-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvimrc
More file actions
executable file
·212 lines (168 loc) · 4.53 KB
/
vimrc
File metadata and controls
executable file
·212 lines (168 loc) · 4.53 KB
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
let mapleader=";"
set mouse=a
syntax on
set ts=4
set sw=4
set list
set si
set number
set hlsearch
set incsearch
" Quick selection
function! SelectIndent ()
let temp_var=indent(line("."))
while indent(line(".")-1) >= temp_var
exe "normal k"
endwhile
exe "normal V"
while indent(line(".")+1) >= temp_var
exe "normal j"
endwhile
endfun
nmap <Space><Space> :call SelectIndent()<CR>
nmap <Space> vi
nmap <S-Space> va
" clear search
nmap <leader>n :noh<CR>
set nodigraph
set shortmess=I
set nowrap
" Open files quickly
nmap <D-1> :FufFile <CR>
inoremap <D-1> <Esc>:FufFile <CR>
nmap <D-±> :FufBuffer <CR>
inoremap <D-±> <Esc>:FufBuffer <CR>
nmap <D-§> :FufCoverageFile <CR>
inoremap <D-§> <Esc>:FufCoverageFile <CR>
let g:bufExplorerShowRelativePath=1
" buffer sizes
map <C-M-D-RIGHT> :vertical res +10<CR>
map <C-M-D-DOWN> :res +10<CR>
map <C-M-D-LEFT> :vertical res -10<CR>
map <C-M-D-UP> :res -10<CR>
map <C-M-D-=> <C-W>=
" buffer nav
map <C-M-LEFT> <C-w><LEFT>
map <C-M-UP> <C-w><UP>
map <C-M-DOWN> <C-w><DOWN>
map <C-M-RIGHT> <C-w><RIGHT>
" starting
map <leader>§ <C-W>v<C-W>v<C-W>s
" open quick
map <leader>e :e <C-R>=expand("%:p:h") . "/" <CR>
map <leader>s :sp <C-R>=expand("%:p:h") . "/" <CR>
map <leader>v :vsp <C-R>=expand("%:p:h") . "/" <CR>
map <leader>t :tabe <C-R>=expand("%:p:h") . "/" <CR>
" Shift selection
map <S-LEFT> <Esc>vh
map <S-UP> <Esc>vk
map <S-DOWN> <Esc>vj
map <S-RIGHT> <Esc>vl
map <S-M-LEFT> <Esc>vb
map <S-M-UP> <Esc>v{
map <S-M-DOWN> <Esc>v}
map <S-M-RIGHT> <Esc>vw
map <S-D-LEFT> <Esc>v0
map <S-D-UP> <Esc>vgg
map <S-D-DOWN> <Esc>vG
map <S-D-RIGHT> <Esc>v$
inoremap <S-LEFT> <Esc>vh
inoremap <S-UP> <Esc>vk
inoremap <S-DOWN> <Esc>vj
inoremap <S-RIGHT> <Esc>vl
inoremap <S-M-LEFT> <Esc>vb
inoremap <S-M-UP> <Esc>v{
inoremap <S-M-DOWN> <Esc>v}
inoremap <S-M-RIGHT> <Esc>vw
inoremap <S-D-LEFT> <Esc>v0
inoremap <S-D-UP> <Esc>vgg
inoremap <S-D-DOWN> <Esc>vG
inoremap <S-D-RIGHT> <Esc>v$
vmap <S-LEFT> h
vmap <S-UP> k
vmap <S-DOWN> j
vmap <S-RIGHT> l
vmap <S-M-LEFT> b
vmap <S-M-UP> {
vmap <S-M-DOWN> }
vmap <S-M-RIGHT> w
vmap <S-D-LEFT> 0
vmap <S-D-UP> gg
vmap <S-D-DOWN> G
vmap <S-D-RIGHT> $
map <M-LEFT> b
map <M-UP> {
map <M-DOWN> }
map <M-RIGHT> w
" Use the same symbols as TextMate for tabstops, EOLs, spaces
"set listchars=tab:▸\ ,eol:¬,trail:·
" Autoinsert, autoindent brachets
inoremap {<CR> {<CR>}<Esc>O
set dictionary+=~/.vim/dico.txt
set complete-=k complete+=k
"make < > shifts keep selection
vnoremap < <gv
vnoremap > >gv
au Filetype html,xml,xsl,tl source ~/.vim/scripts/closetag.vim
au BufNewFile,BufRead *.less set filetype=less
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set wildmenu " Enhanced command line completion.
set wildmode=list:longest " Complete files like a shell.
" Auto scroll 5 lines when cursor is at the limit of the window
set scrolloff=3
" Selection does not include current character
set selection=inclusive
function! SetTabsLength(spaces)
let spaces = a:spaces
if a:spaces > 0
echo a:spaces
execute 'set tabstop='.spaces
execute 'set shiftwidth='.spaces
execute 'set expandtab'
else
set tabstop=4
set shiftwidth=4
set noexpandtab
endif
endfunction
command! -nargs=? ST :call SetTabsLength(<f-args>)
nmap <leader>i :set expandtab! <CR>
function! SearchAll(tar, ep)
let tar = a:tar
let ep = a:ep
execute 'vimgrep /'.ep.'/ **/'.tar
execute 'copen'
endfunction
command! -nargs=? F :call SearchAll('*', <f-args> )
command! -nargs=? L :call SearchAll('*.less', <f-args> )
command! -nargs=? J :call SearchAll('*.js', <f-args> )
command! -nargs=? H :call SearchAll('*.html', <f-args> )
" do no keep a backup file, use versions instead
set nobackup
" show the cursor position all the time
set ruler
" Source the vimrc file after saving it
if has("autocmd")
autocmd bufwritepost .vimrc source $MYVIMRC
endif
"set listchars=tab:▸\ ,eol:¬
if has("gui_macvim")
"let macvim_hig_shift_movement=0
set guioptions=egmrt
set listchars=tab:▸\ ,eol:¬,trail:·
set guifont=Inconsolata\-dz\ for\ Powerline:h12
else
endif
" Theme"
set background=dark
colorscheme base16-flat
"Invisible character colors
highlight NonText guifg=#354C55
highlight SpecialKey guifg=#354C55
set cursorline
let g:fuf_dir_exclude = '.target'
let g:fuf_mrufile_exclude = '\v\.DS_Store|\.git|\.swp|\.svn||target|\v\.class'
let g:fuf_file_exclude = '\v\.DS_Store|\.git|\.swp|\.svn|target|\v\.class'
source /usr/local/lib/python2.7/site-packages/powerline/bindings/vim/plugin/powerline.vim
set laststatus=2