From 84323593d9ada5fb2a8ef8007223c3a3c917f608 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Fri, 10 Oct 2025 16:48:02 +0200 Subject: [PATCH] Update .vimrc --- .vimrc | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index c29bb15..376b12b 100644 --- a/.vimrc +++ b/.vimrc @@ -6,8 +6,14 @@ map gk map gj set spelllang=fr +" for traditional console +" set background=dark " colorscheme habamax -set background=dark +" colorscheme slate +" colorscheme quiet + +" for light terminal +" set background=light set wrap @@ -38,12 +44,26 @@ set shiftwidth=4 " see https://ctrlpvim.github.io/ctrlp.vim/ " set runtimepath^=~/.vim/bundle/ctrlp.vim +" add git root to path +function! AddGitRootToVimPath() + if executable('git') + let l:git_root = system('git -C ' . expand('%:p:h') . ' rev-parse --show-toplevel 2>/dev/null') + if v:shell_error == 0 + let l:git_root = substitute(l:git_root, '\n', '', 'g') + execute 'set path+=' . l:git_root + endif + endif +endfunction + +autocmd BufEnter * call AddGitRootToVimPath() + " homemade ctrl-p set path+=** set wildmenu set wildmode=longest:full,full set wildoptions=pum,fuzzy -nnoremap :find* + +nnoremap :tabfind* " ctrl-j for terminal nnoremap :below terminal