5

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

What config should i edit?

edit:

This is my current config:

➜ ~ 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> <C-l> :nohl<CR><C-l> 

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 
0

1 Answer 1

10

Neovim uses the xdg specification for their config files. If you are already using vim. (If you are transferring from an old version of neovim ~/.nvimrc is now $XDG_CONFIG_HOME/nvim/init.vim and ~/.nvim is 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 get you close to running with neovim (This might not work for all plugins but its a start).


All you should need in $XDG_CONFIG_HOME/nvim/init.vim is the following

filetype plugin indent on syntax on 

to get syntax highlighting for ruby.

Sign up to request clarification or add additional context in comments.

5 Comments

Thank you for responding. Unfortunately adding your changes to .nvimrc generated an error. I've updated the question to reflect this.
@SharkLaser update neovim. Your runtime files appear to be out of date.
thank you! That was the final hurdle. I updated neovim via brew update && brew reinstall --HEAD neovim
@FDinoff have you tried neovim? I haven't given it a try. how do you think about it? good? I mean first, as good as vim?
@Kent I have not tried neovim. I've just been following the development.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.