Skip to content

Instantly share code, notes, and snippets.

@mythusiva
Last active June 5, 2025 16:03
Show Gist options
  • Save mythusiva/e45e121afe25c5a46f69d64485c7c80a to your computer and use it in GitHub Desktop.
Save mythusiva/e45e121afe25c5a46f69d64485c7c80a to your computer and use it in GitHub Desktop.
My vimrc file
" Plugins will be downloaded under the specified directory.
call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged')
" Declare the list of plugins.
Plug 'tpope/vim-sensible'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'vim-scripts/vim-gitgutter'
Plug 'mhinz/vim-signify'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'w0rp/ale'
Plug 'othree/html5.vim'
Plug 'pangloss/vim-javascript'
Plug 'evanleck/vim-svelte', {'branch': 'main'}
Plug 'nathanaelkane/vim-indent-guides'
Plug 'ap/vim-buftabline'
Plug 'terryma/vim-multiple-cursors'
Plug 'itchyny/lightline.vim'
" Plug 'Exafunction/codeium.vim', { 'branch': 'main' }
" Themes below
" Plug 'tinted-theming/base16-vim'
Plug 'mswift42/vim-themes'
Plug 'akiicat/vim-github-theme'
Plug 'morhetz/gruvbox'
Plug 'shwnchpl/vim-cspicker'
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && npx --yes yarn install' }
Plug 'junegunn/seoul256.vim'
" List ends here. Plugins become visible to Vim after this call.
call plug#end()
" Color schemes
set termguicolors
" set background=light
set background=dark
" set t_Co=256
" set t_ut=
" set notermguicolors
" colorscheme github_dark
" colorscheme github_dark_high_contrast
" colorscheme github_dark_protanopia_deuteranopia
" colorscheme github_dark_tritanopia
" colorscheme github_dark_dimmed
" colorscheme Thursday
" colorscheme github_light_high_contrast
" colorscheme github_light_protanopia_deuteranopia
" colorscheme github_light_tritanopia
"" colorscheme soft-morning
colorscheme gruvbox
let g:gruvbox_contrast_dark = 'hard' " Options: 'soft', 'medium', 'hard'
" let g:seoul256_background = 234
" colorscheme seoul256
set mouse=a " Enable mouse support
set re=0 " Use new regex engine
set number " Show line numbers
set linebreak " Break lines at word (requires Wrap lines)
set showbreak=+++ " Wrap-broken line prefix
set textwidth=100 " Line wrap (number of cols)
set showmatch " Highlight matching brace
set visualbell " Use visual bell (no beeping)
set hlsearch " Highlight all search results
set smartcase " Enable smart-case search
set ignorecase " Always case-insensitive
set incsearch " Searches for strings incrementally
set autoindent " Auto-indent new lines
set expandtab " Use spaces instead of tabs
set shiftwidth=2 " Number of auto-indent spaces
set smartindent " Enable smart-indent
set smarttab " Enable smart-tabs
set softtabstop=2 " Number of spaces per Tab
set tabstop=2 " Number of spaces per Tab
set ruler " Show row and column ruler information
" set autochdir " Change working directory to open buffer
set undolevels=1000 " Number of undo levels
set backspace=indent,eol,start " Backspace behaviour
syntax on " Syntax highlighting on
set noswapfile " Don't create swp files
set autoread " Automatically read file changes
" set laststatus=2 " Make status line always visible
" set statusline+=%F " Add full file path to your existing statusline
set noshowmode " Don't show mode because of lightline
set keymodel=startsel
set foldmethod=syntax
set foldcolumn=2
set foldlevelstart=99
" Enable folding
" set foldmethod=manual
" Automatically save and load views
autocmd BufWinLeave *.* mkview
autocmd BufWinEnter *.* silent! loadview
if system('uname -s') == "Darwin\n"
set clipboard=unnamed "OSX
else
set clipboard=unnamedplus "Linux
endif
let mapleader = " " " map leader to Space
let g:indent_guides_enable_on_vim_startup = 1
let g:coc_global_extensions = [
\ 'coc-tsserver',
\ 'coc-eslint',
\ ]
let g:ale_fixers = {
\ 'javascript': ['prettier','eslint'],
\ 'typescript': ['prettier','eslint'],
\ 'html': ['prettier'],
\ 'css': ['prettier'],
\ 'scss': ['prettier'],
\ 'json': ['prettier'],
\ 'yaml': ['prettier'],
\ 'markdown': ['prettier'],
\ 'sql': ['pgformatter']
\ }
let g:ale_fix_on_save = 1
" Markdown Preview Settings
let g:mkdp_preview_options = {
\ 'mkit': {},
\ 'katex': {},
\ 'uml': {},
\ 'maid': {},
\ 'disable_sync_scroll': 1,
\ 'sync_scroll_type': 'middle',
\ 'hide_yaml_meta': 1,
\ 'sequence_diagrams': {},
\ 'flowchart_diagrams': {},
\ 'content_editable': v:false,
\ 'disable_filename': 0,
\ 'toc': {}
\ }
" Shortcuts
nnoremap <leader>ff :Files<CR>
nnoremap <leader>ft :RG<CR>
nnoremap <leader>F :GitFiles<CR>
nnoremap <leader><Right> :bnext<CR>
nnoremap <leader><Left> :bNext<CR>
nnoremap <leader>B :Buffers<CR>
nnoremap <leader>x :bdelete<CR>
nnoremap <leader>gd :call CocAction('jumpDefinition')<CR>
nnoremap <leader>gh :call CocActionAsync('doHover')<CR>
noremap <Leader>y "+y
noremap <Leader>p "+p
" Open current file in VS Code
nnoremap <leader>vs :silent !nohup code %:p > /dev/null 2>&1 &<CR>:redraw!<CR>
@mythusiva
Copy link
Author

mythusiva commented Jul 31, 2024

Install eslint and prettier globally.

npm i -g eslint 
npm i -g prettier

Also install for sql formatting via ALE.

brew install pgformatter

@mythusiva
Copy link
Author

Also install ripgrep

sudo apt install ripgrep;

@mythusiva
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment