1
0
Fork 0
numbers/nvim/plugin/mappings/normal.vim

90 lines
2.4 KiB
VimL

" Ñ master race
nnoremap ñ ;
nnoremap Ñ ,
nnoremap <silent> {q :cprev<CR>
nnoremap <silent> }q :cnext<CR>
nnoremap <silent> {Q :cfirst<CR>
nnoremap <silent> }Q :clast<CR>
nnoremap <silent> {h :lprevious<CR>
nnoremap <silent> }l :lnext<CR>
nnoremap <silent> }o :call append(line('.'), '')<CR>
nnoremap <silent> {o :call append(line('.')-1, '')<CR>
" Find
nnoremap <leader>F :find <C-R>=expand('%:h').'/*'<CR>
nnoremap <leader>S :sfind <C-R>=expand('%:h').'/*'<CR>
nnoremap <leader>V :vert sfind <C-R>=expand('%:h').'/*'<CR>
nnoremap <leader>T :tabfind <C-R>=expand('%:h').'/*'<CR>
" Rearrange Splits
nnoremap <silent> <S-Left> <C-W>H
nnoremap <silent> <S-Right> <C-W>L
nnoremap <silent> <S-Up> <C-W>K
nnoremap <silent> <S-Down> <C-W>J
" Resize splits
nnoremap <silent> <Left> :vertical resize -1<CR>
nnoremap <silent> <Right> :vertical resize +1<CR>
nnoremap <silent> <Up> :resize -1<CR>
nnoremap <silent> <Down> :resize +1<CR>
" Alt to switch between splits
nnoremap <M-j> <C-W><C-J>
nnoremap <M-k> <C-W><C-K>
nnoremap <M-l> <C-W><C-L>
nnoremap <M-h> <C-W><C-H>
" Make splits
nnoremap <silent> <leader>v :vnew<CR>
nnoremap <silent> <leader>h :new<CR><CR>
" Gotta Go Fast (save, buffers, quit, messages, indent, SOF, EOF)
nnoremap <silent> <leader>s :w!<CR>
nnoremap <silent> <leader>c :close<CR>
nnoremap <silent> <leader>q :q!<CR>
nnoremap <silent> <leader>Q :qa!<CR>
nnoremap <silent> <leader>m :messages<CR>
nnoremap <silent> <leader>= gg=G<CR>
nnoremap <silent> <leader>G gqap<CR>
nnoremap <Bar> gg
nnoremap ¿ G
" Centering
nnoremap n nzzzv
nnoremap N nzzzv
nnoremap J mzJ`z
" Shift lines up and down
nnoremap <silent> <C-j> :m .+1<cr>==
nnoremap <silent> <C-k> :m .-2<cr>==
" j = gj :: k = gk while preserving numbered jumps ie. 12j or 30k
nnoremap <buffer><silent><expr>j v:count ? (v:count > 5 ? "m'" . v:count : '') . 'j' : 'gj'
nnoremap <buffer><silent><expr>k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk'
" Line movements
nnoremap <silent> <Home> g<Home>
nnoremap <silent> <End> g<End>
nnoremap <leader>y y$
nnoremap Y yg_
" Tab movement
nnoremap <silent> tn :tabnew<cr>
nnoremap <silent> th :tabfirst<cr>
nnoremap <silent> tl :tablast<cr>
nnoremap <silent> tx :tabclose<cr>
" Replace words
nnoremap cn *``cgn
nnoremap cN *``cgN
" What about the Q
nnoremap Q <nop>
map q <nop>
" Paths
cnoremap <C-P> <C-R>=expand("%:p:h") . "/" <CR>
" Run the last command
nnoremap <leader>C :<up>