diff --git a/common/.config/nvim/autoload b/common/.config/nvim/autoload new file mode 120000 index 0000000..568e63f --- /dev/null +++ b/common/.config/nvim/autoload @@ -0,0 +1 @@ +../../.vim/autoload \ No newline at end of file diff --git a/common/.config/nvim/init.vim b/common/.config/nvim/init.vim new file mode 100644 index 0000000..6a4b1fd --- /dev/null +++ b/common/.config/nvim/init.vim @@ -0,0 +1,28 @@ +"""""""""""""""""""""""""""""""""""""" +" +" Get source common configs from VIM +" +"""""""""""""""""""""""""""""""""""""" +let $VIMDIR="$HOME/.vim" +let $NVIMDIR="$HOME/.config/nvim" + +" Load plugins +source $VIMDIR/plugins.vim + +" Load VIM Configurations +source $VIMDIR/configs.vim + +" Load Keybindings from VIM +source $VIMDIR/key_maps.vim + +" Save session files to $HOME/.vim/session directory +let g:session_dir="$VIMDIR/session" + +"""""""""""""""""""""""""""""""" +" +" LOOKS +" +"""""""""""""""""""""""""""""""" +let g:lightline = { 'colorscheme': 'deepspace' } +colorscheme deep-space + diff --git a/common/.config/nvim/spell b/common/.config/nvim/spell new file mode 120000 index 0000000..6ee6c95 --- /dev/null +++ b/common/.config/nvim/spell @@ -0,0 +1 @@ +../../.vim/spell \ No newline at end of file diff --git a/common/.config/nvim/spell/en.utf-8.add b/common/.config/nvim/spell/en.utf-8.add deleted file mode 100644 index 5ce9286..0000000 --- a/common/.config/nvim/spell/en.utf-8.add +++ /dev/null @@ -1,3 +0,0 @@ -#trl -Ctrl -youtube diff --git a/common/.config/nvim/spell/en.utf-8.add.spl b/common/.config/nvim/spell/en.utf-8.add.spl deleted file mode 100644 index a027687..0000000 Binary files a/common/.config/nvim/spell/en.utf-8.add.spl and /dev/null differ diff --git a/common/.gitignore b/common/.gitignore index 75f039c..04cf3b4 100644 --- a/common/.gitignore +++ b/common/.gitignore @@ -47,6 +47,9 @@ Temporary Items *.dylib # ---- IDE ---- +# Vim Artifacts +*.swp + # VS Code Artifacts .vscode **state.vscdb @@ -96,3 +99,4 @@ lerna-debug.log* **/contents/images **/contents/fonts *kpluginindex.json + diff --git a/common/.vim/configs.vim b/common/.vim/configs.vim new file mode 100644 index 0000000..462817d --- /dev/null +++ b/common/.vim/configs.vim @@ -0,0 +1,65 @@ +" Better autocompletes +filetype plugin indent on +set omnifunc=syntaxcomplete#Complete +set complete+=kspell + +" Make sure tabs are 4 character wide +set shiftwidth=4 tabstop=4 softtabstop=4 expandtab +set autoindent smartindent + +syntax on " syntax highlighting. +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 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 + +" 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 +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\+$/ +autocmd BufWritePre * %s/\s\+$//e + +" Vim is based on Vi. Setting `nocompatible` switches from the default +" Vi-compatibility mode and enables useful Vim functionality. This +" configuration option turns out not to be necessary for the file named +" '~/.vimrc', because Vim automatically enters nocompatible mode if that file +" is present. But we're including it here just in case this config file is +" loaded some other way (e.g. saved as `foo`, and then Vim started with +" `vim -u foo`). +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 +if has("mac") + set clipboard+=unnamed +else + set clipboard^=unnamed,unnamedplus +endif + +" Set color +if !has('gui_running') + set t_Co=256 + set termguicolors + hi LineNr ctermbg=NONE guibg=NONE +endif + diff --git a/common/.vim/key_maps.vim b/common/.vim/key_maps.vim new file mode 100644 index 0000000..7d54ba3 --- /dev/null +++ b/common/.vim/key_maps.vim @@ -0,0 +1,50 @@ +" Disable left, right, up and down keys +" In normal mode... +nnoremap :echoe "Use h" +nnoremap :echoe "Use l" +nnoremap :echoe "Use k" +nnoremap :echoe "Use j" +" ...and in insert mode +inoremap :echoe "Use h" +inoremap :echoe "Use l" +inoremap :echoe "Use k" +inoremap :echoe "Use j" + +" Unbind some useless/annoying default key bindings. +nmap Q + +" Center the cursor when moving through document +nnoremap zz +nnoremap zz +nnoremap g; g;zz +nnoremap g, g,zz +nnoremap zz +nnoremap zz +nnoremap ]s ]szz +nnoremap n nzzzv +nnoremap N Nzzzv + +" Better window/split navigation +map j +map k +map h +map l + +" Clear searches +nnoremap / :call clearmatches():noh + +" Make space-bar the leader-key +let mapleader = " " + +" Map easymotion Plugin to j +map j (easymotion-s) + +" Map nerdtree to e +" Changes the pwd and opens the VCS root +nnoremap e :lcd %:h :NERDTreeToggleVCS +let g:NERDTreeShowHidden = 1 +let g:NERDTreeWinSize = 20 + +" Changes the pwd to the opened file's directory +nnoremap cd :lcd %:h + diff --git a/common/.vim/plugins.vim b/common/.vim/plugins.vim new file mode 100644 index 0000000..d31fb74 --- /dev/null +++ b/common/.vim/plugins.vim @@ -0,0 +1,28 @@ +"""""""""""""""""""""""""""""""" +" +" 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 + Plug 'tpope/vim-repeat' "Repeat for the surround plugin + Plug 'tpope/vim-commentary' "Comments Plugin + Plug 'tpope/vim-sensible' "Sensible options + Plug 'rstacruz/vim-closer' "Auto-close brackets + Plug 'machakann/vim-highlightedyank' "Highlight Yank + Plug 'dbakker/vim-paragraph-motion' "Paragraph Motion + Plug 'airblade/vim-gitgutter' "Git in the left-side gutter + Plug 'junegunn/rainbow_parentheses.vim' "Rainbow parenthesis + Plug 'easymotion/vim-easymotion' "Easy Motion to quickly jump across the buffer + Plug 'preservim/nerdtree' "Nerd Tree + "------------Style Plugins------------" + " Status Styles + Plug 'itchyny/lightline.vim' + Plug 'challenger-deep-theme/vim', { 'as': 'challenger-deep' } "ColorScheme - Challenger-deep + Plug 'cocopon/iceberg.vim' "Color Scheme - Iceberg + Plug 'tyrannicaltoucan/vim-deep-space' "Color Scheme - Deep-space +call plug#end() + diff --git a/common/.vim/spell/en.utf-8.add b/common/.vim/spell/en.utf-8.add new file mode 100644 index 0000000..7c012d9 --- /dev/null +++ b/common/.vim/spell/en.utf-8.add @@ -0,0 +1,9 @@ +Bhubaneswar +Kolkata +Holi +Rakhi +Subrat +Ghosh +Tussar +Patra +Ctrl \ No newline at end of file diff --git a/common/.vim/spell/en.utf-8.add.spl b/common/.vim/spell/en.utf-8.add.spl new file mode 100644 index 0000000..42e77d3 Binary files /dev/null and b/common/.vim/spell/en.utf-8.add.spl differ diff --git a/common/.vim/vimrc b/common/.vim/vimrc index ff17984..c81c056 100644 --- a/common/.vim/vimrc +++ b/common/.vim/vimrc @@ -1,34 +1,24 @@ -" Load the 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 - Plug 'tpope/vim-repeat' "Repeat for the surround plugin - Plug 'tpope/vim-commentary' "Surround Plugin - Plug 'tpope/vim-sensible' "Sensible options - Plug 'rstacruz/vim-closer' "Auto-close brackets - Plug 'machakann/vim-highlightedyank' "Highlight Yank - Plug 'dbakker/vim-paragraph-motion' "Paragraph Motion - Plug 'airblade/vim-gitgutter' "Git in the left-side gutter - 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 'kshenoy/vim-signature' "Show gutter icons for Vim marks - " Plug 'unblevable/quick-scope' "Quick Scope - " Plug 'bronson/vim-trailing-whitespace' "Highlight trailing spaces, remove them all with :FixWhitespace - "------------Style Plugins------------" - " Status Styles - Plug 'itchyny/lightline.vim' - Plug 'challenger-deep-theme/vim', { 'as': 'challenger-deep' } "ColorScheme - Challenger-deep - Plug 'cocopon/iceberg.vim' "Color Scheme - Iceberg - Plug 'whatyouhide/vim-gotham' "Color Scheme - Gotham - Plug 'tyrannicaltoucan/vim-deep-space' "Color Scheme - Deep-space -call plug#end() +let $VIMDIR="$HOME/.vim" +let $VIMRC="$VIMDIR/vimrc" -" ------- Look and Feel ---------------- -" let g:lightline = { 'colorscheme': 'gotham'} -let g:lightline = { 'colorscheme': 'deepspace'} +" Load plugins +source $VIMDIR/plugins.vim + +" Load VIM Configurations +source $VIMDIR/configs.vim + +" Load Keybindings +source $VIMDIR/key_maps.vim + +" Save session files to $HOME/.vim/session directory +let g:session_dir="$VIMDIR/session" + +"""""""""""""""""""""""""""""""" +" +" LOOKS +" +"""""""""""""""""""""""""""""""" +let g:lightline = { 'colorscheme': 'deepspace' } colorscheme deep-space " Set color @@ -38,135 +28,12 @@ if !has('gui_running') hi LineNr ctermbg=NONE guibg=NONE endif -" ------- Making Vim an IDE ---------------- -" Better autocompletes -filetype plugin indent on -set omnifunc=syntaxcomplete#Complete -set complete+=kspell +"""""""""""""""""""""""""""""""" +" +" Quality of life improvements +" +"""""""""""""""""""""""""""""""" -" 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\+$/ -autocmd BufWritePre * %s/\s\+$//e - -" Turn on syntax highlighting. -syntax on - -" Highlight matching pairs of [] {} () -set showmatch - -" Make sure tabs are 4 character wide -set shiftwidth=4 -set tabstop=4 -set softtabstop=4 -set expandtab -set autoindent -set smartindent - -" ------- Vim Related ---------------- " Auto reload .vimrc -autocmd! bufwritepost ~/.vim/.vimrc source % +autocmd! bufwritepost $VIMRC source % -" Show line numbers -set number - -" Relative line numbers -set relativenumber - -" Wrap text -set wrap - -" Status bar -" set laststatus=2 -" set noshowmode - -" Encoding -set encoding=utf-8 - -" Unbind some useless/annoying default key bindings. -nmap Q " 'Q' in normal mode enters Ex mode. You almost never want this. - -" Vim is based on Vi. Setting `nocompatible` switches from the default -" Vi-compatibility mode and enables useful Vim functionality. This -" configuration option turns out not to be necessary for the file named -" '~/.vimrc', because Vim automatically enters nocompatible mode if that file -" is present. But we're including it here just in case this config file is -" loaded some other way (e.g. saved as `foo`, and then Vim started with -" `vim -u foo`). -set nocompatible - -" Disable the default Vim startup message. -set shortmess+=I - -" Normally, backspace works only if you have made an edit. This fixes that. -set backspace=indent,eol,start - -" A line to specify 80 column limit -" setlocal colorcolumn=80 - -" 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 - -" This setting makes search case-insensitive when all characters in the string -" being searched are lowercase. However, the search becomes case-sensitive if -" it contains any capital letters. This makes searching more convenient. -set ignorecase -set smartcase - -" Enable searching as you type, rather than waiting till you press enter. -set incsearch - -" Highlight search pattern -set hlsearch - -" Disable audible bell because it's annoying. -set noerrorbells visualbell t_vb= - -" Enable mouse support. You should avoid relying on this too much, but it can -" sometimes be convenient. -set mouse+=a - -" No header spam in netrw -let g:netrw_banner=0 - -" Display directory in tree style in netrw -let g:netrw_liststyle=3 - -" Sync vim clipboard with system clipboard -" Works across Linux, MacOS & Windows -set clipboard^=unnamed,unnamedplus - -" ------- Remap Keybindings ---------------- -" Disable left, right, up and down keys -" In normal mode... -nnoremap :echoe "Use h" -nnoremap :echoe "Use l" -nnoremap :echoe "Use k" -nnoremap :echoe "Use j" -" ...and in insert mode -inoremap :echoe "Use h" -inoremap :echoe "Use l" -inoremap :echoe "Use k" -inoremap :echoe "Use j" - -" Center the cursor when moving through file -nnoremap zz -nnoremap zz -nnoremap g; g;zz -nnoremap g, g,zz -nnoremap zz -nnoremap zz -nnoremap ]s ]szz - -" Make space-bar the leader-key -let mapleader = " " - -" Map easymotion Plugin to j -map j (easymotion-s) - -" Map nerdtree to e -map e :NERDTreeToggle