Skip to content

Instantly share code, notes, and snippets.

@zxqx
Created February 23, 2015 17:27
Show Gist options
  • Save zxqx/de77cbefcd8a36c76d4e to your computer and use it in GitHub Desktop.
Save zxqx/de77cbefcd8a36c76d4e to your computer and use it in GitHub Desktop.
set nocompatible
filetype off
" --------------------------------------------------
" Vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
" Buffer Management
Plugin 'scrooloose/nerdtree'
Plugin 'LustyJuggler'
Plugin 'rbgrouleff/bclose.vim'
" Searching
Plugin 'rking/ag.vim'
Plugin 'kien/ctrlp.vim'
" Syntax
Plugin 'pangloss/vim-javascript'
Plugin 'elzr/vim-json'
Plugin 'groenewege/vim-less'
Plugin 'mustache/vim-mustache-handlebars'
" Formatting
Plugin 'einars/js-beautify'
Plugin 'JavaScript-Indent'
Plugin 'Raimondi/delimitMate'
Plugin 'scrooloose/nerdcommenter'
Plugin 'tpope/vim-surround'
Plugin 'bronson/vim-trailing-whitespace'
" Linting
Plugin 'scrooloose/syntastic'
" Shorthand
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
Plugin 'SirVer/ultisnips'
Plugin 'my-stuff'
" Autocomplete
Plugin 'Shougo/neocomplete.vim'
" Git
Plugin 'tpope/vim-fugitive'
Plugin 'mattn/webapi-vim'
Plugin 'mattn/gist-vim'
" Color schemes
Plugin 'flazz/vim-colorschemes'
call vundle#end()
filetype plugin indent on
" --------------------------------------------------
" Vim settings
syntax on
colorscheme chance-of-storm
set guifont=Inconsolata:h20
set guioptions-=L
" Set default working directory
cd ~/code
" Searching configs
set incsearch
set ignorecase
set smartcase
" dat menu
set wildmenu
" misc
set number
set showmatch
set showmode
set scrolloff=1000
set incsearch
set ignorecase
set smartcase
set hidden
" backspace stuff
set backspace=indent,eol,start
" use system clipboard on mac
set clipboard=unnamed
" assign json files correct filetype
au BufRead,BufNewFile *.json set filetype=json
" 2 spaces to a tab, spaces as tab
set tabstop=2
set softtabstop=2
set expandtab
set shiftwidth=2
set shiftround
set autoindent
set copyindent
set smarttab
set smartindent
" lol backups
set nobackup
set noswapfile
" show position
set ruler
" folding
set foldenable
set foldlevelstart=10
set foldnestmax=10
set foldmethod=indent
" remember folds
au BufWinLeave ?* mkview
au BufWinEnter ?* silent loadview
" --------------------------------------------------
" neocomplete
let g:neocomplete#enable_at_startup = 1
" neocomplete - Enable omni completion
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
" neocomplete - TAB completion
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" ctrlp
let g:ctrlp_follow_symlinks = 1
let g:ctrlp_working_path_mode = 0
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|node_modules\|bin\|dist\|bower_components',
\ 'file': '\.exe$\|\.so$\|\.dat$'
\ }
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
" delimit
let g:delimitMate_expand_space = 1
let g:delimitMate_expand_cr = 1
" ultisnips - custom trigger button
let g:UltiSnipsSnippetDirectories=["snips"]
let g:UltiSnipsExpandTrigger="<c-j>"
" Open new gists in browser
let g:gist_open_browser_after_post = 1
" let syntastic clobber location list
let g:syntastic_always_populate_loc_list=1
" no concealing json quotes
let g:vim_json_syntax_conceal = 0
" --------------------------------------------------
" My mappings
" fast edits
nmap <silent> <leader>v :e ~/.vimrc<CR>
" Nerd tree and tag list
nmap <silent> <leader>t :NERDTreeToggle<CR>
" fix whitespace
nmap <silent> <leader>fw :FixWhitespace<CR>
" Lusty juggler
nmap <silent> <leader>d :LustyJuggler<CR>
" Buffer
nmap <silent> <leader>q :Bclose<CR>
" change switching windows
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
" delete without yank
nnoremap <leader>e "_d
vnoremap <leader>e "_d
" remove training wheels
map <up> <nop>
map <down> <nop>
map <left> <nop>
map <right> <nop>
imap <up> <nop>
imap <down> <nop>
imap <left> <nop>
imap <right> <nop>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment