lot of updates to vimrc

This commit is contained in:
Bruno Carlin 2020-02-03 11:47:17 +01:00
parent 5fed7e2346
commit b5dcb4da56

View file

@ -30,6 +30,7 @@ set incsearch " Incremental search
set hidden " Hide buffers when they are abandoned
set mouse=a
set number
set relativenumber
set expandtab "Use softtabstop spaces instead of tab characters for indentation
set shiftwidth=4 "Indent by 4 spaces when using >>, <<, == etc.
set softtabstop=4 "Indent by 4 spaces when pressing <TAB>
@ -64,6 +65,7 @@ if has("autocmd")
autocmd FileType gitcommit setlocal tw=80 ts=2 sts=2 sw=2 expandtab
autocmd FileType md setlocal tw=80 ts=2 sts=2 sw=2 expandtab
autocmd FileType vimwiki setlocal tw=80 ts=2 sts=2 sw=2 expandtab
autocmd FileType sh setlocal tw=80 ts=2 sts=2 sw=2 expandtab
endif
" Airline options
@ -114,12 +116,7 @@ let g:go_jump_to_error = 0
let g:go_auto_sameids = 0
" vimwiki options
let g:vimwiki_list = [{'path': '~/Notebook/work',
\ 'auto_toc': 1,
\ 'index': 'main',
\ 'ext': '.md',
\ 'syntax': 'markdown'},
\{'path': '~/Notebook/perso',
let g:vimwiki_list = [{'path': '~/Notebook',
\ 'auto_toc': 1,
\ 'index': 'main',
\ 'ext': '.md',
@ -129,10 +126,9 @@ let g:vimwiki_ext2syntax = {'.md': 'markdown'}
" Grammalecte options
let g:grammalecte_cli_py='/usr/bin/grammalecte'
" IndentGuide options
let g:indent_guides_auto_colors = 0
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd ctermbg=none
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven ctermbg=black
" IndentLine options
let g:indentLine_char = '▏'
"let g:indentLine_setColors = 0
" CoC options
@ -142,7 +138,7 @@ let g:ale_open_list = 1
let g:ale_linters = {
\ 'go': ['gofmt', 'golint', 'golangci-lint']
\}
let g:ale_go_golangci_lint_options = '--enable-all --disable unused'
"let g:ale_go_golangci_lint_options = '--enable-all --disable unused'
let g:ale_fix_on_save = 0
let g:ale_sign_error = '🔴'
let g:ale_sign_info = '🔵'
@ -153,6 +149,8 @@ let g:minisnip_trigger = '<C-w>'
call plug#begin('~/.vim/plugged')
Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } }
Plug 'scrooloose/nerdtree'
Plug 'xuyuanp/nerdtree-git-plugin'
@ -173,7 +171,7 @@ call plug#begin('~/.vim/plugged')
Plug 'liuchengxu/vim-clap'
Plug 'dense-analysis/ale'
Plug 'joereynolds/vim-minisnip'
Plug 'neoclide/coc.nvim', {'branch': 'release', 'do': 'yarn install --frozen-lockfile'}
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'nullvoxpopuli/coc-ember', {'do': 'yarn install --frozen-lockfile'}
Plug 'neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'}
Plug 'neoclide/coc-html', {'do': 'yarn install --frozen-lockfile'}
@ -184,20 +182,40 @@ call plug#begin('~/.vim/plugged')
Plug 'vimwiki/vimwiki'
Plug 'dpelle/vim-Grammalecte'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'Yggdroot/indentLine'
Plug 'michaeljsmith/vim-indent-object'
Plug 'altercation/vim-colors-solarized'
call plug#end()
""
"" Notebook
""
nmap <silent> <space>w<space>w :call mkdir(strftime("diary/%Y/%m"), "p", 0755) \| exec "edit " . strftime("diary/%Y/%m/%Y-%m-%d.md")<CR>
""
"" Keymappings
""
" Other key mappings
map <C-n> :NERDTreeToggle<CR>
map <leader>n :cnext<CR>
map <leader>p :cprevious<CR>
nmap <leader>N :NERDTreeFocus<CR>
nnoremap <leader>h :cclose<CR>
" Removes trailing whitespaces
nnoremap <leader>s :keeppattern %s/\s\+$//<CR>
" Quickfix and location lists key mappings
nmap <space>cf :cfirst<CR>
nmap <space>cn :cnext<CR>
nmap <space>cp :cprevious<CR>
nmap <space>co :copen<CR>
nmap <space>cc :cclose<CR>
nmap <space>lf :lfirst<CR>
nmap <space>ln :lnext<CR>
nmap <space>lp :lprevious<CR>
nmap <space>lo :lopen<CR>
nmap <space>lc :lclose<CR>
autocmd BufNewFile,BufRead *.tmpl set syntax=gohtmltmpl
nmap <silent> gd <Plug>(coc-definition)
@ -208,8 +226,8 @@ nmap <silent> go :CocList outline<CR>
nnoremap <silent> K :call <SID>show_documentation()<CR>
nmap <leader>rn <Plug>(coc-rename)
inoremap <silent><expr> <TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<CR>"
"inoremap <silent><expr> <TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
"inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<CR>"
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
@ -237,3 +255,8 @@ if has("autocmd")
autocmd FileType go nmap <leader>d <Plug>(go-def)
autocmd FileType go nmap <leader>m <Plug>(go-metalinter)
endif
nmap <space>w :w<CR>
" Easier to exit terminal insert mode with Esc
tnoremap <Esc> <C-\><C-n>