0

Just installed neovim. I just created a file ~/.config/nvim/init.vim. The init.vim file only has one line:

set relativenumber

But then when I opened a file using the nvim command (in Cygwin), the relative line numbers are not on. What is going on, and how can I fix it? My version is the latest stable release.

3
  • What is the out of :verbose set relativenumber? – jdhao Jul 9 '20 at 2:20
  • @jdhao It sets the relative line numbers correctly. – Higigig Jul 9 '20 at 2:43
  • Welcome to Vi and Vim! @jdhao meant :verbose set relativenumber?, which will query it. How about :echo $MYVIMRC, or :e $MYVIMRC to try to open it? The :version command should list the location(s) where it will look for a vimrc file... Do those give you a clue about what might be going on? – filbranden Jul 9 '20 at 3:54
2

Cygwin doesn't have a Neovim package, AFAIK. So that was most probably a native Windows build. In this case your config must reside in ~/AppData/Local/nvim/init.vim.

See also :h init.vim for further information.

3
  • AFAIK, you can not run Windows neovim on cygwin. They are not compatible. – jdhao Jul 9 '20 at 7:19
  • @jdhao Cygwin executables have standard format (PE). The only specific thing is that they are dynamically linked to POSIX runtime compat layer (cygwin1.dll) which provides transparent filename translation and a few POSIX-specific syscalls (like fork() etc.). "Under Cygwin" typically means "inside bash compiled by Cygwin tools". And naturally, bash can run any PE under Windows (Cygwin or native) provided you've typed the pathname right. – Matt Jul 9 '20 at 9:19
  • @jdhao Of course, there could be some "issues", like Windows native built console Neovim fails to run under mintty, but, at the very least, GUI works without problem. – Matt Jul 9 '20 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.