diff --git a/apps/neovim/init.vim b/apps/neovim/init.vim index efc80a6..78003fd 100644 --- a/apps/neovim/init.vim +++ b/apps/neovim/init.vim @@ -214,13 +214,18 @@ endif fun! RunMake() split if has('nvim') - execute 'terminal make ' . g:make_args - :autocmd TermClose * call feedkeys('') + " run from the root of the current git repository + let path = system("git rev-parse --show-toplevel | tr -d '\\n'") + " TODO: handle non-git situations + execute 'terminal cd ' . path . ' && make ' . g:make_args else execute '!make ' . g:make_args endif endfun +" kill the terminal buffer when the process exits +" autocmd TermClose * call feedkeys('') + " whitespace " use tabs at a two-space width set tabstop=2