NeoVim & VIM

- Testing setup through neotest plugin
- Spellcheck enabled on markdown and text files
- Diagnosis summary through trouble plugin
- Code completion keybindings improved
- Auto-formatting through conform plugin
- Reactjs context aware commenting through nvim-ts-context-commentstring
- Auto HTML tag completion through nvim-ts-autotag
- CSS color highlight through nvim-highlight-colors
- Lualine: breadcrumbs, git status, single line
- Auto restore neovim sessions
- Better keyboard maps

Shell
- Aliases now load from .bashrc or .zshrc
- Bash & zsh shortcuts to easy open and create projects
- zoxide instead of cd when installed
- bootstrap.sh shellhardened
This commit is contained in:
Pratik Tripathy
2024-02-06 23:24:27 +05:30
parent 6b2d076cdc
commit b0efae3730
36 changed files with 1159 additions and 415 deletions

View File

@@ -0,0 +1,7 @@
" Enable spell check for markdown, gitcommit & text files
augroup spell_check_text_files
autocmd!
autocmd FileType markdown setlocal spell
autocmd FileType gitcommit setlocal spell
autocmd FileType text setlocal spell
augroup END

View File

@@ -23,7 +23,7 @@ set viewoptions-=options
set nolangremap " Do not use non-English keyboards to define keymaps
set list " Show tabs as >, trailing spaces as -, non-breakable space as +
set signcolumn=yes " Always show the signs column (before line number column)
set scrolloff=5 " Cursor always at middle of the screen
set scrolloff=10 " Cursor always at middle of the screen
set updatetime=249 " No typing for this millisec -> write to swap file
set timeoutlen=500 " Multiple keys in keymaps must be pressed in these millisecs
set noswapfile " Turn off swapfiles
@@ -64,11 +64,7 @@ autocmd BufWritePre * %s/\s\+$//e
set backspace=indent,eol,start
" Sync vim clipboard with system clipboard. Works across Linux, MacOS & Windows.
if has("mac")
set clipboard+=unnamed
else
set clipboard^=unnamed,unnamedplus
endif
set clipboard^=unnamed
" Set color
if !has('gui_running')

View File

@@ -62,6 +62,10 @@ map <C-l> <C-w>l
nnoremap <Tab> :bnext<CR>
nnoremap <S-Tab> :bprevious<CR>
" Navigate Quickfixs
nnoremap [q cprev
nnoremap ]q cnext
" Resize window using <ctrl> arrow keys
nnoremap <C-Up> :resize +2<CR>
nnoremap <C-Down> :resize -2<CR>
@@ -83,16 +87,29 @@ nnoremap <C-s> :wa<CR>
vnoremap <C-s> :wa<CR>
" Move cursor in insert mode
inoremap <M-b> <ESC>^i
inoremap <M-a> <ESC>^i
inoremap <M-e> <END>
inoremap <M-h> <Left>
inoremap <M-l> <Right>
inoremap <M-j> <Down>
inoremap <M-k> <Up>
" Ctrl+Backspace to add an undo-point and delete last word
imap <C-BS> <C-W><C-g>u
" Insert mode: add undo points on "," & "." & ";"
imap , ,<C-g>u
imap . .<C-g>u
imap ; ;<C-g>u
" Copy entire content of the current buffer
nnoremap <C-c> :%y+<CR>
" Copy to system clipboard
nnoremap <leader>y "+y
vnoremap <leader>y "+y
" To paste from system clipboard "+p
" Clear search, diff update and redraw
nnoremap <leader>/ :nohlsearch<CR>:diffupdate<CR>:normal! <C-L><CR>
@@ -104,4 +121,3 @@ nnoremap <leader>j <Plug>(easymotion-s)
" Show the undo tree
nnoremap <leader>u :UndotreeToggle<CR>

View File

@@ -10,6 +10,9 @@ source $VIMDIR/configs.vim
" Load Keybindings
source $VIMDIR/key_maps.vim
" Load Autocommand
source $VIMDIR/autocommands.vim
" Save session files to $HOME/.vim/session directory
let g:session_dir="$VIMDIR/session"