-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
173 lines (137 loc) · 3.91 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
" Use Vim settings - in OSX with iTerm2
set nocompatible
" Pathogen!
call pathogen#infect()
" Syntastic settings
" Enable the status line
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
" Let the :Error window pop up automatically
let g:syntastic_auto_loc_list=1
let g:syntastic_auto_jump=1
let g:syntastic_mode_map={ 'mode': 'active','active_filetypes': [], 'passive_filetypes': ['html'] }
" Enable powerline symbols
" let g:Powerline_symbols = 'fancy'
" set encoding=utf-8
" set t_Co=256
set guifont=Inconsolatai-dz\ for\ Powerline:h15
let g:Powerline_symbols = 'fancy'
set encoding=utf-8
set t_Co=256
set term=xterm-256color
set termencoding=utf-8
" powerline in macvim
if has("gui_running")
let s:uname = system("uname")
if s:uname == "Darwin\n"
set guifont=Inconsolata-dz\ for\ Powerline:h15
endif
endif
" Turn on syntax highlighting, auto indent
syntax on
filetype plugin indent on
" Make searches case-sensitive only if they contain upper-case characters
set ignorecase
set smartcase
" Move all backups to one directory
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set backspace=indent,eol,start
" Tab settings and autoindent
set tabstop=3
set shiftwidth=3
"set softtabstop=4
set noexpandtab
set autoindent
set laststatus=2
set showmatch
set incsearch
" Solarized slate
set background=dark
colorscheme slate
" Line numbers
set number
" Don't show scroll bars in the GUI
set guioptions-=L
set guioptions-=r
" Use tab for auto complete
function! SuperTab()
if (strpart(getline('.'),col('.')-2,1)=~'^\W\?$')
return "\<Tab>"
else
return "\<C-n>"
endif
endfunction
imap <Tab> <C-R>=SuperTab()<CR>
" Maps jj to <esc>
inoremap jj <esc>
map <c-f> :CtrlPClearAllCaches <enter>
" Laravel Blade Syntax
au BufRead,BufNewFile *.blade.php set filetype=html
command! W :w
let mapleader=","
nnoremap <Leader>t :! php artisan test <CR>
" resize horzontal split window ^[[1;5A^[[1;5B^[[1;5C^[[1;5D]]]]]]]]
map <ESC>[D <C-W>><C-W>>
map <ESC>[C <C-W><<C-W><
" resize vertical split window
map <ESC>[A <C-W>+<C-W>+
map <ESC>[B <C-W>-<C-W>-
set wildignore+=*vendor*
" Toggle Vexplore with Ctrl-E
function! ToggleVExplorer()
if exists("t:expl_buf_num")
let expl_win_num = bufwinnr(t:expl_buf_num)
if expl_win_num != -1
let cur_win_nr = winnr()
exec expl_win_num . 'wincmd w'
close
exec cur_win_nr . 'wincmd w'
unlet t:expl_buf_num
else
unlet t:expl_buf_num
endif
else
exec '1wincmd w'
Vexplore
let t:expl_buf_num = bufnr("%")
endif
endfunction
map <silent> <C-E> :call ToggleVExplorer()<CR>
com! -nargs=* -bar -bang -complete=dir Lexplore call netrw#Lexplore(<q-args>, <bang>0)
fun! Lexplore(dir, right)
if exists("t:netrw_lexbufnr")
" close down netrw explorer window
let lexwinnr = bufwinnr(t:netrw_lexbufnr)
if lexwinnr != -1
let curwin = winnr()
exe lexwinnr."wincmd w"
close
exe curwin."wincmd w"
endif
unlet t:netrw_lexbufnr
else
" open netrw explorer window in the dir of current file
" (even on remote files)
let path = substitute(exists("b:netrw_curdir")? b:netrw_curdir : expand("%:p"), '^\(.*[/\\]\)[^/\\]*$','\1','e')
exe (a:right? "botright" : "topleft")." vertical ".((g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize) . " new"
if a:dir != ""
exe "Explore ".a:dir
else
exe "Explore ".path
endif
setlocal winfixwidth
let t:netrw_lexbufnr = bufnr("%")
endif
endfun
" absolute width of netrw window
let g:netrw_winsize = -28
" do not display info on the top of window
let g:netrw_banner = 0
" tree-view
let g:netrw_liststyle = 3
" sort is affecting only: directories on the top, files below
let g:netrw_sort_sequence = '[\/]$,*'
" use the previous window to open file
let g:netrw_browse_split = 4