diff options
| -rw-r--r-- | vim/.vimrc | 45 |
1 files changed, 34 insertions, 11 deletions
@@ -2,6 +2,7 @@ if empty(glob('~/.vim/autoload/plug.vim')) silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim endif + call plug#begin('~/.vim/plugged') Plug 'itchyny/lightline.vim' Plug 'rafi/awesome-vim-colorschemes' @@ -15,15 +16,18 @@ Plug 'sheerun/vim-polyglot' Plug 'tpope/vim-commentary' Plug 'yegappan/lsp' Plug 'dense-analysis/ale' +Plug 'tpope/vim-surround' +Plug 'tpope/vim-repeat' +Plug 'andymass/vim-matchup' Plug 'kalbasit/vim-colemak' call plug#end() let mapleader = "\<Space>" -syntax on -"filetype +syntax on + filetype on filetype indent on filetype plugin on -"set + set updatetime=300 set completeopt=menuone,popup,noinsert,noselect set scrolloff=5 " same as helix's scrolloff @@ -40,7 +44,7 @@ set relativenumber set expandtab set tabstop=4 set shiftwidth=4 -set smarttab +set smarttab set smartindent set noswapfile set incsearch @@ -60,12 +64,18 @@ set signcolumn=yes set shortmess+=c " etc colorscheme carbonized-dark -" colorscheme flatwhite +augroup colors_whichkey + autocmd! +autocmd FileType which_key highlight WhichKey guifg=#88C0D0 gui=bold +autocmd FileType which_key highlight WhichKeySeperator guifg=#4C566A +autocmd FileType which_key highlight WhichKeyGroup guifg=#EBCB8B gui=bold +autocmd FileType which_key highlight WhichKeyDesc guifg=#ECEFF4 +augroup END + nnoremap <Space> <Nop> nnoremap <silent> <leader> :WhichKey '<Space>'<CR> inoremap <silent> <Esc> <Esc>l inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" -"let function! Oxlint_fix(buffer) abort return { \ 'command': 'oxlint --fix --stdin --stdin-filename %s < %t' @@ -91,15 +101,16 @@ let g:ale_sign_column_always = 1 let g:lsp_settings_filetype_markdown = [] let g:ale_lint_on_save = 1 let g:ale_fix_on_save = 1 + let g:buftabline_show = 2 let g:buftabline_numbers = 1 + let g:user_emmet_leader_key='<Space>' let g:user_emmet_mode='n' let g:user_emmet_install_global = 0 -" let g:lightline = { -" \ 'colorscheme': 'PaperColor', -" \ 'background': 'dark', -" \ } + +let g:surround_no_mappings = 1 + let g:which_key_map = {} let g:which_key_map.f = ['Files', 'file buffer'] let g:which_key_map.b = { @@ -108,9 +119,22 @@ let g:which_key_map.b = { \ 'p' : ['bp', 'previous buffer'], \ 'b' : ['Buffers', 'fuzzy find buffers'], \ } + +nmap <leader>sa <Plug>Ysurround +nmap <leader>saa <Plug>Yssurround +nmap <leader>sc <Plug>Csurround +nmap <leader>sd <Plug>Dsurround +xmap <leader>s <Plug>VSurround + +let g:which_key_map.s = { 'name' : '+surround' } +let g:which_key_map.s.a = 'add surround' +let g:which_key_map.s.aa = 'add surround (line)' +let g:which_key_map.s.c = 'change surround' +let g:which_key_map.s.d = 'delete surround' call which_key#register('<Space>', 'g:which_key_map') augroup lsp + autocmd! autocmd User LspSetup call LspOptionsSet(#{ \ autoComplete: v:true, \ autoHighlightDiags: v:true, @@ -149,4 +173,3 @@ function! s:lsp_keymaps() abort endfunction augroup END - |
