-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
209 lines (160 loc) · 4.04 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
"" Global settings
set fileencoding=utf8
filetype plugin on
filetype indent on
filetype on
call pathogen#infect()
" set line length for all files at 78
autocmd FileType text setlocal textwidth=120
" important settings
set incsearch
set ignorecase
set hlsearch
" status line
set statusline=
set statusline+=%f\ %2*%m\ %1*%h
set statusline+=%#warningmsg#
set statusline+=%*
set statusline+=%r%=[%{&encoding}\ %{&fileformat}\ %{strlen(&ft)?&ft:'none'}]\ %12.(%c:%l/%L%)
set laststatus=2
set nocompatible
" backspace mode
set bs=2
" highlitt current line and add line numbers
set cursorline
set number
set guioptions=eg
syntax on
" yummy
set antialias
if has('gui')
if has('gui_gnome')
set guifont=DejaVu\ Sans\ Mono\ 8
elseif has('gui_macvim')
set guifont=Menlo:h12.00
set transparency=0
elseif has('gui_win32')
set guifont=Consolas:h8
endif
endif
" turn off the scrollbars and the rest of the crap
if ! has('gui')
set t_Co=256
endif
" colorz
set background=dark
let g:solarized_contrast='high'
colorscheme molokai_mac "Tomorrow-Night
" indent settings
set ruler
set showcmd
set softtabstop=2
set shiftwidth=2
set tabstop=2
set expandtab
" nice mappings
noremap <C-a> ^
noremap <C-e> $
noremap <C-P> :tabp<CR>
noremap <C-N> :tabn<CR>
noremap <leader>S /asdf<CR>
noremap <leader>- :sp<CR>
noremap <leader>\| :vsp<CR>
" sudo write
map w! w !sudo tee % >/dev/null
" better esc
ino jj <esc>
cno jj <c-c>
" better buffer/window/tab navigation
map ee <C-w>
nnoremap <D-d> <C-w>v<C-w>l
nnoremap <D-D> <C-w>s<C-w>j
" Bubble single lines
nmap <C-Up> ddkP
nmap <C-Down> ddp
" Bubble multiple lines
vmap <C-Up> xkP`[V`]
vmap <C-Down> xp`[V`]
" make tab key more better
noremap <tab> v>
noremap <s-tab> v<
vnoremap <tab> >gv
vnoremap <s-tab> <gv
"" Filetype specific settings
" json as javascript
au BufNewFile,BufRead *.json set filetype=javascript
" mustache templates
au BufNewFile,BufRead *.mustache set filetype=mustache
" markdown filetype
au BufNewFile,BufRead *.md,*.mkd,*.markdown set filetype=markdown
au BufNewFile,BufRead *.md,*.mkd,*.markdown set spell
" non ruby files
au BufNewFile,BufRead Gemfile,Gemfile.lock,Guardfile set filetype=ruby
au BufNewFile,BufRead Rakefile set filetype=rake
au BufNewFile,BufRead Rakefile set syntax=ruby
au BufNewFile,BufRead *.rake set filetype=rake
au BufNewFile,BufRead *.rake set syntax=ruby
au BufNewFile,BufRead *tmux.conf set syntax=tmux
" Python specific settings
let NERDTreeIgnore = ['\.pyc$', '\~$', '\.rbc$']
au BufNewFile,BufRead *.py set tabstop=4
au BufNewFile,BufRead *.py set softtabstop=4
au BufNewFile,BufRead *.py set shiftwidth=4
au BufNewFile,BufRead *.py set expandtab
"" Plugin settings
" screen.vim
let g:ScreenImpl='Tmux'
noremap <leader>S :ScreenShell
vnoremap <leader>s :ScreenSend<CR>
noremap <leader>s :ScreenSend<CR>
let twitvim_browser_cmd="open"
let twitvim_count = 50
let g:PreviewBrowsers='qlmanage -p'
:nmap <Leader>v :Preview<CR>
" syntastic
let g:syntastic_auto_loc_lis=1
let g:syntastic_enable_signs=1
" indent guides
let g:indent_guides_start_level=2
let g:indent_guides_guide_size=1
" gist vim
let g:gist_show_privates=1
let g:gist_clip_command = 'pbcopy'
let g:gist_open_browser_after_post = 1
" disable xrargs for grep.vim
let Grep_Find_Use_Xargs = 0
noremap <Leader>r :Rfgrep<CR>
" Ack
noremap <Leader>a :Ack
" command t
noremap <Leader>p :CommandT<CR>
noremap <Leader>l :CommandTBuffer<CR>
" Tagbar
noremap <leader>o :TagbarToggle<CR>
set tags=tags,.git/tags,TAGS
let g:tagbar_type_coffee = {
\ 'kinds' : [
\ 'f:functions',
\ 'o:object'
\ ],
\ 'kind2scope' : {
\ 'f' : 'object',
\ 'o' : 'object'
\},
\ 'sro' : ".",
\ 'ctagsbin' : 'coffeetags',
\ 'ctagsargs' : ' '
\}
" Nerdtree
noremap <Leader>n :NERDTreeToggle<CR>
let NERDTreeMinimalUI=1
let NERDTreeDirArrows=1
"" Functions
fun! <SID>StripTrailingWhitespaces()
let l = line(".")
let c = col(".")
%s/\s\+$//e
call cursor(l, c)
endfun
autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()
nnoremap <F5> :silent update<Bar>silent !xdg-open %:p &<CR>