Update .vimrc

This commit is contained in:
quenousimporte 2025-10-10 16:48:02 +02:00
parent ecbadfcbbe
commit 84323593d9
1 changed files with 22 additions and 2 deletions

24
.vimrc
View File

@ -6,8 +6,14 @@ map <silent> <up> gk
map <silent> <down> gj map <silent> <down> gj
set spelllang=fr set spelllang=fr
" for traditional console
" set background=dark
" colorscheme habamax " colorscheme habamax
set background=dark " colorscheme slate
" colorscheme quiet
" for light terminal
" set background=light
set wrap set wrap
@ -38,12 +44,26 @@ set shiftwidth=4
" see https://ctrlpvim.github.io/ctrlp.vim/ " see https://ctrlpvim.github.io/ctrlp.vim/
" set runtimepath^=~/.vim/bundle/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 " homemade ctrl-p
set path+=** set path+=**
set wildmenu set wildmenu
set wildmode=longest:full,full set wildmode=longest:full,full
set wildoptions=pum,fuzzy set wildoptions=pum,fuzzy
nnoremap <C-p> :find<Space>*
nnoremap <C-p> :tabfind<Space>*
" ctrl-j for terminal " ctrl-j for terminal
nnoremap <C-j> :below terminal<CR> nnoremap <C-j> :below terminal<CR>