Skip to content

Instantly share code, notes, and snippets.

@matt2000
Created September 21, 2015 21:06
Show Gist options
  • Select an option

  • Save matt2000/c1ee2e909b3bb49d4758 to your computer and use it in GitHub Desktop.

Select an option

Save matt2000/c1ee2e909b3bb49d4758 to your computer and use it in GitHub Desktop.
" Following lines added by drush vimrc-install on Fri, 19 Sep 2014 00:29:32 +0000.
set nocompatible
"filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-repeat'
Plugin 'tpope/vim-surround'
Plugin 'vim-scripts/rainbow_parentheses.vim'
Plugin 'mileszs/ack.vim'
Plugin 'derekwyatt/vim-scala'
Plugin 'Behat/Behat'
Plugin 'veloce/vim-behat'
" I don't know why this is Bundle instead of Plugin, but it only works this way.
Bundle 'nsf/gocode', {'rtp': 'vim/'}
execute pathogen#infect()
" VIM for Drupal below breaks ctags. :-(
execute pathogen#infect('/home/matt/.drush/vimrc/bundle/{}')
"" Settigns and remaps that it's OK for plugin settings to override.
set visualbell
" Relative line numbers
set relativenumber
"set undofile
" For real RegEx instead of Vim-style.
"nnoremap / /\v
"vnoremap / /\v
"Forward thru jumplist
nnoremap <F7> <C-i>
nnoremap <F6> <C-o>
" Replace All.
set gdefault
" Quick Escape.
inoremap jj <ESC>
" Convenience.
nnoremap ; :
" Shell toggle
nnoremap <C-d> :sh<CR>
" Diff unsaved changes
:command Changes w !diff -up - %
" Training wheels
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
" Indentation
set expandtab
set shiftwidth=2
set softtabstop=2
set autoindent "Smart Indent can interfere with filetype base rules.
" Syntastic plugin with Drupal Coding Standards
let g:syntastic_php_phpcs_args="--standard=Drupal --extensions=php,module,inc,install,test,profile,theme"
" from https://github.com/spf13/spf13-vim/blob/master/.vimrc
if has('statusline')
set laststatus=2
" Broken down into easily includeable segments
set statusline=%<%f\ " Filename
set statusline+=%w%h%m%r " Options
set statusline+=%{fugitive#statusline()} " Git Hotness
set statusline+=\ [%{&ff}/%Y] " filetype
" set statusline+=\ [%{getcwd()}] " current dir
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_enable_signs=1
set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info
endif
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
autocmd FileType c,cpp,java,php,js autocmd BufWritePre <buffer> :%s/\s\+$//e
autocmd FileType php setlocal omnifunc=phpcomplete_extended#CompletePHP
autocmd VimLeave * mksession! /home/matt/.session.vim
autocmd FileType md set filetype=markdown
autocmd FileType conf set filetype=yaml
autocmd FileType pp set filetype=puppet
let g:feature_filetype='behat'
if !exists('g:neocomplcache_omni_patterns')
let g:neocomplcache_omni_patterns = {}
endif
let g:neocomplcache_omni_patterns.behat = '\(When\|Then\|Given\|And\)\s.*$'
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplete.
let g:neocomplete#enable_at_startup = 1
" Use smartcase.
let g:neocomplete#enable_smart_case = 1
" Set minimum syntax keyword length.
let g:neocomplete#sources#syntax#min_keyword_length = 3
set wrap linebreak nolist
set colorcolumn=80
let &showbreak = '|> '
let &breakat = ' '
nnoremap <F8> :setl noai nocin nosi inde=<CR>
set backupdir=~/.vim/tmp,.
set directory=~/.vim/tmp,.
set ignorecase
set smartcase
set showmode
set showcmd
set t_Co=256
hi Folded ctermbg=233 ctermfg=248
set foldmethod=indent
set tags+=/home/matt/www/tags;
" For security.
set modelines=0
let @w ='O/** * */j'
let @e ='f$mqveykkA @param mixed po* *`ql'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment