Skip to content

Instantly share code, notes, and snippets.

@dvtalk
Created March 22, 2020 02:24
Show Gist options
  • Select an option

  • Save dvtalk/6a2a7a5e090125a983bc139a52186f8a to your computer and use it in GitHub Desktop.

Select an option

Save dvtalk/6a2a7a5e090125a983bc139a52186f8a to your computer and use it in GitHub Desktop.
"
"
" ███████████████████████████
" ███████▀▀▀░░░░░░░▀▀▀███████
" ████▀░░░░░░░░░░░░░░░░░▀████
" ███│░░░░░░░░░░░░░░░░░░░│███
" ██▌│░░░░░░░░░░░░░░░░░░░│▐██
" ██░└┐░░░░░░░░░░░░░░░░░┌┘░██
" ██░░└┐░░░░░░░░░░░░░░░┌┘░░██
" ██░░┌┘▄▄▄▄▄░░░░░▄▄▄▄▄└┐░░██
" ██▌░│██████▌░░░▐██████│░▐██
" ███░│▐███▀▀░░▄░░▀▀███▌│░███
" ██▀─┘░░░░░░░▐█▌░░░░░░░└─▀██
" ██▄░░░▄▄▄▓░░▀█▀░░▓▄▄▄░░░▄██
" ████▄─┘██▌░░░░░░░▐██└─▄████
" █████░░▐█─┬┬┬┬┬┬┬─█▌░░█████
" ████▌░░░▀┬┼┼┼┼┼┼┼┬▀░░░▐████
" █████▄░░░└┴┴┴┴┴┴┴┘░░░▄█████
" ███████▄░░░░░░░░░░░▄███████
" ██████████▄▄▄▄▄▄▄██████████
" ███████████████████████████
"
" You are about to experience a potent dosage of Vim. Watch your steps.
"
" ╔══════════════════════════════════════════╗
" ║ ⎋ HERE BE VIMPIRES ⎋ ║
" ╚══════════════════════════════════════════╝
"
"pathogen
execute pathogen#infect()
" Plug plugins
call plug#begin('~/.vim/plugged')
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & yarn install' }
Plug '~/.fzf'
Plug 'junegunn/fzf.vim'
Plug 'wellle/context.vim'
Plug 'wellle/targets.vim'
call plug#end()
if !has('gui_running')
set t_Co=256
endif
"if($DARK)
set background=dark
colorscheme afterglow
"so ~/.vim/.vimrc_dark
scriptencoding utf-8
set encoding=utf-8
"setting cursorline/column
set cursorcolumn
set cursorline
"setting nocursor for unactive window
autocmd WinEnter * setlocal cursorline cursorcolumn
autocmd WinLeave * setlocal nocursorcolumn
set noscrollbind nocursorbind
"setting to make cursor of 2 opening parallel windows to move cocurrently
"set crb
"other vim setting
set nocompatible
filetype plugin indent on
set mouse=a "using mouse in all mode
set ruler "show the position of cursor
set showcmd "show command in normal mode right bottom of vim
set wildmenu "menu when hit Tab in last line command
set scrolloff=6 "stop scrolling when remain 6 lines
set hlsearch "hightlight search result
set incsearch "display search result while typing
set ignorecase "searching with case insensitvie
set smartcase "case insensitive when searching with all lower letter, case sensitive when there is a Upper letter. only used with ignorecase
"set number "setting number collumn
"set relativenumber
set nobackup
"set backup "create a backup file when editting vim
"set bex=_tmp "suffix for editing backup file
set lbr "when a line is wrapped, only break a whole word, not in a middle of the word
set ai "auto indent.
"set si "smart indent
"Hit Ctrl d for undo indent in insert mode
set shiftwidth=2 "set indent 2 spaces in autoindent
set expandtab "Use the appropriate number of spaces to insert a
"set complete+=k/user/hungvn/.dict "search for word in /user/hungvn/.dict when hit ctrl N
set dictionary+=/user/hungvn/.dict "search for word in /user/hungvn/.dict when hit ctrl X ctrl K
set backspace=indent,eol,start
set nowrap
syntax on "turn syntax highlight on
let mapleader="\\"
set tags=tags; "seacrh tags file for current dir then upper dir
"set paste " put vim in paste mode, this mode turn off the autoindent, smarindent
set hidden "to switch buffer without save"
set list lcs=extends:⇉,precedes:⇇,tab:\ \ ,trail:␣
set clipboard=unnamed
set wildignore+=*/.git/*,*/tmp/*,*.swp "ignore these path/files in file or dir completion
set foldcolumn=1 "
"complete modify"
set complete=.,w,b,u,
"set complete=.,w,b,u,t
set completeopt=popup,menu,menuone,noinsert
""vim slow work around"
"set synmaxcol=300 "disable syntax after 300 char in a line
"set lazyredraw
"set nottyfast
"syntax sync minlines=256
"################################################################################################################################################################################################################################################################################################################################################"
"au BufRead,BufNewFile *.v set filetype=systemverilog
"au BufRead,BufNewFile *.svh set filetype=systemverilog
"au BufRead,BufNewFile *.sv set filetype=systemverilog
"au BufRead,BufNewFile *.sva set filetype=systemverilog
"Set file type format
au BufRead,BufNewFile *.v set filetype=verilog_systemverilog
au BufRead,BufNewFile *.svh set filetype=verilog_systemverilog
au BufRead,BufNewFile *.sv set filetype=verilog_systemverilog
au BufRead,BufNewFile *.sva set filetype=verilog_systemverilog
au BufRead,BufNewFile *.V set filetype=verilog_systemverilog
au BufRead,BufNewFile *.log set filetype=log
au BufRead,BufNewFile *.pl set filetype=perl
au BufRead,BufNewFile *.py set filetype=python
au BufRead,BufNewFile *.pyw set filetype=python
au BufRead,BufNewFile *.csh set filetype=csh
au BufRead,BufNewFile *.tcl set filetype=tcl
au BufRead,BufNewFile *.c set filetype=c
au BufRead,BufNewFile *.s set filetype=asm
au BufRead,BufNewFile *Makefile* set filetype=make
"##### FUNCTION"
"Making Comment
function! Make_Comments()
if (&ft=="asm")
:s/^/;/
elseif (&ft == "vim")
:s/^/"/
elseif (&ft =="verilog")
:s/^/\/\//
elseif (&ft =="c")
:s/^/\/\//
elseif (&ft =="verilog_systemverilog")
:s/^/\/\//
elseif (&ft =="systemverilog")
:s/^/\/\//
elseif ((&ft=="python")||(&ft=="perl"))
:s/^/#/
else
:s/^/#/
endif
endfunction
function! Delete_Comments()
if (&ft=="asm")
:s/^ *;//
elseif (&ft == "vim")
:s/^ *"//
elseif (&ft =="verilog")
:s/^ *\/\///
elseif (&ft =="c")
:s/^ *\/\///
elseif (&ft =="verilog_systemverilog")
:s/^ *\/\///
elseif (&ft =="systemverilog")
:s/^ *\/\///
elseif ((&ft=="python")||(&ft=="perl"))
:s/^ *#//
else
:s/^ *#//
endif
endfunction
noremap cc : call Make_Comments() <CR>
noremap uc : call Delete_Comments() <CR>
function! Delete_Trailing()
:%s/\s*$//g
endfunction
command DelTrail call Delete_Trailing()
"modify the fold line"
function! NeatFoldText()
let line = ' ' . substitute(getline(v:foldstart), '^\s*"\?\s*\|\s*"\?\s*{{' . '{\d*\s*', '', 'g') . ' '
let lines_count = v:foldend - v:foldstart + 1
" let lines_count_text = '| ' . printf("%10s", lines_count . ' lines') . ' |'
let lines_count_text = ' ' . printf("%10s", lines_count . ' lines') . ' '
let foldchar = matchstr(&fillchars, 'fold:\zs.')
let foldtextstart = strpart('+' . repeat(foldchar, v:foldlevel*2) . line, 0, (winwidth(0)*2)/3)
let foldtextend = lines_count_text . repeat(foldchar, 8)
let foldtextlength = strlen(substitute(foldtextstart . foldtextend, '.', 'x', 'g')) + &foldcolumn
return foldtextstart . repeat(foldchar, winwidth(0)-foldtextlength -10) . foldtextend
endfunction
set foldtext=NeatFoldText()
"create popup terminal"
function! Popupterminal()
let w = 90
let h = 24
let opts = {'hidden': 1, 'term_rows':h, 'term_cols':w}
let opts.term_kill = 'term'
let opts.term_finish = 'close'
let opts.norestore = 1
let bid = term_start([&shell], opts)
let opts = {'maxwidth':w, 'maxheight':h, 'minwidth':w , 'minheight':h }
" let opts.wrap = 0
let opts.line = 3
let opts.col = winwidth(0)/2 + 5
let opts.mapping = 0
let opts.title = 'popup-terminal'
"let opts.close = 'button'
let opts.border = [1,0,1,0]
let opts.padding = [0,2,0,2]
let opts.highlight = 'Fzfbackground'
let opts.borderhiglight = ['Fzfborder','Fzfborder','Fzfborder','Fzfborder']
let opts.drag = 1
let opts.resize = 1
let winid = popup_create(bid, opts)
endfunction
command Terminal call Popupterminal()
"hid other buf except current bf"
function! HidBuf()
let curbuf = bufnr('%')
" let buflist =
" call []bufdo
endfunction
"autocomplete"
"let g:acp_completeOption = '.,w,b,k,t'
let g:acp_completeOption = '.,w,b,k'
let g:acp_behaviorKeywordLength = 3
"C-@ is control space"
inoremap <C-@> <C-Y>
inoremap <Tab> <C-Y>
""Using supertab for autotab completion
"let g:SuperTabDefaultCompletionType = "context"
""let g:SuperTabContextDefaultCompletionType = "<c-n>"
"let g:SuperTabMappingForward = '<c-space>'
"let g:SuperTabMappingBackward = '<s-c-space>'
"setting for stealth"
let g:stealth#reveal_on_move = v:false
"netrw setting
let g:netrw_banner = 0
let g:netrw_liststyle = 3
let g:netrw_browse_split = 4
let g:netrw_altv = 1
let g:netrw_winsize = 25
"netrw usage:
"i: change listing view type
"d: make a dir
"D: remove a dir
"t: open file in new tab
"p: preview a file --> <C-W> z to close a previewed file
"""tagbar setting --> do not use for a verylong time
"let g:tagbar_ctags_bin = '~/local/bin/ctags'
"let g:tagbar_iconchars = ['▶', '▼']
"let g:tagbar_indent = 3
"let g:tagbar_autofocus = 1
"let g:tagbar_sort = 1
"let g:tagbar_zoomwidth = 0
"set updatetime=750
"EASY ALIGN SETTING
""" Start interactive EasyAlign in visual mode (e.g. vipga)
xmap ga <Plug>(EasyAlign)
""" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
"some help
"vipga --> <Enter> to change alignment to center/left/right
"vipga --> <Enter> --> <number/*> to select which position, * for all, ** for special:right-left alternating
"for command modem using format below
":EasyAlign[!] [N-th] DELIMITER_KEY [OPTIONS]
"e.g :EasyAlign=is (is option is useful with indentation option)
""setting for match up
""let g:matchup_matchparen_status_offscreen = 0
"function! Loadmatchword()
" setlocal matchpairs=(:),{:},[:]
" let b:match_words = '\<task\>:\<endtask\>,'
" \ . '\<function\>:\<endfunction\>,'
" \ . '\<class\>:\<endclass\>,'
" \ . '\<module\>:\<endmodule\>,'
" \ . '\<package\>:\<endpackage\>,'
" \ . '\<interface\>:\<endinterface\>,'
" \ . '\<property\>:\<endproperty\>,'
" \ . '\<sequence\>:\<endsequence\>,'
" \ . '\<covergroup\>:\<endgroup\>,'
" \ . '\<fork\>:\<join\>,'
" \ . '\<fork\>:\<join_any\>,'
" \ . '\<fork\>:\<join_none\>,'
" \ . '\<begin\>:\<end\>,'
" \ . '\<generate\>:\<endgenerate\>,'
" \ . '\<raise_objection\>:\<drop_objection\>'
"
"" \ . '\<if\>:\<else\>'
"" \ . '\<randcase\>:\<endcase\>,'
"" \ . '\<case\>:\<endcase\>,'
"endfunction
"
let b:match_ignorecase = 0
let b:match_words= '\<begin\>:\<end\>,'
\ . '\<if\>:\<else\>,'
\ . '\<module\>:\<endmodule\>,'
\ . '\<class\>:\<endclass\>,'
\ . '\<program\>:\<endprogram\>,'
\ . '\<clocking\>:\<endclocking\>,'
\ . '\<property\>:\<endproperty\>,'
\ . '\<sequence\>:\<endsequence\>,'
\ . '\<package\>:\<endpackage\>,'
\ . '\<covergroup\>:\<endgroup\>,'
\ . '\<primitive\>:\<endprimitive\>,'
\ . '\<specify\>:\<endspecify\>,'
\ . '\<generate\>:\<endgenerate\>,'
\ . '\<interface\>:\<endinterface\>,'
\ . '\<function\>:\<endfunction\>,'
\ . '\<task\>:\<endtask\>,'
\ . '\<case\>\|\<casex\>\|\<casez\>|\<randcase\>:\<endcase\>,'
\ . '\<fork\>:\<join\>\|\<join_any\>\|\<join_none\>,'
\ . '`ifdef\>:`else\>:`endif\>,'
"""setting for CtrlP
""open: <c-t> for new tab, <c-v> for vertical, <c-x> for horizontal
""mode: <c-f> or <c-b>, <c-r>, <c0d>
""other: <c-y> new file, <c-z> multiple choices <c-o> open multiple
"let g:ctrlp_follow_symlinks = 1
"let g:ctrlp_cmd = 'CtrlPBuffer'
"let g:ctrlp_working_path_mode = 'ra'
"if executable('rg')
" set grepprg=rg\ --color=never
" let g:ctrlp_user_command = 'rg %s --files --color=never --glob ""'
" let g:ctrlp_use_caching = 0
"endif
" let g:ctrlp_extensions = ['tag', 'bookmarkdir', 'dir']
"" \ 'buffertag', 'quickfix', 'rtscript', 'dir' , 'undo', 'line', 'changes', 'mixed']
""
" let g:ctrlp_buftag_ctags_bin = '~/local/bin/ctags'
"setting for Markbar"
let g:markbar_width = 50
let g:markbar_peekaboo_width = 50
let g:markbar_num_lines_context = {
\ 'around_local': 3,
\ 'around_file': 1,
\ 'peekaboo_around_local': 3,
\ 'peekaboo_around_file': 2,
\ }
let g:markbar_marks_to_display = '"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
let g:markbar_peekaboo_marks_to_display = '"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
"signature, do not show mark s, which is used for minisnip
let g:SignatureIncludeMarks = 'abcdefghijklmnopqrtuvwxyzABCDEFGHIJKLMNOPQRTUVWXYZ'
"setting for Peekaboo"
let g:peekaboo_window= 'vert bo 50new'
""setting for Easygrep
"noremap <leader>gw :Grep <C-r><C-w> * <CR>
"noremap <leader>gW :Grep -w <C-r><C-w> * <CR>
"setting for CtrlSF"
let g:ctrlsf_regex_pattern = 1
let g:ctrlsf_search_mode = 'async'
noremap <leader>gw :CtrlSF
noremap <leader>gW :CtrlSF -W <C-r><C-w>
""setting for rainbow
let g:rainbow_active = 1
"let g:rbpt_loadcmd_toggle = 1
""let g:rbpt_max = 15
"au VimEnter * RainbowParenthesesToggle
"au Syntax * RainbowParenthesesLoadRound
"au Syntax * RainbowParenthesesLoadSquare
"au Syntax * RainbowParenthesesLoadBraces
""au Syntax * RainbowParenthesesLoadChevrons
""
"setting for Illuminate
"let g:Illuminate_delay = 250
"setting for Startify"
let g:startify_session_dir = '~/.vim/sessions'
let g:startify_padding_left = 5
let g:startify_lists = [
\ { 'type': 'files', 'header': [' MRU'] },
\ { 'type': 'dir', 'header': [' MRU '. getcwd()] },
\ { 'type': 'sessions', 'header': [' Sessions'] },
\ { 'type': 'bookmarks', 'header': [' Bookmarks'] },
\ { 'type': 'commands', 'header': [' Commands'] },
\ ]
autocmd User Startified setlocal cursorline
let g:ascii = [
\' O ',
\' .-. o ',
\' (o.o) . ',
\' |=| ',
\' __|__ ',
\' //.=|=.\\ ',
\' // .=|=. \\ ',
\' \\ .=|=. // ',
\' \\(_=_)// ',
\' (:| |:) ',
\' || || ',
\' () () ',
\' || || ',
\' ==/ \== ']
let g:startify_custom_header = map(startify#fortune#boxed() + g:ascii , '" ".v:val')
let g:startify_enable_special = 0
let g:startify_skiplist = [
\ '\.cheat',
\ '\.notes'
\ ]
""setting for dim unactive window"
"let g:diminactive_use_syntax = 0
"let g:diminactive_use_colorcolumn = 1
"let g:diminactive_filetype_blacklist = ['startify']
"let g:diminactive_buftype_blacklist = ['nofile', 'nowrite', 'acwrite', 'quickfix', 'help', 'tagbar', 'markbar', 'peekaboo', 'git']
"setting for indent line
let g:indentLine_enabled = 0
let g:indentLine_char_list = ['|', '¦', '┆', '┊']
let g:indentLine_color_term = 22
"setting for bufferline"
let g:bufferline_echo = 0
"let g:bufferline_active_buffer_left = ''
"let g:bufferline_active_buffer_right = ''
let g:bufferline_show_bufnr = 0
let g:bufferline_modified = '[]'
let g:bufferline_rotate = 1
"Setting for csv"
let g:csv_autocmd_arrange = 1
"let g:csv_arrange_align = 'l*'
"setting for git"
"let g:signify_disable_by_default = 1
"setting for minisnip
let g:minisnip_trigger = '<C-j>'
"setting for autosave"
"let g:autosave_extensions = '.backup'
"let g:autosave_backup = '~/.vim/backup'
"let g:autosave_timer = 60*10*1000
augroup filetype_log
autocmd!
autocmd FileType log set nonu norelativenumber
autocmd FileType log :ContextDisable
" autocmd FileType log :RainbowToggleOff
" autocmd FileType log :HighlightedyankOff
augroup END
augroup filetype_vim
autocmd!
autocmd FileType vim set nonu norelativenumber
autocmd FileType vim :ContextDisable
augroup END
augroup filetype_verilog_systemverilog
autocmd!
autocmd FileType verilog_systemverilog setlocal foldmethod=syntax
autocmd FileType verilog_systemverilog let g:verilog_indent_width = 2
autocmd FileType verilog_systemverilog let g:verilog_efm_uvm_lst = "all"
autocmd FileType verilog_systemverilog set foldcolumn=2 "defines 2 col at window left, to indicate folding
autocmd FileType verilog_systemverilog let g:verilog_syntax_fold_lst = "all"
autocmd FileType verilog_systemverilog let g:verilog_efm_uvm_lst = "fatal,error,warning"
autocmd FileType verilog_systemverilog set foldlevelstart=3
autocmd FileType verilog_systemverilog set foldlevel=1
autocmd FileType verilog_systemverilog set omnifunc=syntaxcomplete#Complete
augroup END
"""setting for lsp and svls"
"if executable('svls')
" au User lsp_setup call lsp#register_server({
" \ 'name': 'svls',
" \ 'cmd': {server_info->['svls']},
" \ 'whitelist': ['verilog_systemverilog','systemverilog'], })
"endif
"set foldmethod=expr
" \ foldexpr=lsp#ui#vim#folding#foldexpr()
" \ foldtext=lsp#ui#vim#folding#foldtext()
"setting for context.vim"
let g:context_enabled = 1
let g:context_highlight_normal = 'CursorLine'
let g:context_highlight_border = 'Comment'
let g:context_highlight_tag = 'Special'
"let g:context_max_height = 10
"let g:context_presenter = 'vim-popup'
"let g:context_border_char = 'ـ'
"Setting for FastFold"
let g:fastfold_fold_command_suffixes = []
let g:fastfold_fold_movement_commands = []
let g:fastfold_savehook = 1
"setting for deoplete"
let g:deoplete#enable_at_startup = 1
"setting for Goyo"
"autocmd! User GoyoEnter Limelight
"autocmd! User GoyoLeave Limelight!
"autocmd FileType notes Goyo
"let g:notes_suffix = '.notes'
""setting for Limeline"
"" Color name (:help cterm-colors) or ANSI code
"let g:limelight_conceal_ctermfg = 'gray'
"let g:limelight_conceal_ctermfg = 240
"" Color name (:help gui-colors) or RGB color
"let g:limelight_conceal_guifg = 'DarkGray'
"let g:limelight_conceal_guifg = '#777777'
"" Default: 0.5
"let g:limelight_default_coefficient = 0.7
"" Number of preceding/following paragraphs to include (default: 0)
"let g:limelight_paragraph_span = 1
"" Beginning/end of paragraph
"" When there's no empty line between the paragraphs
"" and each paragraph starts with indentation
"let g:limelight_bop = '^\s'
"let g:limelight_eop = '\ze\n^\s'
"" Highlighting priority (default: 10)
"" Set it to -1 not to overrule hlsearch
"let g:limelight_priority = -1
"vim radical
"gA shows the four representations of the number under the cursor.
"crd, crx, cro, crb convert the number under the cursor to decimal, hex, octal, binary, respectively.
""setting for smooth scroll"
"let g:comfortable_motion_scroll_down_key = "j"
"let g:comfortable_motion_scroll_up_key = "k"
""""setting for ALE
""""enable ALE
"let g:ale_enabled = 0
""""check LINT when OPEN file
"let g:ale_lint_on_enter = 0
""""check LINT when MODIFYING file
"""let g:ale_lint_on_text_changed = 'always'
"""" check LINT when SAVING file
"let g:ale_lint_on_save = 0
""
"
"augroup filetype_python
" autocmd!
" autocmd FileType python let g:ale_enabled = 1
" autocmd FileType python let g:ale_lint_on_enter = 1
" autocmd FileType python let g:ale_lint_on_text_changed = 'always'
" autocmd FileType python let g:ale_lint_on_save = 1
"augroup END
""" jump to next error
"map <C-a><C-n> :ALENext<cr>
"map <C-a><C-p> :ALEPrevious<cr>
""" init the variable
"let g:ale_linters = {}
""" enable “verilator” LINT for systemverilog & verilog filetype
""let g:ale_linters['systemverilog'] = ['verilator']
""let g:ale_linters['verilog'] = ['verilator']
"let g:ale_linters['verilog_systemverilog'] = ['verilator']
""
"""use “verilator” as absolute path
"let g:ale_verilog_verilator_use_global = 1
"let g:ale_verilog_verilator_executable = '/user/hungvn/local/bin/verilator'
"let g:ale_verilog_verilator_options = '--lint-only'
"fzf
function! s:find_git_root()
return system('git rev-parse --show-toplevel 2> /dev/null')[:-2]
endfunction
command! ProjectFiles execute 'Files' s:find_git_root()
command! FZFMru call fzf#run({
\ 'source': reverse(s:all_files()),
\ 'sink': 'edit',
\ 'options': '-m -x +s',
\ 'down': '40%' })
function! s:all_files()
return extend(
\ filter(copy(v:oldfiles),
\ "v:val !~ 'fugitive:\\|NERD_tree\\|^/tmp/\\|.git/'"),
\ map(filter(range(1, bufnr('$')), 'buflisted(v:val)'), 'bufname(v:val)'))
endfunction
let g:fzf_layout = { 'window': { 'width': 0.8, 'height': 0.6, 'rounded': v:true, 'border': 'horizontal', 'highlight': 'Fzfborder'} }
"let g:fzf_layout = { 'window': { 'width': 0.8, 'height': 0.6, 'rounded': v:true, 'border': 'horizontal'} }
"setting for interesting words"
nnoremap <silent> <leader>k :call InterestingWords('n')<cr>
nmap <silent> # :call InterestingWords('n')<cr>
nnoremap <silent> <leader>K :call UncolorAllWords()<cr>
nmap <silent> <C-#> :call UncolorAllWords()<cr>
nnoremap <silent> > :call WordNavigation(1)<cr>
nnoremap <silent> < :call WordNavigation(0)<cr>
let g:interestingWordsTermColors = ['154', '121', '211', '137', '214', '222']
"setting for gutentags"
"let g:gutentags_ctags_exclude = [bk_]
"let g:gutentags_ctags_extra_args = --extras=+q --fields=+i -n
"anzu slow on big log file"
""setting for anzu(1/9) (status search information)"
"nmap n <Plug>(anzu-n-with-echo)
"nmap N <Plug>(anzu-N-with-echo)
"nmap * <Plug>(anzu-star-with-echo)
"let g:anzu_enable_CursorMoved_AnzuUpdateSearchStatus = 1
""nmap <leader>az :call anzu#mode#start("anzu", "n", "", "")<CR>
""let g:anzu_status_format = "%#WarningMsg#%p(%i/%l)"
"mapping in insert mode: 1.Ctrl C ~ ESC, 2. Ctrl h ~ Backspace, 3. Ctrl d d ~ delete current line, 4. remove autoindent when passing using Shift -Insert, 5. press shift tab to jump to after the closing brace
"in C-W for delete a word
"inoremap <C-c> <ESC>
inoremap <C-h> <BS>
"inoremap <C-d><C-d> <ESC>ddi
"inoremap <S-Insert> <ESC>:set noai nosi <CR>:echom "hungvn"<CR> i<S-Insert> :set ai si
"inoremap <S-Insert> <ESC>:set noai nosi <CR>:echom "hungvn"
"inoremap <C-S-i> <S-Insert>
inoremap <S-Tab> <ESC>%%a
inoremap <M-h> <ESC>lxi
"mapping in normal mode: 1. Shift-d w ~ delete word before cursor, 2. shift-d W ~ delete word before cursor
"remove since we can using diw
"nnoremap <S-d>w bdw
"nnoremap <S-d>W BdW
nnoremap <leader>nh :noh<CR>
nnoremap Q <nop>
"nnoremap <C-z> <nop>
nnoremap <C-s> <nop>
nnoremap zuz <Plug>(FastFoldUpdate)
nnoremap bn :bnext<CR>
nnoremap bp :bprevious<CR>
"nnoremap j gj
"nnoremap k gk
"nnoremap <C-n><C-n> :set number relativenumber <CR>
"nnoremap <C-n><C-o> :set nonumber norelativenumber <CR>
"mapping in terminal mode"
tnoremap <ESC><ESC><ESC> <C-\><C-n>
tnoremap <C-p> <C-\><C-n>:Buffers<CR>
"autocmd BufWinEnter,WinEnter * if &buftype == 'terminal' | !normal i | endif
"mapping in all mode: 1. enable netrw, 2. enable Tagbar, 3. show absolute path of file 4.open new file in new tab
noremap <C-g><C-g> 1<C-g>
noremap <C-t>f :tabnew
"map <C-t>n :tabn<CR> instead of this, use gt
"map <C-t>p :tabp<CR> instead of this, use gT
" to go to a specific tab num, use: <num>gt
" use <C-W>T to move current opened buffer to new tab
nmap <C-w>m <Plug>(git-messenger)
noremap <leader>/ :g//#<Left><Left>
noremap <leader>nn :Vex<CR>
"noremap <leader>tt :TagbarToggle<CR>
noremap <leader>vt :vert terminal<CR>
noremap <leader>st :Startify<CR>
noremap <leader>ss :SSave
"noremap <leader>in :IndentLinesToggle<CR>
"noremap <leader>di :DimInactiveToggle<CR>
noremap <leader>ms :SignatureToggleSigns<CR>
noremap <leader>mb <Plug>ToggleMarkbar
noremap <leader>ct :ContextToggle<CR>
"fzf map
noremap <C-_> :BLines <CR>
noremap <C-_><C-_> :Lines <CR>
noremap <C-p> :Buffers <CR>
"noremap <leader>ff :Files<CR>
noremap <leader>ff :ProjectFiles<CR>
noremap <leader>fr :Rg<CR>
noremap <leader>fm :Marks<CR>
noremap <leader>fo :FZFMru<CR>
noremap <leader>fc :Commands<CR>
"noremap <leader>ft :Tags <CR>
noremap <leader>ft :BTags <CR>
imap <c-x><c-k> <plug>(fzf-complete-word)
imap <c-x><c-f> <plug>(fzf-complete-path)
"imap <c-x><c-j> <plug>(fzf-complete-file)
imap <c-x><c-l> <plug>(fzf-complete-line)
"inoremap <expr> <c-x><c-a> fzf#vim#complete(fzf#wrap({
" \ 'prefix': '^.*$',
" \ 'source': complete_info(),
" \ 'options': '',
" \ 'reducer': { lines -> join(split(lines[0], ':\zs')[2:], '') } }))
"insert Completion
"Completion can be done for:
" Whole lines i_CTRL-X_CTRL-L
" keywords in the current file i_CTRL-X_CTRL-N
" keywords in 'dictionary' i_CTRL-X_CTRL-K
" keywords in 'thesaurus', thesaurus-style i_CTRL-X_CTRL-T
" keywords in the current and included files i_CTRL-X_CTRL-I
" tags i_CTRL-X_CTRL-]
" file names i_CTRL-X_CTRL-F
" definitions or macros i_CTRL-X_CTRL-D
" Vim command-line i_CTRL-X_CTRL-V
" User defined completion i_CTRL-X_CTRL-U
" omni completion i_CTRL-X_CTRL-O
" Spelling suggestions i_CTRL-X_s
" keywords in 'complete' i_CTRL-N i_CTRL-P
"We are interested in #12. Notice that it is CTRL-X_s, not CTRL-X_CTRL-s. Vim has this to say about following CTRL-X with CTRL-s
"noremap <C-a><C-l> :ALEToggle<CR>
"noremap <leader>ge :SignifyEnable<CR>
noremap <leader>gv :GV<CR>
"USEFUL FUNCTION IN VIM
":help key-notation
"count words: v-select --> g ->> ^-G"
"gqG` : align line to 80
"insert-normal mode: in insert mode <C-o> --> allow to perform 1 normal command
"register = to calculate: ininsert mode <C-r>= --> can do some math calculation and paste the input to cursor
":digraphs --> show special character, then<C-k>{char}{char} in insert mode
"Select mode: gv to select the last visual selecttion
"Select mode: o to go to the other end of select object
"testasfdj;lfdj
"
set rtp+=/users/users_disk01/hungvn/.fzf
"fun
"screensaver
"autocmd CursorHold * :echo "hungg"; echo "He"
"autocmd QuitPre * :echo "hung":10sleep
"set updatetime=100
"nnoremap <C-l><C-l><C-t> :Matrix<CR>
"set cmdheight=2
"let g:echodoc_enable_at_startup = 1
"let g:echodoc#type = "echo"
"list of vim plugin using
"ligtline.vim --> modify lastline
"auto-pairs --> auto add pairs
"vim-eunuch --> support unix command in lastline command, try :chmod +x
"vim-matrix --> funny screen saver: try :Matrix()
"nerd-tree --> list up a current dir tree : try <C-n><C-n> --> using default netrw instead
"tag bar --> list of function map on the right: try <C-t><C-b>
"easy-align --> align text, using vipga + <character>
"ctrlp --> to find files
"matchup --> adding new matching pair for systemverilog --> need to update rule for if else
"
"Need to install --> dispatch, endwise, ALE,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment