forked from extern/nix-config
neovim: cd to git directory if it exists
This prevents an issue where it was previously possible to open files in vim without the current directory being the project root.
This commit is contained in:
parent
f4db117bc3
commit
5552b5c743
@ -60,6 +60,10 @@ in {
|
||||
|
||||
autocmd BufNewFile,BufRead *.ecr setlocal syntax=html
|
||||
autocmd BufWritePre,FileWritePre * silent! call mkdir(expand('<afile>:p:h'), 'p')
|
||||
augroup cdgit
|
||||
autocmd!
|
||||
autocmd VimEnter * silent! :cd `git rev-parse --show-toplevel`
|
||||
augroup END
|
||||
'';
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user