Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
" Vundle configuration
set nocompatible " be iMproved, required
filetype off " required
" 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'
Plugin 'sjbach/lusty.git'
Plugin 'kien/ctrlp.vim.git'
Plugin 'arnaud-lb/vim-php-namespace.git'
Plugin 'danro/rename.vim.git'
" Here should be other plugins
" Bundle 'joonty/vim-phpqa.git'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - list configured plugins
" :PluginInstall(!) - install (update) plugins
" :PluginSearch(!) foo - search (or refresh cache first) for foo
" :PluginClean(!) - confirm (or auto-approve) removal of unused plugins
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
" Basics
set t_Co=256
colorscheme molokai
syntax on
set number
set tabstop=4
set expandtab
set smartindent
set autoindent
set shiftwidth=4
set directory=/tmp/
filetype plugin indent on
set nobackup " Don't make a backup before overwriting a file.
set nowritebackup " And again.
set wildmenu " Better completion
set wildmode=list:longest " BASH style completion
set wildignore=.svn,CVS,.git,.hg,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif,*.pyc,*.pyo,*.log,**/cache/**,**/logs/**,**/zend/**,**/vendor/**/vendor/**,web/css,web/js,web/bundles,*/project/*,*/target/*,*.hi
" Not sure theses 3 lines are usefull
set clipboard+=unnamedplus
set paste
set go+=a
set hidden
set showcmd
" Tags
:set tags+=vendor.tags
nnoremap <F7> :!ctags -h ".php" --PHP-kinds=+cf --recurse --exclude="*/cache/*" --exclude="*/logs/*" --exclude="*/data/*" --exclude="\.git" --exclude="\.svn" --languages=PHP
" Automatic folder creation
au BufWrite * :call <SID>MkdirsIfNotExists(expand('<afile>:h'))
function! <SID>MkdirsIfNotExists(directory)
if(!isdirectory(a:directory))
call system('mkdir -p '.shellescape(a:directory))
endif
endfunction
let mapleader=","
" Use the htmljinja syntax for twig files
au BufNewFile,BufRead *.twig set ft=htmljinja
" Remove trailing whitespaces and ^M chars
autocmd FileType c,cpp,java,php,js,css,html,xml,yml,vim,twig autocmd BufWritePre <buffer> :call setline(1,map(getline(1,"$"),'substitute(v:val,"\\s\\+$","","")'))
" In order to have right colors on tmux
if !has("gui_running")
set term=screen-256color
endif
" Make CTRLP checking tags
noremap <silent> <C-t> :CtrlPTag<cr>
" Add php namespace plugin
" Add a `use` statement while tapping `,u`
inoremap <Leader>u <C-O>:call PhpInsertUse()<CR>
noremap <Leader>u :call PhpInsertUse()<CR>