1
0
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:
Donovan Glover 2023-06-08 20:50:59 -04:00
parent f4db117bc3
commit 5552b5c743
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -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; [
{