How to enable Ruby syntax highlighting in Neovim?

I am a new Neovim user and trying to figure out how to enable syntax highlighting for Ruby.

What configuration should I edit?

edit:

This is my current configuration:

➜ ~ cat ~/.nvimrc filetype plugin indent on syntax on set tabstop=2 set number set noswapfile " Automatically indent on new lines set autoindent " Copy the indentation of the previous line if auto indent doesn't know what to do set copyindent " Indenting a line with >> or << will indent or un-indent by 2 set shiftwidth=2 " Pressing tab in insert mode will use 4 spaces set softtabstop=2 " Use spaces instead of tabs set expandtab " [SEARCH] :set incsearch :set hlsearch " <Ctrl-l> redraws the screen and removes any search highlighting. nnoremap <silent> <Cl> :nohl<CR><Cl> 

And this is the error I get when loading Neovim:

 ➜ ~ nvim test.rb Error detected while processing /Users/user/.nvimrc: line 2: E484: Can't open file /usr/local/Cellar/neovim/HEAD/share/vim/syntax/syntax.vim Press ENTER or type command to continue 
+5
source share
1 answer

Neovim uses the xdg specification for its configuration files. If you are already using vim. (If you transfer from the old version of neovim ~/.nvimrc now $XDG_CONFIG_HOME/nvim/init.vim and ~/.nvim now $XDG_CONFIG_HOME/nvim )

 mkdir -p ${XDG_CONFIG_HOME:=$HOME/.config} ln -s ~/.vim $XDG_CONFIG_HOME/nvim ln -s ~/.vimrc $XDG_CONFIG_HOME/nvim/init.vim 

should bring you closer to working with neovim (this may not work for all plugins, but this is the beginning).


All you need in $XDG_CONFIG_HOME/nvim/init.vim is this

 filetype plugin indent on syntax on 

to get syntax highlighting for ruby.

+10
source

Source: https://habr.com/ru/post/1209283/


All Articles