forked from FPerezP/myvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
215 lines (173 loc) · 6.26 KB
/
vimrc
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
set nocompatible " Use Vim defaults instead of 100% vi compatibility
" Now we set some defaults for the editor
set autoindent " always set autoindenting on
set backupcopy=yes " Keep a backup file
set viminfo='20,\"50 " read/write a .viminfo file, don't store more than 50 lines of registers
set history=100 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set expandtab
set tabstop=4
set listchars=tab:>.,trail:-,extends:>,precedes:<
set list
set encoding=utf-8
set shiftwidth=2
" Set leader to comma.
let mapleader = ","
let maplocalleader = ","
" Don't redraw screen while executing macros.
set nolazyredraw
" Flexible backspace: allow backspacing over autoindent, line breaks, start of insert.
set backspace=indent,eol,start
" Set title of window according to filename.
set title
" Break line at 80 chars
"set tw=79
" When editing a file, always jump to the last known cursor position. Don't
" " do it when the position is invalid or when inside an event handler
" (happens
" " when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
" first set path
set path+=**
" Suffixes that get lower priority when doing tab completion for filenames.
" These are files we are not likely to want to edit or read.
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
if &term =~ '^screen'
" tmux will send xterm-style keys when its xterm-keys option is on
execute "set <xUp>=\e[1;*A"
execute "set <xDown>=\e[1;*B"
execute "set <xRight>=\e[1;*C"
execute "set <xLeft>=\e[1;*D"
endif
" We know xterm-debian is a color terminal
if &term =~ "xterm-debian" || &term =~ "xterm-xfree86"
set t_Co=16
set t_Sf=[3%dm
set t_Sb=[4%dm
endif
" Make p in Visual mode replace the selected text with the "" register.
vnoremap p <Esc>:let current_reg = @"<CR>gvdi<C-R>=current_reg<CR><Esc>
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
syntax on
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
set background=dark
if has("autocmd")
" Enabled file type detection
" Use the default filetype settings. If you also want to load indent files
" to automatically do language-dependent indenting add 'indent' as well.
filetype plugin on
endif " has ("autocmd")
" Some Debian-specific things
augroup filetype
au BufRead reportbug.* set ft=mail
au BufRead reportbug-* set ft=mail
au BufRead *.module set ft=php
au BufRead *.class set ft=php
au BufRead *.inc set ft=php
au BufRead *.install set ft=php
au BufRead *.profile set ft=php
au BufRead *.test set ft=php
augroup END
" Set paper size from /etc/papersize if available (Debian-specific)
try
if filereadable('/etc/papersize')
let s:papersize = matchstr(system('/bin/cat /etc/papersize'), '\p*')
if strlen(s:papersize)
let &printoptions = "paper:" . s:papersize
endif
unlet! s:papersize
endif
catch /E145/
endtry
nnoremap <C-L> :%s/\s\+$//<cr>:let @/=''<CR>:noh<CR>
set vb t_vb=
set number
set nowrap
map <silent> <C-A-Left> :tabprevious<CR>
map <silent> <C-A-Right> :tabnext<CR>
map <silent> <C-A-S-Left> :execute 'silent! tabmove ' . (tabpagenr()-2)<CR>
map <silent> <C-A-S-Right> :execute 'silent! tabmove ' . tabpagenr()<>
map <silent> <S-n> :FufCoverageFile<CR>
map <silent> <C-f> :NERDTreeToggle<CR>
map <silent> <C-n> :tabe<CR>
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" My Bundles here:
" original repos on github
Bundle 'ervandew/supertab'
Bundle 'scrooloose/syntastic'
Bundle 'sumpygump/php-documentor-vim'
" Bundle 'joestelmach/lint.vim'
Bundle 'garbas/vim-snipmate'
Bundle 'MarcWeber/vim-addon-mw-utils'
Bundle "tomtom/tlib_vim"
" Bundle "honza/snipmate-snippets"
Bundle 'tpope/vim-fugitive'
Bundle 'scrooloose/nerdtree'
Bundle 'jistr/vim-nerdtree-tabs'
" vim-scripts repos
Bundle 'L9'
Bundle 'FuzzyFinder'
" Bundle vim-airline
Bundle 'bling/vim-airline'
" Bundle gitgutter
Bundle 'airblade/vim-gitgutter'
" Bundle vim-puppet
Bundle 'rodjek/vim-puppet'
" Bundle 'Lokaltog/vim-easymotion'
" Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
" non github repos
" Bundle 'git://git.wincent.com/command-t.git'
" gitgutter config
set updatetime=250
let g:gitgutter_max_signs = 500 " default value
filetype plugin indent on " required!
" Brief help
" :BundleList - list configured bundles
" :BundleInstall(!) - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!) - confirm(or auto-approve) removal of unused bundles
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..
"NERDTree open for all tabs
let g:nerdtree_tabs_open_on_console_startup=1
let NERDTreeDirArrows = 1
" Search
set hlsearch " highlight matches
set incsearch " incremental searching
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
" set backupdir=~/.vim/_backup " where to put backup files.
" set directory=~/.vim/_temp " where to put swap files.
" Create _folders if dont exist
" silent !mkdir ~/.vim/_backup > /dev/null 2>&1
" silent !mkdir ~/.vim/_temp > /dev/null 2>&1
" Key maps for phpDocumentor
au BufRead,BufNewFile *.php inoremap <buffer> <C-P> :call PhpDoc()<CR>
au BufRead,BufNewFile *.php nnoremap <buffer> <C-P> :call PhpDoc()<CR>
au BufRead,BufNewFile *.php vnoremap <buffer> <C-P> :call PhpDocRange()<CR>
" airlines preferences
set t_Co=256
set laststatus=2 " always show the status bar
let g:airline_enable_syntastic=1
let g:airline_powerline_fonts=1
" unicode symbols
let g:airline_left_sep = '▶'
let g:airline_right_sep = '◀'
let g:airline_linecolumn_prefix = ' '
let g:airline_fugitive_prefix = '⎇ '
let g:airline_paste_symbol = 'ρ'
let g:airline_readonly_symbol = '✗'
let g:pdv_cfg_Package = 'Crononauta'
let g:pdv_cfg_Author = 'Javier Carranza <[email protected]>'
let g:pdv_cfg_ClassTags = ["package","author","version"]