klen / nvim-config-local

Secure load local config files for neovim
MIT License
150 stars 9 forks source link

Feature: lookup for .vimrc and .vimrc.lua in parent directories #5

Closed Mephistophiles closed 2 years ago

Mephistophiles commented 2 years ago

It will be very convenient for a project group (share settings across multiple sub-projects without symlinking .vimrc)

klen commented 2 years ago

@Mephistophiles it's easy to implement. Have added the functionality in the latest version. You've to enable lookup_parens.

Mephistophiles commented 2 years ago

Thanks!

Mephistophiles commented 2 years ago

Hmm, in my case trust config is not working with the message Unsupported config filetype if trust was tried in а sub folder:


/home/builder/SDKS/.vimrc.lua

❯ pwd 

/home/builder/SDKS/subfolder

❯ vim main.c 

2022-03-25T15:04:26 INFO Try to trust /home/builder/SDKS/.vimrc.lua                                      

2022-03-25T15:04:26 INFO Config files { “.vimrc.lua”, “.vimrc” }                                         

2022-03-25T15:04:26 INFO vim.fn.fnamemodify /home/builder/SDKS/.vimrc.lua                                

2022-03-25T15:04:26 ERROR [config-local]: Unsupported config filetype: “/home/builder/SDKS/.vimrc.lua”   

In my case, fnnamemodify does not strip the directory prefix. How about setting :t in the function?

klen commented 2 years ago

@Mephistophiles Please try the latest version (1.3.0)

Mephistophiles commented 2 years ago

It works, thank you!