Skip to content

Instantly share code, notes, and snippets.

@andrewjong
Last active November 9, 2022 17:19
Show Gist options
  • Save andrewjong/cba88aa56cdba6f44105e44d029610ab to your computer and use it in GitHub Desktop.
Save andrewjong/cba88aa56cdba6f44105e44d029610ab to your computer and use it in GitHub Desktop.
My vim configuration file
""" =====VIM-PLUG=====
" Specify a directory for plugins
" - For Neovim: stdpath('data') . '/plugged'
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
" Make sure you use single quotes
" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
Plug 'tpope/vim-surround'
Plug 'flazz/vim-colorschemes'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Any valid git URL is allowed
Plug 'https://github.com/junegunn/vim-github-dashboard.git'
" Multiple Plug commands can be written in a single line using | separators
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
" On-demand loading
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
" Using a non-default branch
Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }
" Plugin outside ~/.vim/plugged with post-update hook
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
" Unmanaged plugin (manually installed and updated)
Plug '~/my-prototype-plugin'
" Initialize plugin system
call plug#end()
""" =====PERSONAL CUSTOMIZATIONS=====
" ---VIM---
" UTF-8 encoding
set encoding=utf-8
" Auto-save
" Plugin '907th/vim-auto-save'
" let g:auto_save = 1 " enable AutoSave on Vim startup
" ---COLORS---
set t_Co=256 "allow more colors for displaying of colorschemes
let g:airline_powerline_fonts = 1
" Color scheme
" colorscheme Tomorrow-Night-Bright
colorscheme seti
" Line numbers on
set nu
" highlight LineNr ctermfg=grey
syntax on
" Fix transparent background
hi Normal ctermbg=none
highlight NonText ctermbg=none
highlight LineNr ctermbg=none
" ---WINDOWS---
map <C-n> :NERDTreeToggle<CR>
"autocmd vimenter * NERDTree "auto open on vim-start
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif "auto close on vim-quit
" Split screen open positioning
set splitbelow
set splitright
" Moving between split screens
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" ---EDITOR---
" " Auto-complete variables
" Plugin 'Valloric/YouCompleteMe'
" " close auto-complete window after choosing
" let g:ycm_autoclose_preview_window_after_completion=1
" map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
" Enable folding
set foldmethod=syntax
set foldlevel=99
" Enable folding with the spacebar
nnoremap <space> za
" Enable doc preview in fold
let g:SimpylFold_docstring_preview=1
" Underscore as word boundary
" set iskeyword-=_
" Paste mode
set pastetoggle=<F3>
" Prevent mouse from selecting line numbers when copying
set mouse+=a
" Condensed tabs
set tabstop=2
set shiftwidth=2
" Case sensitive search only if contain cases
set ignorecase
set smartcase
" incremental search
set incsearch
set hlsearch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment