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:
Pratik Tripathy
2023-12-28 14:38:03 +05:30
parent 14bca30695
commit 0402ee5481
35 changed files with 679 additions and 297 deletions

View File

@@ -2,39 +2,62 @@
filetype plugin indent on
set omnifunc=syntaxcomplete#Complete
set complete+=kspell
set complete-=i
set completeopt="menuone,noselect"
" Make sure tabs are 4 character wide
set shiftwidth=4 tabstop=4 softtabstop=4 expandtab
set autoindent smartindent
set shiftwidth=4 tabstop=4 softtabstop=4 expandtab smarttab
set autoindent smartindent breakindent
syntax on " syntax highlighting.
syntax enable
set cursorline " Hightlight cursor line
set showmatch " Highlight matching braces
set ls=2 " Show a status line
set wrap " Wrap text
set wildmenu " Makes the ex command mode autocomplete paths with Tab
set number " Show line numbers
set ruler
set relativenumber " Relative line numbers
set shortmess+=I " Disable the default Vim startup message.
set noerrorbells visualbell t_vb= " Disable audible bell because it's annoying.
set mouse+=a " Enable mouse support
set encoding=utf-8 " Encoding
set autoread
set nrformats-=octal
set formatoptions+=j
set display+=lastline
set display+=truncate
set history=1000
set tabpagemax=50
set viminfo^=!
set sessionoptions-=options
set viewoptions-=options
set nolangremap
set list
set signcolumn=yes
set scrolloff=5
set isfname+={,},@-@
set updatetime=50
" Enable undofile and save them in ~/.vim/undo
set undofile " Enable undofiles
set undodir=$HOME/.vim/undo// " Save in each project's root
set directory^=$HOME/.vim/swap// " All swap files at the one place please
" Vim, by default, won't let you jump to a different file without saving the
" current one. With the below, unsaved files are just hidden.
set hidden
" Enable searching as you type, rather than waiting till you press enter.
" Highlight search pattern
" Intelligently handle cases in search
" Enable searching as you type, rather than waiting till you press enter. Highlight search pattern. Intelligently handle cases in search.
set incsearch hlsearch ignorecase smartcase
" Comments in Grey color and italic
hi Comment guifg=#5C6370 ctermfg=50 cterm=italic
" Highlight and remove trailing blank spaces on save
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
highlight ExtraWhitespace ctermbg=red guibg=red
autocmd BufWritePre * %s/\s\+$//e
" Vim is based on Vi. Setting `nocompatible` switches from the default
@@ -49,8 +72,7 @@ set nocompatible
" Normally, backspace works only if you have made an edit. This fixes that.
set backspace=indent,eol,start
" Sync vim clipboard with system clipboard
" Works across Linux, MacOS & Windows
" Sync vim clipboard with system clipboard. Works across Linux, MacOS & Windows.
if has("mac")
set clipboard+=unnamed
else
@@ -62,5 +84,6 @@ if !has('gui_running')
set t_Co=256
set termguicolors
hi LineNr ctermbg=NONE guibg=NONE
set termguicolors
endif

View File

@@ -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>

View File

@@ -1,10 +1,3 @@
""""""""""""""""""""""""""""""""
"
" Plugins
"
"""""""""""""""""""""""""""""""""
" This being the 1st line in the config file,
" makes it possible to configure plugins any place in the file.
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-fugitive' "Fugitive Vim GitHub Wrapper
Plug 'tpope/vim-surround' "Surround Plugin
@@ -18,6 +11,8 @@ call plug#begin('~/.vim/plugged')
Plug 'junegunn/rainbow_parentheses.vim' "Rainbow parenthesis
Plug 'easymotion/vim-easymotion' "Easy Motion to quickly jump across the buffer
Plug 'preservim/nerdtree' "Nerd Tree
Plug 'tpope/vim-obsession' "Obsessions -> saves sessions
Plug 'christoomey/vim-tmux-navigator' "Syncs with Tmux pane navigation keymaps
"------------Style Plugins------------"
" Status Styles
Plug 'itchyny/lightline.vim'

View File

@@ -1,9 +0,0 @@
Bhubaneswar
Kolkata
Holi
Rakhi
Subrat
Ghosh
Tussar
Patra
Ctrl

Binary file not shown.

View File

@@ -15,22 +15,15 @@ let g:session_dir="$VIMDIR/session"
""""""""""""""""""""""""""""""""
"
" LOOKS
" THEME
"
""""""""""""""""""""""""""""""""
let g:lightline = { 'colorscheme': 'deepspace' }
colorscheme deep-space
" Set color
if !has('gui_running')
set t_Co=256
set termguicolors
hi LineNr ctermbg=NONE guibg=NONE
endif
""""""""""""""""""""""""""""""""
"
" Quality of life improvements
" VIM SPECIFIC CONFIG
"
""""""""""""""""""""""""""""""""