Skip to content

Instantly share code, notes, and snippets.

@dagingaa
Last active January 3, 2016 23:39
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 dagingaa/8536593 to your computer and use it in GitHub Desktop.
Save dagingaa/8536593 to your computer and use it in GitHub Desktop.
My .vimrc on my work laptop
filetype off
call pathogen#infect()
call pathogen#helptags()
syntax on
filetype plugin indent on
set smarttab
set shiftwidth=4
set autoindent
set expandtab
set number
set numberwidth=4
set ignorecase
set mouse=a
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,node_modules,.sass-cache,*/.tmp/*,dev,public
highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE
colorscheme hybrid
let mapleader = "\p"
map nt :NERDTree<cr>
map gf :TernDef<cr>
map tr :TernRename<cr>
nnoremap t <C-]>
set tags=./tags;/
set nowrap
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'Shougo/unite.vim'
Bundle 't9md/vim-unite-ack'
Bundle 'Shougo/vimproc.vim'
Bundle 'Shougo/neocomplete'
Bundle 'Shougo/neosnippet'
Bundle 'honza/vim-snippets'
Bundle 'scrooloose/nerdtree'
Bundle 'tpope/vim-sensible'
Bundle 'tpope/vim-endwise'
Bundle 'tpope/vim-surround'
Bundle 'tpope/vim-fugitive'
Bundle 'kien/ctrlp.vim'
Bundle 'Syntastic'
Bundle 'bronson/vim-trailing-whitespace'
Bundle 'jelera/vim-javascript-syntax'
Bundle 'marijnh/tern_for_vim'
Bundle 'editorconfig-vim'
Bundle 'hail2u/vim-css3-syntax'
Bundle 'othree/javascript-libraries-syntax.vim'
Bundle 'kien/rainbow_parentheses.vim'
" Theme
Bundle 'w0ng/vim-hybrid'
" neocomplete
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#enable_smart_case = 1
let g:neocomplete#sources#syntax#min_keyword_length = 3
" let g:neocomplete#enable_fuzzy_completion = 1
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
autocmd FileType Unite setlocal ignorecase smartcase
" Unite.vim
call unite#filters#matcher_default#use(['matcher_fuzzy'])
let g:unite_source_history_yank_enable = 1
nnoremap <leader>m :<C-u>Unite file_mru<CR>
nnoremap <leader>f :<C-u>Unite -start-insert file<CR>
nnoremap <leader>y :<C-u>Unite history/yank<CR>
nnoremap <space>/ :Unite grep:.<cr>
if executable('ack-grep')
let g:unite_source_grep_command = 'ack-grep'
let g:unite_source_grep_default_opts = '--no-heading --no-color -a -H'
let g:unite_source_grep_recursive_opt = ''
endif
" syntastic
let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute \"ng-"]
" neosnippet
let g:neosnippet#snippets_directory='~/.vim/bundle/vim-snippets/snippets'
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
imap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)"
\: pumvisible() ? "\<C-n>" : "\<TAB>"
smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)"
\: "\<TAB>"
" For snippet_complete marker.
if has('conceal')
set conceallevel=2 concealcursor=i
endif
" vimfu
nmap <leader>l :set list!<CR>
set listchars=tab:▸\ ,eol:¬
" persistent undo
if v:version >= 703
set undofile
set undodir=~/.vimundo
endif
" ctrlp
let g:ctrlp_user_command = {
\ 'types': {
\ 1: ['.git', 'cd %s && git ls-files . --cached --exclude-standard --others'],
\ 2: ['.hg', 'hg --cwd %s locate -I .'],
\ },
\ 'fallback': 'find %s -type f'
\ }
if has("autocmd")
autocmd FileType javascript setlocal ts=4 sts=4 sw=4 expandtab
autocmd FileType html setlocal ts=4 sts=4 sw=4 expandtab
autocmd FileType css setlocal ts=4 sts=4 sw=4 expandtab
autocmd BufNewFile,BufRead *.twig setfiletype html
autocmd BufNewFile,BufRead *.scss set ft=scss.css
autocmd BufReadPre *.js let b:javascript_lib_use_angularjs = 1
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment