updated vimrc

This commit is contained in:
wt committed 2026-03-11 14:39:54 +07:00
1 parent 61dd3cfcec
commit 45ca49ccb1
1 file changed
+41 -24
+41 -24
View File
@@ -9,12 +9,11 @@ set foldcolumn=2
set mouse=a set mouse=a
set encoding=utf8 set encoding=utf8
set guifont=JetBrains\ Mono\ Nerd\ Font\ 11 set guifont=JetBrains\ Mono\ Nerd\ Font\ 11
"-------- colorcolumn ------------------ "colorcolumn
set colorcolumn=110 set colorcolumn=110
highlight ColorColumn ctermbg=darkgray highlight ColorColumn ctermbg=darkgray
"---------------------------------------
"-------------------- plugins ------------------------ "plugins
call plug#begin() call plug#begin()
Plug 'preservim/nerdtree' Plug 'preservim/nerdtree'
Plug 'ryanoasis/vim-devicons' Plug 'ryanoasis/vim-devicons'
@@ -27,45 +26,63 @@ call plug#begin()
Plug 'pangloss/vim-javascript' Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx' Plug 'mxw/vim-jsx'
Plug 'theRealCarneiro/hyprland-vim-syntax' Plug 'theRealCarneiro/hyprland-vim-syntax'
Plug 'junegunn/fzf.vim'
call plug#end() call plug#end()
"-----------------------------------------------------
"--------- keybinds ------------------------- "keybinds
nnoremap <C-n> :NERDTreeToggle<CR>
inoremap <C-n> :NERDTreeToggle<CR>
nnoremap <C-a> :NERDTreeFocus<CR> nnoremap <C-a> :NERDTreeFocus<CR>
inoremap <C-a> <Esc>:NERDTreeFocus<CR> inoremap <C-a> <Esc>:NERDTreeFocus<CR>
nnoremap <Space>e :NERDTreeFocus<CR>
inoremap <Space>e :NERDTreeFocus<CR>
nnoremap <C-e> :NERDTree<CR> nnoremap <C-e> :NERDTree<CR>
nnoremap <C-z> :NERDTreeToggle<CR> nnoremap <C-z> :NERDTreeToggle<CR>
inoremap <C-z> :NERDTreeToggle<CR> inoremap <C-z> :NERDTreeToggle<CR>
nnoremap <C-g> :NERDTreeRefresh<CR> nnoremap <C-g> :NERDTreeRefresh<CR>
inoremap <C-g> <Esc>:NERDTreeRefresh<CR> inoremap <C-g> <Esc>:NERDTreeRefresh<CR>
"------------ tabs ----------------------- "tabs
nnoremap <C-p> :tabprevious<CR> nnoremap <Space>[ :tabprevious<CR>
nnoremap <C-n> :tabnext<CR> inoremap <Space>[ <Esc>:tabprevious<CR>
nnoremap <C-t> :tabnew<CR> nnoremap <Space>] :tabnext<CR>
inoremap <C-p> <Esc>:tabprevious<CR>i inoremap <Space>] <Esc>:tabnext<CR>i
inoremap <C-n> <Esc>:tabnext<CR>i nnoremap <Space>t :tabnew<CR>
inoremap <C-t> <Esc>:tabnew<CR> inoremap <Space>t <Esc>:tabnew<CR>
nnoremap <C-d> :tabclose<CR> nnoremap <Space>w :tabclose<CR>
inoremap <C-d> <Esc>:tabclose<CR> inoremap <Space>w <Esc>:tabclose<CR>
"----------------------------------------- "term
"----------------- term --------
nnoremap <C-x> :term<CR> nnoremap <C-x> :term<CR>
inoremap <C-x> <Esc>:term<CR> inoremap <C-x> <Esc>:term<CR>
"------------------------------- "Open terminal bottom with 15split size
"------------- gitlens ----------------------- function! OpenTerminalBelow()
belowright term
resize 15 term
endfunc
nnoremap <Space>h :call OpenTerminalBelow()<CR>
inoremap <Space>h <Esc>:call OpenTerminalBelow()<CR>
nnoremap <Space>l :resize +5<CR>
inoremap <Space>l <Esc>:resize +5<CR>
nnoremap <Space>k :resize -5<CR>
inoremap <Space>k <Esc>:resize -5<CR>
"gitlens
nnoremap <C-l> :call ToggleGitLens()<CR> nnoremap <C-l> :call ToggleGitLens()<CR>
inoremap <C-l> <Esc>:call ToggleGitLens()<CR> inoremap <C-l> <Esc>:call ToggleGitLens()<CR>
"--------------------------------------------- "save file
nnoremap <C-s> :w<CR> nnoremap <C-s> :w<CR>
inoremap <C-s> <Esc>:w<CR> inoremap <C-s> <Esc>:w<CR>
"quit
nnoremap <C-q> :q<CR> nnoremap <C-q> :q<CR>
inoremap <C-q> <Esc>:q<CR> inoremap <C-q> <Esc>:q<CR>
"------------- vim-plug -------------- "vim-plug
nnoremap <C-i> :PlugInstall<CR> nnoremap <C-i> :PlugInstall<CR>
inoremap <C-i> <Esc>:PlugInstall<CR> inoremap <C-i> <Esc>:PlugInstall<CR>
"------------------------------------- "update vim config
nnoremap <C-u> :so%<CR> nnoremap <C-u> :so%<CR>
inoremap <C-u> <Esc>:so%<CR> inoremap <C-u> <Esc>:so%<CR>
"-------------------------------------------- "fzf
"-------------------------------------------- nnoremap <Space>f :Files<CR>
inoremap <Space>f <Esc>:Files<CR>
nnoremap <Space>g :Rg<CR>
inoremap <Space>g <Esc>:Rg<CR>
nnoremap <Space>r :vimgrep // **/*<Left><Left><Left><Left><Left><Left><Left>