Further vim changes

This commit is contained in:
Rob Watson 2020-12-18 13:49:36 +01:00
parent f13c93f025
commit a03f770d41
1 changed files with 10 additions and 2 deletions

12
vimrc
View File

@ -21,6 +21,8 @@ set autoindent
set hlsearch set hlsearch
set showmatch set showmatch
set wildignore+=*.log,*.sql,*.cache set wildignore+=*.log,*.sql,*.cache
set wildmode=longest,list,full
set wildmenu
set number set number
set relativenumber set relativenumber
set ruler set ruler
@ -59,6 +61,8 @@ nnoremap Q @@
nmap <silent> <leader>an :ALENextWrap<cr> nmap <silent> <leader>an :ALENextWrap<cr>
nmap <silent> <leader>ap :ALEPreviousWrap<cr> nmap <silent> <leader>ap :ALEPreviousWrap<cr>
nmap <silent> <leader>ad :ALEDetail<cr> nmap <silent> <leader>ad :ALEDetail<cr>
inoremap <silent><expr> <Tab>
\ pumvisible() ? "\<C-n>" : "\<TAB>"
" Markdown configuration: " Markdown configuration:
autocmd FileType markdown setlocal wrap linebreak autocmd FileType markdown setlocal wrap linebreak
@ -79,7 +83,11 @@ set laststatus=2
" Vim-Go configuration: " Vim-Go configuration:
let g:go_fmt_autosave = 0 let g:go_fmt_autosave = 0
let g:go_imports_autosave = 0 " Vim-Go seems to handle fix-on-save better than ALE:
let g:go_imports_autosave = 1
let g:go_fmt_options = {
\ 'goimports': '-local github.com/sensiblecode.com/cantabular',
\ }
autocmd BufNewFile,BufRead *.gohtml set syntax=gohtmltmpl autocmd BufNewFile,BufRead *.gohtml set syntax=gohtmltmpl
" https://github.com/golang/tools/blob/master/gopls/doc/vim.md#vim-go " https://github.com/golang/tools/blob/master/gopls/doc/vim.md#vim-go
let g:go_def_mode='gopls' let g:go_def_mode='gopls'
@ -97,7 +105,7 @@ let g:ale_linters = {
let g:ale_fixers = { let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'], \ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'javascript': ['prettier'], \ 'javascript': ['prettier'],
\ 'go': ['goimports'], \ 'go': [],
\ 'rust': ['rustfmt'] \ 'rust': ['rustfmt']
\ } \ }
let g:ale_fix_on_save = 1 let g:ale_fix_on_save = 1