highly recommended

[!NOTE|label:references:]

LunarWatcher/auto-pairs

" LunarWatcher/auto-pairs
let g:AutoPairs                             = autopairs#AutoPairsDefine({ '<': '>' })
let g:AutoPairsMapBS                        = 1
let g:AutoPairsFlyMode                      = 0
let g:AutoPairsCompleteOnlyOnSpace          = 1
let g:AutoPairsNoJump                       = 0
let g:AutoPairsSpaceCompletionRegex         = '\w'
" to avoid impact with ctrl-p ( :Files )
let g:AutoPairsShortcutToggleMultilineClose = 0
let g:AutoPairsShortcutBackInsert           = '<M-b>'
let g:AutoPairsPrefix                       = '<M-j>'
let g:AutoPairsShortcutJump                 = '<M-n>'
let g:AutoPairsShortcutToggle               = '<M-j>'

augroup DevOps
  autocmd FileType markdown,html let g:AutoPairsCompleteOnlyOnSpace = 0
  autocmd FileType markdown,html let b:AutoPairs = autopairs#AutoPairsDefine({
        \ '<div>':'</div>', '<font>':'</font>', '<a>':'</a>', '<p>':'</p>',
        \ '<table>':'</table>', '<tbody>':'</tbody>',
        \ '<thread>':'</thread>', '<th>':'</th>', '<td>':'</td>'
        \ })
augroup END
vim auto-pairs
1.3.4.1 -- vim auto-pairs

junegunn/fzf.vim

set runtimepath+=/usr/local/opt/fzf                                         " $ brew install fzf
Plug '/usr/local/opt/fzf'
Plug 'junegunn/fzf.vim'

" junegunn/fzf.vim
nnoremap <silent> <leader>ff :Files<CR>
nnoremap <silent> <leader>gf :GFiles<CR>
nnoremap <silent> <leader>ag :Ag<CR>
nnoremap <silent> <leader>l  :Buffers<CR>
nnoremap <silent> <Leader>H  :Helptags<CR>
nnoremap <silent> <Leader>g  :Commits<CR>
nnoremap <silent> <Leader>hh :History:<CR>
inoremap <expr> <c-x><c-k> fzf#vim#complete('cat /usr/share/dict/words')
inoremap <expr> <c-x><c-l> fzf#vim#complete(fzf#wrap({
  \ 'prefix': '^.*$',
  \ 'source': 'rg -n ^ --color always',
  \ 'options': '--ansi --delimiter : --nth 3..',
  \ 'reducer': { lines -> join(split(lines[0], ':\zs')[2:], '') }
\ }))
let g:fzf_vim                     = {}
let g:fzf_vim.preview_window      = [ 'right,50%', 'ctrl-\' ]
let g:fzf_vim.tags_command        = 'ctags -R'
let g:fzf_vim.commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"'
let $FZF_DEFAULT_COMMAND          = 'ag --hidden --ignore .git -l -g ""'
command! -bang -nargs=? -complete=dir Files
    \ call fzf#vim#files(<q-args>, {'options': ['--layout=reverse', '--info=inline', '--preview', 'bat --color=always {}']}, <bang>0)
command! -bang -complete=dir -nargs=? LS
    \ call fzf#run(fzf#wrap('ls', {'source': 'ls', 'dir': <q-args>}, <bang>0))
let g:fzf_layout                  = { 'window': { 'width': 0.9, 'height': 0.6, 'relative': v:true } }
let g:fzf_history_dir             = '~/.vim/cache/fzf-history'
let g:fzf_action                  = {
  \ 'ctrl-t': 'tab split',
  \ 'ctrl-x': 'split',
  \ 'ctrl-v': 'vsplit'
\ }
let g:fzf_colors                  = {
  \ 'fg':         ['fg', 'Normal'                               ] ,
  \ 'bg':         ['bg', 'Normal'                               ] ,
  \ 'preview-bg': ['bg', 'NormalFloat'                          ] ,
  \ 'hl':         ['fg', 'Comment'                              ] ,
  \ 'fg+':        ['fg', 'CursorLine', 'CursorColumn', 'Normal' ] ,
  \ 'bg+':        ['bg', 'CursorLine', 'CursorColumn'           ] ,
  \ 'hl+':        ['fg', 'Statement'                            ] ,
  \ 'info':       ['fg', 'PreProc'                              ] ,
  \ 'border':     ['fg', 'Ignore'                               ] ,
  \ 'prompt':     ['fg', 'Conditional'                          ] ,
  \ 'pointer':    ['fg', 'Exception'                            ] ,
  \ 'marker':     ['fg', 'Keyword'                              ] ,
  \ 'spinner':    ['fg', 'Label'                                ] ,
  \ 'header':     ['fg', 'Comment'                              ]
\ }

luochen1990/rainbow

[!NOTE|label:alternative:]

Plug 'luochen1990/rainbow'

" luochen1990/rainbow
" for i in '75' '147' '108' '196' '208' '66' '106' '172' '115' '129'; do echo -e "\e[38;05;${i}m${i}"; done | column -c 250 -s ' '; echo -e "\e[m"
let g:rainbow_active    = 1
let g:rainbow_operators = 1
let g:rainbow_conf      = {
  \ 'guifgs' : [ '#6A5ACD', '#ff6347', '#b58900', '#9acd32', '#EEC900', '#9A32CD', '#EE7600', '#268bd2', '#183172' ],
  \ 'ctermfgs' : 'xterm-256color' == $TERM ? [ '75', '147', '108', '196', '208', '66', '106', '172', '115', '129' ] : [ 'lightblue', 'lightgreen', 'yellow', 'red', 'magenta' ],
  \ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/{/ end=/}/ fold'],
  \ 'operators': '_,_',
  \ 'separately': {
  \   '*': {},
  \   'markdown': {
  \     'parentheses_options': 'containedin=markdownCode contained',
  \   },
  \   'css': {
  \     'parentheses': [ ['(',')'], ['\[','\]'] ],
  \   },
  \   'scss': {
  \     'parentheses': [ ['(',')'], ['\[','\]'] ],
  \   },
  \   'stylus': {
  \     'parentheses': [ 'start=/{/ end=/}/ fold contains=@colorableGroup' ],
  \   },
  \   'vim': {
  \     'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/', 'start=/{/ end=/}/ fold', 'start=/(/ end=/)/ containedin=vimFuncBody', 'start=/\[/ end=/\]/ containedin=vimFuncBody', 'start=/{/ end=/}/ fold containedin=vimFuncBody'],
  \   },
  \   'html': {
  \     'parentheses': ['start=/\v\<((area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)[ >])@!\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'|[^ '."'".'"><=`]*))?)*\>/ end=#</\z1># fold'],
  \   },
  \   'nerdtree': 0
  \ }}

Yggdroot/indentLine

[!NOTE|label:alternative:]

Plug 'Yggdroot/indentLine'

" settings
nnoremap <leader>idl :IndentLineEnable<CR>

let g:indentLine_enabled              = 1
let g:indentLine_color_gui            = "#282828"
let g:indentLine_color_term           = 239
let g:indentLine_indentLevel          = 20
let g:indentLine_showFirstIndentLevel = 1
let g:indentLine_color_tty            = 0
let g:indentLine_faster               = 1
let g:indentLine_concealcursor        = 'inc'
let g:indentLine_conceallevel         = 2
if has( 'gui_running' ) || 'xterm-256color' == $TERM
  let g:indentLine_char               = '¦'
elseif has( 'win32' )
  let g:indentLine_color_term         = 8
  let g:indentLine_char               = '|'
else
  let g:indentLine_color_tty_dark     = 0
  let g:indentLine_char               = '¦'
endif

vim-airline/vim-airline

[!NOTE|label:references:]

Plug 'tpope/vim-fugitive'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'

" vim-airline/vim-airline
let g:airline_powerline_fonts                      = 1
let g:airline_highlighting_cache                   = 1
let g:airline_detect_spelllang                     = 0              " disable spelling language
let g:airline_exclude_preview                      = 0              " disable in preview window
let g:airline_theme                                = 'base16_embers'" 'apprentice', 'base16', 'gruvbox', 'zenburn', 'base16_atelierheath'
let g:Powerline_symbols                            = 'fancy'
let g:airline_section_y                            = ''             " fileencoding
let g:airline_section_x                            = ''
let g:airline_section_z                            = "%3p%% %l/%L:%c [%B]"
let g:airline_skip_empty_sections                  = 1
let g:airline_detect_modified                      = 1
let g:airline_detect_paste                         = 1
let g:airline#extensions#wordcount#enabled         = 1
let g:airline#extensions#wordcount#filetypes       = '\vtext|nroff|plaintex'
let g:airline#extensions#quickfix#enabled          = 0
let g:airline#extensions#quickfix#quickfix_text    = 'Quickfix'
let g:airline_stl_path_style                       = 'short'
let g:airline#extensions#tabline#enabled           = 1              " ╮ enable airline tabline
let g:airline#extensions#tabline#fnamemod          = ':t'           " │
let g:airline#extensions#tabline#show_close_button = 0              " │ remove 'X' at the end of the tabline
let g:airline#extensions#tabline#show_buffers      = 1              " │
let g:airline#extensions#tabline#show_splits       = 0              " │ disables the buffer name that displays on the right of the tabline
let g:airline#extensions#tabline#tab_min_count     = 2              " │ minimum of 2 tabs needed to display the tabline
let g:airline#extensions#tabline#show_tabs         = 0              " │
let g:airline#extensions#tabline#tab_nr_type       = 1              " ╯ tab number
let g:airline#extensions#branch#format             = 2
let g:airline#extensions#fzf#enabled               = 1
let g:airline#extensions#nerdtree_statusline       = 1
let g:airline#extensions#syntastic#enabled         = 1
let g:airline#extensions#coc#enabled               = 1              " ╮
let g:airline#extensions#coc#show_coc_status       = 0              " │
let g:airline#extensions#coc#error_symbol          = ' ✗:'          " ├ coc
let g:airline#extensions#coc#warning_symbol        = ' ⍨:'          " │
let g:airline#extensions#coc#stl_format_err        = '%C(␊%L)'      " │
let g:airline#extensions#coc#stl_format_warn       = '%C(␊%L)'      " ╯
let g:airline#extensions#ale#enabled               = 0              " ╮
let g:airline#extensions#ale#error_symbol          = ' ᓆ :'         " │
let g:airline#extensions#ale#warning_symbol        = ' ᣍ :'         " ├ ale
let g:airline#extensions#ale#show_line_numbers     = 0              " │
let g:airline#extensions#ale#open_lnum_symbol      = '(␊:'          " │
let g:airline#extensions#ale#close_lnum_symbol     = ')'            " ╯
" let g:airline_mode_map                           = { '__': '-', 'n' : 'N', 'i' : 'I', 'R' : 'R', 'c' : 'C', 'v' : 'V', 'V' : 'V', '': 'V', 's' : 'S', 'S' : 'S', '': 'S', }
if !exists('g:airline_symbols') | let g:airline_symbols = {} | endif
let g:airline_symbols.dirty                        = ' ♪'
let g:airline_left_sep                             = ''
let g:airline_right_sep                            = ''
" +----------------------------------+
" | A | B | C            | X | Y | Z |
" +----------------------------------+
function! AirlineInit()
  let g:airline_section_a = airline#section#create([ '[', 'mode', ']' ])
  let g:airline_section_y = airline#section#create([ '%{strftime("%H:%M %b-%d %a")} ', '['.&ff.']' ])
  let g:airline_section_c = '%<' . airline#section#create([ '%F' ]) " let g:airline_section_c = '%<' . '%{expand(%:p:~)}'
endfunction
autocmd User AirlineAfterInit call AirlineInit()
airline + ale
1.3.4.2 -- airline + ale
  • tips

    • remove section_

      let g:airline_section_<x>         = ''                          " remove the filetype part
      let g:airline_skip_empty_sections = 1                           " remove separators for empty sections
      
    • setup short mode

      let g:airline_mode_map = { '__': '-', 'n' : 'N', 'i' : 'I', 'R' : 'R', 'c' : 'C', 'v' : 'V', 'V' : 'V', '': 'V', 's' : 'S', 'S' : 'S', '': 'S', }
      
    • unicode symbols

      [!NOTE|label:symbols]

        " powerline symbols
        let g:airline_left_sep          = ''     " U+E0B0
        let g:airline_left_alt_sep      = ''     " U+E0B1
        let g:airline_right_sep         = ''     " U+E0B2
        let g:airline_right_alt_sep     = ''     " U+E0B3
        let g:airline_symbols.branch    = ''     " U+E0A0
        let g:airline_symbols.colnr     = ' ℅:'   " U+2105 U+003A
        let g:airline_symbols.readonly  = ''     " U+E0A2
        let g:airline_symbols.linenr    = ' :'   " U+E0A1
        let g:airline_symbols.maxlinenr = '☰ '   " U+2630
        let g:airline_symbols.dirty     = '⚡'    " U+26A1
      
        " old vim-powerline symbols
        let g:airline_left_sep          = '⮀'     " U+2B80
        let g:airline_left_alt_sep      = '⮁'     " U+2B81
        let g:airline_right_sep         = '⮂'     " U+2B82
        let g:airline_right_alt_sep     = '⮃'     " U+2B83
        let g:airline_symbols.branch    = '⭠'     " U+2B60
        let g:airline_symbols.readonly  = '⭤'     " U+2B64
        let g:airline_symbols.linenr    = '⭡'     " U+2B61
      
        " unicode symbols
        let g:airline_left_sep           = '»'    " U+00BB
        let g:airline_left_sep           = '▶'    " U+25B6
        let g:airline_right_sep          = '«'    " U+00AB
        let g:airline_right_sep          = '◀'    " U+25C0
        let g:airline_symbols.colnr      = ' ㏇:' " U+33C7
        let g:airline_symbols.colnr      = ' ℅:'  " U+2105
        let g:airline_symbols.crypt      = '🔒'   " U+0001F512
        let g:airline_symbols.linenr     = '☰'   " U+2630
        let g:airline_symbols.linenr     = ' ␊:'  " U+240A
        let g:airline_symbols.linenr     = '
      :'  " U+2424
        let g:airline_symbols.linenr     = '¶'    " U+00B6
        let g:airline_symbols.maxlinenr  = ''
        let g:airline_symbols.maxlinenr  = '㏑'   " U+33D1
        let g:airline_symbols.branch     = '⎇'    " U+2387
        let g:airline_symbols.paste      = 'ρ'    " U+03C1
        let g:airline_symbols.paste      = 'Þ'    " U+00DE
        let g:airline_symbols.paste      = '∥'    " U+2225
        let g:airline_symbols.spell      = 'Ꞩ'    " U+A7A8
        let g:airline_symbols.notexists  = 'Ɇ'    " U+0246
        let g:airline_symbols.notexists  = '∄'    " U+2204
        let g:airline_symbols.whitespace = 'Ξ'    " U+039E
      
        " unicode symbols
        let g:airline_left_sep           = '»'    " U+00BB
        let g:airline_left_sep           = '▶'    " U+25B6
        let g:airline_right_sep          = '«'    " U+00AB
        let g:airline_right_sep          = '◀'    " U+25C0
        let g:airline_symbols.linenr     = '␊'    " U+240A
        let g:airline_symbols.linenr     = '
      '    " U+2424
        let g:airline_symbols.linenr     = '¶'    " U+00B6
        let g:airline_symbols.branch     = '⎇''   " U+2387
        let g:airline_symbols.paste      = 'ρ'    " U+03C1
        let g:airline_symbols.paste      = 'Þ'    " U+00DE
        let g:airline_symbols.paste      = '∥'    " U+2225
        let g:airline_symbols.whitespace = 'Ξ'    " U+039E
      
      let g:airline_symbols.branch         = '⎇'                   " ╮
      let g:airline_symbols.paste          = 'ρ'                    " ├ unicode symbols
      let g:airline_symbols.dirty          = ' ↯'                   " ╯
      
    • get theme randomly

      [!NOTE]

      let g:airline_theme                  = 'random'
      

sections

[!NOTE|label:references:]

let g:airline_section_x                          = "%-{strftime(\"%H:%M\ %d/%m/%y\")} %1*--%n%%--%*"
let g:airline_section_y                          = "%{&fenc}%{&bomb ? '[bom]' : ''}%{strlen(&ff) > 0 ? '['.&ff.']' : ''}"
let g:airline#parts#ffenc#skip_expected_string   ='utf-8[unix]'
let g:airline_section_c_only_filename            = 0

function! AirlineInit()
  " NORMAL  docs/vim/
  let g:airline_section_a = airline#section#create([ 'mode', '  ', '%{join( split(getcwd(), "/")[-2:-1], "/" )}', '/' ])
  " NORMAL  docs/vim/plugins.md
  let g:airline_section_a = airline#section#create([ 'mode', '  ', '%{join( split(expand("%:p"), "/")[-3:-1], "/" )}' ])
  let g:airline_section_y = airline#section#create(['%{strftime("%H:%M %b-%d %a")} ', '['.&ff.']'])
  let g:airline_section_c = '%<' . airline#section#create(['%{expand("%:p:~")}'])
endfunction
autocmd User AirlineAfterInit call AirlineInit()
  • section_a

    [!NOTE|label:paths:]

    • show relative path %F : let g:airline_section_c = airline#section#create([ '%F' ]) -> ~/.vimrc
    • show filename only %f : let g:airline_section_c = airline#section#create([ '%f' ]) -> .vimrc
    section_a with default mode
    1.3.4.3 -- section_a with default mode
    section_a with short mode
    1.3.4.4 -- section_a with short mode
    • via function

      function! ShortPath()
        let pathlist=split(expand("%:p:~"), "/")
        return len(pathlist) < 3 ? join( pathlist[-2:-1], "/" ) : join( pathlist[-3:-1], "/" )
      endfunction
      " or"
      function! ShortPath()
        let pathlist=split(expand("%:p:~"), "/")
        if len(pathlist) < 3 | let final_result=join( pathlist[-2:-1], "/" ) | else | let final_result=join( pathlist[-3:-1], "/" ) | endif
        return final_result
      endfunction
      
      let g:airline_section_a = airline#section#create([ 'mode', '  ', ShortPath() ])
      
      • i.e.:

        function! ShortPath()
          let pathlist=split(expand("%:p:~"), "/")
          return len(pathlist) < 3 ? join( pathlist[-2:-1], "/" ) : join( pathlist[-3:-1], "/" )
        endfunction
        function! AirlineInit()
          let g:airline_section_a = airline#section#create([ '[', 'mode', ']', '  ', '%{&fenc}', '  ', ShortPath() ])
          let g:airline_section_y = airline#section#create([ '%{strftime("%H:%M %b-%d %a")} ', '['.&ff.']' ])
          let g:airline_section_c = '%<' . airline#section#create([ '%F' ]) " let g:airline_section_c = '%<' . '%{expand(%:p:~)}'
        endfunction
        autocmd User AirlineAfterInit call AirlineInit()
        
        airline section_a shortpath
        1.3.4.5 -- airline section_a shortpath
    • via %{}

      function! AirlineInit()
        let pathlist=split( expand("%:p:~"), "/" )
        let g:airline_section_a = airline#section#create([ 'mode', '  ', '%{len(pathlist) < 3 ? join( pathlist[-2:-1], "/" ) : join( pathlist[-3:-1], "/" )}'])
      endfunction
      autocmd User AirlineAfterInit call AirlineInit()
      
      airline section_a shortpath with '%{}'
      1.3.4.6 -- airline section_a shortpath with '%{}'
  • sections with length limitation

    • %<': let g:airline_section_c = '%<' . airline#section#create(['%{expand("%:p:~")}'])
    • %-0.xx{} : let g:airline_section_c = '%<' . '%-0.13{expand("%:p:~")}'

    • i.e.:

      let g:airline_section_c = '%<' . '%-0.20{expand("%:p:~")}'
      " <docs/vim/plugins.md
      
      let g:airline_section_c = '%<' . '%{expand("%:p:~")}'
      " ~/path/to/ibook/docs/vim/plugins.md
      
      let g:airline_section_c = airline#section#create(['%F'])
      " ~/path/to/book/docs/vim/plugins.md
      

themes

programming

vim-syntastic/syntastic

[!NOTE|label:references:]

style warning
1.3.4.13 -- style warning
error
1.3.4.14 -- error
vimrc for vim-syntastic
Plug 'vim-syntastic/syntastic'

" syntastic settings                                                " Plug 'vim-syntastic/syntastic'
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
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_loc_list_height          = 2
let g:syntastic_ignore_files             = ['\.py$']
let g:syntastic_html_tidy_ignore_errors  = [" proprietary attribute \"ng-"]
let g:syntastic_enable_signs             = 1
let g:syntastic_info_symbol              = 'ೲ'                      " ࠵ ϊ
let g:syntastic_error_symbol             = '✗'                      " ஓ ௐ ྾
let g:syntastic_warning_symbol           = '⍨'                      " ᓆ ᓍ
let g:syntastic_style_error_symbol       = '⍥'
let g:syntastic_style_warning_symbol     = 'ఠ'                      " ⍤ ൠ
highlight link SyntasticErrorSign        Error
highlight link SyntasticWarningSign      GruvboxYellow
highlight link SyntasticStyleErrorSign   GruvboxRedSign
highlight link SyntasticStyleWarningSign GruvboxPurpleSign
former version
Bundle 'vim-syntastic/syntastic'

" configure syntastic syntax checking to check on open as well as save
set statusline+=%#warningmsg#
set statusline+=\ %{SyntasticStatuslineFlag()}                      " vim-syntastic/syntastic
set statusline+=\ %* |
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_loc_list_height           = 2
let g:syntastic_ignore_files              = ['\.py$']
let g:syntastic_html_tidy_ignore_errors   = [" proprietary attribute \"ng-"]
" vim-syntastic/syntastic
" info: ࠵ ೲ; error: ஓ ௐ ྾; warning ᓆ ᓍ 𐘿; style_warning: ⍤ ൠ
set statusline+=%#warningmsg#
if has('unix')
  set statusline+=\ %{SyntasticStatuslineFlag()}
endif
set statusline+=\ %* |
let g:syntastic_always_populate_loc_list = 0                        " ╮ whether if open
let g:syntastic_auto_loc_list            = 0                        " ╯ diagnostics windows
let g:syntastic_check_on_open            = 1
let g:syntastic_check_on_wq              = 0
let g:syntastic_loc_list_height          = 2
let g:syntastic_ignore_files             = ['\.py$']
let g:syntastic_html_tidy_ignore_errors  = [" proprietary attribute \"ng-"]
let g:syntastic_enable_signs             = 1
let g:syntastic_info_symbol              = 'ϊ'
let g:syntastic_error_symbol             = '✗'
let g:syntastic_warning_symbol           = '⍨'
let g:syntastic_style_error_symbol       = '⍥'
let g:syntastic_style_warning_symbol     = 'ఠ'
let g:syntastic_dockerfile_checkers      = [ 'hadolint' ]
highlight link SyntasticErrorSign        Error
highlight link SyntasticWarningSign      GruvboxYellow
highlight link SyntasticStyleErrorSign   GruvboxRedSign
highlight link SyntasticStyleWarningSign GruvboxPurpleSign

coc.nvim

[!TIP|label:references:]

  • initialize

    $ pip install jedi
    
    " install
    Plug 'neoclide/coc.nvim', { 'branch': 'release' }
    
    " neoclide/coc.nvim
    set updatetime=300
    set signcolumn=yes
    let g:coc_global_extensions = [
      \   'coc-sh',
      \   'coc-groovy', 'coc-java',
      \   'coc-json',
      \   'coc-css', 'coc-htmlhint', 'coc-html-css-support',
      \   'coc-pyright',
      \   'coc-snippets',
      \   'coc-docker',
      \   'coc-emoji'
      \ ]
    function! CheckBackspace() abort
      let col = col('.') - 1
      return !col || getline('.')[col - 1]  =~# '\s'
    endfunction
    function! ShowDocumentation()
      if CocAction('hasProvider', 'hover')
        call CocActionAsync('doHover')
      else
        call feedkeys('K', 'in')
      endif
    endfunction
    autocmd FileType json syntax match Comment +\/\/.\+$+
    autocmd FileType html let b:coc_root_patterns = ['.git', '.env', 'tailwind.config.js', 'tailwind.config.cjs']
    inoremap <silent><expr> <DOWN>
          \ coc#pum#visible() ? coc#pum#next(1) : CheckBackspace()
          \                   ? "\<DOWN>" : coc#refresh()
    inoremap <expr><UP> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
    inoremap <silent><expr> <C-M>
         \ coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
    command! -nargs=0 OR  :call CocActionAsync('runCommand', 'editor.action.organizeImport')
    nmap     <silent>[g   <Plug>(coc-diagnostic-prev)
    nmap     <silent>]g   <Plug>(coc-diagnostic-next)
    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)
    nnoremap <silent>K    :call ShowDocumentation()<CR>
    nmap     <leader>cl   <Plug>(coc-codelens-action)
    " coc-snippets ( ctrl-j )
    imap <C-l> <Plug>(coc-snippets-expand)
    vmap <C-j> <Plug>(coc-snippets-select)
    let g:coc_snippet_next = '<c-j>'
    let g:coc_snippet_prev = '<c-k>'
    imap <C-j> <Plug>(coc-snippets-expand-jump)
    inoremap <silent><expr> <C-j>
          \ pumvisible() ? coc#_select_confirm() :
          \ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
          \ CheckBackSpace() ? "\<TAB>" :
          \ coc#refresh()
    function! CheckBackSpace() abort
      let col = col('.') - 1
      return !col || getline('.')[col - 1]  =~# '\s'
    endfunction
    
  • open configure file ( coc-settings.json )

    [!NOTE|label:references:]

    :CocConfig
    
    • setup sources priority

      [!NOTE|label:references:]

      // coc-settings.json
      {
        "coc.source.around.priority": 85,
        "coc.source.file.priority": 80,
        "coc.source.buffer.priority": 70,
        "coc.source.word.priority": 1,
        "coc.source.dictionary.priority": 1,
      }
      
      " check sources priority
      :CocList sources
      * html-css-support       [HCS]                 99  html,markdown
      * emoji                  [T]        :          3   markdown
      * word                   [10K]                 1
      * dictionary             [D]                   1
      * tag                    [T]                   3
      * snippets               [S]                   90
      * snippets-source        [S]        $          90  snippets
      * around                 [A]                   85
      * buffer                 [B]                   70
      * file                   [F]        /          80
      * issues                 [[I]]      #          99  gitcommit,gina-commit
      * semantic-commit        [Commit]              99  gitcommit,gina-commit
      * vimlsp                 [LS]       .:#[&$<"'  99  vim
      
    • language server setup

      {
          "languageserver": {
              "intelephense": {
                  "command": "intelephense",
                  "args": ["--stdio"],
                  "filetypes": ["php"],
                  "initializationOptions": {
                      "storagePath": "/tmp/intelephense"
                  }
              }
          },
      }
      
    • sample for groovy

      [!TIP|label:references:]

      {
        "langageserver": {
          "groovy": {
            "filetypes": ["groovy"],
            "module": "/Users/marslo/.config/coc/extensions/node_modules/coc-groovy/server/groovy-language-server-all.jar",
            "trace.server": "verbose",
            "settings": {
              "groovy": {
                "classpath": [
                  "/opt/homebrew/opt/groovy/libexec/lib",
                  "/opt/jenkins/latest/WEB-INF/lib",
                  "/opt/jenkins/plugins/credentials/WEB-INF/lib",
                  "./libs"
                ]
              }
            }
          }
        }
      }
      
      {
        "languageserver": {
          "groovy": {
            "trace.server": "off",
            "command": "java",
            "args": [
              "-jar",
              "/path/to/groovy-language-server/build/libs/groovy-language-server-all.jar"
            ],
            "filetypes": ["groovy"],
            "settings": {
              "groovy": {
                "classpath": [
                  "/path/to/.groovy/grapes/org.codehaus.groovy/groovy-sql/jars/groovy-sql-3.0.1.jar",
                  "/path/to/.groovy/grapes/org.codehaus.groovy/groovy/jars/groovy-3.0.1.jar",
                  "/path/to/libs",
                  "./libs"
                ]
              }
            }
          }
        }
      }
      
  • check information

    :CocInfo
    :checkhealth
    :CocOpenLog
    :CocCommand workspace.showOutput
    
  • CocConfig:

    {
      "codeLens.enable": true,
      "java.referencesCodeLens.enabled": true,
      "diagnostic.displayByAle": false,
      "diagnostic.errorSign": "✘",
      "diagnostic.infoSign": "ᓆ",
      "diagnostic.warningSign": "ᑹ",
      "diagnostic.hintSign": "➤",
      "diagnostic-languageserver.filetypes": {
        "yaml": [ "yamllint" ],
        "vim": "vint",
        "sh": "shellcheck"
      },
      "html-css-support.styleSheets": [
          "https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css",
          "/style.css",
          "style.css"
      ],
      "html-css-support.enabledLanguages": [ "html", "markdown" ],
      "coc.source.file.ignoreHidden": false,
      "snippets.userSnippetsDirectory": "~/.marslo/vimrc.d/snips"
    }
    
    • start completion from 2nd string

      {
        "suggest.minTriggerInputLength": 2
      }
      
    • cause issue of trigger

      [!TIP]

      • support autoTrigger: always, trigger
      {
        "suggest.autoTrigger": "trigger",
        "suggest.triggerCompletionWait": 50
      }
      
nvim coc copilot snippets
1.3.4.15 -- nvim coc copilot snippets
nvim coc lspconfig
1.3.4.16 -- nvim coc lspconfig
  • shortcuts

    " neoclide/coc.nvim
    nmap     <silent>[g    <Plug>(coc-diagnostic-prev)
    nmap     <silent>]g    <Plug>(coc-diagnostic-next)
    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)
    nmap     <leader>cl    <Plug>(coc-codelens-action)
    nnoremap <silent>K     :call ShowDocumentation()<CR>
    
    • <Plug>(coc-diagnostic-prev) : [ + g : previous diagnostic
    • <Plug>(coc-diagnostic-next) : ] + g : next diagnostic
    • <Plug>(coc-definition) : g + d : go to definition
    • <Plug>(coc-type-definition) : g + y : type definition
    • <Plug>(coc-implementation) : g + i : implementation
    • <Plug>(coc-references) : g + r : references
    • <Plug>(coc-codelens-action) : c + l : code lens action
  • troubleshooting

    [!NOTE|label:references:]

    $ rust-analyzer --help
    error: 'rust-analyzer' is not installed for the toolchain 'stable-x86_64-unknown-linux-gnu'
    
    $ rustup component add rust-analyzer
    

floating window configure

[!TIP|label:check from source]

$ sed -n '88892,88900p' "$HOME"/.vim/plugged/coc.nvim/build/index.js &&
  echo "---" &&
  sed -n '89244,89260p' "$HOME"/.vim/plugged/coc.nvim/build/index.js &&
  echo "---" &&
  sed -n '89275,89285p' "$HOME"/.vim/plugged/coc.nvim/build/index.js &&
  echo "---" &&
  sed -n '89918,89930p' "$HOME"/.vim/plugged/coc.nvim/build/index.js &&
  echo "---" &&
  sed -n '90113,90125p' "$HOME"/.vim/plugged/coc.nvim/build/index.js &&
  echo "---" &&
  sed -n '90226,90235p' "$HOME"/.vim/plugged/coc.nvim/build/index.js
$ sed -n '88000,88098p' /Users/marslo/.vim/plugged/coc.nvim/build/index.js

options

OPTIONS VALUES DEFAULT DESCRIPTION
border true / false false Set to true to use borders
rounded true / false false Use rounded borders when border is true
highlight highlight group name: "CocFloating", "NormalFloat", "Normal", "Pmenu" "CocFloating" Background highlight group of float window
borderhighlight highlight group name: "CocFloatBorder", "FloatBorder", "Comment" "CocFloatBorder" Border highlight group of float window
title any string "" Title used by float window
close true / false false Set to true to draw close icon
maxWidth positive integer Maximum width of float window, include border
maxHeight integer ≥ 2 Maximum height of float window, include border
focusable true / false true Enable focus by user actions (wincmds, mouse events), neovim only
shadow true / false false Drop shadow effect by blending with the background, neovim only
winblend 0 – 100 0 Enables pseudo-transparency via 'winblend' option, neovim only
position "auto" / "fixed" "auto" "fixed": use top/bottom/left/right; "auto": default positioning
top number ≥ 0 Distance from top of editor in chars (only when position="fixed")
bottom number ≥ 0 Distance from bottom of editor (position="fixed", overrides top)
left number ≥ 0 Distance from left of editor (only when position="fixed")
right number ≥ 0 Distance from right of editor (position="fixed", overrides left)

[!TIP|label:highlight groups]

:hi CocFloating
:hi CocFloatBorder
:hi NormalFloat
COC.NVIM HIGHLIGHT GROUP DEFAULT LINKS TO DESCRIPTION
CocFloating NormalFloat (nvim) / Pmenu (vim) 浮窗默认背景
CocFloatBorder FloatBorder / CocFloating 浮窗边框(只用前景色)
CocFloatThumb 滚动条滑块
CocFloatSbar 滚动条轨道
CocFloatDividingLine NonText 浮窗内分割线
CocFloatActive CocSearch 激活的文本(如当前参数高亮)
CocErrorFloat 浮窗中的错误文本
CocHintFloat 浮窗中的提示文本
NVIM HIGHLIGHT GROUPS / FLOATCONFIG DESCRIPTION
NormalFloat nvim 浮窗默认背景/前景
FloatBorder nvim 浮窗默认边框
Normal 普通文本(与编辑器背景一致)
Pmenu 补全菜单背景
PmenuSel 补全菜单选中项
Comment 注释颜色(常用于淡化边框)
NonText 不可见字符(如 listchars)
" customize highlight groups
highlight MyPinkBorder guifg=#FFB6C1 guibg=NONE
// coc.vim
"suggest.floatConfig": {
  "borderhighlight": "MyPinkBorder"
}

types

TYPES DESCRIPTION
floatFactory.floatConfig Configure default/global style for float window/popup created by float factory (around cursor, auto-closed)
suggest.floatConfig Configure style of popup menu and documentation window of completion
suggest.pumFloatConfig Configure style of popup menu, suggest.floatConfig is used when not specified
signature.floatConfig Configure float window style of signature documents
hover.floatConfig Configure float window style of hover documents
diagnostic.floatConfig Configure float window style of diagnostic message
dialog.floatConfig Configuration for interactive dialogs (e.g., Code Action menu, Rename input)
list.floatConfig Configuration for the coc-list interface windows

coc-snippets

[!NOTE|label:references:]

coc-snippets
1.3.4.17 -- coc-snippets

[!TIP|label:default snippets]

$ fd all.snippets ~/.config/nvim ~/.vim ~/.local/share/nvim
/Users/marslo/.vim/plugged/vim-snippets/UltiSnips/all.snippets
/Users/marslo/.vim/plugged/vim-snippets/snippets/all.snippets
OPTIONS DESCRIPTION
b beginning of line
i In-word explansion
w Word boundary
r Regular Expression
t Do NOT expand tabs
s Remove Whitespace immediately before the cursor
t Trim all whitespaces from right side of snippet lines
c Custom context snippet
A Snippet will be triggered automatically
" ~/.vimrc.d/extension
Plug 'neoclide/coc.nvim', { 'branch': 'release' }
Plug 'honza/vim-snippets'
let g:coc_global_extensions = [ 'coc-snippets' ]

" coc-snippets ( ctrl-j )
imap <C-l> <Plug>(coc-snippets-expand)
vmap <C-j> <Plug>(coc-snippets-select)
let g:coc_snippet_next = '<c-j>'
let g:coc_snippet_prev = '<c-k>'
imap <C-j> <Plug>(coc-snippets-expand-jump)
inoremap <silent><expr> <C-j>
      \ pumvisible() ? coc#_select_confirm() :
      \ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
      \ CheckBackSpace() ? "\<TAB>" :
      \ coc#refresh()
function! CheckBackSpace() abort
  let col = col('.') - 1
  return !col || getline('.')[col - 1]  =~# '\s'
endfunction
" ~/.vimrc.d/hightlight
" coc-snippet
highlight! link snipLeadingSpaces snipComment

snippets

snippet "mode(line)?( (\S+))?" "vim modeline" br
${1:#} vim`!v ':set '. (&expandtab ? printf('expandtab shiftwidth=%i tabstop=%i softtabstop=%i', &sw, &ts, &sts) : printf('noexpandtab:sts=%i:sw=%i:ts=%i', &sts, &sw, &ts)) . (&tw ? ':tw='. &tw : '') . (':filetype=')`${2:`!p
snip.rv = match.group(3) if match.group(2) is not None else "sh"`}:
endsnippet

snippet "be(gin)?( (\S+))?" "begin{} / end{}" br
\begin{${1:`!p
snip.rv = match.group(3) if match.group(2) is not None else "something"`}}
  ${2:${VISUAL}}
\end{$1}$0
endsnippet

snippet wow
${1:Text}`!p snip.rv = (75-2*len(t[1]))*' '+t[1].upper()`
endsnippet

snippet case
case ${1:word} in
  ${2:pattern} ) $0;;
esac
endsnippet

snippet query
Your age: ${1|<18,18~60,>60|}
Your height: ${2|<120cm,120cm~180cm,>180cm|}
endsnippet

commands

:CocList snippets
:CocCommand snippets.openSnippetFiles
:CocCommand snippets.editSnippets
:CocCommand snippets.openOutput

:CocCommand workspace.showOutput snippets
[Info  - 04:10:41.632] Using ultisnips directories:
[
  "UltiSnips",
  "/Users/marslo/.marslo/vimrc.d/snips"
]
[Info  - 04:10:41.663] Loading textmate snippets from filetypes: jenkinsfile
[Info  - 04:10:41.666] Loaded 23 _ snipmate snippets from: /Users/marslo/.vim/plugged/vim-snippets/snippets/_.snippets
[Info  - 04:10:41.666] Loaded 9 UltiSnip snippets from: /Users/marslo/.marslo/vimrc.d/snips/all.snippets
[Info  - 04:10:41.667] Loaded 14 UltiSnip snippets from: /Users/marslo/.vim/plugged/vim-snippets/UltiSnips/all.snippets
[Info  - 04:10:41.667] Execute python file /var/folders/8g/68t3rg090jd2tpqjcwm9vskh0000gq/T/nvim.marslo/HFc9S7/coc-snippets-7398faf046499cfcea484a37fe5c9294.py from: /Users/marslo/.vim/plugged/vim-snippets/UltiSnips/all.snippets

coc-word

[!NOTE|label:references:]

" via command
:CocInstall coc-word

" or .vimrc
let g:coc_global_extensions = [ 'coc-word' ]
"coc.source.word.filetypes": [ "text", "markdown" , "python" ],

extensions management

[!NOTE|label:references:]

  • list all installed

    :CocList extensions
    
    $ ls ~/.config/coc/extensions/node_modules
    coc-css     coc-emoji   coc-html-css-support  coc-java  coc-omni     coc-sh        coc-tag
    coc-docker  coc-groovy  coc-htmlhint          coc-json  coc-pyright  coc-snippets
    
  • show status

    [!TIP|label:references:]

    :echo CocAction('extensionStats')
    :TabMessage echo CocAction('extensionStats')
    
  • add/remove execute:

    :CocInstall coc-sh coc-groovy coc-json coc-css coc-pyright coc-snippets coc-emoji coc-omni coc-tag coc-htmlhint coc-html-css-support coc-docker
    :CocInstall @yaegassy/coc-tailwindcss3
    :CocUninstall coc-git
    
  • or

    $ nvim -c 'CocInstall -sync coc-groovy \
                                coc-java \
                                coc-css \
                                coc-pyright \
                                coc-snippet \
                                coc-emoji \
                                coc-tag \
                                coc-docker\
                                coc-htmlhint\
                                coc-html-css-support \
                                coc-sh \
                                coc-omni|q'
    
  • using custom registry

    $ cat ~/.npmrc
    coc.nvim:registry=https://registry.npmjs.org/
    
  • update extensions

    :CocUpdate
    :CocUpdateSync
    
    # or
    $ vim -c 'CocUpdateSync|q'
    

nvim-treesitter/nvim-treesitter

[!NOTE]

nvim-treesitter
1.3.4.18 -- nvim-treesitter
# tree-sitter executable not found
$ sudo apt install -y clang libclang-dev build-essential
$ rustup update
$ cargo install tree-sitter-cli
# or
$ sudo npm i -g tree-sitter-cli
# or
$ brew install tree-sitter

$ which -a tree-sitter
~/.cargo/bin/tree-sitter
# macos
$ which -a tree-sitter
/usr/local/bin/tree-sitter
  • others

    $ pip3 install tree_sitter
    
  • configure

    Plug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' }
    
    -- ~/.config/nvim/init.vim
    require('config/nvim-treesitter')
    
    -- ~/.config/nvim/lua/config/nvim-treesitter.lua
    require'nvim-treesitter.configs'.setup {
      ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "python", "bash", "groovy", "java", "yaml", "xml", "cmake", "css", "dockerfile", "git_config", "gitcommit", "gitignore", "jq", "json", "markdown", "ssh_config", "vimdoc", "ini" },
      sync_install = true,
      -- install automatically
      auto_install = true,
      ignore_install = { "javascript" },
      indent = {
        enable = true,
        disable = { "markdown" },
      },
      incremental_selection = {
        enable = true,
        keymaps = {
          init_selection = "<CR>",
          node_incremental = "<CR>",
          node_decremental = "<BS>",
          scope_incremental = "<TAB>",
        },
      },
      highlight = {
        enable = true,
        disable = { "markdown" },
        additional_vim_regex_highlighting = false,
      },
    }
    require("nvim-treesitter.install").prefer_git = true
    
  • install manually

    :TSInstall bash css gitcommit git_config gpg html java jq lua python xml yaml
    
  • commands

    :TSBufToggle highlight
    :TSInstallInfo
    :TSModuleInfo
    :checkhealth nvim-treesitter
    :echo nvim_get_runtime_file('*/lua.so', v:true)
    ['/Users/marslo/.vim/plugged/nvim-treesitter/parser/lua.so', '/usr/local/Cellar/neovim/0.9.5/lib/nvim/parser/lua.so']
    

github/copilot.vim

[!NOTE|label:references:]

nvim copilot
1.3.4.19 -- nvim copilot
  • setup

    Plug 'github/copilot.vim'
    
    " github/copilot.vim
    let g:copilot_proxy            = 'http://proxy.sample.com:8080'
    let g:copilot_proxy_strict_ssl = v:false
    let g:copilot_filetypes        = {
        \ '*': v:false,
        \ 'gitcommit': v:true,
        \ 'markdown': v:true,
        \ 'yaml': v:true,
        \ 'groovy': v:true,
        \ 'python': v:true,
        \ 'Jenkinsfile': v:true,
        \ 'sh': v:true
        \ }
    " disable for extra large file
    autocmd BufReadPre *
        \ let f=getfsize(expand("<afile>"))
        \ | if f > 100000 || f == -2
        \ |   let b:copilot_enabled = v:false
        \ | endif
    " invpaste -> paste in insert/normal/visual mode
    noremap <leader>pp :set invpaste<cr>
    map <silent> <F2>  :Copilot disable<CR>
    
    :Copilot setup
    
    " check status
    :Copilot status
    Copilot: Ready
    " or
    Copilot: Disabled for filetype=c by g:copilot_filetypes
    
    :Copilot log
    :resize -5
    " or
    :autocmd BufWinEnter * if bufname('%') ==# 'copilot:///log' | resize -5 | endif
    " or
    autocmd BufWinEnter copilot:///log execute 'resize -5'
    " or
    autocmd BufWinEnter copilot:///log call timer_start(50, {-> execute('resize -5')})
    
    :Copilot panel
    
  • config

    [!NOTE|label:references:]

    let g:copilot_proxy = '192.168.100.1:8080'
    let g:copilot_proxy_strict_ssl = v:false
    
  • shortcuts

    • copilot#Accept("\<CR>") : Tab : accept suggestion

      " to re-mapping
      imap <silent><script><expr> <C-J> copilot#Accept("\<CR>")
      let g:copilot_no_tab_map = v:true
      
    • <Plug>(copilot-accept-word) : Meta/Alt + : accept the next word of the current suggestion

      " to re-mapping
      imap <C-L>   <Plug>(copilot-accept-word)
      
    • <Plug>(copilot-accept-line) : Meta/Alt + Ctrl + : accept the next line of the current suggestion

      " to re-mapping
      imap <C-M-L> <Plug>(copilot-accept-line)
      
    • <Plug>(copilot-next) : Meta/Alt + ] : next suggestion

    • <Plug>(copilot-previous) : Meta/Alt + [ : previous suggestion
    • <Plug>(copilot-dismiss) : Control/Ctrl + ] : dismiss the current suggestion.
    • <Plug>(copilot-suggest) : Meta/Alt + \> : explicitly request a suggestion, even if Copilot is disabled
  • self-signed certificate error

    [!NOTE|label:references:]

    $ openssl x509 -inform der -in <exported_cert>.cer -out mycert.pem
    $ export NODE_EXTRA_CA_CERTS="/path/to/mycert.pem"
    
    # or
    $ keytool -import -storepass changeit -keystore PATH_TO_YOUR_INTELLIJ_JRE/lib/security/cacerts -file PATH_TO_YOUR_CUSTOM_ROOTCA.pem
    
  • vscode

    // settings.json
    {
      "http.proxyStrictSSL": false,
      "http.proxy": "http://proxy.sample.com:8080",
    }
    

CopilotChat.nvim

[!NOTE|label:references:]

" install
Plug 'CopilotC-Nvim/CopilotChat.nvim' , { 'branch': 'canary' }      " ╮
Plug 'zbirenbaum/copilot.lua'                                       " ├ copilot chat
Plug 'nvim-lua/plenary.nvim'                                        " ╯
-- ~/.config/nvim/init.vim
require("CopilotChat").setup {
  debug = true,
  allow_insecure = true,
  show_folds = false,
}

troubleshooting

  • No GitHub token found in WSL

    • error message

      No GitHub token found, please use `:Copilot setup` to set it up from copilot.vim or copilot.lua
      
    • error log

      [CopilotChat.nvim] [ERROR 23:59:58] /home/marslo/.vim/plugged/CopilotChat.nvim/lua/CopilotChat/copilot.lua:275: No GitHub token found, please use `:Copilot setup` to set it up from copilot.vim or copilot.lua
      
    • solution

      $ user="$(jq -c -r 'to_entries[].value.user' < ~/.config/github-copilot/apps.json)"
      $ token="$(jq -c -r 'to_entries[].value.oauth_token' < ~/.config/github-copilot/apps.json)"
      $ echo "{\"github.com\":{\"user\":\"${user}\",\"oauth_token\":\"${token}\"}}" > ~/.config/github-copilot/hosts.json
      
  • [ghostText] Error on ghost text request: FetchError: CA signature digest algorithm too weak

    • error log

      [2024-11-19 21:41:44] [INFO] [lsp] GitHub Copilot Language Server 1.236.0 initialized
      [2024-11-19 21:41:54] [INFO] [certificates] Removed 2 expired certificates
      [2024-11-19 21:41:54] [ERROR] [default] Error sending telemetry FetchError: CA signature digest algorithm too weak
          at fetch (/Users/marslo/.vim/plugged/copilot.vim/node_modules/@adobe/helix-fetch/src/fetch/index.js:99:11)
          at processTicksAndRejections (node:internal/process/task_queues:105:5)
          at cachingFetch (/Users/marslo/.vim/plugged/copilot.vim/node_modules/@adobe/helix-fetch/src/fetch/index.js:288:16)
          at Dge.fetch (/Users/marslo/.vim/plugged/copilot.vim/lib/src/network/helix.ts:93:22) {
        type: 'system',
        _name: 'FetchError',
        code: 'UNSPECIFIED',
        errno: undefined,
        erroredSysCall: undefined
      }
      [2024-11-19 21:41:56] [ERROR] [ghostText] Error on ghost text request: FetchError: CA signature digest algorithm too weak
          at fetch (/Users/marslo/.vim/plugged/copilot.vim/node_modules/@adobe/helix-fetch/src/fetch/index.js:99:11)
          at processTicksAndRejections (node:internal/process/task_queues:105:5)
          at cachingFetch (/Users/marslo/.vim/plugged/copilot.vim/node_modules/@adobe/helix-fetch/src/fetch/index.js:288:16)
          at Dge.fetch (/Users/marslo/.vim/plugged/copilot.vim/lib/src/network/helix.ts:93:22)
          at bte.fetchWithParameters (/Users/marslo/.vim/plugged/copilot.vim/lib/src/openai/fetch.ts:450:26)
          at bte.fetchAndStreamCompletions (/Users/marslo/.vim/plugged/copilot.vim/lib/src/openai/fetch.ts:353:26)
          at genericGetCompletionsFromNetwork (/Users/marslo/.vim/plugged/copilot.vim/lib/src/ghostText/ghostText.ts:149:21)
          at getGhostText (/Users/marslo/.vim/plugged/copilot.vim/lib/src/ghostText/ghostText.ts:698:23)
          at getGhostTextWithAbortHandling (/Users/marslo/.vim/plugged/copilot.vim/agent/src/methods/getCompletions.ts:313:16)
          at handleChecked (/Users/marslo/.vim/plugged/copilot.vim/agent/src/methods/inlineCompletion.ts:86:33) {
        type: 'system',
        _name: 'FetchError',
        code: 'UNSPECIFIED',
        errno: undefined,
        erroredSysCall: undefined
      }
      
    • solutin

tomtom/tcomment_vim

Plug 'tomtom/tcomment_vim'

" tomtom/tcomment_vim
" g:tcomment_mapleader1 = ','
map  <leader>x gcc
vmap <leader>x <c-_>b
nmap <C-/>     gcc
imap <C-/>     <c-_><c-_>
vmap <C-/>     <c-_>b

dense-analysis/ale

[!NOTE|label:references:]

[!TIP] to reset the ale_list_window_size via autocmd:

augroup ALEResizeLocList
  autocmd!
  autocmd BufWinEnter * if &buftype ==# 'quickfix' && getloclist(0) != [] | execute "resize 2" | endif
augroup END
" ~/.vimrc.d/extension
Plug 'stephpy/vim-yaml'                                             " ╮ yaml
Plug 'pedrohdz/vim-yaml-folds'                                      " ╯
Plug 'dense-analysis/ale'

" pedrohdz/vim-yaml-folds                                           " brew install yamllint; pipx install yamllint
set foldlevelstart=20

" dense-analysis/ale
"   error: ❗‼ 💢 ✘ 👾 💣 🙅 🤦 🔥   ;
"   warning:    ⚠ ⸮ ⸘ ☹ ᑹ 󱗗;
"   info: ⸚ ϔ 𐘿 𐰦 󰛨 ➤;
"   style_error: ᑹ 󰷞 󰉲 󰈸;
"   style_warning: ᓏ ᓍ ఠ ൠ  󱋿;
" whether if open diagnostics list window, set to `= 'on_save'` for json/jsonc
let g:ale_open_list                       = 1
" the height of the list window
let g:ale_list_window_size                = 2
let g:ale_set_loclist                     = 1
let g:ale_set_lists_synchronously         = 1
let g:ale_echo_msg_format                 = '[%linter%] %code%: %s [%severity%]'
let g:ale_virtualtext_prefix              = '%comment% %type% [%code%]: '
let g:ale_sign_error                      = '✗'
let g:ale_sign_warning                    = 'ఠ'
let g:ale_sign_info                       = 'ᓆ'
let g:ale_sign_style_error                = '⍥'
let g:ale_sign_style_warning              = '⍨'

" performance enhancement
let g:ale_lint_on_text_changed            = 'never'
let g:ale_lint_on_enter                   = 0
let g:ale_lint_on_insert_leave            = 1
let g:ale_fix_on_save                     = 0
let g:ale_lint_on_save                    = 1
let g:ale_linters_explicit                = 1

let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace  = 1
let g:ale_set_balloons                    = 1
let g:ale_hover_to_preview                = 1
let g:ale_floating_preview                = 1
let g:ale_close_preview_on_insert         = 1
let g:ale_groovy_npmgroovylint_options    = '--noserver --loglevel warning --config ' . expand('~/.groovylintrc.json')
if executable(expand('~/.npm/bin/npm-groovy-lint'))
  let g:ale_groovy_npmgroovylint_executable = expand('~/.npm/bin/npm-groovy-lint')
endif
let g:ale_linter_aliases                  = { 'Jenkinsfile': ['groovy'] }
let g:ale_use_neovim_diagnostics_api      = 0
" for ansbile.yaml
let g:ale_ansible_ansible_lint_executable = 'ansible-lint'
let g:ale_ansible_language_server_config  = {}
let g:ale_ansible_language_server_executable = 'ansible-language-server'
" vscodejson requires `$ npm install -g vscode-langservers-extracted`
let g:ale_linters = {
      \ 'c'          : ['clang', 'cppcheck'],
      \ 'cpp'        : ['clang++', 'cppcheck'],
      \ 'json'       : ['vscodejson'],
      \ 'jsonc'      : ['vscodejson'],
      \ 'html'       : ['vscodehtml'],
      \ 'css'        : ['vscodecss'],
      \ 'markdown'   : ['vscodemarkdown'],
      \ 'javascript' : ['eslint'],
      \ 'groovy'     : ['npm-groovy-lint']
      \}
  • shortcuts

    noremap  ]a   :ALENextWrap<CR>
    noremap  [a   :ALEPreviousWrap<CR>
    noremap  ]A   :ALELast<CR>
    noremap  [A   :ALEFirst<CR>
    
    • :ALENextWrap<CR> : ] + a
    • :ALEPreviousWrap<CR> : [ + a
    • :ALELast<CR> : ] + A
    • :ALEFirst<CR> : [ + A
  • linter/checker install

    $ brew install checkstyle stylelint prettier
    # shell
    $ brew install bashate shfmt
    # yaml
    $ brew install yamllint yamlfmt
    # java
    $ brew install google-java-format
    # groovy/Jenkinsfile
    $ npm i -g npm-groovy-lint
    
  • debug info

    :ALEInfo
    
ale error
1.3.4.20 -- ale error
ale warning
1.3.4.21 -- ale warning
ale info
1.3.4.22 -- ale info

color and theme

[!NOTE|label:references:]

set encoding=UTF-8
if has('win32') || has('win64')
  set guifont=OperatorMonoLig\ Nerd\ Font\ Mono:h29
else
  set guifont=OperatorMono\ Nerd\ Font:h29
  set renderoptions=type:directx,renmode:5
endif
  • more
    set guifont=Agave\ Nerd\ Font\ Mono:h32
    set guifont=JetBrainsMono\ Nerd\ Font\ Mono:h26
    set guifont=OperatorMono\ Nerd\ Font:h29
    set renderoptions=type:directx,gamma:1.5,contrast:0.5,geom:1,renmode:5,taamode:1,level:0.5
    

scrooloose/nerdtree

[!NOTE|label:references:]

nvim nerdtree devicons coc lspconfig
1.3.4.23 -- nvim nerdtree devicons coc lspconfig
Plug 'scrooloose/nerdtree'

" scrooloose/nerdtree
map <C-A-n> :NERDTreeToggle<CR>
nnoremap <silent> <leader>nt :NERDTreeToggle<CR>
let NERDTreeShowHidden            = 1
let NERDTreeHighlightCursorline   = 0
let g:NERDTreeShowLineNumbers     = 0
let g:NERDTreeQuitOnOpen          = 1
let g:NERDTreeWinPos              = 'left'
let g:NERDTreeWinSize             = 25
" will cause tiagofumo/vim-nerdtree-syntax-highlight highlight issue
" let g:NERDTreeFileLines         = 1
let g:NERDTreeDirArrowExpandable  = '+'
let g:NERDTreeDirArrowCollapsible = '⏵'
let g:NERDTreeIgnore              = [
      \ '^.*history$',
      \ '.*iterm2_shell_integration.*',
      \ '^.*\.swp',
      \ '.*\.log',
      \ '.wget-hsts',
      \ '.DS_Store',
      \ '^__pycache__$',
      \ 'vim_mru_files',
      \ 'viminfo',
      \ '^node_modules$',
      \ '^.git$',
      \ '^.Trash$',
      \ 'NERDTree.*',
      \ 'CFUserTextEncoding',
      \ '.*tags',
      \ '.cache',
      \ '.bundle',
      \ '.bash_.*',
      \ '.gradle.*',
      \ '.gnupg'
      \]
autocmd BufEnter * if winnr() == winnr('h') && bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 |
    \ let buf=bufnr() | buffer# | execute "normal! \<C-W>w" | execute 'buffer'.buf | endif
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
" start nerdtree when vim start
autocmd VimEnter *  NERDTree

ryanoasis/vim-devicons

[!NOTE|label:unicodes]

nvim nerdtree devicon highlight
1.3.4.24 -- nvim nerdtree devicon highlight
" ryanoasis/vim-devicons
let g:WebDevIconsOS                                                    = 'Darwin'
let g:DevIconsEnableFoldersOpenClose                                   = 1
let g:DevIconsEnableFolderExtensionPatternMatching                     = 0
let g:DevIconsDefaultFolderOpenSymbol                                  = ''
let g:WebDevIconsUnicodeDecorateFolderNodesDefaultSymbol               = ''
let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols              = {}
let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['log']       = ''
let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['json']      = ''
let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['md']        = ''
let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['perm']      = '󰌋'
let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['groovy']    = ''
let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['sh']        = '󱆃'
let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['yaml']      = '󱚥'
let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['yml']       = '󱚥'
let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['gitcommit'] = ''
let g:WebDevIconsUnicodeDecorateFileNodesExactSymbols                  = {}
let g:WebDevIconsUnicodeDecorateFileNodesExactSymbols['jenkinsfile']   = ''
let g:WebDevIconsUnicodeDecorateFileNodesExactSymbols['devops']        = '󰘦'
let g:WebDevIconsUnicodeDecorateFileNodesExactSymbols['vimrc.d']       = '󰷺'
let g:WebDevIconsUnicodeDecorateFileNodesExactSymbols['vars']          = '󱆃'
let g:WebDevIconsUnicodeDecorateFileNodesExactSymbols['src']           = '󰵮'
let g:WebDevIconsUnicodeDecorateFileNodesPatternSymbols                = {}
let g:WebDevIconsUnicodeDecorateFileNodesPatternSymbols['.*ignore$']   = ''
let g:WebDevIconsUnicodeDecorateFileNodesPatternSymbols['.*rc$']       = '󱔁'
let g:WebDevIconsUnicodeDecorateFileNodesPatternSymbols['.*git.*$']    = ''
if exists('g:loaded_webdevicons') | call webdevicons#refresh() | endif
autocmd filetype nerdtree set conceallevel=3
autocmd filetype nerdtree set concealcursor=nvic

" tiagofumo/vim-nerdtree-syntax-highlight
" #293739 #BDBB72 #808000 #ba55d3 #183172 #0d6efd #3a346f #fd7e14 #d63384 #6c71c4
let g:NERDTreeSyntaxEnabledExtensions                 = ['rb', 'lua', 'vim', 'sh', 'py', 'groovy', 'css', 'html', 'json', 'log']
let g:NERDTreeSyntaxEnabledExactMatches               = ['.marslo', 'jenkins', 'virtualization', 'vimrc.d', 'devops', 'vars', 'jenkinsfile', '.vimrc']
let g:NERDTreeExtensionHighlightColor                 = {}
let g:NERDTreeExtensionHighlightColor['groovy']       = '8FAA54'       " #8FAA54
let g:NERDTreeExtensionHighlightColor['log']          = '44788E'       " #44788E
let g:NERDTreeExtensionHighlightColor['yaml']         = '9370db'       " #9370db
let g:NERDTreeExtensionHighlightColor['yml']          = '9370db'       " #9370db
let g:NERDTreeExtensionHighlightColor['png']          = '719899'       " #719899
let g:NERDTreeExtensionHighlightColor['css']          = 'fd7e14'       " #fd7e14
let g:NERDTreeExactMatchHighlightColor                = {}
let g:NERDTreeExactMatchHighlightColor['README']      = '0099BD'       " #0099BD
let g:NERDTreePatternMatchHighlightColor              = {}
let g:NERDTreePatternMatchHighlightColor['.*rc$']     = '616E88'       " #616E88
let g:NERDTreePatternMatchHighlightColor['.*git.*$']  = '6c71c4'       " #6c71c4
let g:NERDTreePatternMatchHighlightColor['.*rc$']     = '4682b4'       " #4682b4
let g:NERDTreePatternMatchHighlightColor['.*ignore$'] = 'cd853f'       " #cd853f
let g:NERDTreePatternMatchHighlightColor['.*\.bak$']  = '293739'       " #293739
  • default settings

    default settings
    let g:WebDevIconsUnicodeDecorateFolderNodes        = 1
    let g:WebDevIconsNerdTreeAfterGlyphPadding         = ' '
    let g:webdevicons_enable_nerdtree                  = 1
    let g:webdevicons_enable_unite                     = 1
    let g:webdevicons_enable_vimfiler                  = 1
    let g:webdevicons_conceal_nerdtree_brackets        = 1
    let g:WebDevIconsNerdTreeGitPluginForceVAlign      = 1
    let g:DevIconsEnableFolderExtensionPatternMatching = 0
    
    :echo g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols
    {'erl': '', 'style': '', 'db': '', 'rmd': '', 'c++': '', 'pyc': '', 'pyd': '', 'go': '', 'suo':
    '', 'lua': '', 'bash': '', 'pyo': '', 'mustache': '', 'gif': '', 'nix': '', 'jsx': '', 'leex':
    '', 'lhs': '', 'sol': 'ﲹ', 'scala': '', 'zsh': '', 'jpeg': '', 'pem': '', 'ts': '', 'xcplaygroun
    d': '', 'fsi': '', 'coffee': '', 'scss': '', 'js': '', 'gitcommit': '', 'xul': '', 'mdx': '', '
    less': '', 'fish': '', 'htm': '', 'rb': '', 'f#': '', 'c': '', 'd': '', 'md': '', 'webp': '',
    'h': '', 'mli': 'λ', 'mk': '', 'rs': '', 'haml': '', 'png': '', 'hh': '', 'php': '', 'cc': '',
    't': '', 'jl': '', 'json': '', 'cljc': '', 'exs': '', 'jenkinsfile': '', 'hs': '', 'sql': '', '
    ico': '', 'ps1': '', 'cs': '', 'bmp': '', 'sln': '', 'cljs': '', 'html': '', 'cpp': '', 'hrl':
    '', 'ml': 'λ', 'sass': '', 'vue': '﵂', 'awk': '', 'conf': '', 'pl': '', 'pm': '', 'cp': '', 'rli
    b': '', 'pp': '', 'tex': '', 'elm': '', 'jpg': '', 'toml': '', 'webmanifest': '', 'mjs': '', 's
    wift': '', 'r': '', 'ai': '', 'fs': '', 'csh': '', 'psd': '', 'psb': '', 'heex': '', 'rss': ''
    , 'cxx': '', 'css': '', 'log': '', 'rake': '', 'sh': '', 'hpp': '', 'bat': '', 'fsx': '', 'ini'
    : '', 'gemspec': '', 'markdown': '', 'hbs': '', 'twig': '', 'rproj': '鉶', 'yaml': '', 'fsscript'
    : '', 'ksh': '', 'vim': '', 'ejs': '', 'clj': '', 'ex': '', 'end': '', 'slim': '', 'eex': '',
    'tsx': '', 'dump': '', 'groovy': '', 'py': '', 'hxx': '', 'diff': '', 'dart': '', 'java': '', '
    yml': ''}
    
    :echo g:WebDevIconsUnicodeDecorateFileNodesExactSymbols
    {'.vimrc': '', 'gruntfile.coffee': '', '_gvimrc': '', '_vimrc': '', 'dropbox': '', '.gvimrc': '',
     'license': '󰌋', 'procfile': '', 'config.ru': '', 'gemfile': '', '.gitignore': '', 'COMMIT_EDITMSG'
    : '', 'src': '', '.gitmodules': '', 'makefile': '', 'rakefile': '', '.bashprofile': '', 'gulpfile
    .coffee': '', 'gruntfile.js': '', '.zshenv': '', 'gruntfile.ls': '', 'node_modules': '', 'gulpfile
    .js': '', '.bashrc': '', 'robots.txt': '󰚩', '.zshrc': '', 'mix.lock': '', 'gulpfile.ls': '', 'exac
    t-match-case-sensitive-2': '2', 'docker-compose.yml': '', '.gitconfig': '', '.gitattributes': '', 'r
    eact.jsx': '', 'exact-match-case-sensitive-1.txt': '1', 'dockerfile': '', '.zprofile': '', 'cmakelis
    ts.txt': '', '.ds_store': '', 'favicon.ico': ''}
    
full config
Plug 'ryanoasis/vim-devicons'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'

" ryanoasis/vim-devicons
let g:WebDevIconsOS                                               = 'Darwin'
let g:WebDevIconsUnicodeDecorateFolderNodes                       = 1
let g:WebDevIconsNerdTreeAfterGlyphPadding                        = ' '
let g:webdevicons_enable_nerdtree                                 = 1
let g:webdevicons_enable_unite                                    = 1
let g:webdevicons_enable_vimfiler                                 = 1
let g:webdevicons_conceal_nerdtree_brackets                       = 1
let g:DevIconsEnableFoldersOpenClose                              = 1
let g:DevIconsDefaultFolderOpenSymbol                             = ''
let g:WebDevIconsUnicodeDecorateFolderNodesDefaultSymbol          = ''
let g:DevIconsEnableFolderExtensionPatternMatching                = 1
let g:WebDevIconsNerdTreeGitPluginForceVAlign                     = 1
let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols         = {}
let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['log']  = ''
let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['json'] = ''
let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['md']   = ''
let g:WebDevIconsUnicodeDecorateFileNodesExactSymbols             = {}
let g:WebDevIconsUnicodeDecorateFileNodesExactSymbols['src']      = ''
if exists('g:loaded_webdevicons') | call webdevicons#refresh() | endif

" tiagofumo/vim-nerdtree-syntax-highlight
let s:brown       = "905532"                                      " #905532
let s:aqua        = "3AFFDB"                                      " #3AFFDB
let s:blue        = "689FB6"                                      " #689FB6
let s:darkBlue    = "44788E"                                      " #44788E
let s:purple      = "834F79"                                      " #834F79
let s:lightPurple = "834F79"                                      " #834F79
let s:red         = "AE403F"                                      " #AE403F
let s:beige       = "F5C06F"                                      " #F5C06F
let s:yellow      = "F09F17"                                      " #F09F17
let s:orange      = "D4843E"                                      " #D4843E
let s:darkOrange  = "F16529"                                      " #F16529
let s:pink        = "CB6F6F"                                      " #CB6F6F
let s:salmon      = "EE6E73"                                      " #EE6E73
let s:green       = "8FAA54"                                      " #8FAA54
let s:lightGreen  = "31B53E"                                      " #31B53E
let s:white       = "FFFFFF"                                      " #FFFFFF
let s:rspec_red   = 'FE405F'                                      " #FE405F
let s:git_orange  = 'F54D27'                                      " #F54D27
let g:NERDTreeHighlightCursorline                        = 1
let g:NERDTreeExtensionHighlightColor                    = {}
let g:NERDTreeExtensionHighlightColor['groovy']          = s:beige
let g:NERDTreeExtensionHighlightColor['md']              = "CC6666"
let g:NERDTreeExactMatchHighlightColor                   = {}
let g:NERDTreeExactMatchHighlightColor['.gitignore']     = s:git_orange
let g:NERDTreePatternMatchHighlightColor                 = {}
let g:NERDTreePatternMatchHighlightColor['.*\.md$']      = s:yellow
let g:WebDevIconsDefaultFolderSymbolColor                = s:beige
let g:WebDevIconsDefaultFileSymbolColor                  = s:darkBlue
let g:NERDTreeSyntaxEnabledExtensions                    = ['rb', 'sh', 'py', 'groovy', 'css', 'html']
let g:NERDTreeSyntaxEnabledExactMatches                  = ['.marslo', 'jenkins', 'virtualization', 'devops']
  • more settings for vim-devicon | latest

    more settings
    Plug 'ryanoasis/vim-devicons'
    
    let g:WebDevIconsUnicodeDecorateFolderNodes = 1
    let g:DevIconsEnableFoldersOpenClose = 1
    if exists("g:loaded_webdevicons") | call webdevicons#refresh() | endif
    augroup devicons
      autocmd!
      autocmd FileType nerdtree setlocal nolist
      autocmd FileType nerdtree syntax match hideBracketsInNerdTree "\]" contained conceal containedin=ALL
      autocmd FileType nerdtree syntax match hideBracketsInNerdTree "\[" contained conceal containedin=ALL
      autocmd FileType nerdtree setlocal conceallevel=3
      autocmd FileType nerdtree setlocal concealcursor=nvic
    augroup END
    function! DeviconsColors(config)
      let colors = keys(a:config)
      augroup devicons_colors
        autocmd!
        for color in colors
          if color == 'normal'
            exec 'autocmd FileType nerdtree,startify if &background == ''dark'' | '.
              \ 'highlight devicons_'.color.' guifg='.g:sol.gui.base01.' ctermfg='.g:sol.cterm.base01.' | '.
              \ 'else | '.
              \ 'highlight devicons_'.color.' guifg='.g:sol.gui.base1.' ctermfg='.g:sol.cterm.base1.' | '.
              \ 'endif'
          elseif color == 'emphasize'
            exec 'autocmd FileType nerdtree,startify if &background == ''dark'' | '.
              \ 'highlight devicons_'.color.' guifg='.g:sol.gui.base1.' ctermfg='.g:sol.cterm.base1.' | '.
              \ 'else | '.
              \ 'highlight devicons_'.color.' guifg='.g:sol.gui.base01.' ctermfg='.g:sol.cterm.base01.' | '.
              \ 'endif'
          else
            exec 'autocmd FileType nerdtree,startify highlight devicons_'.color.' guifg='.g:sol.gui[color].' ctermfg='.g:sol.cterm[color]
          endif
          exec 'autocmd FileType nerdtree,startify syntax match devicons_'.color.' /\v'.join(a:config[color], '|').'/ containedin=ALL'
        endfor
      augroup END
    endfunction
    let g:devicons_colors = {
      \'normal': ['', '', '', '', ''],
      \'emphasize': ['', '', '', '', '', '', '', '', '', '', ''],
      \'yellow': ['', '', ''],
      \'orange': ['', '', '', 'λ', '', ''],
      \'red': ['', '', '', '', '', '', '', '', ''],
      \'magenta': [''],
      \'violet': ['', '', '', ''],
      \'blue': ['', '', '', '', '', '', '', '', '', '', '', '', ''],
      \'cyan': ['', '', '', ''],
      \'green': ['', '', '', '']
    \}
    call DeviconsColors(g:devicons_colors)
    

RRethy/vim-hexokinase

Plug 'rrethy/vim-hexokinase', { 'do': 'make hexokinase' }

" rrethy/vim-hexokinase
let g:Hexokinase_highlighters  = [ 'backgroundfull' ]              " available options: 'virtual', 'sign_column', 'background', 'backgroundfull', 'foreground', 'foregroundfull'
let g:Hexokinase_optInPatterns = [
\     'full_hex',
\     'triple_hex',
\     'rgb',
\     'rgba',
\     'hsl',
\     'hsla',
\     'colour_names'
\ ]
let g:Hexokinase_ftEnabled     = [ 'css', 'html', 'javascript']    " not recommended

utils

vim-scripts/AuthorInfoDetect

Plug 'marslo/authorinfo'

noremap <leader>aid :AuthorInfoDetect<CR>
let g:vimrc_author = 'marslo'
let g:vimrc_email  = 'marslo.jiao@gmail.com'
autocmd BufWritePre, FileWritePre * :AuthorInfoDetect<CR>
autocmd BufWritePre               * :AuthorInfoDetect<CR>

simnalamburt/vim-mundo

" ~/.vimrc
if has( 'persistent_undo' )
  if has('nvim')
    let target_path = expand( '~/.vim/undo' )
    set undodir=expand('~/.vim/undo')
  else
    let target_path = expand( '~/.vim/undo/vundo' )
  endif
  if !isdirectory( target_path )
    call system( 'mkdir -p ' . target_path )
  endif
  set undofile
  let &undodir=target_path
endif
" ~/.vimrc.d/extension
Plug 'simnalamburt/vim-mundo'

"simnalamburt/vim-mundo
noremap <Leader>u :MundoToggle<CR>
let g:mundo_prefer_python3 = 1
let g:mundo_width          = 26

yegappan/mru

noremap <leader>re :MRU<CR>
let MRU_Auto_Close    = 1                                           " most recently used(mru)
let MRU_Max_Entries   = 10
let MRU_Exclude_Files = '^/tmp/.*\|^/temp/.*\|^/media/.*\|^/mnt/.*'

amitds1997/remote-nvim.nvim

[!NOTE|label:references:]

markdown

preservim/vim-markdown

Plug 'preservim/vim-markdown'

" preservim/vim-markdown
let g:vim_markdown_toc_autofit          = 1
let g:vim_markdown_conceal              = 0
let g:vim_markdown_conceal_code_blocks  = 0
let g:vim_markdown_strikethrough        = 1
let g:vim_markdown_folding_disabled     = 1                         " =1 to disable folding
let g:vim_markdown_new_list_item_indent = 2
  • other configurations
    let g:vim_markdown_frontmatter        = 1
    let g:vim_markdown_json_frontmatter   = 1
    let g:vim_markdown_autowrite          = 1
    let g:vim_markdown_follow_anchor      = 1
    let g:vim_markdown_anchorexpr         = "'<<'.v:anchor.'>>'"
    

dhruvasagar/vim-table-mode

Plug 'dhruvasagar/vim-table-mode'

noremap <Leader>tm :TableModeToggle<CR>
let g:tabular_loaded             = 1
let g:table_mode_corner          = '|'
let g:table_mode_header_fillchar = '-'
let g:table_mode_align_char      = ":"
let g:table_mode_corner          = "|"
let g:table_mode_align_char      = ":"
" let g:table_mode_corner_corner = '+'
  • automatic alignment table in markdown
    function! s:isAtStartOfLine(mapping)
      let text_before_cursor = getline('.')[0 : col('.')-1]
      let mapping_pattern = '\V' . escape(a:mapping, '\')
      let comment_pattern = '\V' . escape(substitute(&l:commentstring, '%s.*$', '', ''), '\')
      return (text_before_cursor =~? '^' . ('\v(' . comment_pattern . '\v)?') . '\s*\v' . mapping_pattern . '\v$')
    endfunction
    inoreabbrev <expr> <bar><bar>
              \ <SID>isAtStartOfLine('\|\|') ?
              \ '<c-o>:TableModeEnable<cr><bar><space><bar><left><left>' : '<bar><bar>'
    inoreabbrev <expr> __
              \ <SID>isAtStartOfLine('__') ?
              \ '<c-o>:silent! TableModeDisable<cr>' : '__'
    

godlygeek/tabular

Plug 'godlygeek/tabular'

" settings
if exists(":Tabularize")
  nmap <Leader>a= :Tabularize /=<CR>
  vmap <Leader>a= :Tabularize /=<CR>
  nmap <leader>a: :Tabularize /:\zs<CR>
  vmap <leader>a: :Tabularize /:\zs<CR>
  inoremap <silent> <Bar>   <Bar><Esc>:call <SID>table_auto_align()<CR>
endif
  • function for auto-alignment
    function! s:table_auto_align()
      let p = '^\s*|\s.*\s|\s*$'
      if exists(':Tabularize') && getline('.') =~# '^\s*|'
        \ && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
        let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
        let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
        Tabularize/|/l1
        normal! 0
        call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
      endif
    endfunction
    

git

  • call bash cmd in silent mode
    nnoremap <leader>mp  :execute 'silent !git push --force' \| redraw! \| echohl Function \| echo 'change committed !!'<CR>
    " or to call gitalias
    nnoremap <leader>mp  :execute 'silent !git mp' \| redraw!<CR>
    
git blamer blame
1.3.4.25 -- git blamer blame

airblade/vim-gitgutter

[!NOTE|label:references:]

Plug 'airblade/vim-gitgutter'

" airblade/vim-gitgutter
set updatetime=250
set signcolumn=yes
let g:gitgutter_enabled          = 1
let g:gitgutter_realtime         = 0
let g:gitgutter_eager            = 0
if has('win32') || has('win64')
  let g:gitgutter_git_executable = 'c:\iMarslo\myprograms\Git\bin\git.exe'
else
  let g:gitgutter_git_executable = '/usr/local/bin/git'
endif
highlight clear SignColumn
  • shortcuts

    noremap  ]h :GitGutterNextHunk<CR>
    noremap  [h :GitGutterPrevHunk<CR>
    
    • :GitGutterNextHunk<CR> : ] + h
    • :GitGutterPrevHunk<CR> : [ + h

tpope/vim-fugitive

Plug 'tpope/vim-fugitive'

" fugitive
nnoremap <leader>mp :silent exec '! git mp'<CR>
nnoremap <Leader>ga :Git add %:p<CR><CR>
nnoremap <Leader>gs :Gstatus<CR>
nnoremap <leader>gl :silent! Glog<CR>:bot copen<CR>
nnoremap <leader>gp :Ggrep<Space>
nnoremap <leader>gb :Git branch<Space>
nnoremap <leader>go :Git checkout<Space>
nnoremap <leader>gc :Git commit -am ""<Left>
command! -bar -nargs=* Gpull execute 'Git pull'
command! -bar -nargs=* Gpush execute 'Git push'

APZelos/blamer.nvim

Plug 'APZelos/blamer.nvim'

" APZelos/blamer.nvim
nnoremap <Leader>bb  :BlamerToggle<CR>
if has( 'nvim' )
  let g:blamer_enabled            = 1
else
  let g:blamer_enabled            = 0
endif
let g:blamer_delay                = 100
let g:blamer_show_in_visual_modes = 0
let g:blamer_show_in_insert_modes = 0
let g:blamer_relative_time        = 1
let g:blamer_prefix               = '  '
let g:blamer_template             = '<committer> • <commit-short> • <summary>'

zivyangll/git-blame.vim

" zivyangll/git-blame.vim
nnoremap <Leader>ebb :<C-u>call gitblame#echo()<CR>

troubleshooting

airline

[!NOTE|label:references:]

```vim
if has("mac") || has("macunix")
    set guifont=Monaco\ for\ Powerline:h24
elseif has("win32") || has("win64")
    set guifont=Monaco\ for\ Powerline:h14:cANSI
    set renderoptions=type:directx,renmode:5
endif
```
  • solution : install powerline fonts

    [!NOTE|label:references:]

    $ git clone git@github.com:powerline/fonts.git ${iRCHOME}/utils/
    $ git clone git@github.com:supermarin/powerline-fonts.git ${iRCHOME}/utils/
    
    $ cd ${iRCHOME}/utils/fonts
    $ ./install.sh
    
Copyright © marslo 2020-2026 all right reserved,powered by GitbookLast Modified: 2026-05-29 23:00:56

results matching ""

    No results matching ""