Update vimrc
This commit is contained in:
parent
a03f770d41
commit
8fa27d57d5
92
vimrc
92
vimrc
|
@ -2,7 +2,10 @@ syntax on
|
|||
filetype plugin indent on
|
||||
|
||||
" Make comma the leader key
|
||||
:let mapleader=","
|
||||
let mapleader=","
|
||||
|
||||
" file browser
|
||||
let g:netrw_banner = 0
|
||||
|
||||
set shiftwidth=2
|
||||
set shiftround
|
||||
|
@ -39,8 +42,15 @@ set nobackup
|
|||
set noswapfile
|
||||
set clipboard=unnamed
|
||||
set pastetoggle=<F2>
|
||||
set ttymouse=sgr
|
||||
set mouse=a
|
||||
set mousemodel=popup_setpos
|
||||
set lazyredraw
|
||||
set completeopt=menu,menuone,popup,noselect,noinsert
|
||||
set timeoutlen=600
|
||||
set ballooneval
|
||||
set balloonevalterm
|
||||
set scrolloff=5
|
||||
|
||||
" Colour scheme:
|
||||
colorscheme PaperColor
|
||||
|
@ -54,24 +64,16 @@ map <up> <nop>
|
|||
map <down> <nop>
|
||||
map <left> <nop>
|
||||
map <right> <nop>
|
||||
map <leader>n :Ntree<cr>
|
||||
" Select just-pasted text:
|
||||
nnoremap <Leader>p `[v`]
|
||||
nnoremap Q @@
|
||||
" Skip to next linter problems:
|
||||
nmap <silent> <leader>an :ALENextWrap<cr>
|
||||
nmap <silent> <leader>ap :ALEPreviousWrap<cr>
|
||||
nmap <silent> <leader>ad :ALEDetail<cr>
|
||||
inoremap <silent><expr> <Tab>
|
||||
\ pumvisible() ? "\<C-n>" : "\<TAB>"
|
||||
|
||||
" Markdown configuration:
|
||||
autocmd FileType markdown setlocal wrap linebreak
|
||||
|
||||
" Nerdtree configuration:
|
||||
map <Leader>n :NERDTreeToggle<CR>
|
||||
|
||||
" Command-T configuration:
|
||||
map <leader>f :CommandTFlush<CR>
|
||||
map <leader>tf :CommandTFlush<CR>
|
||||
let g:CommandTFileScanner="git"
|
||||
let g:CommandTGitScanSubmodules=1
|
||||
let g:CommandTGitIncludeUntracked=1
|
||||
|
@ -94,30 +96,70 @@ let g:go_def_mode='gopls'
|
|||
let g:go_info_mode='gopls'
|
||||
|
||||
" Vim-Rust configuration:
|
||||
let g:rustfmt_autosave = 0
|
||||
let g:rustfmt_autosave = 1
|
||||
|
||||
" ALE configuration:
|
||||
let g:ale_linters = {
|
||||
\ 'javascript': ['eslint'],
|
||||
\ 'go': ['gopls'],
|
||||
\ 'rust': ['cargo']
|
||||
\ }
|
||||
let g:ale_fixers = {
|
||||
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
|
||||
\ 'javascript': ['prettier'],
|
||||
\ 'go': [],
|
||||
\ 'rust': ['rustfmt']
|
||||
\ }
|
||||
set omnifunc=ale#completion#OmniFunc
|
||||
function SymbolSearch()
|
||||
call inputsave()
|
||||
let s:pattern = trim(input("symbol search: "))
|
||||
call inputrestore()
|
||||
if len(s:pattern) > 0
|
||||
execute 'ALESymbolSearch' s:pattern
|
||||
endif
|
||||
endfunction
|
||||
nmap <silent> <leader>af :ALEFirst<cr>
|
||||
nmap <silent> <leader>al :ALELast<cr>
|
||||
nmap <silent> <leader>an :ALENextWrap<cr>
|
||||
nmap <silent> <leader>ap :ALEPreviousWrap<cr>
|
||||
nmap <silent> <leader>aN :ALENext -error<cr>
|
||||
nmap <silent> <leader>aP :ALEPrevious -error<cr>
|
||||
nmap <leader>ad :ALEDetail<cr>
|
||||
map <Leader>ss :call SymbolSearch()<CR>
|
||||
map <Leader>g :ALEGoToDefinition<CR>
|
||||
map <Leader>gt :ALEGoToTypeDefinition<CR>
|
||||
map <Leader>f :ALEFindReferences<CR>
|
||||
map <Leader>fv :ALEFindReferences -vsplit<CR>
|
||||
map <Leader>fh :ALEFindReferences -split<CR>
|
||||
map <Leader>ft :ALEFindReferences -tab<CR>
|
||||
map <Leader>r :ALERename<CR>
|
||||
|
||||
let g:ale_sign_column_always = 1
|
||||
let g:ale_fix_on_save = 1
|
||||
let g:ale_lint_on_text_changed = 0
|
||||
let g:ale_lint_on_text_changed = 1
|
||||
let g:ale_lint_on_enter = 1
|
||||
let g:ale_lint_on_insert_leave = 1
|
||||
let g:ale_lint_on_save = 1
|
||||
let g:ale_echo_cursor = 1
|
||||
let g:ale_rust_cargo_use_clippy = 0
|
||||
let g:ale_lint_delay = 50
|
||||
let g:ale_set_balloons = 1
|
||||
" NOTE: Needs https://github.com/dense-analysis/ale/issues/3350
|
||||
let g:ale_rust_analyzer_config = {
|
||||
\ 'diagnostics': { 'disabled': ['unresolved-import'] },
|
||||
\ 'cargo': { 'loadOutDirsFromCheck': v:true },
|
||||
\ 'procMacro': { 'enable': v:true },
|
||||
\ 'checkOnSave': { 'command': 'clippy', 'enable': v:true }
|
||||
\ }
|
||||
let g:ale_go_goimports_options = '-local github.com/sensiblecodeio/cantabular'
|
||||
let g:ale_command_wrapper = 'nice -n5'
|
||||
let g:ale_completion_enabled = 1
|
||||
let g:ale_close_preview_on_insert = 1
|
||||
let g:ale_hover_to_preview = 1
|
||||
let g:ale_sign_column_always = 1
|
||||
let g:ale_history_log_output = 1
|
||||
let g:ale_linters = {
|
||||
\ 'javascript': ['eslint'],
|
||||
\ 'go': ['gopls'],
|
||||
\ 'rust': ['analyzer']
|
||||
\ }
|
||||
let g:ale_fixers = {
|
||||
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
|
||||
\ 'javascript': ['prettier'],
|
||||
\ 'rust': ['rustfmt'],
|
||||
\ 'go': []
|
||||
\ }
|
||||
|
||||
" load ALE only after configured:
|
||||
packadd! ale
|
||||
|
||||
runtime macros/matchit.vim
|
||||
|
|
Loading…
Reference in New Issue