Skip to content

Instantly share code, notes, and snippets.

@mythusiva
Last active October 29, 2024 14:32
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'
" 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
syntax on
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 shiftwidth=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 noshowmode " Don't show mode because of lightline
set keymodel=startsel
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-python',
\ 'coc-eslint',
\ ]
let g:ale_fixers = {
\ 'javascript': ['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
let g:trouble_default_position = 'bottom'
" Shortcuts
nnoremap <leader>w :w<CR>
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
@mythusiva
Copy link
Author

Also install ripgrep

sudo apt install ripgrep;

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