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
[!NOTE|label:references:]
section:
tips:
check loaded extensions : :AirlineExtension
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()
tips
let g:airline_section_<x> = '' " remove the filetype part
let g:airline_skip_empty_sections = 1 " remove separators for empty sections
%<': let g:airline_section_c = '%<' . airline#section#create(['%{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
great themes
angr
selenized/selenized_bw
biogoo
base16_default
base16color
base16_chalk
base16_bright
biogoo ( dark background in insert mode )
nice themes
owo
hybrid
bubblegum
supernova
alduin
base16_summerfruit
base16_atelierseaside
raven ( no background color )
peaksea ( no background color change )
programming
[!NOTE|label:references:]
:SyntasticInfo
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
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-"]
<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
if install from standalone package, tree-sitter required
osx: $ brew install tree-sitter
# tree-sitter executable not found
$ 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
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
:Copilot panel
config
[!NOTE|label:references:]
copilot enable/disable for filetypes:
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
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
" 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 = 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 = 'ఠ'
let g:syntastic_dockerfile_checkers = [ 'hadolint' ]
highlight link SyntasticErrorSign Error
highlight link SyntasticWarningSign GruvboxYellow
highlight link SyntasticStyleErrorSign GruvboxRedSign
highlight link SyntasticStyleWarningSign GruvboxPurpleSign
color and theme
[!NOTE|label:references:]
plugins:
theme
wallpapers
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
[!NOTE|label:references:]
configs
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
[!NOTE|label:unicodes]
bracket issue in nerdtree
configs
icons:
" 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
" ~/.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
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/.*'
[!NOTE|label:references:]
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.'>>'"
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 = '+'
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>
[!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