Files
dotfiles/common/.vim/key_maps.vim
Pratik Tripathy f780d7f6bd # Tmux Config
- Added Catppuccin theme
- Added kitty terminal config

# Sync and Rectify Vim & NVIM

- Undo files are incompatible between VIM & NVIM - saved those files separately
- Keybinding for saving and quitting moved to VIM config
- VIM & NVIM swapfiles removed
- More VIM options set to enhance usability
- Synced system vim config and keybindings with ideavimrc

# Shell Script File Changes

- Reverted to using `#!/bin/sh` as bash is slow and not POSIX compliant.
- Reformatted
2024-01-02 23:56:13 +05:30

68 lines
1.6 KiB
VimL

" Disable left, right, up and down keys
" In normal mode...
nnoremap <Left> :echoe "Use h"<CR>
nnoremap <Right> :echoe "Use l"<CR>
nnoremap <Up> :echoe "Use k"<CR>
nnoremap <Down> :echoe "Use j"<CR>
" ...and in insert mode
inoremap <Left> <ESC>:echoe "Use h"<CR>
inoremap <Right> <ESC>:echoe "Use l"<CR>
inoremap <Up> <ESC>:echoe "Use k"<CR>
inoremap <Down> <ESC>:echoe "Use j"<CR>
" Unbind some useless/annoying default key bindings.
nmap Q <Nop>
" Don't do anything on pressing space itself
nnoremap <Space> <Nop>
vnoremap <Space> <Nop>
" Make space-bar the leader-key
let mapleader = " "
let maplocalleader = " "
" Center the cursor when moving through document
nnoremap <C-d> <C-d>zz
nnoremap <C-u> <C-u>zz
nnoremap g; g;zz
nnoremap g, g,zz
nnoremap <C-o> <C-o>zz
nnoremap <C-i> <C-i>zz
nnoremap ]s ]szz
nnoremap n nzzzv
nnoremap N Nzzzv
" Move visually selected lines around with J & K
vnoremap J :m '>+1<CR>gv=gv
vnoremap K :m '<-2<CR>gv=gv
" Keeps the cursor at the same place when doing J
" And not move to end of the line
nnoremap J mzJ`z:delmarks z<CR>
" Better window/split navigation
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-h> <C-w>h
map <C-l> <C-w>l
" Clear searches
nnoremap <leader>/ :call clearmatches()<CR>:noh<CR>
" Changes the pwd to the opened file's directory
nnoremap <leader>cd :lcd %:h<CR>
" Map easymotion Plugin to <Leader>j
map <leader>j <Plug>(easymotion-s)
" Map nerdtree to <Leader>e
" Changes the pwd and opens the VCS root
nnoremap <leader>e :tcd %:h<CR> :NERDTreeToggleVCS<CR>
" <ctrl-q> to save everything and quit Neovim
nnoremap <C-q> :wqa<CR>
vnoremap <C-q> :wqa<CR>
nnoremap <C-s> :wa<CR>
vnoremap <C-s> :wa<CR>