nvim/maps.vim
2022-04-22 15:30:12 +08:00

65 lines
1.1 KiB
VimL

" window
"-------------------------------------------------------------------------------
" Split window
nmap ss :split<Return><C-w>w
nmap sv :vsplit<Return><C-w>w
" Move window
"nmap <Space> <C-w>w
"map s<left> <C-w>h
"map s<up> <C-w>k
"map s<down> <C-w>j
"map s<right> <C-w>l
map sh <C-w>h
map sk <C-w>k
map sj <C-w>j
map sl <C-w>l
" Resize window
nmap <leader><up> <C-w>+
nmap <leader><down> <C-w>-
nmap <leader><left> <C-w><
nmap <leader><right> <C-w>>
" 插入模式移动光标
inoremap <leader>h <Left>
inoremap <leader>j <Down>
inoremap <leader>k <Up>
inoremap <leader>l <Right>
inoremap <leader>d <Delete>
nnoremap L $
nnoremap H ^
" 退出
" nmap <leader>w :wq<CR>
" nmap <leader>q :wqa<CR>
nmap q :bdelete<CR>
nmap Q :q!<CR>
" 重新加载设置
map R :source $MYVIMRC<CR>
" 全选
nmap <C-a> gg<S-v>G
" 切换页面
" nmap <S-Tab> :bprev<Return>
" nmap <Tab> :bnext<Return>
nmap <S-Tab> :BufferLineCyclePrev<CR>
nmap <Tab> :BufferLineCycleNext<CR>
nnoremap <F2> :NvimTreeToggle<CR>
" telescope
nnoremap sf <cmd>Telescope find_files<cr>
nnoremap sw <cmd>Telescope live_grep<cr>