diff --git a/vim/.vimrc b/vim/.vimrc index 1904db2..9bd2938 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -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 @@ -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 = '' 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 ww :call mkdir(strftime("diary/%Y/%m"), "p", 0755) \| exec "edit " . strftime("diary/%Y/%m/%Y-%m-%d.md") + +"" +"" Keymappings +"" + " Other key mappings map :NERDTreeToggle -map n :cnext -map p :cprevious nmap N :NERDTreeFocus -nnoremap h :cclose " Removes trailing whitespaces nnoremap s :keeppattern %s/\s\+$// +" Quickfix and location lists key mappings +nmap cf :cfirst +nmap cn :cnext +nmap cp :cprevious +nmap co :copen +nmap cc :cclose +nmap lf :lfirst +nmap ln :lnext +nmap lp :lprevious +nmap lo :lopen +nmap lc :lclose + autocmd BufNewFile,BufRead *.tmpl set syntax=gohtmltmpl nmap gd (coc-definition) @@ -208,8 +226,8 @@ nmap go :CocList outline nnoremap K :call show_documentation() nmap rn (coc-rename) -inoremap pumvisible() ? "\" : "\" -inoremap pumvisible() ? "\" : "\" +"inoremap pumvisible() ? "\" : "\" +"inoremap pumvisible() ? "\" : "\" function! s:show_documentation() if (index(['vim','help'], &filetype) >= 0) @@ -237,3 +255,8 @@ if has("autocmd") autocmd FileType go nmap d (go-def) autocmd FileType go nmap m (go-metalinter) endif + +nmap w :w + +" Easier to exit terminal insert mode with Esc +tnoremap