wip: nvim 0.5 goodness

This commit is contained in:
Daniel Lundin 2020-10-15 08:35:59 +02:00
parent f9436798f0
commit 27a2c1c3d2
No known key found for this signature in database
GPG key ID: 6AB527C9196ACDCC
3 changed files with 105 additions and 624 deletions

View file

@ -316,11 +316,11 @@ call <sid>hi("CursorLine", "", "#011121", "")
call <sid>hi("CursorLineNR", s:blue_grey_500, "#112131", "")
call <sid>hi("Folded", s:purple_200, s:deep_purple_900, "")
call <sid>hi("Pmenu", s:blue_grey_500, "#112131", "none")
call <sid>hi("Pmenu", s:light_blue_500, "#0D3791", "none")
call <sid>hi("PmenuSbar", s:blue_grey_500, "#111c27", "none")
call <sid>hi("PmenuThumb", s:blue_grey_400, "#112131", "none")
" call <sid>hi("PmenuSel", s:light_blue_100, "#0D3771", "bold")
call <sid>hi("PmenuSel", s:amber_100, "#0D3771", "bold")
call <sid>hi("PmenuSel", s:light_blue_100, s:light_blue_800, "bold")
call <sid>hi("CocFloating", s:light_blue_100, "#0D3771", "italic")
@ -343,3 +343,5 @@ call <sid>hi("goFunction", s:blue_300, "", "bold")
call <sid>hi("goOperator", s:teal_200, "", "")
call <sid>hi("goSameId", s:yellow_100, "", "underline")
call <sid>hi("Floating", s:red_200, "", "italic")

View file

@ -1,335 +0,0 @@
" Theme setup
hi clear
syntax reset
let g:colors_name = "dln"
let s:red_50 = "#ffebee"
let s:red_100 = "#ffcdd2"
let s:red_200 = "#ef9a9a"
let s:red_300 = "#e57373"
let s:red_400 = "#ef5350"
let s:red_500 = "#f44336"
let s:red_600 = "#e53935"
let s:red_700 = "#d32f2f"
let s:red_800 = "#c62828"
let s:red_900 = "#b71c1c"
let s:red_a100 = "#ff8a80"
let s:red_a200 = "#ff5252"
let s:red_a400 = "#ff1744"
let s:red_a700 = "#d50000"
let s:pink_50 = "#fce4ec"
let s:pink_100 = "#f8bbd0"
let s:pink_200 = "#f48fb1"
let s:pink_300 = "#f06292"
let s:pink_400 = "#ec407a"
let s:pink_500 = "#e91e63"
let s:pink_600 = "#d81b60"
let s:pink_700 = "#c2185b"
let s:pink_800 = "#ad1457"
let s:pink_900 = "#880e4f"
let s:pink_a100 = "#ff80ab"
let s:pink_a200 = "#ff4081"
let s:pink_a400 = "#f50057"
let s:pink_a700 = "#c51162"
let s:purple_50 = "#f3e5f5"
let s:purple_100 = "#e1bee7"
let s:purple_200 = "#ce93d8"
let s:purple_300 = "#ba68c8"
let s:purple_400 = "#ab47bc"
let s:purple_500 = "#9c27b0"
let s:purple_600 = "#8e24aa"
let s:purple_700 = "#7b1fa2"
let s:purple_800 = "#6a1b9a"
let s:purple_900 = "#4a148c"
let s:purple_a100 = "#ea80fc"
let s:purple_a200 = "#e040fb"
let s:purple_a400 = "#d500f9"
let s:purple_a700 = "#aa00ff"
let s:deep_purple_50 = "#ede7f6"
let s:deep_purple_100 = "#d1c4e9"
let s:deep_purple_200 = "#b39ddb"
let s:deep_purple_300 = "#9575cd"
let s:deep_purple_400 = "#7e57c2"
let s:deep_purple_500 = "#673ab7"
let s:deep_purple_600 = "#5e35b1"
let s:deep_purple_700 = "#512da8"
let s:deep_purple_800 = "#4527a0"
let s:deep_purple_900 = "#311b92"
let s:deep_purple_a100 = "#b388ff"
let s:deep_purple_a200 = "#7c4dff"
let s:deep_purple_a400 = "#651fff"
let s:deep_purple_a700 = "#6200ea"
let s:indigo_50 = "#e8eaf6"
let s:indigo_100 = "#c5cae9"
let s:indigo_200 = "#9fa8da"
let s:indigo_300 = "#7986cb"
let s:indigo_400 = "#5c6bc0"
let s:indigo_500 = "#3f51b5"
let s:indigo_600 = "#3949ab"
let s:indigo_700 = "#303f9f"
let s:indigo_800 = "#283593"
let s:indigo_900 = "#1a237e"
let s:indigo_a100 = "#8c9eff"
let s:indigo_a200 = "#536dfe"
let s:indigo_a400 = "#3d5afe"
let s:indigo_a700 = "#304ffe"
let s:blue_50 = "#e3f2fd"
let s:blue_100 = "#bbdefb"
let s:blue_200 = "#90caf9"
let s:blue_300 = "#64b5f6"
let s:blue_400 = "#42a5f5"
let s:blue_500 = "#2196f3"
let s:blue_600 = "#1e88e5"
let s:blue_700 = "#1976d2"
let s:blue_800 = "#1565c0"
let s:blue_900 = "#0d47a1"
let s:blue_a100 = "#82b1ff"
let s:blue_a200 = "#448aff"
let s:blue_a400 = "#2979ff"
let s:blue_a700 = "#2962ff"
let s:light_blue_50 = "#e1f5fe"
let s:light_blue_100 = "#b3e5fc"
let s:light_blue_200 = "#81d4fa"
let s:light_blue_300 = "#4fc3f7"
let s:light_blue_400 = "#29b6fc"
let s:light_blue_500 = "#03a9f4"
let s:light_blue_600 = "#039be5"
let s:light_blue_700 = "#0288d1"
let s:light_blue_800 = "#0277bd"
let s:light_blue_900 = "#01579b"
let s:light_blue_a100 = "#80d8ff"
let s:light_blue_a200 = "#40c4ff"
let s:light_blue_a400 = "#00b0ff"
let s:light_blue_a700 = "#0091ea"
let s:cyan_50 = "#e0f7fa"
let s:cyan_100 = "#b2ebf2"
let s:cyan_200 = "#80deea"
let s:cyan_300 = "#4dd0e1"
let s:cyan_400 = "#26c6da"
let s:cyan_500 = "#00bcd4"
let s:cyan_600 = "#00acc1"
let s:cyan_700 = "#0097a7"
let s:cyan_800 = "#00838f"
let s:cyan_900 = "#006064"
let s:cyan_a100 = "#84ffff"
let s:cyan_a200 = "#18ffff"
let s:cyan_a400 = "#00e5ff"
let s:cyan_a700 = "#00b8d4"
let s:teal_50 = "#e0f2f1"
let s:teal_100 = "#b2dfdb"
let s:teal_200 = "#80cbc4"
let s:teal_300 = "#4db6ac"
let s:teal_400 = "#26a69a"
let s:teal_500 = "#009688"
let s:teal_600 = "#00897b"
let s:teal_700 = "#00796b"
let s:teal_800 = "#00695c"
let s:teal_900 = "#004d40"
let s:teal_a100 = "#a7ffeb"
let s:teal_a200 = "#64ffda"
let s:teal_a400 = "#1de9b6"
let s:teal_a700 = "#00bfa5"
let s:green_50 = "#e8f5e9"
let s:green_100 = "#c8e6c9"
let s:green_200 = "#a5d6a7"
let s:green_300 = "#81c784"
let s:green_400 = "#66bb6a"
let s:green_500 = "#4caf50"
let s:green_600 = "#43a047"
let s:green_700 = "#388e3c"
let s:green_800 = "#2e7d32"
let s:green_900 = "#1b5e20"
let s:green_a100 = "#b9f6ca"
let s:green_a200 = "#69f0ae"
let s:green_a400 = "#00e676"
let s:green_a700 = "#00c853"
let s:light_green_50 = "#f1f8e9"
let s:light_green_100 = "#dcedc8"
let s:light_green_200 = "#c5e1a5"
let s:light_green_300 = "#aed581"
let s:light_green_400 = "#9ccc65"
let s:light_green_500 = "#8bc34a"
let s:light_green_600 = "#7cb342"
let s:light_green_700 = "#689f38"
let s:light_green_800 = "#558b2f"
let s:light_green_900 = "#33691e"
let s:light_green_a100 = "#ccff90"
let s:light_green_a200 = "#b2ff59"
let s:light_green_a400 = "#76ff03"
let s:light_green_a700 = "#64dd17"
let s:lime_50 = "#f9fbe7"
let s:lime_100 = "#f0f4c3"
let s:lime_200 = "#e6ee9c"
let s:lime_300 = "#dce775"
let s:lime_400 = "#d4e157"
let s:lime_500 = "#cddc39"
let s:lime_600 = "#c0ca33"
let s:lime_700 = "#a4b42b"
let s:lime_800 = "#9e9d24"
let s:lime_900 = "#827717"
let s:lime_a100 = "#f4ff81"
let s:lime_a200 = "#eeff41"
let s:lime_a400 = "#c6ff00"
let s:lime_a700 = "#aeea00"
let s:yellow_50 = "#fffde7"
let s:yellow_100 = "#fff9c4"
let s:yellow_200 = "#fff590"
let s:yellow_300 = "#fff176"
let s:yellow_400 = "#ffee58"
let s:yellow_500 = "#ffeb3b"
let s:yellow_600 = "#fdd835"
let s:yellow_700 = "#fbc02d"
let s:yellow_800 = "#f9a825"
let s:yellow_900 = "#f57f17"
let s:yellow_a100 = "#ffff82"
let s:yellow_a200 = "#ffff00"
let s:yellow_a400 = "#ffea00"
let s:yellow_a700 = "#ffd600"
let s:amber_50 = "#fff8e1"
let s:amber_100 = "#ffecb3"
let s:amber_200 = "#ffe082"
let s:amber_300 = "#ffd54f"
let s:amber_400 = "#ffca28"
let s:amber_500 = "#ffc107"
let s:amber_600 = "#ffb300"
let s:amber_700 = "#ffa000"
let s:amber_800 = "#ff8f00"
let s:amber_900 = "#ff6f00"
let s:amber_a100 = "#ffe57f"
let s:amber_a200 = "#ffd740"
let s:amber_a400 = "#ffc400"
let s:amber_a700 = "#ffab00"
let s:orange_50 = "#fff3e0"
let s:orange_100 = "#ffe0b2"
let s:orange_200 = "#ffcc80"
let s:orange_300 = "#ffb74d"
let s:orange_400 = "#ffa726"
let s:orange_500 = "#ff9800"
let s:orange_600 = "#fb8c00"
let s:orange_700 = "#f57c00"
let s:orange_800 = "#ef6c00"
let s:orange_900 = "#e65100"
let s:orange_a100 = "#ffd180"
let s:orange_a200 = "#ffab40"
let s:orange_a400 = "#ff9100"
let s:orange_a700 = "#ff6d00"
let s:deep_orange_50 = "#fbe9a7"
let s:deep_orange_100 = "#ffccbc"
let s:deep_orange_200 = "#ffab91"
let s:deep_orange_300 = "#ff8a65"
let s:deep_orange_400 = "#ff7043"
let s:deep_orange_500 = "#ff5722"
let s:deep_orange_600 = "#f4511e"
let s:deep_orange_700 = "#e64a19"
let s:deep_orange_800 = "#d84315"
let s:deep_orange_900 = "#bf360c"
let s:deep_orange_a100 = "#ff9e80"
let s:deep_orange_a200 = "#ff6e40"
let s:deep_orange_a400 = "#ff3d00"
let s:deep_orange_a700 = "#dd2600"
let s:brown_50 = "#efebe9"
let s:brown_100 = "#d7ccc8"
let s:brown_200 = "#bcaaa4"
let s:brown_300 = "#a1887f"
let s:brown_400 = "#8d6e63"
let s:brown_500 = "#795548"
let s:brown_600 = "#6d4c41"
let s:brown_700 = "#5d4037"
let s:brown_800 = "#4e342e"
let s:brown_900 = "#3e2723"
let s:grey_50 = "#fafafa"
let s:grey_100 = "#f5f5f5"
let s:grey_200 = "#eeeeee"
let s:grey_300 = "#e0e0e0"
let s:grey_400 = "#bdbdbd"
let s:grey_500 = "#9e9e9e"
let s:grey_600 = "#757575"
let s:grey_700 = "#616161"
let s:grey_800 = "#424242"
let s:grey_900 = "#212121"
let s:black_1000 = "#000000"
let s:white_1000 = "#ffffff"
let s:blue_grey_50 = "#eceff1"
let s:blue_grey_100 = "#cfd8dc"
let s:blue_grey_200 = "#b0bbc5"
let s:blue_grey_300 = "#90a4ae"
let s:blue_grey_400 = "#78909c"
let s:blue_grey_500 = "#607d8b"
let s:blue_grey_600 = "#546e7a"
let s:blue_grey_700 = "#455a64"
let s:blue_grey_800 = "#37474f"
let s:blue_grey_900 = "#263238"
" Highlighting function
fun! <sid>hi(group, guifg, guibg, attr)
if a:guifg != ""
exec "hi " . a:group . " guifg=" . a:guifg
endif
if a:guibg != ""
exec "hi " . a:group . " guibg=" . a:guibg
endif
if a:attr != ""
exec "hi " . a:group . " gui=" . a:attr
endif
endfun
call <sid>hi("LineNr", s:blue_grey_400, s:grey_50, "italic")
call <sid>hi("Normal", s:black_1000, s:white_1000, "")
call <sid>hi("Bold", "", "", "bold")
call <sid>hi("Italic", "", "", "italic")
call <sid>hi("Boolean", s:pink_900, "", "bold")
call <sid>hi("Character", "", "", "")
" call <sid>hi("Comment", s:deep_orange_900, "", "italic")
call <sid>hi("Comment", s:blue_grey_400, "", "italic")
" call <sid>hi("Comment", s:grey_600, "", "italic")
call <sid>hi("Conditional", "", "", "")
call <sid>hi("Constant", "", "", "")
call <sid>hi("Define", "", "", "")
call <sid>hi("Delimiter", "", "", "")
call <sid>hi("Float", "", "", "")
call <sid>hi("Function", s:red_900, "", "bold")
" call <sid>hi("Function", 5:grey_900, "", "bold")
call <sid>hi("Identifier", s:indigo_500, "", "bold")
call <sid>hi("Include", "", "", "")
call <sid>hi("Keyword", s:indigo_900, "", "")
call <sid>hi("Label", "", "", "")
call <sid>hi("Number", s:indigo_500, "", "")
call <sid>hi("Operator", s:cyan_900, "", "")
call <sid>hi("PreProc", "", "", "")
call <sid>hi("Repeat", "", "", "")
call <sid>hi("Search", "", s:yellow_100, "none")
call <sid>hi("Special", s:green_700, "", "")
call <sid>hi("SpecialChar", "", "", "")
call <sid>hi("Statement", s:blue_grey_700, "", "bold")
call <sid>hi("StorageClass", "", "", "")
call <sid>hi("String", s:light_green_900, "", "italic")
call <sid>hi("Structure", "", "", "")
call <sid>hi("Tag", "", "", "")
call <sid>hi("Todo", "", "", "")
call <sid>hi("Type", s:deep_purple_900, "", "none")
call <sid>hi("Typedef", "", "", "")
call <sid>hi("goDeclaration", "", "", "bold")
call <sid>hi("goReceiverType", s:teal_500, "", "none")
call <sid>hi("goMethodCall", s:brown_600, "", "none")
call <sid>hi("goField", s:cyan_900, "", "none")
call <sid>hi("goFunctionCall", s:brown_500, "", "none")

1
.config/nvim/colors/dln.vim Symbolic link
View file

@ -0,0 +1 @@
/home/dln/src/github.com/dln/nvim-highlite/colors/dln.vim

View file

@ -1,23 +1,15 @@
call plug#begin('~/.local/share/nvim/plugged')
Plug 'dln/nvim-highlite'
Plug 'bluz71/vim-moonfly-colors'
" Autocomplete
" Plug 'ncm2/ncm2'
" Plug 'roxma/nvim-yarp'
" Plug 'ncm2/ncm2-bufword'
" Plug 'ncm2/ncm2-tmux'
" Plug 'ncm2/ncm2-path'
" Plug 'ncm2/ncm2-go'
" Plug 'ncm2/ncm2-racer'
" Plug 'neoclide/coc.nvim', {'tag': '*', 'do': { -> coc#util#install()}}
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'neovim/nvim-lspconfig'
Plug 'nvim-lua/completion-nvim'
Plug 'nvim-lua/diagnostic-nvim'
Plug 'nvim-treesitter/nvim-treesitter'
Plug 'steelsojka/completion-buffers'
Plug 'janko/vim-test'
Plug 'jgdavey/tslime.vim'
" Plugin outside ~/.vim/plugged with post-update hook
Plug 'junegunn/fzf', { 'do': './install --bin' }
Plug 'junegunn/fzf.vim'
" Ansible
@ -33,31 +25,12 @@ Plug 'bronson/vim-trailing-whitespace'
" comment lines out (gc in visual mode)
Plug 'tomtom/tcomment_vim'
" Pimped out bar at the bottom of current buffer
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Theme
Plug 'kaicataldo/material.vim'
" Golang
Plug 'fatih/vim-go'
Plug 'mdempsky/gocode'
" Bazel
Plug 'bazelbuild/vim-bazel'
Plug 'bazelbuild/vim-ft-bzl'
" Rust
Plug 'racer-rust/vim-racer'
Plug 'roxma/nvim-cm-racer'
Plug 'rust-lang/rust.vim'
" Terraform
Plug 'jvirtanen/vim-hcl'
Plug 'hashivim/vim-terraform'
Plug 'juliosueiras/vim-terraform-completion'
" Jsonnet filetype plugin
Plug 'google/vim-jsonnet'
@ -73,30 +46,13 @@ Plug 'junegunn/vim-peekaboo'
Plug 'kshenoy/vim-signature'
Plug 'Matt-Deacalion/vim-systemd-syntax'
Plug 'NLKNguyen/papercolor-theme'
Plug 'Shougo/neosnippet.vim'
Plug 'Shougo/neosnippet-snippets'
Plug 'terminalnode/sway-vim-syntax'
Plug 'tsandall/vim-rego'
Plug 'vim-syntastic/syntastic'
Plug 'w0rp/ale'
" Powershell
Plug 'PProvost/vim-ps1'
" Git
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'
Plug 'junegunn/gv.vim'
" PowerShell
Plug 'PProvost/vim-ps1'
" Webdev
Plug 'burner/vim-svelte'
call plug#end()
" language en_US
@ -299,32 +255,6 @@ let g:gitgutter_sign_removed = ''
let g:gitgutter_sign_removed_first_line = ''
let g:gitgutter_sign_modified_removed = ''
"" Syntastic
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_enable_signs = 1
let g:syntastic_error_symbol = "✗"
let syntastic_style_error_symbol = "✗"
let g:syntastic_warning_symbol = "∙∙"
let syntastic_style_warning_symbol = "∙∙"
"" ALE
let g:airline#extensions#ale#enabled = 1
let g:ale_sign_column_always = 1
let g:ale_sign_error = '' "     ﱥ  ﬡ  樂
let g:ale_sign_warning = ''
" let g:ale_linters = {'go': ['gofmt']}
" let g:ale_linters = {'go': ['go build', 'gofmt', 'golint', 'gometalinter', 'gosimple', 'go vet', 'staticcheck']}
" let g:ale_linters = {'go': ['gofmt', 'golint', 'gometalinter', 'gosimple', 'go vet', 'staticcheck']}
let g:ale_linters = {'go': ['gofmt', 'gometalinter']}
let g:go_gometalinter_options = join([
\ '--fast'
\ ], ' ')
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)
"" Buffer navigation
" map <silent> ` :b#<CR>
@ -365,144 +295,98 @@ let g:vim_json_syntax_conceal = 0
let g:jsonnet_fmt_fail_silently = 0
autocmd BufNewFile,BufAdd,BufRead *.libjsonnet setlocal ft=jsonnet
"" Scala
autocmd BufNewFile,BufAdd,BufRead build.sbt setlocal ft=scala
autocmd BufNewFile,BufAdd,BufRead *.scala setlocal ft=scala
autocmd FileType scala setlocal expandtab shiftwidth=2 tabstop=2 softtabstop=2
"" Rust
autocmd FileType rust setlocal expandtab shiftwidth=4 tabstop=4 softtabstop=4
"" Clojure
let g:paredit_mode=0
let g:clj_highlight_builtins=1 " Highlight Clojure's builtins
let g:clj_paren_rainbow=1 " Rainbow parentheses'!
"" Python
au FileType python
\ setlocal efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m |
\ setlocal makeprg=python\ % |
\ setlocal tabstop=4 softtabstop=4 shiftwidth=4 |
\ setlocal nosmartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
autocmd BufWritePre *.py normal m`:%s/\s\+$//e ``
" pydoc integration
let g:pydoc_highlight = 0
let python_highlight_all = 1
let g:pcs_check_when_saving = 0
let g:pymode_lint = 0
let g:pymode_lint_checker = "pyflakes"
" enable ncm2 for all buffers
" autocmd BufEnter * call ncm2#enable_for_buffer()
set completeopt=noinsert,menuone,noselect
"" COC completion
" Use tab for trigger completion with characters ahead and navigate.
" Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Remap for rename current word
nmap <leader>rn <Plug>(coc-rename)
" Use <c-space> for trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()
" Use <cr> for confirm completion, `<C-g>u` means break undo chain at current position.
" Coc only does snippet and additional edit on confirm.
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" Use `[c` and `]c` for navigate diagnostics
nmap <silent> [c <Plug>(coc-diagnostic-prev)
nmap <silent> ]c <Plug>(coc-diagnostic-next)
" Remap keys for gotos
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 for show documentation in preview window
nnoremap <silent> K :call <SID>show_documentation()<CR>
" Use U to show documentation in preview window
nnoremap <silent> U :call <SID>show_documentation()<CR>
function! s:show_documentation()
if &filetype == 'vim'
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
endfunction
" Highlight symbol under cursor on CursorHold
" autocmd CursorHold * silent call CocActionAsync('highlight')
autocmd CursorHold * silent call CocActionAsync('doHover')
" Remap for rename current word
nmap <leader>rn <Plug>(coc-rename)
" Remap for format selected region
" vmap <leader>f <Plug>(coc-format-selected)
" nmap <leader>f <Plug>(coc-format-selected)
augroup mygroup
autocmd!
" Setup formatexpr specified filetype(s).
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
" Update signature help on jump placeholder
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
" Remap for do codeAction of selected region, ex: `<leader>aap` for current paragraph
vmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
" Remap for do codeAction of current line
nmap <leader>ac <Plug>(coc-codeaction)
" Fix autofix problem of current line
nmap <leader>qf <Plug>(coc-fix-current)
" tags
set tags=./tags;/
" C++
" Add highlighting for function definition in C++
function! EnhanceCppSyntax()
syn match cppFuncDef "::\~\?\zs\h\w*\ze([^)]*\()\s*\(const\)\?\)\?$"
hi def link cppFuncDef Special
endfunction
autocmd Syntax cpp call EnhanceCppSyntax()
autocmd FileType cpp setlocal expandtab shiftwidth=2 tabstop=2 softtabstop=2
"" syntax and completion
nnoremap <silent> <c-]> <cmd>lua vim.lsp.buf.definition()<CR>
nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
nnoremap <silent> gD <cmd>lua vim.lsp.buf.implementation()<CR>
nnoremap <silent> <c-k> <cmd>lua vim.lsp.buf.signature_help()<CR>
nnoremap <silent> 1gD <cmd>lua vim.lsp.buf.type_definition()<CR>
nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
nnoremap <silent> g0 <cmd>lua vim.lsp.buf.document_symbol()<CR>
nnoremap <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<CR>
nnoremap <silent> gd <cmd>lua vim.lsp.buf.declaration()<CR>
" HTML
au FileType html
\ set makeprg=tidy\ -qe\ -access\ 3\ % |
\ set errorformat=line\ %l\ column\ %c\ \-\ %m
" let g:html_indent_tags .= '\|p'
" let g:html_indent_tags .= '\|li'
:lua << END
require'nvim_lsp'.gopls.setup{
on_attach=require'diagnostic'.on_attach
}
require'nvim_lsp'.jdtls.setup{
on_attach=require'diagnostic'.on_attach
}
require'nvim_lsp'.terraformls.setup{
on_attach=require'diagnostic'.on_attach,
cmd = {'terraform-ls', 'serve'}
}
require'nvim_lsp'.vimls.setup{
on_attach=require'diagnostic'.on_attach
}
require'nvim_lsp'.yamlls.setup{
on_attach=require'diagnostic'.on_attach
}
END
nmap <tab> <Plug>(completion_smart_tab)
nmap <s-tab> <Plug>(completion_smart_s_tab)
let g:completion_chain_complete_list = [
\{'complete_items': ['lsp', 'snippet']},
\{'mode': '<c-p>'},
\{'mode': '<c-n>'}
\]
au FileType xml
\ set makeprg=tidy\ -qe\ -access\ 3\ % |
\ set errorformat=line\ %l\ column\ %c\ \-\ %m
" Use <Tab> and <S-Tab> to navigate through popup menu
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
"" Diagnostics
let g:diagnostic_enable_virtual_text = 1
let g:diagnostic_insert_delay = 1
let g:diagnostic_virtual_text_prefix = '⟸ '
call sign_define("LspDiagnosticsErrorSign", {"text" : "", "texthl" : "LspDiagnosticsError"})
call sign_define("LspDiagnosticsWarningSign", {"text" : "", "texthl" : "LspDiagnosticsWarning"})
call sign_define("LspDiagnosticsInformationSign", {"text" : "I", "texthl" : "LspDiagnosticsInformation"})
call sign_define("LspDiagnosticsHintSign", {"text" : "H", "texthl" : "LspDiagnosticsHint"})
let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy', 'all']
set completeopt=menuone,noinsert,noselect
set shortmess+=c
autocmd BufEnter * lua require'completion'.on_attach()
"" Treesitter
:lua << END
require'nvim-treesitter.configs'.setup {
ensure_installed = "all",
highlight = {
enable = true,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
},
},
}
END
set foldmethod=expr
set foldexpr=nvim_treesitter#foldexpr()
"" fzf
function! CreateCenteredFloatingWindow()
@ -563,10 +447,7 @@ map ,h :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
\ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
set background=light
let g:one_allow_italics=1
let g:PaperColor_Light_Override = { 'Background' : '#fefe00' }
set background=dark
" Golang
let g:go_highlight_build_constraints = 1
@ -592,91 +473,23 @@ autocmd FileType go nmap <S-k> <Plug>(go-doc)
autocmd FileType go nmap <Leader>d <Plug>(go-doc-vertical)
"" Neosnippet
" imap <C-k> <Plug>(neosnippet_expand_or_jump)
" smap <C-k> <Plug>(neosnippet_expand_or_jump)
" xmap <C-k> <Plug>(neosnippet_expand_target)
" imap <expr> <CR> (pumvisible() ? "\<c-y>\<Plug>(expand_or_nl)" : "\<CR>")
" imap <expr> <Plug>(expand_or_nl) (cm#completed_is_snippet() ? "\<C-k>":"\<CR>")
"
imap <c-j> <Plug>(neosnippet_expand_or_jump)
vmap <c-j> <Plug>(neosnippet_expand_or_jump)
inoremap <silent> <c-u> <c-r>=cm#sources#neosnippet#trigger_or_popup("\<Plug>(neosnippet_expand_or_jump)")<cr>
vmap <c-u> <Plug>(neosnippet_expand_target)
" expand parameters
let g:neosnippet#enable_completed_snippet=1
" Hugo
let g:vim_markdown_frontmatter = 1
let g:vim_markdown_toml_frontmatter = 1
"" Airline
let g:airline_theme="minimalist"
let g:airline_powerline_fonts = 0
let g:airline_skip_empty_sections = 1
let g:airline#parts#ffenc#skip_expected_string='utf-8[unix]'
let g:airline_section_x = '' " Hide file type
" let g:airline_section_z = "\u2193%l \u2192%c"
let g:airline_section_z = "%P \u2192%c"
" let g:airline_section_z = "%l:%c"
let g:airline_mode_map = {
\ '__' : '-',
\ 'c' : 'C',
\ 'i' : 'I',
\ 'ic' : 'I',
\ 'ix' : 'I',
\ 'n' : "\ue62b",
\ 'ni' : "\ue62b",
\ 'no' : "\ue62b",
\ 'R' : 'R',
\ 'Rv' : 'R',
\ 's' : 'S',
\ 'S' : 'S',
\ '' : 'S',
\ 't' : 'T',
\ 'v' : 'V',
\ 'V' : 'V',
\ '' : 'V',
\ }
"" Testing
let test#strategy = "tslime"
nmap <M-t> :TestLast<CR>
imap <M-t> :TestLast<CR>
nmap <M-S-t> :TestFile<CR>
imap <M-S-t> :TestFile<CR>
"" Terminal
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
set termguicolors
let &t_8f = "<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "<Esc>[48;2;%lu;%lu;%lum"
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
" " undercurl in tmux
set t_Cs = "\e[4:3m"
set t_Ce = "\e[4:0m"
color dln-light
map ,l :color dln-light<CR>
let s:hidden_all = 0
function! ToggleHiddenAll()
if s:hidden_all == 0
let s:hidden_all = 1
set noshowmode
set noruler
set laststatus=0
set noshowcmd
else
let s:hidden_all = 0
set showmode
set ruler
set laststatus=2
set showcmd
endif
endfunction
nnoremap <S-h> :call ToggleHiddenAll()<CR>
color dln
map ,l :color dln<CR>