Skip to main content
89 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,809
36 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,210
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,998
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
  • 103k
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
  • 52.4k
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
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
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
  • 103k
7 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
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
  • 46.3k
5 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
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.8k
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,149
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
  • 15.1k
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
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
  • 743
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 do I enable syntax highlighting in vim on Mac?

Merely adding syntax on in .vimrc configuration file is not good enough. Your configurations in this file will still be overridden by system initialisation. The easiest way without recompiling vim is ...
littletree76'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
  • 103k
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,276
2 votes

How do I copy text from vi?

Try selecting the text you want to copy in visual mode, then press "+y "+ is a special register, the system clipboard. Using "+-yank commands you can copy to the system clipboard, and ...
minseong's user avatar
  • 9,072
2 votes

How can I make vim "command mode" the default mode for terminal

No there in no way to start your terminal in command mode. The set keymap setting is used to customize the keymap within terminal. A line with set keymap vi-command means that mappings below that ...
arjun_aj'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
  • 165
2 votes
Accepted

Can you work with Vim on iPad Mini with an external keyboard?

I use Prompt 2 to connect over SSH to my server. It's a paid app, but I never had an issue with it, it's really reliable. If your connection is good enough you won't appreciate any lag. Vim works ...
jherran's user avatar
  • 13.3k

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