Skip to content

Instantly share code, notes, and snippets.

@vuongpd95
Last active November 26, 2021 02:44
Show Gist options
  • Save vuongpd95/a9f81a89570269d8cd5196d974c27a5d to your computer and use it in GitHub Desktop.
Save vuongpd95/a9f81a89570269d8cd5196d974c27a5d to your computer and use it in GitHub Desktop.
My .vrimrc
" Install Vim
" sudo apt-get install vim
" Install Vundle
" git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
" $ vim
" $ :PluginInstall
set shell=/bin/bash
set nocompatible
set encoding=utf-8
set fileencodings=urf-8
filetype off
set tabstop=2 shiftwidth=2 expandtab
set rtp+=~/.vim/bundle/Vundle.vim
let NERDTreeShowHidden=1
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" Make sure your vim has GUI
" sudo apt-get install vim-gui-common vim-runtime
" Track the engine.
Plugin 'SirVer/ultisnips'
"
" Snippets are separated from the engine. Add this if you want them:
Plugin 'honza/vim-snippets'
"
" Trigger configuration. You need to change this to something other than
" <tab> if you use one of the following:
" - https://github.com/Valloric/YouCompleteMe
" - https://github.com/nvim-lua/completion-nvim
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
"
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
Plugin 'myusuf3/numbers.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'preservim/nerdtree'
Plugin 'vim-airline/vim-airline'
Plugin 'slim-template/vim-slim.git'
" tagbar needs sudo apt-get install exuberant-ctags
Plugin 'preservim/tagbar'
" Use Ag or Rg, one should be enough
" Install Ag: sudo apt-get install silversearcher-ag
" Install ripgrep:
" sudo add-apt-repository ppa:x4121/ripgrep (Ubuntu)
" sudo apt-get install ripgrep
" Download .deb file from https://github.com/BurntSushi/ripgrep/releases
" (Debian) then sudo dpkg -i <file.deb>
Plugin 'junegunn/fzf'
Plugin 'junegunn/fzf.vim'
" Multiple cursor
Plugin 'mg979/vim-visual-multi'
" Indent Guides
Plugin 'nathanaelkane/vim-indent-guides'
" let g:indent_guides_auto_colors = 0
" let g:indent_guides_enable_on_vim_startup = 1
" let g:indent_guides_start_level = 2
" let g:indent_guides_guide_size = 1
" autocmd VimEnter,Colorscheme * :hi IndentGuidesEven ctermbg=238
" autocmd VimEnter,Colorscheme * :hi IndentGuidesOld ctermbg=236
" If you like Nord color theme: https://github.com/arcticicestudio/nord-vim
Plugin 'arcticicestudio/nord-vim'
" Javascript syntax highlighting
Plugin 'pangloss/vim-javascript'
" Typescript syntax highlighting
Plugin 'leafgarland/typescript-vim'
" Enable Indent Guides on startup
let g:indent_guides_enable_on_vim_startup = 1
" Syntax highlighting for Vue
" Plugin 'posva/vim-vue' or treat vue file as HTML file
autocmd BufRead,BufNewFile *.vue setfiletype html
" Add fun to trim trailing whitespaces
fun! TrimWhitespace()
let l:save = winsaveview()
keeppatterns %s/\s\+$//e
call winrestview(l:save)
endfun
command! TrimWS call TrimWhitespace()
" Plugin 'L9'
" Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Plugin configurations & overrides
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tagbar#enabled = 1
" Add Ag default options
" let s:ag_options = ' --one-device --skip-vcs-ignores --smart-case'
" Add a shorter command to open Tagbar
command! -nargs=0 Tb call tagbar#ToggleWindow()
command! -nargs=0 Tc call tagbar#CloseWindow()
" Close all buffers except for the current one
command! BdOnly silent! execute "%bd|e#|bd#"
" Auto open NERDTree on vim startup
" autocmd VimEnter * NERDTree ams
" Custom map
map gn :bn<cr>
map gp :bp<cr>
map gd :bd<cr>
call vundle#end()
" Enable Nord vim color scheme
colorscheme nord
syntax enable
filetype plugin indent on
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment