Skip to content

Instantly share code, notes, and snippets.

@mythusiva
Last active May 9, 2024 01:31
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 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
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 'morhetz/gruvbox'
Plug 'ap/vim-buftabline'
" List ends here. Plugins become visible to Vim after this call.
call plug#end()
" Color schemes
set background=dark
colorscheme gruvbox
syntax on
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 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 laststatus=2 " Make status line always visible
set statusline+=%F " Add full file path to your existing statusline
set mouse=a
let mapleader = " " " map leader to Space
let g:ale_fixers = {
\ 'javascript': ['eslint']
\ }
" Shortcuts
nnoremap <leader>e :Lexplore<CR>
nnoremap <leader>ff :Files<CR>
nnoremap <leader>ft :RG<CR>
nnoremap <leader>F :GitFiles<CR>
nnoremap <silent> <C-Right> :bnext<CR>
nnoremap <silent> <C-Left> :bNext<CR>
nnoremap <leader>B :Buffers<CR>
nnoremap <leader>x :bdelete<CR>
nnoremap <leader>le :LspDocumentDiagnostics<CR>
nnoremap <leader>ld :LspDefinition<CR>
nnoremap <leader>lr :LspReferences<CR>
@mythusiva
Copy link
Author

mythusiva commented Jan 16, 2024

Make sure to install

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