lot of updates to vimrc
This commit is contained in:
parent
5fed7e2346
commit
b5dcb4da56
1 changed files with 41 additions and 18 deletions
59
vim/.vimrc
59
vim/.vimrc
|
@ -30,6 +30,7 @@ set incsearch " Incremental search
|
||||||
set hidden " Hide buffers when they are abandoned
|
set hidden " Hide buffers when they are abandoned
|
||||||
set mouse=a
|
set mouse=a
|
||||||
set number
|
set number
|
||||||
|
set relativenumber
|
||||||
set expandtab "Use softtabstop spaces instead of tab characters for indentation
|
set expandtab "Use softtabstop spaces instead of tab characters for indentation
|
||||||
set shiftwidth=4 "Indent by 4 spaces when using >>, <<, == etc.
|
set shiftwidth=4 "Indent by 4 spaces when using >>, <<, == etc.
|
||||||
set softtabstop=4 "Indent by 4 spaces when pressing <TAB>
|
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 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 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 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
|
endif
|
||||||
|
|
||||||
" Airline options
|
" Airline options
|
||||||
|
@ -114,12 +116,7 @@ let g:go_jump_to_error = 0
|
||||||
let g:go_auto_sameids = 0
|
let g:go_auto_sameids = 0
|
||||||
|
|
||||||
" vimwiki options
|
" vimwiki options
|
||||||
let g:vimwiki_list = [{'path': '~/Notebook/work',
|
let g:vimwiki_list = [{'path': '~/Notebook',
|
||||||
\ 'auto_toc': 1,
|
|
||||||
\ 'index': 'main',
|
|
||||||
\ 'ext': '.md',
|
|
||||||
\ 'syntax': 'markdown'},
|
|
||||||
\{'path': '~/Notebook/perso',
|
|
||||||
\ 'auto_toc': 1,
|
\ 'auto_toc': 1,
|
||||||
\ 'index': 'main',
|
\ 'index': 'main',
|
||||||
\ 'ext': '.md',
|
\ 'ext': '.md',
|
||||||
|
@ -129,10 +126,9 @@ let g:vimwiki_ext2syntax = {'.md': 'markdown'}
|
||||||
" Grammalecte options
|
" Grammalecte options
|
||||||
let g:grammalecte_cli_py='/usr/bin/grammalecte'
|
let g:grammalecte_cli_py='/usr/bin/grammalecte'
|
||||||
|
|
||||||
" IndentGuide options
|
" IndentLine options
|
||||||
let g:indent_guides_auto_colors = 0
|
let g:indentLine_char = '▏'
|
||||||
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd ctermbg=none
|
"let g:indentLine_setColors = 0
|
||||||
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven ctermbg=black
|
|
||||||
|
|
||||||
" CoC options
|
" CoC options
|
||||||
|
|
||||||
|
@ -142,7 +138,7 @@ let g:ale_open_list = 1
|
||||||
let g:ale_linters = {
|
let g:ale_linters = {
|
||||||
\ 'go': ['gofmt', 'golint', 'golangci-lint']
|
\ '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_fix_on_save = 0
|
||||||
let g:ale_sign_error = '🔴'
|
let g:ale_sign_error = '🔴'
|
||||||
let g:ale_sign_info = '🔵'
|
let g:ale_sign_info = '🔵'
|
||||||
|
@ -153,6 +149,8 @@ let g:minisnip_trigger = '<C-w>'
|
||||||
|
|
||||||
call plug#begin('~/.vim/plugged')
|
call plug#begin('~/.vim/plugged')
|
||||||
|
|
||||||
|
Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } }
|
||||||
|
|
||||||
Plug 'scrooloose/nerdtree'
|
Plug 'scrooloose/nerdtree'
|
||||||
Plug 'xuyuanp/nerdtree-git-plugin'
|
Plug 'xuyuanp/nerdtree-git-plugin'
|
||||||
|
|
||||||
|
@ -173,7 +171,7 @@ call plug#begin('~/.vim/plugged')
|
||||||
Plug 'liuchengxu/vim-clap'
|
Plug 'liuchengxu/vim-clap'
|
||||||
Plug 'dense-analysis/ale'
|
Plug 'dense-analysis/ale'
|
||||||
Plug 'joereynolds/vim-minisnip'
|
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 'nullvoxpopuli/coc-ember', {'do': 'yarn install --frozen-lockfile'}
|
||||||
Plug 'neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'}
|
Plug 'neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'}
|
||||||
Plug 'neoclide/coc-html', {'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 'vimwiki/vimwiki'
|
||||||
Plug 'dpelle/vim-Grammalecte'
|
Plug 'dpelle/vim-Grammalecte'
|
||||||
Plug 'nathanaelkane/vim-indent-guides'
|
Plug 'Yggdroot/indentLine'
|
||||||
|
Plug 'michaeljsmith/vim-indent-object'
|
||||||
Plug 'altercation/vim-colors-solarized'
|
Plug 'altercation/vim-colors-solarized'
|
||||||
|
|
||||||
call plug#end()
|
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
|
" Other key mappings
|
||||||
map <C-n> :NERDTreeToggle<CR>
|
map <C-n> :NERDTreeToggle<CR>
|
||||||
map <leader>n :cnext<CR>
|
|
||||||
map <leader>p :cprevious<CR>
|
|
||||||
nmap <leader>N :NERDTreeFocus<CR>
|
nmap <leader>N :NERDTreeFocus<CR>
|
||||||
nnoremap <leader>h :cclose<CR>
|
|
||||||
" Removes trailing whitespaces
|
" Removes trailing whitespaces
|
||||||
nnoremap <leader>s :keeppattern %s/\s\+$//<CR>
|
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
|
autocmd BufNewFile,BufRead *.tmpl set syntax=gohtmltmpl
|
||||||
|
|
||||||
nmap <silent> gd <Plug>(coc-definition)
|
nmap <silent> gd <Plug>(coc-definition)
|
||||||
|
@ -208,8 +226,8 @@ nmap <silent> go :CocList outline<CR>
|
||||||
|
|
||||||
nnoremap <silent> K :call <SID>show_documentation()<CR>
|
nnoremap <silent> K :call <SID>show_documentation()<CR>
|
||||||
nmap <leader>rn <Plug>(coc-rename)
|
nmap <leader>rn <Plug>(coc-rename)
|
||||||
inoremap <silent><expr> <TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
|
"inoremap <silent><expr> <TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
|
||||||
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<CR>"
|
"inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<CR>"
|
||||||
|
|
||||||
function! s:show_documentation()
|
function! s:show_documentation()
|
||||||
if (index(['vim','help'], &filetype) >= 0)
|
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>d <Plug>(go-def)
|
||||||
autocmd FileType go nmap <leader>m <Plug>(go-metalinter)
|
autocmd FileType go nmap <leader>m <Plug>(go-metalinter)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
nmap <space>w :w<CR>
|
||||||
|
|
||||||
|
" Easier to exit terminal insert mode with Esc
|
||||||
|
tnoremap <Esc> <C-\><C-n>
|
||||||
|
|
Loading…
Add table
Reference in a new issue