Files
dotfiles/vimrc
T
2026-03-11 14:39:54 +07:00

89 lines
2.3 KiB
VimL

set number
syntax on
set expandtab
set smarttab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set foldcolumn=2
set mouse=a
set encoding=utf8
set guifont=JetBrains\ Mono\ Nerd\ Font\ 11
"colorcolumn
set colorcolumn=110
highlight ColorColumn ctermbg=darkgray
"plugins
call plug#begin()
Plug 'preservim/nerdtree'
Plug 'ryanoasis/vim-devicons'
Plug 'ap/vim-css-color'
Plug 'leshill/vim-json'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'othree/html5-syntax.vim'
Plug 'ale-cci/aqua-vim'
Plug 'Eliot00/git-lens.vim'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'theRealCarneiro/hyprland-vim-syntax'
Plug 'junegunn/fzf.vim'
call plug#end()
"keybinds
nnoremap <C-n> :NERDTreeToggle<CR>
inoremap <C-n> :NERDTreeToggle<CR>
nnoremap <C-a> :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-z> :NERDTreeToggle<CR>
inoremap <C-z> :NERDTreeToggle<CR>
nnoremap <C-g> :NERDTreeRefresh<CR>
inoremap <C-g> <Esc>:NERDTreeRefresh<CR>
"tabs
nnoremap <Space>[ :tabprevious<CR>
inoremap <Space>[ <Esc>:tabprevious<CR>
nnoremap <Space>] :tabnext<CR>
inoremap <Space>] <Esc>:tabnext<CR>i
nnoremap <Space>t :tabnew<CR>
inoremap <Space>t <Esc>:tabnew<CR>
nnoremap <Space>w :tabclose<CR>
inoremap <Space>w <Esc>:tabclose<CR>
"term
nnoremap <C-x> :term<CR>
inoremap <C-x> <Esc>:term<CR>
"Open terminal bottom with 15split size
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>
inoremap <C-l> <Esc>:call ToggleGitLens()<CR>
"save file
nnoremap <C-s> :w<CR>
inoremap <C-s> <Esc>:w<CR>
"quit
nnoremap <C-q> :q<CR>
inoremap <C-q> <Esc>:q<CR>
"vim-plug
nnoremap <C-i> :PlugInstall<CR>
inoremap <C-i> <Esc>:PlugInstall<CR>
"update vim config
nnoremap <C-u> :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>