This commit is contained in:
Nachuan Tang
2022-10-26 00:20:19 -04:00
4 changed files with 48 additions and 29 deletions
+1
View File
@@ -4,3 +4,4 @@
.vim/ .vim/
autoload/ autoload/
node_modules/ node_modules/
tags
View File
+4 -7
View File
@@ -12,6 +12,9 @@
let g:vim_version = str2float(g:vim_version) let g:vim_version = str2float(g:vim_version)
let g:dotfile_path = '~/.dotfiles/' let g:dotfile_path = '~/.dotfiles/'
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath=&runtimepath
" The default leader is '\', but many people prefer ',' as it's in a standard " The default leader is '\', but many people prefer ',' as it's in a standard
let mapleader = ',' let mapleader = ','
let maplocalleader = '_' let maplocalleader = '_'
@@ -199,7 +202,7 @@
" Map <Leader>ff to display all lines with keyword under cursor " Map <Leader>ff to display all lines with keyword under cursor
" and ask which one to jump to " and ask which one to jump to
nmap <Leader>ff [I:let nr = input("Which one: ")<Bar>exe "normal " . nr ."[\t"<CR> nmap <Leader>j [I:let nr = input("Which one: ")<Bar>exe "normal " . nr ."[\t"<CR>
" Easier horizontal scrolling " Easier horizontal scrolling
map zl zL map zl zL
@@ -216,12 +219,6 @@
nmap <Leader>ac <Plug>ToggleAutoCloseMappings nmap <Leader>ac <Plug>ToggleAutoCloseMappings
" } " }
" JSON {
nmap <leader>jt <Esc>:%!python -m json.tool<CR><Esc>:set filetype=json<CR>
let g:vim_json_syntax_conceal = 0
" }
" } " }
" Functions { " Functions {
+43 -22
View File
@@ -9,6 +9,7 @@
" Plugin_Preferences " Plugin_Preferences
" Theme_Appearance " Theme_Appearance
" Key_Mappings " Key_Mappings
" Useful_Info
" Environment { " Environment {
set nocompatible " Must be first line set nocompatible " Must be first line
@@ -29,7 +30,6 @@
endif endif
Plug 'rust-lang/rust.vim' Plug 'rust-lang/rust.vim'
Plug 'leafgarland/typescript-vim'
" { " {
Plug 'alvan/vim-closetag' Plug 'alvan/vim-closetag'
@@ -38,7 +38,6 @@
Plug 'scrooloose/nerdtree' Plug 'scrooloose/nerdtree'
Plug 'godlygeek/tabular'
" for markdown{ " for markdown{
Plug 'preservim/vim-markdown' Plug 'preservim/vim-markdown'
"} "}
@@ -76,6 +75,11 @@
Plug 'mbbill/undotree' Plug 'mbbill/undotree'
Plug 'tpope/vim-commentary' Plug 'tpope/vim-commentary'
" put text in neibouring tmux pane into auto complete
Plug 'wellle/tmux-complete.vim'
Plug 'ludovicchabant/vim-gutentags'
" only work with nvim > 0.5 " only work with nvim > 0.5
" For other versions, just loading the plugin may " For other versions, just loading the plugin may
" cause error " cause error
@@ -129,6 +133,30 @@ if g:vim_type == 'nvim'
endif endif
" } " }
" ludovicchabant/vim-gutentags {
set statusline+=%{gutentags#statusline()}
let g:gutentags_cache_dir=g:vim_dir . '/.vimtags/'
"}
" easymotion/vim-easymotion {
" <Leader>f{char} to move to {char}
map <Leader>f <Plug>(easymotion-bd-f)
nmap <Leader>f <Plug>(easymotion-overwin-f)
" s{char}{char} to move to {char}{char}
nmap s <Plug>(easymotion-overwin-f2)
" Move to line
map <Leader>L <Plug>(easymotion-bd-jk)
nmap <Leader>L <Plug>(easymotion-overwin-line)
" Move to word
map <Leader>w <Plug>(easymotion-bd-w)
nmap <Leader>w <Plug>(easymotion-overwin-w)
" }
" antoinemadec/coc-fzf { " antoinemadec/coc-fzf {
if isdirectory(expand(plugin_dir . "/coc-fzf")) if isdirectory(expand(plugin_dir . "/coc-fzf"))
nnoremap <silent> <space><space> :<C-u>CocFzfList<CR> nnoremap <silent> <space><space> :<C-u>CocFzfList<CR>
@@ -155,24 +183,11 @@ endif
" airblade/vim-rooter { " airblade/vim-rooter {
if isdirectory(expand(plugin_dir . "/vim-rooter")) if isdirectory(expand(plugin_dir . "/vim-rooter"))
let g:rooter_patterns = ['.vscode', '.git'] let g:rooter_patterns = ['.vscode', '.git', '*.sln']
let g:rooter_change_directory_for_non_project_files = 'current'
endif endif
" } " }
" godlygeek/tabular {
if isdirectory(expand(plugin_dir . "/tabular"))
nmap <leader>t= :Tabularize /=<CR>
vmap <leader>t= :Tabularize /=<CR>
nmap <leader>t\| :Tab /\|<CR>
vmap <leader>t\| :Tab /\|<CR>
nmap <leader>t: :Tab /:\zs<CR>
vmap <leader>t: :Tab /:\zs<CR>
endif
" }
" NerdTree { " NerdTree {
if isdirectory(expand(plugin_dir . "/nerdtree")) if isdirectory(expand(plugin_dir . "/nerdtree"))
let g:NERDShutUp=1 let g:NERDShutUp=1
@@ -368,11 +383,12 @@ endif
highlight CocInfoSign ctermbg=none highlight CocInfoSign ctermbg=none
highlight CocHintSign ctermbg=none highlight CocHintSign ctermbg=none
if g:theme_color == 'dark' if g:theme_color == 'dark'
highlight! link CocFloating PmenuThumb highlight! link TempColor Visual
highlight! link CocErrorFloat PmenuThumb highlight! link CocFloating TempColor
highlight! link CocWarningFloat PmenuThumb highlight! link CocErrorFloat TempColor
highlight! link CocInfoFloat PmenuThumb highlight! link CocWarningFloat TempColor
highlight! link CocHintFloat PmenuThumb highlight! link CocInfoFloat TempColor
highlight! link CocHintFloat TempColor
endif endif
endif endif
endfunction endfunction
@@ -560,3 +576,8 @@ endif
nnoremap <C-w>% :vsplit<CR> nnoremap <C-w>% :vsplit<CR>
nnoremap <C-w>" :split<CR> nnoremap <C-w>" :split<CR>
" } " }
"
" Useful_Info{
" show mapping info
" :verbose map ,cf
" }