Hot answers tagged

84 votes
Accepted

How do I enable syntax highlighting in vim on Mac?

Method 1 The easiest method is to place syntax on into your .vimrc. Though I've found that only having this in the vim resource file might overwrite a vast majority of the default configurations, so I'...
Hunter T.'s user avatar
  • 1,709
35 votes
Accepted

How to show italic in vim in iTerm2

You have to update your TERMINFO file. Thanks to wincent's video and his github pages Watch the video and look at his github pages, they're excellent. I have the following note stored on my HD: We ...
PeterVP's user avatar
  • 1,190
24 votes
Accepted

How to upgrade system default vim?

Get the Homebrew* package manager. Install vim formula (as of today it is Vim 8.0.2) with: brew install vim Check the messages it produced for any manual actions you might be required to perform, ...
techraf's user avatar
  • 3,958
20 votes

How do I enable syntax highlighting in vim on Mac?

If you want to toggle this on/off (without creating a .vimrc file) simply type :syntax on while in vi/vim.
agrayray's user avatar
  • 201
18 votes
Accepted

How could macOS be POSIX compliant without vi?

It's actually optional. Per the The Open Group Base Specifications Issue 7, 2018 edition in the Shells & Utilities Volume, the vi command states: This utility shall be provided on systems ...
Allan's user avatar
  • 100k
13 votes
Accepted

Make Homebrew installed Vim override system installed one

The output of both brew info vim and type -a vim clearly states that Homebrew provided version of vim is not installed on your system. It appears that you have both ex-vi and mac-vim installed which ...
Nimesh Neema's user avatar
  • 51.7k
12 votes

Make Homebrew installed Vim override system installed one

I was facing the same issue, I tried the solution proposed by @Nimesh Neema but the vim version was still showing older version. Apparently restarting the shell fixed it: exec -l $SHELL Before: ...
Mohan Nataraj's user avatar
10 votes

How do I edit current shell command in VI

Your edit-and-execute-command may not be bound for vi mode. Try: bind -m vi-insert '"\C-x\C-e": edit-and-execute-command' To make it permanent, add that line to your ~/.inputrc file. (via this ...
Stew's user avatar
  • 326
10 votes

Numeric keypad keys in vi insert letters instead of numbers

I solved the problem on my own, but I'd like to know WHY my solution works. I deselected the option the red arrow indicates in the following picture This is italian, but the english version of the ...
Enlico's user avatar
  • 605
10 votes
Accepted

Where is the folder with color schemes used by vim?

I found the answer here: color scheme's and syntax' files can be found in /usr/share/vim/.
Enlico's user avatar
  • 605
8 votes
Accepted

Numeric keypad keys in vi insert letters instead of numbers

As far as I understand, there are two possible modes for number keypads of VT100 terminals: the normal Numeric keypad mode and the Application keypad mode. The latter has the keypad keys send not ...
Dictionarics Anonymous's user avatar
7 votes
Accepted

How do you insert literal control chars in vim on Mac?

It's the same like in Unix/Linux: ^V^M But, if you want to use the character in a substitution string, then you should write it like it is, \r, e.g. :%s/blabla/\r/
t0r0X's user avatar
  • 200
7 votes
Accepted

What was the first version of macOS to ship with the Vim text editor?

vim has been included with OS X since version 10.3.0 (Panther); vi has been included from the very first version, 10.0 (Cheetah). Apple has an excellent Open Source repository - http://opensource....
Allan's user avatar
  • 100k
6 votes
Accepted

RBENV managed Rubies: VIM upgrade forcing homebrew to install Ruby

Ruby is a dependency for building vim with Homebrew according to the package details: ianc.local > brew info vim vim: stable 8.0.0019 (bottled), HEAD Vi "workalike" with many additional features ...
Ian C.'s user avatar
  • 45.9k
5 votes
Accepted

Vim the editor keeps crashing on Sierra

It is failing reliably for me too. For me it only happens with vim running on a remote machine using ssh. Vim does seem to be the common factor. According to this Google groups thread, the problem ...
janm's user avatar
  • 3,081
5 votes
Accepted

Why is [dos] sometimes in the output of a save in "vim". such as: "foo.txt [dos] 38L, 193C"?

What flags a file as being a [dos] file? Line endings. Windows uses CR (carrage return) and NL (newline) characters. Old Mac plain text files use CR and macOS (and other Unix like systems) command ...
fd0's user avatar
  • 10.7k
5 votes
Accepted

Vim frozen and unresponsive on startup

When vim starts, it reads these two files from your home folder: .vimrc, a configuration file that contains initialization commands .viminfo, a history file that contains, among others, string and ...
jaume's user avatar
  • 15k
4 votes
Accepted

Where is POSIX Ex editor on Mac?

You could install it using Homebrew. It is part of the brew ex-vi package, e.g.: brew install ex-vi
Werner Van Geit's user avatar
4 votes

How to upgrade system default vim?

You can install vim with Homebrew overriding the current system's vim with the --with-override-system-vi: brew install vim -- --with-override-system-vi Remember to restart your terminal after that ...
Giovanni Benussi's user avatar
4 votes

Copying text in vim to the global clipboard

macOS version of vim is compiled with -clipboard (you can check with vim --version). So there's no shared clipboard available. In this case you can download/recompile new vim or you can use system ...
Mateusz Szlosek's user avatar
4 votes
Accepted

Open a MacVim (gvim) window from MacVim

Using :!mvim filename (or !gvim filename) works for me, but I have the commands set up in /usr/local/bin (and /usr/local/bin in PATH), and I don't remember the installation instructions for where to ...
Random832's user avatar
  • 741
4 votes
Accepted

Homebrew Vim with Python support depends on Python 3.7.0, and I have to use 3.6.5

To solve this with homebrew, you can temporarily backdate homebrew-core and set the HOMEBREW_NO_AUTO_UPDATE variable to hold it in place: cd `brew --repo homebrew/core` git checkout ...
Steven Peters's user avatar
4 votes

Homebrew Vim with Python support depends on Python 3.7.0, and I have to use 3.6.5

Another way, if you also have python 3.7 in your system. Go to the dir, where vim trying to find the python. cd /usr/local/opt/python/Frameworks/Python.framework/Versions And create a link to 3.7 ...
Konstantin's user avatar
4 votes
Accepted

Command-C in vim on macOS is not copying even with "+clipboard" flag

My confusion stems from "which" terminal is being used. I had not installed iTerm2 yet: and that is the critical difference between the two laptops. With mouse reporting enabled we do have ...
WestCoastProjects's user avatar
3 votes

Where is the folder with color schemes used by vim?

You should install new ones into $HOME/.vim/colors/ you can run mkdir -p ~/.vim/colors to create it.
xenoterracide's user avatar
3 votes

How to clear selection in OS X Terminal?

You need to learn the keyboard commands for the editor you are using; in this case, vim. To delete, press Esc for "Command Mode" then.... x - for a character dw - for the current word dd - for ...
Allan's user avatar
  • 100k
3 votes
Accepted

Vim like navigation keys for Finder

Vim can get addictive once we get the hang of it. To vim-ify the Finder is a lovely idea. However, what features are you thinking about? For example, browsing files using the navigation keys h, j, k, ...
Yoric's user avatar
  • 1,256
3 votes

Scrolling issue in vim after switch to iterm2

I had the same problem and what worked for me is changing a setting in iTerm2. Navigate to Settings > Advanced and then change the option Scroll wheel sends arrow keys when in alternate screen mode ...
hoffer13's user avatar
2 votes

How do I edit current shell command in VI

This worked for me: If you’re using zsh (as you should), you could add the following to your .zshrc (or .zprofile): export EDITOR=nvim # Enable Ctrl-x-e to edit command line autoload -U edit-command-...
rofrol's user avatar
  • 163

Only top scored, non community-wiki answers of a minimum length are eligible