if $SHELL =~ 'bin/fish'
set shell=/bin/sh
endif
set nocompatible " no vi compatibility
filetype off
if has('win32') || has('win64')
set rtp+=~/vimfiles/bundle/vundle/
call vundle#rc('$HOME/vimfiles/bundle/')
set guifont=DejaVu\ Sans\ Mono:h11
else
" Usual quickstart instructions
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
if has("gui_macvim")
set guifont=DejaVu\ Sans\ Mono:h12
else
set guifont=DejaVu\ Sans\ Mono\ 11
endif
endif
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'kien/ctrlp.vim'
Bundle 'bling/vim-airline'
Bundle 'scrooloose/nerdtree'
Bundle 'hesselbom/vim-hsftp'
Bundle 'Shougo/neocomplcache.vim'
Bundle 'Shougo/neosnippet'
Bundle 'mattn/emmet-vim'
"Bundle 'Yggdroot/indentLine'
Bundle 'scrooloose/syntastic'
Bundle 'othree/javascript-libraries-syntax.vim'
Bundle 'terryma/vim-multiple-cursors'
Bundle 'Valloric/MatchTagAlways'
Bundle 'evidens/vim-twig'
Bundle 'arnaud-lb/vim-php-namespace'
Bundle 'terryma/vim-multiple-cursors'
Bundle 'Valloric/MatchTagAlways'
" Bundle 'Shougo/vimproc'
" Bundle 'm2mdas/phpcomplete-extended'
filetype plugin indent on
set encoding=utf8
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Files, backups and undo
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Turn backup off, since most stuff is in SVN, git anyway...
set nobackup
set nowb
set noswapfile
set vb
autocmd GUIEnter * set vb t_vb= "disable visual bells gvim "disable visual bells for gvim
autocmd VimEnter * set vb t_vb= "disable visual bells in vim " disable visual bells for vim
syntax enable
" colors
set t_Co=256
set background=dark
if has('gui_running')
colorscheme Tomorrow-Night
else
colorscheme Tomorrow
endif
"Persistent undo
try
set undodir=~/.vim/undodir
set undofile
catch
endtry
set hidden "allow to jumping between modified buffers
set cf " Enable error files & error jumping.
set history=256 " Number of things to remember in history.
"set ruler " Ruler on
set nu " Line numbers on
set nowrap " Line wrapping off
set timeoutlen=250 " Time to wait after ESC (default causes an annoying delay)
set cursorline
" Formatting
set tabstop=4 " Tabs are 2 spaces
set shiftwidth=4 " Tabs under smart indent
set expandtab
set smarttab
set cindent
set autoindent
set bs=2 " Backspace over everything in insert mode
set nocp incsearch
set colorcolumn=80
set formatoptions=tcqr
" Make backspce behave more normally
set backspace=indent,eol,start " Visual
" searching
set hlsearch " highlight all search results
set incsearch " increment search
set ignorecase " case-insensitive search
set smartcase " uppercase causes case-sensitive search
set showmatch " Show matching brackets.
set mat=5 " Bracket blinking.
let g:airline_powerline_fonts = 0
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline#extensions#tabline#buffer_nr_show = 1
let g:airline#extensions#tabline#buffer_max = 500
set cmdheight=1
set noshowmode " hide original status line because of airline
set laststatus=2 " Always show status line.
function! SaveProper()
:set et| retab " change indent to spaces and retab
:set ff=unix " set line endings to unix
:%s/\s\+$//e " delete trailing whitespace
:update " write to disk
endfunction
" keyboard remaps
let mapleader = ","
inoremap jk <esc>
"nnoremap <silent> <C-s> :update<CR>
nnoremap <silent> <C-s> :call SaveProper()<CR>
nnoremap <space> 10jzz
nnoremap <backspace> 10kzz
nnoremap <leader>n :NERDTreeToggle<cr>
nnoremap <leader>N :NERDTreeFind<cr>
nnoremap <C-tab> :bn<CR>
nnoremap <C-S-tab> :bp<CR>
inoremap <C-tab> <Esc>:bn<CR>i
inoremap <C-S-tab> <Esc>:bp<CR>i
vmap <C-c> "+y
vmap <C-p> "+gP
imap <C-c> "+y
imap <C-p> "+gP
nmap <C-c> "+y
nmap <C-p> "+gP
imap <c-l> <space>=><space>
imap <c-b> ->
" let g:netrw_liststyle = 3
" sftp shortcuts
nnoremap <silent> <leader>s :Hupload<CR>
nnoremap <silent> <leader>d :Hdownload<CR>
" neocomplcache
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_ctags_program = "ctags"
" neosnippet
" Plugin key-mappings.
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
"Ctrl P
let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:10,results:10'
" SuperTab like snippets behavior.
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
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType php setlocal omnifunc=javascriptcomplete#CompletePHP
let g:neocomplcache_max_list = 10
let g:neocomplcache_auto_completion_start_length = 3
" emmet
let g:user_emmet_leader_key = '<c-tab>'
"syntastic
let g:syntastic_html_checkers=[]
" indentline
let g:indentLine_color_gui = '#111111'
let g:indentLine_char = '│'
" javascript libraries
let g:used_javascript_libs = 'underscore,angularjs,jquery'
" airline
let g:airline_left_sep=''
let g:airline_right_sep=''
"php namespace
set tags+=./tags.vendors,tags.vendors
inoremap <Leader>u <C-O>:call PhpInsertUse()<CR>
noremap <Leader>u :call PhpInsertUse()<CR>
inoremap <Leader>e <C-O>:call PhpExpandClass()<CR>
noremap <Leader>e :call PhpExpandClass()<CR>
" php-extend
autocmd FileType php setlocal omnifunc=phpcomplete_extended#CompletePHP
" gvim specific
set mousehide " Hide mouse after chars typed
set mouse=a " Mouse in all modesc
set guioptions-=m "Hide toolbar
set guioptions-=T "Hide menubar
set guioptions-=L "Hide scrollbar