mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
NVIM Configuration Enhancements
- VIM: Keybindings for better coding - Gitignore in common is now a hardlinked to the root one - NVIM: Bash Alias added for Nvim - VIM: settings added from VIM-sensible and Primeagen - NVIM: Moved autocommands, keybindings & configurations specific to NVIM to lua/config - Wezterm, tmux configured. - Generic: Configurations moved inside $HOME/.config/ directory - Generic: All aliases renamed to similar names. - Generic: Relevant aliases added for reaching git root
This commit is contained in:
@@ -13,6 +13,14 @@ 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
|
||||
@@ -24,6 +32,14 @@ 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
|
||||
@@ -31,10 +47,7 @@ map <C-h> <C-w>h
|
||||
map <C-l> <C-w>l
|
||||
|
||||
" Clear searches
|
||||
nnoremap <Leader>/ :call clearmatches()<CR>:noh<CR>
|
||||
|
||||
" Make space-bar the leader-key
|
||||
let mapleader = " "
|
||||
nnoremap <leader>/ :call clearmatches()<CR>:noh<CR>
|
||||
|
||||
" Changes the pwd to the opened file's directory
|
||||
nnoremap <leader>cd :lcd %:h<CR>
|
||||
@@ -44,7 +57,10 @@ map <leader>j <Plug>(easymotion-s)
|
||||
|
||||
" Map nerdtree to <Leader>e
|
||||
" Changes the pwd and opens the VCS root
|
||||
nnoremap <leader>e :lcd %:h<CR> :NERDTreeToggleVCS<CR>
|
||||
nnoremap <leader>e :tcd %:h<CR> :NERDTreeToggleVCS<CR>
|
||||
let g:NERDTreeShowHidden = 1
|
||||
let g:NERDTreeWinSize = 20
|
||||
let g:NERDTreeWinSize = 25
|
||||
|
||||
" <ctrl-q> to save everything and quit Neovim
|
||||
nnoremap <C-q> :wqa<CR>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user