vim: Update config
This commit is contained in:
48
vim/vimrc
48
vim/vimrc
@@ -36,6 +36,10 @@ Plug 'reedes/vim-pencil', Cond(!exists('g:vscode'))
|
|||||||
"" markdown
|
"" markdown
|
||||||
Plug 'suan/vim-instant-markdown', Cond(!exists('g:vscode'))
|
Plug 'suan/vim-instant-markdown', Cond(!exists('g:vscode'))
|
||||||
|
|
||||||
|
Plug 'dense-analysis/ale', Cond(!exists('g:vscode'))
|
||||||
|
|
||||||
|
Plug 'neoclide/coc.nvim', Cond(!exists('g:vscode'), {'branch': 'release'})
|
||||||
|
|
||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
@@ -98,7 +102,7 @@ set nowritebackup
|
|||||||
" == swap ==
|
" == swap ==
|
||||||
set swapfile
|
set swapfile
|
||||||
set updatecount=200
|
set updatecount=200
|
||||||
set updatetime=10000
|
set updatetime=300
|
||||||
|
|
||||||
" == undo ==
|
" == undo ==
|
||||||
set undolevels=1000
|
set undolevels=1000
|
||||||
@@ -144,6 +148,8 @@ set termguicolors
|
|||||||
" === keybinds ===
|
" === keybinds ===
|
||||||
set pastetoggle=<F11>
|
set pastetoggle=<F11>
|
||||||
|
|
||||||
|
set signcolumn=yes
|
||||||
|
|
||||||
let maplocalleader = "ö"
|
let maplocalleader = "ö"
|
||||||
let mapleader = "\<Space>"
|
let mapleader = "\<Space>"
|
||||||
" map <leader>w: w!<cr>
|
" map <leader>w: w!<cr>
|
||||||
@@ -209,6 +215,10 @@ else
|
|||||||
syntax enable
|
syntax enable
|
||||||
silent! colorscheme monokai
|
silent! colorscheme monokai
|
||||||
|
|
||||||
|
highlight Comment guifg=#64d86b
|
||||||
|
highlight SpecialComment guifg=#64d86b
|
||||||
|
highlight Todo guibg=#a9ebad
|
||||||
|
|
||||||
let g:lightline = {
|
let g:lightline = {
|
||||||
\ 'colorscheme': 'wombat',
|
\ 'colorscheme': 'wombat',
|
||||||
\ 'active': {
|
\ 'active': {
|
||||||
@@ -250,6 +260,8 @@ else
|
|||||||
" == limelight ==
|
" == limelight ==
|
||||||
let g:limelight_default_coefficient = 0.5
|
let g:limelight_default_coefficient = 0.5
|
||||||
|
|
||||||
|
let g:ale_linters = {'rust': ['rust-analyzer']}
|
||||||
|
|
||||||
" === functions ===
|
" === functions ===
|
||||||
function! DeleteTrailingWS()
|
function! DeleteTrailingWS()
|
||||||
exe "normal mz"
|
exe "normal mz"
|
||||||
@@ -269,6 +281,40 @@ else
|
|||||||
|
|
||||||
let g:rustfmt_autosave = 1
|
let g:rustfmt_autosave = 1
|
||||||
|
|
||||||
|
inoremap <silent><expr> <TAB>
|
||||||
|
\ coc#pum#visible() ? coc#pum#next(1) :
|
||||||
|
\ CheckBackspace() ? "\<Tab>" :
|
||||||
|
\ coc#refresh()
|
||||||
|
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
|
||||||
|
|
||||||
|
" Make <CR> to accept selected completion item or notify coc.nvim to format
|
||||||
|
" <C-g>u breaks current undo, please make your own choice.
|
||||||
|
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
|
||||||
|
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
||||||
|
|
||||||
|
function! CheckBackspace() abort
|
||||||
|
let col = col('.') - 1
|
||||||
|
return !col || getline('.')[col - 1] =~# '\s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Use <c-space> to trigger completion.
|
||||||
|
if has('nvim')
|
||||||
|
inoremap <silent><expr> <c-space> coc#refresh()
|
||||||
|
else
|
||||||
|
inoremap <silent><expr> <c-@> coc#refresh()
|
||||||
|
endif
|
||||||
|
|
||||||
|
if has('nvim')
|
||||||
|
inoremap <silent><expr> <c-space> coc#refresh()
|
||||||
|
else
|
||||||
|
inoremap <silent><expr> <c-@> coc#refresh()
|
||||||
|
endif
|
||||||
|
|
||||||
" https://stackoverflow.com/a/8585343
|
" https://stackoverflow.com/a/8585343
|
||||||
map <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>
|
map <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>
|
||||||
|
|
||||||
|
nmap <silent> gd <Plug>(coc-definition)
|
||||||
|
nmap <silent> gy <Plug>(coc-type-definition)
|
||||||
|
nmap <silent> gi <Plug>(coc-implementation)
|
||||||
|
nmap <silent> gr <Plug>(coc-references)
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user