Skip to content

Instantly share code, notes, and snippets.

@dnavas77
Last active August 14, 2016 20:05
Show Gist options
  • Save dnavas77/0db11df9eadc72b1132b to your computer and use it in GitHub Desktop.
Save dnavas77/0db11df9eadc72b1132b to your computer and use it in GitHub Desktop.
"------------- Vundle and Plugins ------------
set nocompatible
filetype off
syntax off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-surround'
Plugin 'gregsexton/Matchtag'
Plugin 'tpope/vim-commentary'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'Valloric/YouCompleteMe'
Plugin 'raimondi/delimitmate'
Plugin 'rking/ag.vim'
Plugin 'flazz/vim-colorschemes'
Plugin 'scrooloose/nerdtree'
Plugin 'mattn/emmet-vim'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'tmhedberg/SimpylFold'
Plugin 'scrooloose/syntastic'
Plugin 'mxw/vim-jsx'
Plugin 'pangloss/vim-javascript'
Plugin 'chriskempson/base16-vim'
Plugin 'mustache/vim-mustache-handlebars'
Plugin 'elixir-lang/vim-elixir'
Bundle 'Lokaltog/powerline', {'rtp':'powerline/bindings/vim/'}
call vundle#end()
filetype plugin indent on
let python_highlight_all=1
syntax on
" Set Vim Settings
let mapleader = ";"
set t_Co=256
set backspace=indent,eol,start
set shortmess=atI "don't show message at startup
set title "show filename in widow titlebar
set clipboard+=unnamed "allow copy from vim and paste into system
set autoindent
set smartindent
set lazyredraw
set nobackup
set nowb
set history=10000
set noswapfile
set laststatus=2
set noshowmode
set smarttab
set linebreak
set cindent
set showmatch
set mat=2
set cc=100
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set nowrap
set ignorecase
set smartcase
set hlsearch
set wildmenu
set modifiable
set encoding=utf-8
"set linespace=4
"set number
"set relativenumber
"set cursorline
"set cursorcolumn
let g:Powerline_symbols="fancy"
let g:airline_powerline_fonts=1
set fillchars+=stl:\ ,stlnc:\
set timeoutlen=500 ttimeoutlen=500
" YouCompleteMe settings
let g:ycm_error_symbol = '>'
let g:ycm_filepath_completion_use_working_dir = 0
let g:ycm_warning_symbol = '>'
let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
" Open Nerdtree with Ctrl + n
map <C-n> :NERDTreeToggle<CR>
" Enable Airline line
set guitablabel=%t
let g:airline#extensions#tabline#enabled=1
let g:airline#extensions#syntastic#enabled = 1
let g:airline#extensions#branch#enabled=1
let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline#extensions#hunks#enabled=0
let g:airline_left_sep=''
let g:airline_right_sep=''
let g:airline_theme='tomorrow'
" Enable folding
set foldmethod=indent
set foldlevel=99
let g:SimpylFold_docstring_preview=1
"python with virtualenv support
py << EOF
import os
import sys
if 'VIRTUAL_ENV' in os.environ:
project_base_dir = os.environ['VIRTUAL_ENV']
activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
EOF
au BufNewFile,BufRead *.py
\ set tabstop=4 |
\ set softtabstop=4 |
\ set shiftwidth=4 |
\ set textwidth=100 |
\ set expandtab |
\ set autoindent |
\ set fileformat=unix
au BufNewFile,BufRead *.js,*.html,*.css,*.hbs
\ set tabstop=2 |
\ set softtabstop=2 |
\ set shiftwidth=2 |
\ set textwidth=100 |
\ set expandtab |
\ set autoindent |
\ set fileformat=unix
" JSX and Babel Stuff
let g:jsx_ext_required = 0 " Allow JSX in normal JS files
" Enable Vim Tag Matching
runtime macros/matchit.vim
" Silver Searcher
let g:ag_working_path_mode = "r"
" SYNTASTIC
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_javascript_checkers = ['jshint', 'eslint']
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_enable_signs = 1
let g:syntastic_check_on_open = 0
let g:syntastic_check_on_wq = 0
let g:syntastic_auto_jump = 0
let g:syntastic_mode_map = {
\ "mode": "active",
\ "active_filetypes": [],
\ "passive_filetypes": ['java', 'html']
\ }
let g:syntastic_stl_format = '[%E{%e Errors}%B{, }%W{%w Warnings}]' " syntastic status line format
let g:syntastic_error_symbol = '✗'
let g:syntastic_style_error_symbol = '⚡'
let g:syntastic_warning_symbol = '⚠'
let g:syntastic_style_warning_symbol = '!'
" cd sets path to the path of the file in the current buffer.
nnoremap cd :cd %:p:h
" Open the NERDTree on the path of the file in the current buffer.
set autochdir
let NERDTreeChDirMode=2
let NERDTreeShowHidden=1
nnoremap t :NERDTree %:p:h
" Control P Settings
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_working_path_mode = 'r'
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows
set wildignore+=**/node_modules " ignores node_modules
set wildignore+=**/bower_components " ignores bower_components
set wildignore+=**/tmp "ignores tmp created by Ember
set wildignore+=**/dist "ignores dist created by Ember
" DANI's SHORTCUTS / KEYBINDINGS
nnoremap <leader>rv :source $MYVIMRC<CR>
nnoremap <leader>av :tabnew $MYVIMRC<CR>
nnoremap <leader>a :bprevious<CR>
nnoremap <leader>d :bnext<CR>
nnoremap <leader>t :tabnew<CR>
nnoremap <leader>w :bw<CR>
nnoremap <leader>q :q<CR>
nnoremap <leader>h :sp<CR>
nnoremap <leader>v :vsp<CR>
nnoremap <S-n> :tabprevious<CR>
nnoremap <S-m> :tabnext<CR>
nnoremap <space><space> :w<CR>
nnoremap <space> :set hlsearch! hlsearch?<CR>
" Maps Shift + [h,j,k,l] to resize splits
map <silent> <S-H> <C-w><
map <silent> <S-J> <C-W>+
map <silent> <S-K> <C-W>-
map <silent> <S-L> <C-w>>
" Switch between opened buffers splits by holding Ctrl and using HJKL
nnoremap <C-J> <C-W>j
nnoremap <C-K> <C-W>k
nnoremap <C-L> <C-W>l
nnoremap <C-H> <C-W>h
inoremap lk <Esc>
vnoremap lk <Esc>
cnoremap lk <Esc>
" Better indentation
vnoremap < <gv
vnoremap > >gv
" Set theme
set background=light
if has('gui_running')
let g:solarized_termtrans=0
set guifont=Hack:h12
set guioptions-=L
set guioptions-=T
set guioptions-=r
else
let g:solarized_termtrans=1
endif
let g:solarized_termcolors=16
let g:solarized_visibility="normal"
let g:solarized_contrast="normal"
let g:hybrid_custom_term_colors = 1
let g:hybrid_reduced_contrast = 1 " Remove this line if using the default palette.
let g:gruvbox_contrast_dark='medium'
colo PaperColor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment