onivim / oni

Oni: Modern Modal Editing - powered by Neovim
https://www.onivim.io
MIT License
11.36k stars 300 forks source link

foldmethod setting in .vimrc not applied #2627

Closed direvus closed 5 years ago

direvus commented 5 years ago

Oni Version: 0.3.6 Neovim Version (Linux only): Operating System: MacOS 10.13.6

Issue: I have the command set foldmethod=indent in my .vimrc file, and oni.loadInitVim set to true. However, when I open any file in Oni, there is no folding and :set foldmethod? shows foldmethod=manual.

If I then manually execute :set foldmethod=indent, the folding mode does get set correctly and the folding behaviour works exactly as expected. So there doesn't appear to be any problem with using Vim folding in Oni, it's just that this setting weirdly is not respected when importing vimrc.

Note that I use the same .vimrc with command-line vim and MacVim clients, and the folding method setting has always worked correctly.

Expected behavior: foldmethod should be always set to indent, per my vimrc.

Actual behavior: foldmethod is set to manual.

Steps to reproduce:

oni-bot[bot] commented 5 years ago

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

nghialm269 commented 5 years ago

You should put that line in ~/.config/nvim/init.vim instead of ~/.vimrc because Oni uses neovim, or just source .vimrc in init.vim.

direvus commented 5 years ago

Ah thanks for explaining that @mnrce -- as you can probably tell, I'm new to using neovim since starting with Oni. As neovim is branded as a drop-in replacement for vim, I had assumed (naively as it turns out) that neovim would source my vimrc files.

Creating ~/.config/nvim/init.vim with source ~/.vimrc, as you suggest, solved my problem. That would also explain why my AutoCmds weren't working.

Sorry for the noise, closing this issue.