2022-10-09 21:31:30 -07:00
|
|
|
set autoindent
|
|
|
|
set expandtab
|
|
|
|
set tabstop=4
|
|
|
|
set shiftwidth=4
|
|
|
|
set foldmethod=syntax
|
|
|
|
set foldlevel=20
|
|
|
|
set number
|
2022-10-14 19:46:50 -07:00
|
|
|
set guifont=MesloLGS\ NF\ 10
|
2022-10-09 21:31:30 -07:00
|
|
|
syntax on
|
|
|
|
syntax enable
|
|
|
|
filetype plugin indent on
|
|
|
|
|
|
|
|
|
|
|
|
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
|
|
|
|
" delays and poor user experience.
|
|
|
|
set updatetime=300
|
|
|
|
|
|
|
|
set signcolumn=number
|
|
|
|
|
2022-10-14 19:46:50 -07:00
|
|
|
let g:airline_powerline_fonts=1
|
2022-10-14 18:20:47 -07:00
|
|
|
let g:typescript_compiler_binary = 'npx tsc'
|
2022-10-09 21:31:30 -07:00
|
|
|
|
|
|
|
" Use tab for trigger completion with characters ahead and navigate.
|
|
|
|
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
|
|
|
|
" other plugin before putting this into your config.
|
|
|
|
inoremap <silent><expr> <TAB>
|
|
|
|
\ pumvisible() ? "\<C-n>" :
|
|
|
|
\ CheckBackspace() ? "\<TAB>" :
|
|
|
|
\ coc#refresh()
|
2022-12-09 23:36:33 -08:00
|
|
|
|
2022-10-09 21:31:30 -07:00
|
|
|
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
2022-12-09 23:36:33 -08:00
|
|
|
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
|
|
|
|
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
2022-10-09 21:31:30 -07:00
|
|
|
|
|
|
|
function! CheckBackspace() abort
|
|
|
|
let col = col('.') - 1
|
|
|
|
return !col || getline('.')[col - 1] =~# '\s'
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
" Use <c-space> to trigger completion.
|
2022-12-16 13:36:52 -08:00
|
|
|
inoremap <silent><expr> <c-space> coc#refresh()
|
2022-10-09 21:31:30 -07:00
|
|
|
|
|
|
|
|
|
|
|
" Use `[g` and `]g` to navigate diagnostics
|
|
|
|
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
|
|
|
|
nmap <silent> [g <Plug>(coc-diagnostic-prev)
|
|
|
|
nmap <silent> ]g <Plug>(coc-diagnostic-next)
|
|
|
|
|
|
|
|
" GoTo code navigation.
|
|
|
|
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)
|
|
|
|
|
|
|
|
" Use K to show documentation in preview window.
|
|
|
|
nnoremap <silent> K :call ShowDocumentation()<CR>
|
|
|
|
|
|
|
|
function! ShowDocumentation()
|
|
|
|
if CocAction('hasProvider', 'hover')
|
|
|
|
call CocActionAsync('doHover')
|
|
|
|
else
|
|
|
|
call feedkeys('K', 'in')
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
" Highlight the symbol and its references when holding the cursor.
|
|
|
|
autocmd CursorHold * silent call CocActionAsync('highlight')
|
|
|
|
|
|
|
|
" Symbol renaming.
|
|
|
|
nmap <leader>rn <Plug>(coc-rename)
|
|
|
|
|
|
|
|
" Formatting selected code.
|
|
|
|
xmap <leader>f <Plug>(coc-format-selected)
|
|
|
|
nmap <leader>f <Plug>(coc-format-selected)
|
|
|
|
let g:rustfmt_autosave = 1
|
|
|
|
|
|
|
|
" Add `:Format` command to format current buffer.
|
|
|
|
command! -nargs=0 Format :call CocActionAsync('format')
|
|
|
|
|
|
|
|
" Add `:Fold` command to fold current buffer.
|
|
|
|
command! -nargs=? Fold :call CocAction('fold', <f-args>)
|
|
|
|
|
|
|
|
" Add `:OR` command for organize imports of the current buffer.
|
|
|
|
command! -nargs=0 OR :call CocActionAsync('runCommand', 'editor.action.organizeImport')
|
|
|
|
|
|
|
|
" Add (Neo)Vim's native statusline support.
|
|
|
|
" NOTE: Please see `:h coc-status` for integrations with external plugins that
|
|
|
|
" provide custom statusline: lightline.vim, vim-airline.
|
|
|
|
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
|
|
|
|
|
|
|
|
|
|
|
|
colorscheme moonfly
|
|
|
|
set number
|
2023-01-06 21:19:22 -08:00
|
|
|
|
|
|
|
" Remove moonfly's background color for the terminal color
|
|
|
|
highlight Normal ctermbg=NONE
|
2023-01-06 21:25:29 -08:00
|
|
|
highlight LineNr ctermbg=NONE
|