Skip to content

Instantly share code, notes, and snippets.

@MinSomai
Last active April 20, 2020 15:42
Show Gist options
  • Save MinSomai/351c16cfde77a4455da48764bd5f0cfb to your computer and use it in GitHub Desktop.
Save MinSomai/351c16cfde77a4455da48764bd5f0cfb to your computer and use it in GitHub Desktop.
FrontEnd .vimrc 2020
"" Vim commands e: $MYVIMRC
" Not compatible with vi
set nocompatible " required
filetype off " required
" ---------- VUNDLE -----------
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
"call vundle#begin('~/some/path/here')
" Run :PlugingInstall after adding the plugins
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-surround'
Plugin 'scrooloose/nerdtree'
Plugin 'tmhedberg/SimpylFold'
" Plugin 'prettier/vim-prettier'
Plugin 'tpope/vim-commentary' "gc
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'mattn/emmet-vim'
Plugin 'junegunn/fzf'
Plugin 'junegunn/fzf.vim'
""""""" Web Development (HTML/CSS/preprocessors/etc)
Plugin 'aaronjensen/vim-sass-status'
Plugin 'cakebaker/scss-syntax.vim'
Plugin 'groenewege/vim-less'
Plugin 'hail2u/vim-css3-syntax'
Plugin 'lukaszb/vim-web-indent'
Plugin 'othree/html5.vim'
Plugin 'tpope/vim-haml'
Plugin 'ap/vim-css-color'
" Plugin 'scrooloose/syntastic' " Syntax highlighting
" Go
Plugin 'fatih/vim-go'
" Theme related
Plugin 'morhetz/gruvbox'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype indent on
filetype plugin indent on " required
" override the default console color
set t_Co=256
" ---------- CUSTOMIZATION -----------
"speed up from normal to insert mode
set ttimeoutlen=5 ttimeoutlen=0
"split navigations
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>
" Enable folding
set foldmethod=indent
set foldlevel=10
" turn hybrid line numbers on
:set number relativenumber
:set nu rnu
" Enable folding with the spacebar
nnoremap <space> za
" jj to esc from insert mode
imap jj <Esc>
" Nerdtree
" toggle with f2
map <F2> :NERDTreeToggle<CR>
let NERDTreeMapOpenInTab='<ENTER>'
" Airline arrow symbols fix
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline_right_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_left_alt_sep= ''
let g:airline_left_sep = ''
let g:airline_theme='violet'
" .......... PRETTIER ................
" overwrite default prettier
" let g:prettier#config#tab_width = 'auto'
" let g:prettier#config#use_tabs = 'auto'
" let g:prettier#exec_cmd_path="~/AppData/Roaming/npm"
" let g:prettier#config#bracket_spacing = 'true'
" let g:prettier#config#jsx_bracket_same_line = 'false'
" running before saving
" let g:prettier#quickfix_enabled = 0
" let g:prettier#autoformat = 0
" autocmd BufWritePre,TextChanged,InsertLeave *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue,*.yaml,*.html PrettierAsync
" autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.yaml,*.html PrettierAsync
" .......... EMMET ................
let g:user_emmet_install_global = 0
" Emmet only for html and css
autocmd FileType php,scss,html,css EmmetInstall
" Emmet leaderkey in comma comma ',' instead of <c-y>
let g:user_emmet_leader_key=','
let g:user_emmet_settings = {
\ 'html' : {
\ 'indentation' : ' '
\ },
\ 'css' : {
\ 'indentation' : '2'
\ },
\ 'sass' : {
\ 'indentation' : '2'
\ },
\}
" .......... CtrlP ................
" Ignore folders
"set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.idea/*,*/.DS_Store,*/vendor, */node_modules
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git|.git'
"tab indent
set shiftwidth=4
set tabstop=4
" tab autocompletion
" imap <Tab> <C-n>
" select the autocompletion option with enter instead of Ctrl + y
inoremap <expr> <CR> pumvisible() ? "\<C-Y>" : "\<CR>"
" Enter and Shift enter to put empty line
nmap <S-Enter> O<Esc>
nmap <CR> o<Esc>
" Hide explorer, using NerdTree
let g:netrw_banner=0 " disable banner
let g:netrw_liststyle=3 " tree view
":set novb " removes the flickers in windows
"Gruvbox vim theme settings
colorscheme gruvbox " this is freaking awesome
:set bg=dark
"if !has("gui_running")
" set term=xterm
" set t_Co=256
" let &t_AB="\e[48;5;%dm"
" let &t_AF="\e[38;5;%dm"
" colorscheme darkblue
"endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment