Skip to content

Instantly share code, notes, and snippets.

@criloz
Last active October 9, 2017 15:13
Show Gist options
  • Save criloz/699b8f9c96f25a78ab94abf019adbfaf to your computer and use it in GitHub Desktop.
Save criloz/699b8f9c96f25a78ab94abf019adbfaf to your computer and use it in GitHub Desktop.
call plug#begin('~/.vim/plugged')
" Make sure you use single quotes
Plug 'junegunn/vim-easy-align'
Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'fatih/vim-go', { 'tag': '*' }
Plug 'goatslacker/mango.vim'
Plug 'wavded/vim-stylus'
Plug 'mattn/emmet-vim'
Plug 'blueshirts/darcula'
Plug 'NLKNguyen/papercolor-theme'
Plug 'airblade/vim-gitgutter'
Plug 'majutsushi/tagbar'
Plug 'garyburd/go-explorer'
Plug 'scrooloose/syntastic'
Plug 'ryanoasis/vim-devicons'
Plug 'Yggdroot/indentLine'
Plug 'bling/vim-airline'
Plug 'powerline/powerline'
Plug 'w0ng/vim-hybrid'
Plug 'kovetskiy/next-indentation'
Plug 'tpope/vim-surround'
Plug 'easymotion/vim-easymotion'
Plug 'chriskempson/base16-vim'
Plug 'szw/vim-ctrlspace'
Plug 'ajh17/Spacegray.vim'
Plug 'tell-k/vim-autoflake'
Plug 'rking/ag.vim'
Plug 'Chiel92/vim-autoformat'
" Add plugins to &runtimepath
call plug#end()
" Required:
filetype plugin indent on
let g:go_bin_path = "/root/.gotools"
map <C-n> :NERDTreeToggle<CR>
map <C-s> :FZF<CR>
" vim devicons
let g:airline_powerline_fonts = 1
" NERDTress File highlighting
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg)
exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg
exec 'autocmd filetype nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#'
endfunction
call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#151515')
call NERDTreeHighlightFile('py', 'green', 'none', 'green', '#151515')
call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('md', 'blue', 'none', '#3366FF', '#151515')
call NERDTreeHighlightFile('yml', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('config', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('conf', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('json', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('html', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('styl', 'cyan', 'none', 'cyan', '#151515')
call NERDTreeHighlightFile('css', 'cyan', 'none', 'cyan', '#151515')
call NERDTreeHighlightFile('coffee', 'Red', 'none', 'red', '#151515')
call NERDTreeHighlightFile('js', 'Red', 'none', '#ffa500', '#151515')
call NERDTreeHighlightFile('php', 'Magenta', 'none', '#ff00ff', '#151515')
call NERDTreeHighlightFile('go', 'Red', 'none', 'red', '#151515')
set number
let g:molokai_original = 1
let g:rehash256 = 1
nmap <F8> :TagbarToggle<CR>
nmap q <c-v>
" set terminal title
autocmd BufEnter * let &titlestring = ' ' . expand("%:t")
set title
filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab
set backupdir=~/.config/nvim/backup/
set directory=~/.config/nvim/swap/
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:airline_powerline_fonts = 1
let g:gruvbox_contrast_dark = 'hard'
let base16colorspace=256 " Access colors present in 256 colorspace
set background=dark
colorscheme darcula
set guifont=Envy\ Code\ R
nnoremap { :IndentationGoUp<CR>
nnoremap } :IndentationGoDown<CR>
nnoremap <F2> :on<CR>
let g:tmux_navigator_save_on_switch = 1
set undodir=~/.config/nvim/undodir
set undofile
let g:BASH_Ctrl_j = 'off'
let g:syntastic_html_tidy_exec = 'tidy'
" tmux_navigator in insert mode
imap <c-h> <c-o><c-h><i>
imap <c-j> <c-o><c-j><i>
imap <c-k> <c-o><c-k><i>
imap <c-l> <c-o><c-l><i>
imap <c-\> <c-o><c-\>
tnoremap <c-h> <C-\><C-n><C-w>h<i>
tnoremap <c-j> <C-\><C-n><C-w>j<i>
tnoremap <c-k> <C-\><C-n><C-w>k<i>
tnoremap <c-l> <C-\><C-n><C-w>l<i>
syntax on
set clipboard+=unnamedplus
" easymotions
let g:EasyMotion_do_mapping = 0 " Disable default mappings
" Bi-directional find motion
" Jump to anywhere you want with minimal keystrokes, with just one key binding.
" `s{char}{label}`
nmap / <Plug>(easymotion-tn)
nmap f <Plug>(easymotion-sn)
nmap c <Plug>(easymotion-repeat)
let g:EasyMotion_smartcase = 1
nmap s <Plug>(easymotion-j)
nmap w <Plug>(easymotion-k)
nmap a <Plug>(easymotion-w)
nmap n <Plug>(easymotion-next)
nmap N <Plug>(easymotion-prev)
set nocompatible
set hidden
set showtabline=0
let g:airline#extensions#ctrlspace#enabled = 1
let g:CtrlSpaceLoadLastWorkspaceOnStart = 1
let g:CtrlSpaceSaveWorkspaceOnSwitch = 1
let g:CtrlSpaceSaveWorkspaceOnExit = 1
let g:airline#extensions#syntastic#enabled = 1
let g:airline#extensions#tagbar#enabled = 1
" Autoformat
"function Autoformat (command)
" execute "w"
" execute "!clear;time " . a:command . " " . expand("%")
"endfunction
let g:autoflake_remove_unused_variables=1
let g:autoflake_disable_show_diff=1
let g:autoflake_imports="django,requests,urllib3"
let mapleader = "\<Space>"
nnoremap <leader>h :leftabove vnew<CR>:FZF<CR>
nnoremap <leader>l :rightbelow vnew<CR>:FZF<CR>
nnoremap <leader>k :leftabove new<CR>:FZF<CR>
nnoremap <leader>j :rightbelow new<CR>:FZF<CR>
set cursorline
set spell
set autoread
let g:user_emmet_install_global = 0
autocmd FileType html,css,styl EmmetInstall
inoremap <Esc> <Esc>:w<CR>
vnoremap <Esc> <Esc>:w<CR>
nnoremap <Esc> <Esc>:w<CR>
let syntastic_typescript_tsc_args = "--target es6 --jsx"
let g:tagbar_type_typescript = {
\ 'ctagstype': 'typescript',
\ 'kinds': [
\ 'c:classes',
\ 'n:modules',
\ 'f:functions',
\ 'v:variables',
\ 'v:varlambdas',
\ 'm:members',
\ 'i:interfaces',
\ 'e:enums',
\ ]
\ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment