Macos Vim

Posted on  by admin

Question or issue on macOS:

  1. Mac Os Vm
  2. Macros Vim
  3. Macos Vim Colorscheme
  4. Macos Vim Commands
  5. Macos Vim Syntax Highlighting
  6. Macos Vim Copy To Clipboard

Mac Os Vm

I’m working with the Vim 7.2 that comes with Mac OS 10.6.1 (Leopard), using the Mac’s “Terminal” app. I’d like to use a fancy color scheme. I did this…

Save

Then this…

Method 1: One of the easiest and most commonly recommended methods is by creating a file called.vimrc in your home directory. The one and only command you need to run is echo syntax on /.vimrc. The next time you access a non-txt file with vim, you will notice highlighted text. Echo 'syntax on' /.vimrc. VIM - Vi IMproved 8.1 (2018 May 18, compiled Sep 30 2019 01:26:53) macOS version Included patches: 1-2100 Compiled by Homebrew johnlamb mentioned this issue Oct 10, 2019 macOS Catalina 10.15 search tag appear 'E432: Tags file not sorted' neovim/neovim#11196.

Macros Vim

Using the vim text editor, I am looking for a method to copy content highlighted in visual mode to the system clipboard (i.e. I would then be able to Ctr-v that content say in a browser window). Is there a standard way to copy content directly to the system clipboard?

Syntax highlighting is working, but I’m finding that regardless of the scheme I choose, the only colors displayed are the basic Red, Blue, Cyan, Gray, etc.

Is there a way to get the Terminal app to display a larger collection of colors to allow some more subtle schemes?

Macos

Macos Vim Colorscheme

How to solve this problem?

Solution no. 1:

The Terminal.app supports AFAIK only 16 colors; iTerm supports more colors or you use mvim (as suggested by Daniel).

Solution no. 2:

Create vimrc file on your home folder and then edit it. You can try adding syntax on inside ~/.vimrc file.

It will highlight your code syntax on vim

Solution no. 3:

Add “syntax on” to the file /usr/share/vim/vimrc and you’ll get highlighting in your files every time you edit one.

# vi /usr/share/vim/vimrc

Add this line at the end of the file:

Now you’ll get highlighting when you edit whatever’s file.

Solution no. 4:

You need to create file ~/.vimrc and add syntax on in that file


vi ~/.vimrc
syntax on

save the file
and run your vim

Solution no. 5:

You might want to consider using a version of Vim that is a native Mac app (that runs in a window).

MacVim has great color schemes and you can still launch it from Terminal like so:

That will open your file in a new Vim window.

Solution no. 6:

@ashcatch – Can’t leave a comment, but wanted to add that iTerm has other advantages over Terminal.app such as sensible copy and paste (configurable ‘word’ regex for easy double click selection of paths/urls, middle click paste) and terminal mouse support (:se mouse=a in vi to get mouse text selection, moving of window borders etc.)

I’d be lost without it.

Hope this helps!

Question or issue on macOS:

I’m working with the Vim 7.2 that comes with Mac OS 10.6.1 (Leopard), using the Mac’s “Terminal” app. I’d like to use a fancy color scheme. I did this…

Then this…

Syntax highlighting is working, but I’m finding that regardless of the scheme I choose, the only colors displayed are the basic Red, Blue, Cyan, Gray, etc.

Is there a way to get the Terminal app to display a larger collection of colors to allow some more subtle schemes?

How to solve this problem?

Solution no. 1:

Mac vim config

The Terminal.app supports AFAIK only 16 colors; iTerm supports more colors or you use mvim (as suggested by Daniel).

Solution no. 2:

Create vimrc file on your home folder and then edit it. You can try adding syntax on inside ~/.vimrc file.

It will highlight your code syntax on vim

Solution no. 3:

Add “syntax on” to the file /usr/share/vim/vimrc and you’ll get highlighting in your files every time you edit one.

# vi /usr/share/vim/vimrc

Add this line at the end of the file:

Now you’ll get highlighting when you edit whatever’s file.

Solution no. 4:

You need to create file ~/.vimrc and add syntax on in that file


vi ~/.vimrc
syntax on

save the file
and run your vim

Solution no. 5:

You might want to consider using a version of Vim that is a native Mac app (that runs in a window).

MacVim has great color schemes and you can still launch it from Terminal like so:

That will open your file in a new Vim window.

Solution no. 6:

Macos Vim Commands

@ashcatch – Can’t leave a comment, but wanted to add that iTerm has other advantages over Terminal.app such as sensible copy and paste (configurable ‘word’ regex for easy double click selection of paths/urls, middle click paste) and terminal mouse support (:se mouse=a in vi to get mouse text selection, moving of window borders etc.)

Macos Vim Syntax Highlighting

I’d be lost without it.

Macos Vim Copy To Clipboard

Hope this helps!