From c60d9ad1042688226498a7d9352d9a4f31900cbb Mon Sep 17 00:00:00 2001 From: Pallav Jha Date: Thu, 1 Jan 2026 21:07:19 +0530 Subject: [PATCH 1/2] Update .vimrc with new plugin configurations Refactor .vimrc to improve plugin management and settings. --- vim/.vimrc | 153 +++++++++++++++-------------------------------------- 1 file changed, 42 insertions(+), 111 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index 5afa18c..22d5525 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -1,10 +1,16 @@ -" To get the full path you can add this command -" https://unix.stackexchange.com/a/111560/176830 -set statusline+=%F +call plug#begin() + +" List your plugins here +Plug 'preservim/nerdtree' +Plug 'vim-airline/vim-airline' +Plug 'vim-airline/vim-airline-themes' +Plug 'junegunn/fzf.vim' + -execute pathogen#infect() +call plug#end() -" Uncomment the following line to start NERDTree on enter + +" Uncomment the following line to start NERDTree on enter " autocmd vimenter * NERDTree " Show hiddle files in NERDTree @@ -17,17 +23,27 @@ autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isT nmap :NERDTreeToggle nmap :NERDTreeFind -" Make Ctrl-W a NOP in insert mode -" https://stackoverflow.com/a/69020234/2422530 -inoremap -" For Mac only +" fzf.vim specific config +set rtp+=/opt/homebrew/opt/fzf " only for mac silicon +nnoremap :Files + +" To get the full path you can add this command +" https://unix.stackexchange.com/a/111560/176830 +set statusline+=%F set regexpengine=0 + " Colorscheme -colorscheme apprentice +set t_Co=256 +" set termguicolors syntax enable +" let g:solarized_termcolors=256 +" let g:solarized_termtrans = 1 set background=dark +" colorscheme apprentice +colorscheme retrobox + " Settings " Set it to show Line numbers @@ -44,8 +60,8 @@ set smartindent set noswapfile " Wrapping config -set textwidth=80 -set colorcolumn=+1 +" set textwidth=80 +" set colorcolumn=+1 " ****************** Starting the vim script copied from https://github.com/neoclide/coc.nvim#example-vim-configuration @@ -61,108 +77,14 @@ set hidden set nobackup set nowritebackup -" Give more space for displaying messages. -set cmdheight=2 - -" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable -" delays and poor user experience. -set updatetime=300 - -" Don't pass messages to |ins-completion-menu|. -set shortmess+=c - -" Always show the signcolumn, otherwise it would shift the text each time -" diagnostics appear/become resolved. -if has("patch-8.1.1564") - " Recently vim can merge signcolumn and number column into one - set signcolumn=number -else - set signcolumn=yes -endif +" vim-airlime-theme configuration +" let g:airline_theme='dark' -" ****************** Starting the vim script copied from https://github.com/kien/ctrlp.vim#basic-options - -let g:ctrlp_map = '' -let g:ctrlp_cmd = 'CtrlP' -let g:ctrlp_working_path_mode = 'ra' -" let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$' -let g:ctrlp_custom_ignore = '\v[\/](\.(git|hg|svn)|(node_modules))$' - -" ****************** Closing the vim script copied from https://github.com/kien/ctrlp.vim#basic-options " Enabling the mouse support set mouse=a -" Enable folding the functions -set foldmethod=syntax -let javaScript_fold=1 -set foldcolumn=0 -set foldlevel=5 -set foldlevelstart=8 -set foldclose=all - -" Enable copy directly to system clipboard -set clipboard=unnamedplus - -" Setting up the statusline configuration -source ~/.vim/statusline.vim - -" Autocompleting without any plugins -" Source -> https://www.youtube.com/watch?v=2f8h45YR494 -set complete+=kspell -set completeopt=menuone,longest -set shortmess+=c - -" -> Navigate the complete menu items like CTRL+n / CTRL+p would. -inoremap pumvisible() ? "" :"" -inoremap pumvisible() ? "" : "" - -" -> Select the complete menu item like CTRL+y would. -inoremap pumvisible() ? "" : "" -inoremap pumvisible() ? "" :"" - -" Settings for tabline.vim -" https://github.com/mkitt/tabline.vim -" Found here -> https://github.com/drmingdrmer/vim-tabbar -" Previously using https://superuser.com/a/1203482/686983 -hi TabLine ctermfg=Green ctermbg=Black cterm=NONE -hi TabLineFill ctermfg=Grey ctermbg=Black cterm=NONE -hi TabLineSel ctermfg=Green ctermbg=Black cterm=NONE - - - -" Configurations for vim-lsc https://github.com/natebosch/vim-lsc -let g:lsc_server_commands = {'go': 'gopls'} - -" Complete default mappings are: -let g:lsc_auto_map = { - \ 'GoToDefinition': 'gd', - \ 'GoToDefinitionSplit': [']', ''], - \ 'FindReferences': 'gr', - \ 'NextReference': 'g', - \ 'PreviousReference': 'g', - \ 'FindImplementations': 'gi', - \ 'FindCodeActions': 'ga', - \ 'Rename': 'gR', - \ 'ShowHover': v:true, - \ 'DocumentSymbol': 'go', - \ 'WorkspaceSymbol': 'gS', - \ 'SignatureHelp': 'gm', - \ 'Completion': 'completefunc', - \} - - -" Settings for Code format -" https://github.com/google/vim-codefmt#autoformatting -" https://stackoverflow.com/a/40275194/2422530 -" NOTE: will require installation of the required dependencies -autocmd FileType rust setlocal equalprg=rustfmt -autocmd FileType go setlocal equalprg=gofmt - -" https://stackoverflow.com/a/59719162/2422530 -" NOTE: Needs the installation -> npm -g install js-beautify -autocmd FileType javascript setlocal equalprg=js-beautify\ -s\ 2\ - " Setting the formatting for svelte to be same as html au! BufNewFile,BufRead *.svelte set ft=html @@ -176,7 +98,16 @@ au BufNewFile,BufRead *.py set tabstop=4 \ autoindent \ fileformat=unix -au BufNewFile,BufRead *.js,*.ts,*.html,*.svelte,*.css,*.scss set - \ tabstop=2 - \ softtabstop=2 +au BufNewFile,BufRead *.js,*.ts,*.html,*.svelte,*.css,*.scss set + \ tabstop=2 + \ softtabstop=2 \ shiftwidth=2 + +au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown + + +" augroup statusline +" autocmd! +" autocmd WinEnter,BufEnter * setlocal statusline=%!statusline#active() +" autocmd WinLeave,BufLeave * setlocal statusline=%!statusline#inactive() +" augroup end From 5171730ce389ff45bf2ceb18c4150dfacd21b6bc Mon Sep 17 00:00:00 2001 From: Pallav Jha Date: Thu, 1 Jan 2026 21:15:15 +0530 Subject: [PATCH 2/2] Update vimrc with NERDTree and fzf.vim configurations --- vim/.vimrc | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index 22d5525..03fe0b3 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -9,6 +9,7 @@ Plug 'junegunn/fzf.vim' call plug#end() +" ===== NERDTree Configurations ===== " Uncomment the following line to start NERDTree on enter " autocmd vimenter * NERDTree @@ -23,11 +24,16 @@ autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isT nmap :NERDTreeToggle nmap :NERDTreeFind +" ===== NERDTree Configurations ===== + +" ===== fzf.vim Configurations ===== -" fzf.vim specific config set rtp+=/opt/homebrew/opt/fzf " only for mac silicon nnoremap :Files +" ===== fzf.vim Configurations ===== + +" ===== Settings ===== " To get the full path you can add this command " https://unix.stackexchange.com/a/111560/176830 set statusline+=%F @@ -43,9 +49,6 @@ syntax enable set background=dark " colorscheme apprentice colorscheme retrobox - - -" Settings " Set it to show Line numbers se nu set incsearch @@ -63,10 +66,6 @@ set noswapfile " set textwidth=80 " set colorcolumn=+1 - -" ****************** Starting the vim script copied from https://github.com/neoclide/coc.nvim#example-vim-configuration - -" Set internal encoding of vim, not needed on neovim, since coc.nvim using some " unicode characters in the file autoload/float.vim set encoding=utf-8 @@ -81,10 +80,14 @@ set nowritebackup " let g:airline_theme='dark' - " Enabling the mouse support set mouse=a +" Autocompleting without any plugins +" Source -> https://www.youtube.com/watch?v=2f8h45YR494 +set complete+=kspell +set completeopt=menuone,longest +set shortmess+=c " Setting the formatting for svelte to be same as html au! BufNewFile,BufRead *.svelte set ft=html @@ -111,3 +114,4 @@ au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown " autocmd WinEnter,BufEnter * setlocal statusline=%!statusline#active() " autocmd WinLeave,BufLeave * setlocal statusline=%!statusline#inactive() " augroup end +" ===== Settings =====