2020-12-17 15:25:37 +01:00
|
|
|
"""""""""""""""
|
2009-11-13 12:00:50 +01:00
|
|
|
" SHORTCUTS "
|
|
|
|
"""""""""""""
|
|
|
|
" F1 help
|
2020-12-19 23:53:14 +01:00
|
|
|
" S-F1 open vimrc
|
2021-11-10 17:39:54 +01:00
|
|
|
" M-S-F1 vim help
|
|
|
|
" C-F1 LSP Menu
|
2015-02-27 16:38:02 +01:00
|
|
|
" F2 open file in a new tab
|
2023-02-24 00:26:29 +01:00
|
|
|
" C-F2 open FZF in a new tab
|
2015-02-27 16:38:02 +01:00
|
|
|
" S-F2 Split and open file
|
2014-04-07 16:00:04 +02:00
|
|
|
" F3 autotags Update
|
|
|
|
" S-F3 autotags Add
|
2009-11-13 12:00:50 +01:00
|
|
|
" F4 open include file
|
2010-09-16 14:49:27 +02:00
|
|
|
" F5 find C symbol
|
2009-11-13 12:00:50 +01:00
|
|
|
" F6 go to definition
|
|
|
|
" F7 go to calls
|
|
|
|
" F8 view tag list
|
2020-12-19 23:53:14 +01:00
|
|
|
" S-F8 Open DB building menu
|
2010-04-26 10:35:32 +02:00
|
|
|
" M-F8 build kernel ctags/cscope databases
|
2021-11-10 17:39:54 +01:00
|
|
|
" F9 Open NerdTree. s to open in split. t to open in tab
|
2015-07-06 14:26:11 +02:00
|
|
|
" M-F9 Show diff line
|
2014-04-08 14:26:26 +02:00
|
|
|
" S-F9 Highlight diff line
|
2014-04-07 16:00:04 +02:00
|
|
|
" F10 folding
|
|
|
|
" S-F10 unfolding
|
2009-11-13 12:00:50 +01:00
|
|
|
" F11 unhighlight search
|
|
|
|
" F12 paste mode
|
|
|
|
" C-left/right switch tab
|
|
|
|
" C-up/down switch window
|
|
|
|
" M-left/right horizontal size
|
|
|
|
" M-up/down vertical size
|
2015-02-27 15:56:40 +01:00
|
|
|
" gc comment/uncomment
|
2022-01-03 16:06:03 +01:00
|
|
|
" C-K in normal:indent selection
|
2020-12-17 15:37:32 +01:00
|
|
|
" \-a Set Kernel Coding style
|
2021-05-30 22:40:26 +02:00
|
|
|
" from a.vim
|
|
|
|
" :A[SVTN] Switch between header/file , split, vertical, tab, next match
|
|
|
|
" :IH[SVTN] Switch to file under cursor
|
2021-11-10 17:39:54 +01:00
|
|
|
"\o to run FZF
|
2014-08-13 13:53:14 +02:00
|
|
|
" Use snippets with tab e.g : for <tab> (see .vim/bundle/vim-snippets/snippets for available
|
2010-05-04 15:32:13 +02:00
|
|
|
" snippets)
|
2020-12-17 15:25:37 +01:00
|
|
|
" look at :help index
|
|
|
|
" or
|
2020-12-18 11:44:16 +01:00
|
|
|
" :verbose map <key>
|
|
|
|
" or for all keys
|
2020-12-17 15:25:37 +01:00
|
|
|
":redir! > vim_maps.txt
|
|
|
|
":map " Normal, visual, select and operator bindings
|
|
|
|
":map! "insert and command-line mode bindings
|
|
|
|
":redir END
|
2022-01-03 16:06:03 +01:00
|
|
|
" C-K in insert for ligature. See available ligature with :digraphs
|
|
|
|
" Could be disabled with :set conceallevel=0. See after/syntax for custom
|
|
|
|
" settings
|
|
|
|
" Require a font with ligature support
|
|
|
|
|
2009-11-13 12:00:50 +01:00
|
|
|
"""""""""""
|
|
|
|
" GENERAL "
|
|
|
|
"""""""""""
|
2020-04-15 22:47:43 +02:00
|
|
|
" move around where there is no char, insert space when inserting
|
|
|
|
set virtualedit=all
|
2009-11-13 12:00:50 +01:00
|
|
|
" disable vi-compatible mode
|
|
|
|
set nocompatible
|
2016-08-29 18:22:37 +02:00
|
|
|
|
|
|
|
" Switch syntax highlighting on when the terminal has colors or when using the
|
|
|
|
" GUI (which always has colors).
|
|
|
|
if &t_Co > 2 || has("gui_running")
|
2018-07-11 17:33:17 +02:00
|
|
|
" Revert with ":syntax off".
|
|
|
|
syntax on
|
2016-08-29 18:22:37 +02:00
|
|
|
|
2018-07-11 17:33:17 +02:00
|
|
|
" I like highlighting strings inside C comments.
|
|
|
|
" Revert with ":unlet c_comment_strings".
|
|
|
|
let c_comment_strings=1
|
2016-08-29 18:22:37 +02:00
|
|
|
endif
|
|
|
|
|
2015-07-07 15:02:12 +02:00
|
|
|
filetype plugin on
|
2016-08-29 18:22:37 +02:00
|
|
|
" enable file type detection and do language-dependent indenting
|
|
|
|
filetype plugin indent on
|
2015-02-27 15:56:40 +01:00
|
|
|
"set clipboard=unnamed
|
2020-12-17 15:25:37 +01:00
|
|
|
" Add to .vimrc to enable project-specific vimrc
|
|
|
|
|
|
|
|
"set exrc
|
|
|
|
"set secure
|
|
|
|
|
|
|
|
" exrc allows loading local executing local rc files.
|
|
|
|
" secure disallows the use of :autocmd, shell and write commands in local .vimrc files.
|
2020-12-29 11:12:24 +01:00
|
|
|
|
|
|
|
" save undo trees in files
|
|
|
|
set undofile
|
|
|
|
set undodir=~/.vim/undo
|
|
|
|
|
|
|
|
" number of undo saved
|
|
|
|
set undolevels=10000
|
|
|
|
|
2009-11-13 12:00:50 +01:00
|
|
|
""""""""
|
|
|
|
" SAVE "
|
|
|
|
""""""""
|
|
|
|
" disable backup
|
|
|
|
set nobackup
|
|
|
|
" save before compilation
|
|
|
|
set autowrite
|
2016-08-29 18:22:37 +02:00
|
|
|
" Put these in an autocmd group, so that you can revert them with:
|
|
|
|
" ":augroup vimStartup | au! | augroup END"
|
|
|
|
augroup vimStartup
|
2018-07-11 17:33:17 +02:00
|
|
|
au!
|
|
|
|
" When editing a file, always jump to the last known cursor position.
|
|
|
|
" Don't do it when the position is invalid or when inside an event handler
|
|
|
|
" (happens when dropping a file on gvim).
|
|
|
|
autocmd BufReadPost *
|
|
|
|
\ if line("'\"") >= 1 && line("'\"") <= line("$") |
|
|
|
|
\ exe "normal! g`\"" |
|
|
|
|
\ endif
|
2016-08-29 18:22:37 +02:00
|
|
|
|
2021-09-24 22:32:32 +02:00
|
|
|
" Check that file have not been changed
|
|
|
|
" CursorHold : after cursor move
|
|
|
|
" WinEnter or BufWinEnter
|
|
|
|
au WinEnter * checktime
|
|
|
|
au BufWinEnter * checktime
|
2016-08-29 18:22:37 +02:00
|
|
|
augroup END
|
|
|
|
|
2009-11-13 12:00:50 +01:00
|
|
|
" command line history
|
2019-09-05 15:12:07 +02:00
|
|
|
set history=1000
|
|
|
|
set tabpagemax=50
|
2009-11-13 12:00:50 +01:00
|
|
|
|
|
|
|
"""""""""
|
|
|
|
" INPUT "
|
|
|
|
"""""""""
|
|
|
|
" allow backspacing in insert mode
|
|
|
|
set backspace=indent,eol,start
|
|
|
|
" don't use Ex mode, use Q for formatting
|
|
|
|
map Q gq
|
2015-12-07 12:05:07 +01:00
|
|
|
" Enable mouse for 'a'll mode
|
2014-02-27 17:24:24 +01:00
|
|
|
set mouse=a
|
2009-11-13 12:00:50 +01:00
|
|
|
" key combination timeout
|
|
|
|
set notimeout
|
|
|
|
"set timeoutlen=4000
|
|
|
|
" set timeout for multicharacter keys codes (like <F1>)
|
|
|
|
set ttimeout
|
|
|
|
" set timeout to tenth of a second (could be increased for slow terminals)
|
|
|
|
set ttimeoutlen=100
|
|
|
|
" key event timeout
|
|
|
|
set updatetime=1000
|
|
|
|
|
2017-08-16 14:41:36 +02:00
|
|
|
" Use hjkl-movement between rows when soft wrapping.
|
|
|
|
nnoremap j gj
|
|
|
|
nnoremap k gk
|
|
|
|
vnoremap j gj
|
|
|
|
vnoremap k gk
|
|
|
|
|
2020-10-20 20:34:23 +02:00
|
|
|
" move visual block around
|
|
|
|
vnoremap <S-Down> :m '>+1<cr>gv=gv
|
|
|
|
vnoremap <S-Up> :m '<-2<cr>gv=gv
|
|
|
|
vnoremap <S-Right> >gv
|
|
|
|
vnoremap <S-Left> <gv
|
2009-11-13 12:00:50 +01:00
|
|
|
"""""""""""
|
|
|
|
" DISPLAY "
|
|
|
|
"""""""""""
|
|
|
|
" highlight the cursor line
|
|
|
|
set cursorline
|
|
|
|
" show the cursor position
|
|
|
|
set ruler
|
|
|
|
" show mode
|
|
|
|
set showmode
|
|
|
|
" display incomplete commands
|
|
|
|
set showcmd
|
|
|
|
" display line number"
|
|
|
|
set number
|
2011-05-26 14:01:52 +02:00
|
|
|
" set status line
|
|
|
|
set statusline=%<%f\ %h%w%m%r%3.(\ %)%{fugitive#statusline()}%=%([%{Tlist_Get_Tagname_By_Line()}]%)%3.(\ %)%-14.(%l,%c%V%)\ %P
|
|
|
|
" always display status line
|
|
|
|
set laststatus=2
|
2016-08-29 18:22:37 +02:00
|
|
|
set showcmd " display incomplete commands
|
|
|
|
set wildmenu " display completion matches in a status line
|
2009-11-13 12:00:50 +01:00
|
|
|
|
2011-06-27 09:52:26 +02:00
|
|
|
" show bad white spaces
|
|
|
|
let c_space_errors = 1
|
|
|
|
let python_space_error_highlight = 1
|
|
|
|
highlight link cSpaceError SpaceError
|
|
|
|
highlight link pythonSpaceError SpaceError
|
|
|
|
highlight SpaceError ctermfg=235 cterm=reverse
|
|
|
|
|
2009-11-13 12:00:50 +01:00
|
|
|
"""""""""""""""
|
|
|
|
" INDENTATION "
|
|
|
|
"""""""""""""""
|
2011-05-26 14:01:52 +02:00
|
|
|
" use tabs at the start of a line, spaces elsewhere
|
2011-07-08 14:57:16 +02:00
|
|
|
set smarttab
|
|
|
|
set smartindent
|
2011-06-27 10:27:18 +02:00
|
|
|
set autoindent
|
2014-03-24 19:27:29 +01:00
|
|
|
"" tab=4
|
|
|
|
"set tabstop=4
|
|
|
|
"set softtabstop=4
|
|
|
|
"set shiftwidth=4
|
|
|
|
" tab=8
|
2014-03-24 17:46:29 +01:00
|
|
|
set tabstop=8
|
|
|
|
set softtabstop=8
|
|
|
|
set shiftwidth=8
|
2009-11-13 12:00:50 +01:00
|
|
|
" real tabs
|
2011-10-20 14:52:04 +02:00
|
|
|
" set noexpandtab
|
2011-05-26 14:01:52 +02:00
|
|
|
|
2022-03-09 10:06:25 +01:00
|
|
|
nnoremap <silent> <leader>gg :tab term ++close lazygit<CR>
|
2018-03-07 17:15:11 +01:00
|
|
|
|
|
|
|
"filetype specific action
|
2022-01-03 16:06:03 +01:00
|
|
|
augroup FtSpecific
|
2018-03-07 17:15:11 +01:00
|
|
|
au Filetype markdown set tabstop=4 shiftwidth=4 softtabstop=4
|
|
|
|
au BufRead,BufNewFile *.iris set ft=python
|
|
|
|
au BufRead,BufNewFile *.ino set tabstop=4 shiftwidth=4 softtabstop=4
|
|
|
|
au BufRead,BufNewFile *.asm set ft=nasm
|
2022-03-09 10:06:25 +01:00
|
|
|
"hand written GNU AS
|
2021-11-10 17:39:54 +01:00
|
|
|
au BufRead,BufNewFile *.S set ft=asm
|
2022-01-03 16:06:03 +01:00
|
|
|
au BufRead,BufNewFile *.logcat set filetype=logcat
|
|
|
|
au BufRead,BufNewFile logcat set filetype=logcat
|
|
|
|
au BufNewFile,BufRead *.lc set filetype=logcat
|
2018-03-07 17:15:11 +01:00
|
|
|
|
2015-02-27 16:38:02 +01:00
|
|
|
" python
|
|
|
|
" autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab
|
2016-03-02 18:20:03 +01:00
|
|
|
autocmd Filetype python set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
|
2018-03-07 17:15:11 +01:00
|
|
|
autocmd Filetype python set tabstop=4 shiftwidth=4 softtabstop=4
|
2016-03-02 18:20:03 +01:00
|
|
|
autocmd Filetype python set expandtab
|
|
|
|
autocmd Filetype python set modeline
|
2016-03-02 17:27:17 +01:00
|
|
|
" Indentation with = for python need autopep8
|
2016-03-02 18:20:03 +01:00
|
|
|
autocmd Filetype python set equalprg=autopep8\ -
|
2017-08-16 14:13:29 +02:00
|
|
|
iab sefl self
|
|
|
|
iab slef self
|
2021-09-24 22:32:32 +02:00
|
|
|
augroup END
|
2009-11-13 12:00:50 +01:00
|
|
|
|
2011-07-08 14:57:16 +02:00
|
|
|
" vim -b : edit binary using xxd-format!
|
|
|
|
augroup Binary
|
2015-02-27 16:38:02 +01:00
|
|
|
au!
|
|
|
|
au BufReadPre *.bin let &bin=1
|
|
|
|
au BufReadPost *.bin if &bin | %!xxd
|
|
|
|
au BufReadPost *.bin set ft=xxd | endif
|
|
|
|
au BufWritePre *.bin if &bin | %!xxd -r
|
|
|
|
au BufWritePre *.bin endif
|
|
|
|
au BufWritePost *.bin if &bin | %!xxd
|
|
|
|
au BufWritePost *.bin set nomod | endif
|
2011-07-08 14:57:16 +02:00
|
|
|
augroup END
|
|
|
|
|
2018-07-11 18:18:42 +02:00
|
|
|
|
|
|
|
fu DetectIndent()
|
2022-03-09 10:13:02 +01:00
|
|
|
if len(expand('%')) == 0
|
|
|
|
return
|
|
|
|
endif
|
|
|
|
|
2022-10-03 10:19:00 +02:00
|
|
|
execute system ('python3 ~/.vim/indent_finder/indent_finder.py --vim-output --default space --default-size ' . &tabstop .' "' . expand('%') . '"' )
|
2018-07-11 18:18:42 +02:00
|
|
|
if &expandtab
|
2022-11-23 11:35:19 +01:00
|
|
|
let b:clang_style="{BasedOnStyle: LLVM, AlignConsecutiveAssignments: true, AllowShortFunctionsOnASingleLine: Empty, BreakBeforeBraces: Linux, BreakStringLiterals: false, ColumnLimit: 120, IndentCaseLabels: true, IndentWidth: " .&shiftwidth .", TabWidth: " .&tabstop .", UseTab: Never}"
|
2018-07-11 18:18:42 +02:00
|
|
|
else
|
2022-11-23 11:35:19 +01:00
|
|
|
let b:clang_style="{BasedOnStyle: LLVM, AlignConsecutiveAssignments: true, AllowShortFunctionsOnASingleLine: Empty, BreakBeforeBraces: Linux, BreakStringLiterals: false, ColumnLimit: 120, IndentCaseLabels: true, IndentWidth: " .&shiftwidth .", TabWidth: " .&tabstop .", UseTab: ForContinuationAndIndentation}"
|
2018-07-11 18:18:42 +02:00
|
|
|
endif
|
|
|
|
endfu
|
|
|
|
|
2018-07-11 17:20:21 +02:00
|
|
|
" detect indentation see http://www.freehackers.org/Indent_Finder
|
2021-09-24 22:32:32 +02:00
|
|
|
augroup IndentFind
|
|
|
|
autocmd BufReadPost /* call DetectIndent()
|
|
|
|
augroup END
|
2017-01-28 14:33:22 +01:00
|
|
|
|
2021-05-30 22:40:26 +02:00
|
|
|
noremap <C-K> :py3f ~/.vim/syntax/clang-format.py<CR>
|
2022-01-03 16:06:03 +01:00
|
|
|
"inoremap <C-K> <ESC>:py3f ~/.vim/syntax/clang-format.py<CR>i
|
2017-09-20 14:25:58 +02:00
|
|
|
|
2018-01-04 11:05:47 +01:00
|
|
|
set wildignore+=*.o,*.d,*.dex,*.class,*.png,*.jpeg,*.jpg,*.pdf
|
|
|
|
|
2009-11-13 12:00:50 +01:00
|
|
|
""""""""""
|
|
|
|
" SEARCH "
|
|
|
|
""""""""""
|
2011-07-08 14:57:16 +02:00
|
|
|
|
2009-11-13 12:00:50 +01:00
|
|
|
" highlight search
|
|
|
|
set hlsearch
|
|
|
|
" unhighlight current search
|
|
|
|
map <silent> <F11> :nohlsearch<CR>
|
|
|
|
imap <F11> <ESC><F11>a
|
|
|
|
" highlight search while typing
|
|
|
|
set incsearch
|
2010-04-19 18:48:56 +02:00
|
|
|
" show matching brackets -> key %
|
2009-11-13 12:00:50 +01:00
|
|
|
set showmatch
|
|
|
|
" tenths of a second before blink matching brackets
|
|
|
|
set mat=5
|
|
|
|
" search word and list lines to jump with F3
|
2014-07-18 23:21:55 +02:00
|
|
|
" map <F3> [I:let nr = input("Which one: ") <Bar>execute "normal " . nr ."[\t"<CR>
|
2009-11-13 12:00:50 +01:00
|
|
|
" go to declaration with F5
|
2010-09-16 14:49:27 +02:00
|
|
|
" map <silent> <F5> gd:nohlsearch<CR>
|
|
|
|
" imap <F5> <ESC><F5>i
|
2011-05-26 14:01:52 +02:00
|
|
|
|
2009-11-13 12:00:50 +01:00
|
|
|
" plugin taglist
|
|
|
|
let Tlist_Ctags_Cmd = '/usr/bin/ctags'
|
|
|
|
let Tlist_Process_File_Always = 1
|
|
|
|
let Tlist_Exit_OnlyWindow = 1
|
|
|
|
"let Tlist_Close_On_Select = 1
|
|
|
|
let Tlist_Auto_Highlight_Tag = 1
|
|
|
|
let Tlist_Display_Prototype = 0
|
|
|
|
let Tlist_Display_Tag_Scope = 0
|
|
|
|
let Tlist_Show_One_File = 1
|
|
|
|
let Tlist_Compact_Format = 1
|
2010-09-28 15:43:25 +02:00
|
|
|
let Tlist_Enable_Fold_Column = 0
|
2013-03-04 17:05:25 +01:00
|
|
|
" sort by name or order ?
|
|
|
|
let Tlist_Sort_Type = "name"
|
2009-11-13 12:00:50 +01:00
|
|
|
"let Tlist_File_Fold_Auto_Close = 1
|
|
|
|
let Tlist_Inc_Winwidth = 0
|
|
|
|
"let Tlist_Use_Horiz_Window = 1
|
|
|
|
let Tlist_Use_Right_Window = 1
|
|
|
|
" open/close tag list window with F8
|
2016-10-17 11:32:42 +02:00
|
|
|
"map <silent> <F8> :TlistToggle<CR>
|
|
|
|
nmap <F8> :TagbarToggle<CR>
|
2021-05-30 22:40:26 +02:00
|
|
|
"map <silent> <F8> :Vista!!<CR>
|
|
|
|
|
2011-05-26 14:01:52 +02:00
|
|
|
|
2009-11-13 12:00:50 +01:00
|
|
|
" close preview window after a completion
|
2021-09-24 22:32:32 +02:00
|
|
|
augroup AutoCompletion
|
2015-02-27 16:38:02 +01:00
|
|
|
autocmd CursorMovedI *.{[hc],cpp} if pumvisible() == 0|pclose|endif
|
|
|
|
autocmd InsertLeave *.{[hc],cpp} if pumvisible() == 0|pclose|endif
|
2021-09-24 22:32:32 +02:00
|
|
|
augroup END
|
2009-11-13 12:00:50 +01:00
|
|
|
|
2011-06-09 14:02:03 +02:00
|
|
|
function! TagInNewTab()
|
2015-02-27 16:38:02 +01:00
|
|
|
let word = expand("<cword>")
|
|
|
|
redir => tagsfiles
|
|
|
|
silent execute 'set tags'
|
|
|
|
redir END
|
|
|
|
tabe
|
|
|
|
execute 'setlocal' . strpart(tagsfiles, 2)
|
|
|
|
execute 'tag ' . word
|
2011-06-09 14:02:03 +02:00
|
|
|
endfunction
|
|
|
|
|
2022-03-09 10:06:25 +01:00
|
|
|
map <S-T> :call TagInNewTab()<CR>
|
2011-06-09 14:02:03 +02:00
|
|
|
|
2009-11-13 12:00:50 +01:00
|
|
|
"""""""""
|
|
|
|
" PASTE "
|
|
|
|
"""""""""
|
|
|
|
" set/unset paste mode with F12/shift+F12
|
|
|
|
map <F12> :set paste<CR>
|
|
|
|
map <S-F12> :set nopaste<CR>
|
|
|
|
imap <F12> <C-O>:set paste<CR>
|
|
|
|
imap <S-F12> <nop>
|
|
|
|
set pastetoggle=<S-F12>
|
|
|
|
" paste with reindent with Esc prefix
|
2020-11-11 21:46:16 +01:00
|
|
|
"nnoremap <Esc>P P'[v']=
|
|
|
|
"nnoremap <Esc>p p'[v']=
|
2009-11-13 12:00:50 +01:00
|
|
|
|
|
|
|
""""""""""
|
|
|
|
" WINDOW "
|
|
|
|
""""""""""
|
|
|
|
" create window below or at right of the current one
|
|
|
|
set splitbelow
|
|
|
|
set splitright
|
|
|
|
" if multiple windows
|
|
|
|
if bufwinnr(1)
|
2022-07-12 14:24:57 +02:00
|
|
|
if $TERM == "screen"
|
|
|
|
nnoremap <M-Up> :TmuxNavigateUp<cr>
|
|
|
|
nnoremap <M-Right> :TmuxNavigateRight<cr>
|
|
|
|
imap <M-Up> <ESC>:TmuxNavigateUp<cr>
|
|
|
|
imap <M-Right> <ESC>:TmuxNavigateRight<cr>
|
|
|
|
nnoremap <M-Left> :TmuxNavigateLeft<cr>
|
|
|
|
nnoremap <M-Down> :TmuxNavigateDown<cr>
|
|
|
|
imap <M-Left> <ESC>:TmuxNavigateLeft<cr>
|
|
|
|
imap <M-Down> <ESC>:TmuxNavigateDown<cr>
|
|
|
|
endif
|
2015-02-27 16:38:02 +01:00
|
|
|
" switch to next/previous tab with ctrl+right/ctrl+left
|
|
|
|
map <C-Right> gt
|
|
|
|
map <C-Left> gT
|
|
|
|
imap <C-Right> <ESC><C-Right>a
|
|
|
|
imap <C-Left> <ESC><C-Left>a
|
|
|
|
" switch to next/previous window with ctrl+down/ctrl+up
|
|
|
|
map <C-Down> <C-W>w
|
|
|
|
map <C-Up> <C-W>W
|
|
|
|
imap <C-Down> <ESC><C-Down>a
|
|
|
|
imap <C-Up> <ESC><C-Up>a
|
2009-11-13 12:00:50 +01:00
|
|
|
endif
|
|
|
|
" open automatically quickfix window
|
2021-09-24 22:32:32 +02:00
|
|
|
augroup QuickFix
|
2018-07-11 17:33:17 +02:00
|
|
|
autocmd QuickFixCmdPost * cw
|
2021-09-24 22:32:32 +02:00
|
|
|
augroup END
|
2015-02-27 16:38:02 +01:00
|
|
|
|
2009-11-13 12:00:50 +01:00
|
|
|
" open a file in the same directory as the current file with F2 and split with shift+F2
|
|
|
|
map <F2> :tabe <C-R>=expand("%:h") . "/"<CR>
|
|
|
|
nmap <S-F2> :split <C-R>=expand("%:h") . "/"<CR>
|
2023-02-24 00:26:29 +01:00
|
|
|
map <C-F2> :call FZFTab()<CR>
|
|
|
|
fun! FZFTab()
|
|
|
|
tabe
|
|
|
|
FZF
|
|
|
|
endfun
|
2009-11-13 12:00:50 +01:00
|
|
|
|
|
|
|
""""""""
|
|
|
|
" HELP "
|
|
|
|
""""""""
|
|
|
|
" allow embedded man page
|
|
|
|
runtime! ftplugin/man.vim
|
|
|
|
" show vimrc with shift+F1
|
2023-02-23 17:51:47 +01:00
|
|
|
nnoremap <silent> <S-F1> :tabe $MYVIMRC<CR>gg
|
|
|
|
inoremap <S-F1> <Esc><S-F1>
|
2009-11-13 12:00:50 +01:00
|
|
|
" show contextual help with F1
|
2021-05-30 22:40:26 +02:00
|
|
|
|
|
|
|
" get doc of std::string instead of string
|
|
|
|
" Need installation of cppMan
|
|
|
|
function! s:JbzCppMan()
|
|
|
|
let old_isk = &iskeyword
|
|
|
|
setl iskeyword+=:
|
|
|
|
let str = expand("<cword>")
|
|
|
|
let &l:iskeyword = old_isk
|
|
|
|
execute 'Man ' . str
|
|
|
|
endfunction
|
|
|
|
|
2009-11-13 12:00:50 +01:00
|
|
|
function Help()
|
2015-02-27 16:38:02 +01:00
|
|
|
try
|
2018-07-11 17:33:17 +02:00
|
|
|
if exists('b:current_syntax') && b:current_syntax == "python"
|
|
|
|
:call ShowPyDoc(expand("<cword>"), 1)
|
2021-05-30 22:40:26 +02:00
|
|
|
elseif exists('b:current_syntax') && b:current_syntax == "cpp"
|
|
|
|
:call s:JbzCppMan()
|
2020-12-17 15:49:59 +01:00
|
|
|
elseif has_key(g:LanguageClient_serverCommands, &filetype)
|
|
|
|
:call LanguageClient#textDocument_hover()
|
2018-07-11 17:33:17 +02:00
|
|
|
else
|
|
|
|
execute "Man " . expand("<cword>")
|
|
|
|
endif
|
2015-02-27 16:38:02 +01:00
|
|
|
catch /:E149:/
|
|
|
|
execute "help " . expand("<cword>")
|
|
|
|
endtry
|
2009-11-13 12:00:50 +01:00
|
|
|
endfunction
|
|
|
|
nmap <silent> <F1> :call Help()<CR>
|
2010-09-21 10:59:10 +02:00
|
|
|
imap <F1> <Esc><F1>
|
2009-11-13 12:00:50 +01:00
|
|
|
" show VIM help with alt+shift+F1
|
|
|
|
nmap <silent> <M-S-F1> :help <C-R>=expand("<cword>")<CR><CR>
|
|
|
|
imap <M-S-F1> <Esc><M-S-F1>
|
|
|
|
|
|
|
|
"""""""""
|
|
|
|
" TOOLS "
|
|
|
|
"""""""""
|
|
|
|
" show git diff when committing
|
|
|
|
let g:git_diff_spawn_mode = 1
|
|
|
|
|
2010-09-16 14:49:27 +02:00
|
|
|
" zf#j creates a fold from the cursor down # lines.
|
|
|
|
"zf/string creates a fold from the cursor to string .
|
|
|
|
"zj moves the cursor to the next fold.
|
|
|
|
"zk moves the cursor to the previous fold.
|
|
|
|
"zo opens a fold at the cursor.
|
|
|
|
"zO opens all folds at the cursor.
|
|
|
|
"zm increases the foldlevel by one.
|
|
|
|
"zM closes all open folds.
|
|
|
|
"zr decreases the foldlevel by one.
|
|
|
|
"zR decreases the foldlevel to zero -- all folds will be open.
|
|
|
|
"zd deletes the fold at the cursor.
|
|
|
|
"zE deletes all folds.
|
|
|
|
"[z move to start of open fold.
|
|
|
|
"]z move to end of open fold.
|
|
|
|
|
|
|
|
" fold form this bracket
|
|
|
|
nmap <F10> zfa{<CR><CR>
|
|
|
|
" unfold or use End
|
|
|
|
nmap <S-F10> zo<CR><CR>
|
2010-09-28 15:43:25 +02:00
|
|
|
" Autosave folding
|
|
|
|
"au BufWinLeave * mkview
|
|
|
|
" Autoload folding
|
|
|
|
"au BufWinEnter * silent loadview
|
2009-11-13 12:00:50 +01:00
|
|
|
|
2010-11-30 16:30:39 +01:00
|
|
|
|
2009-11-20 13:49:07 +01:00
|
|
|
""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
"Omni-completion par CTRL-X_CTRL-O
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""
|
2015-07-07 14:06:52 +02:00
|
|
|
set omnifunc=syntaxcomplete#Complete
|
|
|
|
|
2009-11-20 13:49:07 +01:00
|
|
|
" Enable omnicppcompletion
|
2010-04-19 18:48:56 +02:00
|
|
|
let OmniCpp_ShowAccess = 0
|
|
|
|
let OmniCpp_LocalSearchDecl=1
|
|
|
|
let OmniCpp_MayCompleteDot = 1 " autocomplete after .
|
|
|
|
let OmniCpp_MayCompleteArrow = 1 " autocomplete after ->
|
|
|
|
let OmniCpp_MayCompleteScope = 1 " autocomplete after ::
|
2022-03-31 09:55:29 +02:00
|
|
|
set path+=..
|
|
|
|
"**,/usr/local/include,/usr/include
|
2010-04-19 18:48:56 +02:00
|
|
|
|
2011-01-27 00:06:07 +01:00
|
|
|
"""""""""""""
|
|
|
|
" Latex "
|
|
|
|
"""""""""""""
|
|
|
|
" package vim-latexsuite
|
|
|
|
" Insert the following line in your ~/.vim/ftplugin/tex.vim file:
|
|
|
|
" imap <buffer> <leader>it <Plug>Tex_InsertItemOnThisLine
|
|
|
|
" compile with \ll
|
|
|
|
set grepprg=grep\ -nH\ $*
|
|
|
|
let g:tex_flavor = "pdflatex"
|
|
|
|
imap <buffer> <leader>it <Plug>Tex_InsertItemOnThisLine
|
|
|
|
let g:Tex_DefaultTargetFormat="pdf"
|
2012-03-20 10:40:56 +01:00
|
|
|
|
2015-12-07 12:05:58 +01:00
|
|
|
if has('gui_running')
|
|
|
|
colorscheme darkblue
|
|
|
|
else
|
|
|
|
colorscheme mycolor
|
|
|
|
endif
|
2014-03-24 17:46:29 +01:00
|
|
|
cnoremap sudow w !sudo tee % >/dev/null
|
2018-07-11 17:33:17 +02:00
|
|
|
" Allow saving of files as sudo when I forgot to start vim using sudo.
|
2020-07-21 10:45:53 +02:00
|
|
|
"cmap w!! w !sudo tee > /dev/null %
|
|
|
|
cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
|
2014-04-08 14:26:26 +02:00
|
|
|
"""""""""""
|
2015-07-06 14:26:11 +02:00
|
|
|
" NerdTree
|
2014-04-08 14:26:26 +02:00
|
|
|
"""""""""""
|
2021-09-24 22:32:32 +02:00
|
|
|
augroup NerdGroup
|
2022-03-31 09:55:29 +02:00
|
|
|
" Exit Vim if NERDTree is the only window remaining in the only tab.
|
|
|
|
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
|
|
|
|
" Close the tab if NERDTree is the only window remaining in it.
|
|
|
|
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
|
2021-09-24 22:32:32 +02:00
|
|
|
map <F9> :NERDTreeToggle<CR>
|
2021-11-10 17:39:54 +01:00
|
|
|
let NERDTreeIgnore= ['\.o$', '\.d$']
|
2021-09-24 22:32:32 +02:00
|
|
|
augroup END
|
2015-07-06 14:26:11 +02:00
|
|
|
|
|
|
|
"""""""""""
|
|
|
|
" GitGutter
|
|
|
|
"""""""""""
|
|
|
|
map <M-F9> :GitGutterSignsToggle <CR>
|
2014-04-08 14:26:26 +02:00
|
|
|
map <S-F9> :GitGutterLineHighlightsToggle <CR>
|
|
|
|
|
2015-12-08 15:00:03 +01:00
|
|
|
""""""""""
|
|
|
|
" LocalConfig
|
|
|
|
""""""""""
|
|
|
|
|
|
|
|
if filereadable(expand('~/.vimrc.local'))
|
2018-07-11 17:33:17 +02:00
|
|
|
" Plugins list and settings should be loaded
|
|
|
|
" only once. Load local_settings block
|
|
|
|
let g:local_plugins = 0
|
|
|
|
let g:local_settings = 1
|
|
|
|
source ~/.vimrc.local
|
2020-07-21 10:45:53 +02:00
|
|
|
" Look for .vimrc in working dir
|
|
|
|
" Restrict cmdline as this could be seen as security issue
|
|
|
|
set exrc
|
|
|
|
set secure
|
2015-12-08 15:00:03 +01:00
|
|
|
endif
|
|
|
|
|
2016-06-03 11:02:06 +02:00
|
|
|
""""""""""
|
|
|
|
" W3m
|
|
|
|
""""""""""
|
|
|
|
let g:w3m#external_browser = 'firefox'
|
2016-05-23 14:52:04 +02:00
|
|
|
|
2017-01-28 14:37:33 +01:00
|
|
|
""""""""""
|
|
|
|
" Kernel
|
|
|
|
""""""""""
|
|
|
|
let g:linuxsty_patterns = [ "/usr/src/", "/linux" ]
|
|
|
|
nnoremap <silent> <leader>a :LinuxCodingStyle<cr>
|
|
|
|
|
2016-05-23 14:52:04 +02:00
|
|
|
""""""""""
|
|
|
|
" Debug
|
|
|
|
""""""""""
|
|
|
|
|
|
|
|
"Or start vim with -V[VERBOSENUMBER][FILE]
|
|
|
|
function! ToggleVerbose()
|
2018-07-11 17:33:17 +02:00
|
|
|
if !&verbose
|
|
|
|
set verbosefile=~/.log/vim/verbose.log
|
|
|
|
set verbose=15
|
|
|
|
else
|
|
|
|
set verbose=0
|
|
|
|
set verbosefile=
|
|
|
|
endif
|
2016-05-23 14:52:04 +02:00
|
|
|
endfunction
|
|
|
|
|
2019-03-21 14:22:35 +01:00
|
|
|
""""""""
|
|
|
|
" Spell
|
|
|
|
""""""""
|
|
|
|
" do :set spelllang+=XX to install language
|
|
|
|
set spelllang=fr,en
|
|
|
|
" Ctrl-L correct last error
|
|
|
|
inoremap <C-l> <c-g>u<Esc>[s1z=`]a<c-g>u
|
|
|
|
|
2020-07-21 10:45:53 +02:00
|
|
|
"set list
|
|
|
|
"set listchars=eol:⏎,tab:▸·,trail:␠,nbsp:⎵
|
|
|
|
|
2020-12-17 15:25:37 +01:00
|
|
|
""""""""
|
|
|
|
" GPG
|
|
|
|
""""""""
|
|
|
|
|
|
|
|
augroup encrypted
|
|
|
|
au!
|
|
|
|
autocmd BufReadPre,FileReadPre *.gpg set viminfo=
|
|
|
|
autocmd BufReadPre,FileReadPre *.gpg set noswapfile noundofile nobackup
|
|
|
|
autocmd BufReadPre,FileReadPre *.gpg set bin
|
|
|
|
autocmd BufReadPre,FileReadPre *.gpg let ch_save = &ch|set ch=2
|
|
|
|
autocmd BufReadPost,FileReadPost *.gpg '[,']!gpg --decrypt 2> /dev/null
|
|
|
|
autocmd BufReadPost,FileReadPost *.gpg set nobin
|
|
|
|
autocmd BufReadPost,FileReadPost *.gpg let &ch = ch_save|unlet ch_save
|
|
|
|
autocmd BufReadPost,FileReadPost *.gpg execute ":doautocmd BufReadPost " . expand("%:r")
|
|
|
|
autocmd BufWritePre,FileWritePre *.gpg '[,']!gpg --default-recipient-self -ae 2>/dev/null
|
|
|
|
autocmd BufWritePost,FileWritePost *.gpg u
|
|
|
|
augroup END
|
|
|
|
|
2014-04-07 16:29:15 +02:00
|
|
|
"""""""""
|
|
|
|
" Plugin"
|
|
|
|
"""""""""
|
2018-03-27 14:03:57 +02:00
|
|
|
" for autotags plugin
|
|
|
|
let g:autotags_pycscope_cmd = '/usr/local/bin/pycscope'
|
|
|
|
|
2014-04-07 16:29:15 +02:00
|
|
|
"Using vundle
|
|
|
|
"cf. https://github.com/gmarik/Vundle.vim
|
|
|
|
":PluginInstall to install them
|
2014-06-06 11:53:43 +02:00
|
|
|
set rtp+=~/.vim/bundle/Vundle.vim/
|
|
|
|
call vundle#begin()
|
2014-04-07 16:29:15 +02:00
|
|
|
|
|
|
|
" let Vundle manage Vundle, required
|
2015-06-05 16:40:47 +02:00
|
|
|
Plugin 'gmarik/Vundle.vim'
|
2014-04-07 16:29:15 +02:00
|
|
|
|
2021-05-30 22:40:26 +02:00
|
|
|
"Rust
|
|
|
|
Plugin 'rust-lang/rust.vim'
|
|
|
|
|
2015-07-07 14:15:38 +02:00
|
|
|
" Communication with git
|
2014-04-07 16:29:15 +02:00
|
|
|
Plugin 'tpope/vim-fugitive'
|
2015-12-15 11:29:21 +01:00
|
|
|
" Support for Gbrowse
|
|
|
|
Plugin 'tpope/vim-rhubarb'
|
2015-07-07 14:15:38 +02:00
|
|
|
" Comment block of code
|
2014-08-13 13:39:55 +02:00
|
|
|
Plugin 'tpope/vim-commentary'
|
2019-09-05 15:13:04 +02:00
|
|
|
" Make terminal vim and tmux work better together for Focus.
|
2015-12-08 14:59:32 +01:00
|
|
|
Plugin 'tmux-plugins/vim-tmux-focus-events'
|
2014-08-13 13:39:55 +02:00
|
|
|
" language pack
|
|
|
|
Plugin 'sheerun/vim-polyglot'
|
|
|
|
" color even for terminal without gui...
|
|
|
|
" Plugin 'vim-scripts/CSApprox'
|
2021-06-29 21:37:55 +02:00
|
|
|
" Show current modified line
|
|
|
|
" Plugin 'airblade/vim-gitgutter'
|
2014-04-08 14:26:26 +02:00
|
|
|
" Same as gitgutter but for other cvs
|
|
|
|
"Plugin mhinz/vim-signify
|
2021-06-29 21:37:55 +02:00
|
|
|
if has('nvim') || has('patch-8.0.902')
|
|
|
|
Plugin 'mhinz/vim-signify'
|
|
|
|
else
|
|
|
|
Plugin 'mhinz/vim-signify', { 'branch': 'legacy' }
|
|
|
|
endif
|
2014-04-07 16:29:15 +02:00
|
|
|
|
2015-07-06 13:56:02 +02:00
|
|
|
" echofunc -> what is the current function
|
|
|
|
Plugin 'mbbill/echofunc'
|
2014-08-13 13:39:55 +02:00
|
|
|
|
2015-07-06 14:03:16 +02:00
|
|
|
" What to test some color ?
|
2023-05-09 13:42:28 +02:00
|
|
|
" Plugin 'vim-scripts/Colour-Sampler-Pack.git'
|
2015-07-06 14:15:29 +02:00
|
|
|
|
2014-08-13 13:39:55 +02:00
|
|
|
" More Snippets :
|
2014-08-13 13:48:46 +02:00
|
|
|
Plugin 'tomtom/tlib_vim'
|
|
|
|
Plugin 'MarcWeber/vim-addon-mw-utils'
|
|
|
|
Plugin 'honza/vim-snippets'
|
|
|
|
Plugin 'garbas/vim-snipmate'
|
2021-05-30 22:40:26 +02:00
|
|
|
let g:snipMate = { 'snippet_version' : 1 }
|
2019-03-21 14:22:35 +01:00
|
|
|
Plugin 'sirver/ultisnips'
|
|
|
|
let g:UltiSnipsExpandTrigger = '<tab>'
|
2020-11-30 12:01:16 +01:00
|
|
|
let g:UltiSnipsListSnippets = '<s-tab>'
|
2019-03-21 14:22:35 +01:00
|
|
|
let g:UltiSnipsJumpForwardTrigger = '<tab>'
|
|
|
|
let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'
|
2014-08-13 13:39:55 +02:00
|
|
|
|
2015-07-06 14:26:11 +02:00
|
|
|
" Filesystem exploration
|
2022-03-31 09:55:29 +02:00
|
|
|
Plugin 'preservim/nerdtree'
|
2015-07-06 14:26:11 +02:00
|
|
|
|
2014-06-06 11:53:43 +02:00
|
|
|
" Python completion
|
2015-02-27 15:45:32 +01:00
|
|
|
"Plugin 'klen/python-mode'
|
2014-12-22 16:27:59 +01:00
|
|
|
"" Python Bundle
|
|
|
|
"Plugin 'davidhalter/jedi-vim'
|
|
|
|
"Plugin 'scrooloose/syntastic'
|
|
|
|
"Plugin 'majutsushi/tagbar'
|
|
|
|
"Plugin 'Yggdroot/indentLine'
|
2020-12-17 15:25:37 +01:00
|
|
|
Plugin 'fs111/pydoc.vim'
|
2014-12-22 16:27:59 +01:00
|
|
|
|
2015-07-07 14:06:52 +02:00
|
|
|
" Omni completion for cpp
|
2022-07-30 23:51:16 +02:00
|
|
|
Plugin 'vim-scripts/OmniCppComplete' " Can be forced with set omnifunc=omni#cpp#complete#Main
|
2015-07-07 14:06:52 +02:00
|
|
|
|
2015-07-07 14:15:38 +02:00
|
|
|
" List current file function
|
2016-03-02 17:32:37 +01:00
|
|
|
" let $GIT_SSL_NO_VERIFY = 'true'
|
|
|
|
Plugin 'gitlab@gitlab.mathux.org:Mathieu/taglist.git'
|
2016-10-17 11:32:42 +02:00
|
|
|
" Tagbar look like a maintened taglist
|
|
|
|
Plugin 'majutsushi/tagbar'
|
2015-07-07 14:15:38 +02:00
|
|
|
|
2020-12-04 00:14:01 +01:00
|
|
|
" Fuzzy finder
|
2023-02-23 17:51:47 +01:00
|
|
|
Plugin 'junegunn/fzf' " then run, cd .vim/bundle/fzf && ./install --bin
|
2021-11-10 17:39:54 +01:00
|
|
|
Plugin 'junegunn/fzf.vim'
|
2020-12-04 00:14:01 +01:00
|
|
|
nnoremap <silent> <leader>o :FZF<CR>
|
|
|
|
nnoremap <silent> <leader>O :FZF!<CR>
|
|
|
|
|
2021-11-10 17:39:54 +01:00
|
|
|
" 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)
|
|
|
|
|
2017-08-16 14:14:28 +02:00
|
|
|
if v:version >= 800
|
|
|
|
" Async lint
|
2022-07-19 23:26:51 +02:00
|
|
|
" Plugin 'dense-analysis/ale'
|
2020-12-19 23:53:14 +01:00
|
|
|
let g:ale_fixers = {
|
2021-05-30 22:40:26 +02:00
|
|
|
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
|
|
|
|
\}
|
|
|
|
let g:ale_linters = {
|
|
|
|
\ 'cpp': ['clangd'],
|
|
|
|
\}
|
|
|
|
|
2020-12-17 15:49:59 +01:00
|
|
|
Plugin 'autozimu/LanguageClient-neovim', {
|
|
|
|
\ 'oninstall': 'bash install.sh',
|
|
|
|
\ }
|
|
|
|
let g:LanguageClient_serverCommands = {
|
|
|
|
\ 'cpp': ['clangd', '-background-index',],
|
|
|
|
\ 'c': ['clangd', '-background-index',],
|
2022-07-31 11:12:59 +02:00
|
|
|
\ 'python': ['/usr/bin/pyls'],
|
2023-02-24 00:26:29 +01:00
|
|
|
\ 'rust': ['rustup', 'run', 'stable', 'rls'],
|
2020-12-17 15:49:59 +01:00
|
|
|
\ }
|
2021-11-09 11:10:03 +01:00
|
|
|
let g:LanguageClient_loggingFile = expand('~/.LanguageClient.log')
|
|
|
|
" Could be debbuged with
|
|
|
|
":call LanguageClient_setLoggingLevel('DEBUG')
|
|
|
|
":LanguageClientStart
|
2020-12-17 15:49:59 +01:00
|
|
|
|
2022-07-30 23:51:16 +02:00
|
|
|
"Language Client recommanded settings
|
|
|
|
Plugin 'Shougo/deoplete.nvim' " Need to install pynvim
|
|
|
|
Plugin 'roxma/nvim-yarp'
|
|
|
|
Plugin 'roxma/vim-hug-neovim-rpc'
|
|
|
|
let g:deoplete#enable_at_startup = 1
|
|
|
|
|
|
|
|
Plugin 'Shougo/echodoc.vim'
|
|
|
|
|
|
|
|
let cmdheight=2
|
|
|
|
let g:echodoc#enable_at_startup = 1
|
|
|
|
let g:echodoc#type = 'signature'
|
|
|
|
|
2020-12-17 15:49:59 +01:00
|
|
|
function LC_maps()
|
|
|
|
if has_key(g:LanguageClient_serverCommands, &filetype)
|
|
|
|
nmap <buffer> <silent> K <Plug>(lcn-hover)
|
|
|
|
nmap <buffer> <silent> gd <Plug>(lcn-definition)
|
2022-03-09 10:06:25 +01:00
|
|
|
nmap <buffer> <silent> gy <Plug>(lcn-type-definition)
|
|
|
|
nmap <buffer> <silent> gi <Plug>(lcn-implementation)
|
2021-09-01 14:47:17 +02:00
|
|
|
nmap <buffer> <silent> gr <Plug>(lcn-references)
|
2020-12-17 15:49:59 +01:00
|
|
|
nmap <buffer> <silent> cr <Plug>(lcn-rename)
|
2022-11-23 11:35:19 +01:00
|
|
|
nmap <buffer> <silent> gq <Plug>(lcn-code-action)
|
2021-09-01 14:47:17 +02:00
|
|
|
nmap <C-F1> <Plug>(lcn-menu)
|
2020-12-17 15:49:59 +01:00
|
|
|
endif
|
|
|
|
endfunction
|
2021-09-24 22:32:32 +02:00
|
|
|
augroup LSP
|
2022-07-31 11:12:59 +02:00
|
|
|
autocmd FileType c,cpp,python call LC_maps()
|
2021-09-24 22:32:32 +02:00
|
|
|
augroup END
|
2022-07-30 23:51:16 +02:00
|
|
|
|
|
|
|
|
2017-08-16 14:14:28 +02:00
|
|
|
else
|
|
|
|
"Syntax checking | Install flake8 or pylint for python
|
2018-03-01 16:39:58 +01:00
|
|
|
" Install shellcheck for bash
|
2017-08-16 14:14:28 +02:00
|
|
|
Plugin 'vim-syntastic/syntastic'
|
|
|
|
let g:syntastic_c_checkers = ['gcc', 'cppcheck']
|
2018-03-01 16:39:58 +01:00
|
|
|
"let g:syntastic_cpp_compiler = 'clang++'
|
|
|
|
"let g:syntastic_cpp_compiler_options = '-std=c++14'
|
2017-08-16 14:14:28 +02:00
|
|
|
endif
|
2020-07-21 10:45:53 +02:00
|
|
|
|
2014-12-22 16:27:59 +01:00
|
|
|
"Completion (need more configuration for python, c# ...)
|
2022-03-09 10:06:25 +01:00
|
|
|
"Plugin 'ycm-core/YouCompleteMe'
|
2014-06-06 11:53:43 +02:00
|
|
|
" VimWiki
|
|
|
|
Plugin 'vimwiki/vimwiki'
|
|
|
|
let g:vimwiki_list=[{'path':'~/.vim/vimwiki'}]
|
2020-11-16 11:25:28 +01:00
|
|
|
Plugin 'mattn/calendar-vim'
|
|
|
|
" Use \w\w to create new diary entry.
|
|
|
|
" use :Diary to view all on them
|
|
|
|
command! Diary VimwikiDiaryIndex
|
|
|
|
augroup vimwikigroup
|
|
|
|
autocmd!
|
|
|
|
" automatically update links on read diary
|
|
|
|
autocmd BufRead,BufNewFile diary.wiki VimwikiDiaryGenerateLinks
|
|
|
|
augroup end
|
2014-06-06 11:53:43 +02:00
|
|
|
|
2015-06-05 16:41:06 +02:00
|
|
|
" open file at the given line with the file.txt:20 syntax
|
2016-03-02 17:33:31 +01:00
|
|
|
" But it's screw up the git commit message
|
|
|
|
"Plugin 'bogado/file-line'
|
2015-09-02 10:35:23 +02:00
|
|
|
|
2015-12-07 12:05:07 +01:00
|
|
|
" % match if/then/else/html ...
|
|
|
|
Plugin 'tmhedberg/matchit'
|
|
|
|
|
2015-09-02 10:35:23 +02:00
|
|
|
" Kernel Formatting
|
|
|
|
Plugin 'gregkh/kernel-coding-style.git'
|
2016-06-03 11:02:06 +02:00
|
|
|
|
|
|
|
" Web browsing
|
2016-09-26 13:50:15 +02:00
|
|
|
"Plugin 'yuratomo/w3m.vim'
|
2016-09-01 10:11:55 +02:00
|
|
|
|
|
|
|
" Recognize Key in screen/tmux
|
2016-09-26 13:50:15 +02:00
|
|
|
"Plugin 'drmikehenry/vim-fixkey'
|
2019-09-05 15:13:04 +02:00
|
|
|
set term=xterm-256color
|
2016-10-17 11:35:57 +02:00
|
|
|
|
2017-08-16 14:14:28 +02:00
|
|
|
Plugin 'tpope/vim-surround'
|
|
|
|
" Maps ss to surround word. e.g. ss] to add [] around word
|
|
|
|
nmap ss ysiw
|
|
|
|
" Maps sl to surround line
|
|
|
|
nmap sl yss
|
|
|
|
" Surround Visual selection
|
|
|
|
vmap s S
|
|
|
|
|
2017-09-20 15:39:40 +02:00
|
|
|
"Grammar Checking
|
|
|
|
Plugin 'rhysd/vim-grammarous'
|
|
|
|
|
2017-08-16 14:14:28 +02:00
|
|
|
Plugin 'junegunn/goyo.vim'
|
2019-03-21 14:22:35 +01:00
|
|
|
Plugin 'junegunn/limelight.vim'
|
2021-09-24 22:32:32 +02:00
|
|
|
augroup LimeGroup
|
|
|
|
autocmd! User GoyoEnter Limelight
|
|
|
|
autocmd! User GoyoLeave Limelight!
|
|
|
|
augroup END
|
2019-03-21 14:22:35 +01:00
|
|
|
|
2016-10-17 11:35:57 +02:00
|
|
|
"Complete delimiters
|
|
|
|
Plugin 'Raimondi/delimitMate.git'
|
2017-08-16 14:14:28 +02:00
|
|
|
|
|
|
|
Plugin 'Yggdroot/LeaderF'
|
2017-11-03 16:12:14 +01:00
|
|
|
|
|
|
|
"Vim session
|
|
|
|
Plugin 'tpope/vim-obsession'
|
|
|
|
Plugin 'mhinz/vim-startify'
|
|
|
|
let g:startify_commands = [
|
2019-03-21 14:22:35 +01:00
|
|
|
\ ['Plugin Update', 'PluginUpdate'],
|
|
|
|
\ ['Plugin Install', 'PluginInstall'],
|
|
|
|
\ ['Vim Wiki', 'VimwikiIndex'],
|
|
|
|
\]
|
2017-11-06 10:50:41 +01:00
|
|
|
let g:startify_custom_header = []
|
2019-03-21 14:22:35 +01:00
|
|
|
|
|
|
|
Plugin 'vim-pandoc/vim-pandoc'
|
|
|
|
let g:pandoc#modules#disabled = ["folding"]
|
|
|
|
Plugin 'vim-pandoc/vim-pandoc-syntax'
|
|
|
|
|
|
|
|
"Unicode research
|
|
|
|
"Plugin 'chrisbra/unicode.vim'
|
|
|
|
|
|
|
|
" Tig explorer
|
|
|
|
Plugin 'iberianpig/tig-explorer.vim'
|
|
|
|
|
|
|
|
" LaTex
|
|
|
|
Plugin 'lervag/vimtex'
|
|
|
|
let g:tex_flavor='latex'
|
|
|
|
let g:vimtex_view_method='zathura'
|
|
|
|
let g:vimtex_quickfix_mode=0
|
|
|
|
set conceallevel=1
|
|
|
|
let g:tex_conceal='abdmg'
|
|
|
|
" not compatible with LaTeX-Box included in polyglot
|
|
|
|
let g:polyglot_disabled = ['latex']
|
2019-07-05 15:27:10 +02:00
|
|
|
|
|
|
|
" Visual incrementation. increment in block with ctrl-A
|
2021-09-24 22:32:32 +02:00
|
|
|
"-> use g ctr-a instead
|
|
|
|
"Plugin 'triglav/vim-visual-increment'
|
|
|
|
"set nrformats=alpha,octal,hex
|
2019-09-05 15:38:01 +02:00
|
|
|
|
|
|
|
Plugin 'christoomey/vim-tmux-navigator'
|
|
|
|
let g:tmux_navigator_no_mappings=1
|
2020-07-21 10:17:39 +02:00
|
|
|
|
2023-02-24 00:26:29 +01:00
|
|
|
" view register content
|
2020-07-21 10:17:39 +02:00
|
|
|
Plugin 'junegunn/vim-peekaboo'
|
2020-11-16 11:11:44 +01:00
|
|
|
|
|
|
|
Plugin 'patashish704/pandoc-complete'
|
2021-05-30 22:40:26 +02:00
|
|
|
|
|
|
|
" Debugger
|
|
|
|
Plugin 'puremourning/vimspector'
|
|
|
|
"let g:vimspector_enable_mappings = 'HUMAN'
|
|
|
|
|
|
|
|
" Open browser related things
|
|
|
|
Plugin 'tyru/open-browser.vim'
|
|
|
|
let g:openbrowser_search_engines = extend(
|
|
|
|
\ get(g:, 'openbrowser_search_engines', {}),
|
|
|
|
\ {
|
|
|
|
\ 'cppreference': 'https://en.cppreference.com/mwiki/index.php?title=Special%3ASearch&search={query}',
|
|
|
|
\ 'qt': 'https://doc.qt.io/qt-5/search-results.html?q={query}',
|
|
|
|
\ 'devdoc': 'https://devdocs.io/#q={query}',
|
|
|
|
\ 'github-cpp': 'http://github.com/search?l=C%2B%2B&q=fork%3Afalse+language%3AC%2B%2B+{query}&type=Code',
|
|
|
|
\ 'en2fr': 'http://translate.google.fr/translate_t?hl=fr&ie=UTF-8&text={query}&sl=en&tl=fr#',
|
|
|
|
\ 'fr2en': 'http://translate.google.fr/translate_t?hl=fr&ie=UTF-8&text={query}&sl=fr&tl=en#',
|
|
|
|
\ 'verbe' : 'http://www.la-conjugaison.fr/du/verbe/{query}.php'
|
|
|
|
\ },
|
|
|
|
\ 'keep'
|
|
|
|
\)
|
|
|
|
nnoremap <silent> <leader>osx :call openbrowser#smart_search(expand('<cword>'), "cppreference")<CR>
|
|
|
|
nnoremap <silent> <leader>osq :call openbrowser#smart_search(expand('<cword>'), "qt")<CR>
|
|
|
|
nnoremap <silent> <leader>osd :call openbrowser#smart_search(expand('<cword>'), "devdoc")<CR>
|
|
|
|
nnoremap <silent> <leader>osen2fr :call openbrowser#smart_search(expand('<cword>'), "en2fr")<CR>
|
|
|
|
nnoremap <silent> <leader>osfr2en :call openbrowser#smart_search(expand('<cword>'), "fr2en")<CR>
|
|
|
|
|
|
|
|
" A recent tagbar
|
|
|
|
Plugin 'liuchengxu/vista.vim'
|
|
|
|
" highlight other use of he word under the cursor
|
|
|
|
Plugin 'RRethy/vim-illuminate'
|
|
|
|
" Parentheses with various colors
|
|
|
|
Plugin 'luochen1990/rainbow'
|
|
|
|
let g:rainbow_active = 1 "set to 0 if you want to enable it later via :RainbowToggle
|
2021-06-29 21:37:55 +02:00
|
|
|
|
2021-11-09 11:10:03 +01:00
|
|
|
" Markdown preview -> then install with :call mkdp#util#install()
|
|
|
|
Plugin 'iamcco/markdown-preview.nvim'
|
|
|
|
|
|
|
|
" File skeleton
|
|
|
|
Plugin 'pgilad/vim-skeletons'
|
|
|
|
let skeletons#autoRegister = 1
|
|
|
|
let skeletons#skeletonsDir = ["~/.vim/templates/"]
|
|
|
|
"let skeletons#skeletonsDir += ["~/.vim/bundle/vim-skeletons/skeletons/"]
|
2021-11-10 17:39:54 +01:00
|
|
|
|
|
|
|
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)
|
2022-07-31 01:28:59 +02:00
|
|
|
Plugin 'mmarchini/bpftrace.vim'
|
|
|
|
autocmd BufNewFile,BufRead *.bt setfiletype bpftrace
|
2021-11-10 17:39:54 +01:00
|
|
|
|
2022-06-08 10:10:20 +02:00
|
|
|
" Source the termdebug plugin
|
|
|
|
packadd termdebug
|
|
|
|
let g:termdebug_wide=1
|
2023-04-19 15:37:58 +02:00
|
|
|
" Boormark // visual mark
|
|
|
|
Plugin 'MattesGroeger/vim-bookmarks'
|
2022-06-08 10:10:20 +02:00
|
|
|
|
2014-06-06 11:53:43 +02:00
|
|
|
call vundle#end()
|