Skip to content

Instantly share code, notes, and snippets.

@charleslouis
Created June 1, 2018 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charleslouis/b2b603a0e3b519b725549f365b032b0c to your computer and use it in GitHub Desktop.
Save charleslouis/b2b603a0e3b519b725549f365b032b0c to your computer and use it in GitHub Desktop.
"********************************************************************************
"define mapleader now before it is used by anything else
"********************************************************************************
let mapleader = ","
"********************************************************************************
"autoload plug vim
"********************************************************************************
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
"********************************************************************************
"Load plugs w/ vim plug
"********************************************************************************
call plug#begin('~/.vim/plugged')
" Plug 'vim-scripts/bufexplorer.vim'
" most recently used file
Plug 'vim-scripts/mru'
Plug 'amix/open_file_under_cursor.vim'
Plug 'MarcWeber/vim-addon-mw-utils'
" NERD Commenter
Plug 'scrooloose/nerdcommenter'
Plug 'vim-scripts/tlib'
" Create tags html
Plug 'garbas/vim-snipmate'
" ES2015 code snippets (Optional)
Plug 'epilande/vim-es2015-snippets'
" React code snippets
Plug 'epilande/vim-react-snippets'
" Ultisnips
Plug 'SirVer/ultisnips'
" Surround - next-generation Vim syntax highlighting and error checking for Babel, JSX, Ruby, or whatever you’re into.
Plug 'tpope/vim-surround'
" Syntastic
Plug 'vim-syntastic/syntastic'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'tmhedberg/matchit'
Plug 'mileszs/ack.vim'
Plug 'w0rp/ale'
Plug 'tpope/vim-commentary'
"Plug 'terryma/vim-multiple-cursors'
"Plug 'junegunn/limelight.vim'
"Plug '/usr/local/opt/fzf'
Plug 'junegunn/fzf.vim'
" PlugInstall and PlugUpdate will clone fzf in ~/.fzf and run install script
"Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
" Both options are optional. You don't have to install fzf in ~/.fz
" and you don't have to run install script if you use fzf only in Vim.
Plug 'gcorne/vim-sass-lint'
Plug 'gorodinskiy/vim-coloresque'
" Color Schemes
Plug 'flazz/vim-colorschemes'
Plug 'phanviet/vim-monokai-pro'
Plug 'scrooloose/nerdtree'
"Plug 'ctrlpvim/ctrlp'
call plug#end()
"********************************************************************************
"set config stuff
"********************************************************************************
set hls
set nu
set history=1000
set ruler
set showcmd
set wildmenu
set scrolloff=10
set ignorecase
set incsearch
set smartcase
set backup
set lbr
set ai
set si
"colo lucariox
"map <F2> 80i*oi* my name is <CR>
set clipboard=unnamed
filetype plugin on
"********************************************************************************
"Change color theme
"********************************************************************************
set termguicolors
colorscheme monokai
"colorscheme monokai_pro
"********************************************************************************
"SASS LINT
"********************************************************************************
let g:syntastic_sass_checkers=["sasslint"]
let g:syntastic_scss_checkers=["sasslint"]
"let g:sass_lint_config = '/path/to/config.yml'
"Map FZF
"********************************************************************************
noremap <C-f> :FZF<CR>
"********************************************************************************
" Ack
"*******************************************************************************
cnoreabbrev Ack Ack!
nnoremap <Leader>a :Ack!<Space>
"********************************************************************************
" NERDTREE
"********************************************************************************
autocmd vimenter * NERDTree
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
"Toggle nerdtree on ctrl+n
noremap <C-n> :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" 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('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', 'blue', 'none', 'blue', '#151515')
call NERDTreeHighlightFile('js', 'blue', 'none', '#ffa500', '#151515')
map <F12> :set hls!<CR>
map <F1> :vs ~/cheatsheet/cheatsheet.md<CR>
" Trigger configuration (Optional)
" let g:UltiSnipsExpandTrigger="<C-l>"
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment