vim: more conf for fzf, nerdtree and add cosco

This commit is contained in:
Mathieu Maret 2021-11-10 17:39:54 +01:00
parent 7f42be1e5d
commit c37cd39404

24
.vimrc
View File

@ -3,6 +3,8 @@
""""""""""""" """""""""""""
" F1 help " F1 help
" S-F1 open vimrc " S-F1 open vimrc
" M-S-F1 vim help
" C-F1 LSP Menu
" F2 open file in a new tab " F2 open file in a new tab
" S-F2 Split and open file " S-F2 Split and open file
" F3 autotags Update " F3 autotags Update
@ -14,7 +16,7 @@
" F8 view tag list " F8 view tag list
" S-F8 Open DB building menu " S-F8 Open DB building menu
" M-F8 build kernel ctags/cscope databases " M-F8 build kernel ctags/cscope databases
" F9 Open NerdTree " F9 Open NerdTree. s to open in split. t to open in tab
" M-F9 Show diff line " M-F9 Show diff line
" S-F9 Highlight diff line " S-F9 Highlight diff line
" F10 folding " F10 folding
@ -31,6 +33,7 @@
" from a.vim " from a.vim
" :A[SVTN] Switch between header/file , split, vertical, tab, next match " :A[SVTN] Switch between header/file , split, vertical, tab, next match
" :IH[SVTN] Switch to file under cursor " :IH[SVTN] Switch to file under cursor
"\o to run FZF
" Use snippets with tab e.g : for <tab> (see .vim/bundle/vim-snippets/snippets for available " Use snippets with tab e.g : for <tab> (see .vim/bundle/vim-snippets/snippets for available
" snippets) " snippets)
" look at :help index " look at :help index
@ -192,6 +195,8 @@ augroup IrisPython
au BufRead,BufNewFile *.iris set ft=python au BufRead,BufNewFile *.iris set ft=python
au BufRead,BufNewFile *.ino set tabstop=4 shiftwidth=4 softtabstop=4 au BufRead,BufNewFile *.ino set tabstop=4 shiftwidth=4 softtabstop=4
au BufRead,BufNewFile *.asm set ft=nasm au BufRead,BufNewFile *.asm set ft=nasm
"hand written GNU AS
au BufRead,BufNewFile *.S set ft=asm
" python " python
" autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab " autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab
@ -462,6 +467,7 @@ cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
augroup NerdGroup augroup NerdGroup
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
map <F9> :NERDTreeToggle<CR> map <F9> :NERDTreeToggle<CR>
let NERDTreeIgnore= ['\.o$', '\.d$']
augroup END augroup END
""""""""""" """""""""""
@ -625,9 +631,15 @@ Plugin 'majutsushi/tagbar'
" Fuzzy finder " Fuzzy finder
Plugin 'junegunn/fzf' Plugin 'junegunn/fzf'
Plugin 'junegunn/fzf.vim'
nnoremap <silent> <leader>o :FZF<CR> nnoremap <silent> <leader>o :FZF<CR>
nnoremap <silent> <leader>O :FZF!<CR> nnoremap <silent> <leader>O :FZF!<CR>
" Insert mode completion
imap <c-x><c-k> <plug>(fzf-complete-word)
imap <c-x><c-f> <plug>(fzf-complete-path)
imap <c-x><c-l> <plug>(fzf-complete-line)
if v:version >= 800 if v:version >= 800
" Async lint " Async lint
" Plugin 'w0rp/ale' " Plugin 'w0rp/ale'
@ -671,11 +683,6 @@ else
"let g:syntastic_cpp_compiler_options = '-std=c++14' "let g:syntastic_cpp_compiler_options = '-std=c++14'
endif endif
"Android integration
"Plugin 'hsanson/vim-android'
" let g:android_sdk_path="~/Android/Sdk/"
"background task
Plugin 'tpope/vim-dispatch'
"Completion (need more configuration for python, c# ...) "Completion (need more configuration for python, c# ...)
"Plugin 'Valloric/YouCompleteMe' "Plugin 'Valloric/YouCompleteMe'
" VimWiki " VimWiki
@ -818,4 +825,9 @@ Plugin 'pgilad/vim-skeletons'
let skeletons#autoRegister = 1 let skeletons#autoRegister = 1
let skeletons#skeletonsDir = ["~/.vim/templates/"] let skeletons#skeletonsDir = ["~/.vim/templates/"]
"let skeletons#skeletonsDir += ["~/.vim/bundle/vim-skeletons/skeletons/"] "let skeletons#skeletonsDir += ["~/.vim/bundle/vim-skeletons/skeletons/"]
Plugin 'lfilho/cosco.vim'
autocmd FileType c,cpp nmap <silent> <Leader>; <Plug>(cosco-commaOrSemiColon)
autocmd FileType c,cpp imap <silent> <Leader>; <c-o><Plug>(cosco-commaOrSemiColon)
call vundle#end() call vundle#end()