-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
214 lines (173 loc) · 6.78 KB
/
Copy pathvimrc
File metadata and controls
214 lines (173 loc) · 6.78 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
212
213
214
filetype off
runtime bundle/vim-pathogen/autoload/pathogen.vim
call pathogen#infect()
call pathogen#helptags()
syntax on
filetype plugin indent on
call pathogen#infect()
set nocompatible " We don't want vi compatibility.
set smarttab
set autoindent
set expandtab
set tags=tags;
set hidden
set guioptions-=T "remove toolbar
set guioptions-=r "remove right-hand scroll bar
set fileformats=unix,dos
set showmatch " Show matching brackets.
set mat=5 " Bracket blinking.
set lcs=eol:$,trail:~,extends:>,precedes:< " Show $ at end of line and trailing space as ~
set novisualbell " No blinking .
set noerrorbells " No noise.
set laststatus=2 " Always show status line.
set hidden
set history=1000
set wildmenu
set wildmode=list:longest
set ignorecase
set smartcase
set scrolloff=3
set backup " Enable creation of backup file.
set backupdir=~/.vim/backups " Where backups will go.
set directory=~/.vim/tmp " Where temporary files will go.
set ruler
set statusline=%<%f%h%m%r%y%=%03b\ 0x%02B\ \ %04l,%03c\ %P
set hlsearch " Highlight search terms...
set incsearch " ...dynamically as they are typed.
set backspace=indent,eol,start " Intuitive backspacing in insert mode
set foldmethod=indent "fold based on indent
set foldnestmax=10 "deepest fold is 10 levels
set nofoldenable "dont fold by default
set foldlevel=1 "this is just what i use
set number
set background=dark
set t_Co=256
set shortmess=atI
set listchars=tab:>-,trail:.,eol:$
colorscheme solarized
" I always hit wq by accident on my small laptop keyboard, so disable it.
cabbrev wq w
nnoremap ' `
nnoremap ` '
let mapleader = ","
let maplocalleader = "."
nnoremap <C-e> 3<C-e>
nnoremap <C-y> 3<C-y>
nmap <silent> <leader>n :silent :nohlsearch<CR>
nmap <silent> <leader>s :set nolist!<CR>
"This unsets the "last search pattern" register by hitting return
nnoremap <CR> :noh<CR>
" nnoremap <esc> :noh<return><esc>
" noremap n n:call HighlightNearCursor()<CR>
" noremap N N:call HighlightNearCursor()<CR>
" noremap * *:call HighlightNearCursor()<CR>
" function HighlightNearCursor()
" match Todo /\k*\%#\k*/
" endfunction
let g:netrw_keepdir=0
function MultiExtensionFiletype()
let ft_default=&filetype
let ft_prefix=substitute(matchstr(expand('%'),'\..\+\.'),'\.','','g')
sil exe "set filetype=" . ft_prefix . "." . ft_default
endfunction
autocmd BufReadPost *.*.* call MultiExtensionFiletype()
au FileType c,cc,cpp,h,hh,hpp,java,objc,objcpp :set autoindent expandtab cin shiftwidth=4 softtabstop=4 cino +=(0
au FileType html,htm,jsp :set autoindent expandtab cin shiftwidth=2 softtabstop=2 cino +=(0
au FileType xml :set autoindent expandtab cin shiftwidth=2 softtabstop=2
au FileType cucumber :set autoindent expandtab cin shiftwidth=2 softtabstop=2
au FileType perl :set autoindent expandtab cin shiftwidth=2 softtabstop=2
au FileType make :set noautoindent noexpandtab shiftwidth=4 tabstop=4 softtabstop=0
" Javascript stuff
au FileType javascript set autoindent expandtab cin shiftwidth=2 softtabstop=2 cino +=(0
au FileType javascript set omnifunc=javascriptcomplete#CompleteJS
" Python stuff
au FileType python :set autoindent expandtab cin shiftwidth=4 softtabstop=4 cino +=(0
au BufNewFile,BufRead *.mako set filetype=mako
" Ruby stuff
au FileType ruby,eruby set autoindent expandtab cin shiftwidth=2 softtabstop=2 cino +=(0
au FileType ruby,eruby set omnifunc=rubycomplete#Complete
au FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
au FileType ruby,eruby let g:rubycomplete_rails = 1
au FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
au BufNewFile,BufRead *.thor set filetype=ruby
au BufNewFile,BufRead .autotest set filetype=ruby
au BufNewFile,BufRead Gemfile set filetype=ruby
au BufNewFile,BufRead *.yaml,*.yml setf yaml
au BufNewFile,BufRead *.jst set syntax=jst
au BufNewFile,BufRead *.j :set syntax=objj
" MapServer config file
au BufNewFile,BufRead *.map setf map
au FileType map set shiftwidth=2 softtabstop=2 et
" VimOrganizer
" au! BufRead,BufWrite,BufWritePost,BufNewFile *.org
" au BufEnter *.org call org#SetOrgFileType()
" let g:org_todo_setup='TODO | DONE | NEXT | WAITING'
" let g:org_tags_alist='{@home(h) @work(w) @tennisclub(t)} {easy(e) hard(d)} {computer(c) phone(p)}'
" let g:org_agenda_select_dirs=["~/org_files"]
" let g:agenda_files = split(glob("~/org_files/org-mod*.org"),"\n")
" let g:org_todo_custom_highlights =
" \ { 'NEXT': { 'guifg':'#888888', 'guibg':'#222222',
" \ 'ctermfg':'gray', 'ctermbg':'darkgray'}
" \ 'WAITING': { 'guifg':'red',
" \ 'ctermfg':'red' } }
" Todo.txt
autocmd BufNewFile,BufRead *.task,*.todo,todo.txt setf todo
" Quicktask
" autocmd BufNewFile,BufRead *.task,*.todo,todo.txt setf quicktask
" let g:quicktask_autosave = 1
" let g:quicktask_snip_path = '~/quicktask/snips'
" Fuzze match
let g:fuzzy_ignore = "*.log"
let g:fuzzy_matching_limit = 70
map <silent> <leader>f :FufFileWithCurrentBufferDir<CR>
" map <silent> <leader>b :FufBuffer<CR>
let g:NERDTreeDirArrows=0 " Turn off the nifty unicode arrows, don't work everywhere
map <leader>N :NERDTreeToggle<CR>
map <leader>n :NERDTree<CR>
let NERDTreeMapActivateNode='<CR>'
let NERDTreeShowBookmarks=1
let NERDTreeChDirMode=2
let NERDTreeQuitOnOpen=1
let NERDTreeIgnore=['\.pyc','\.o']
" specky
" let g:speckyQuoteSwitcherKey = "<leader>'"
" let g:speckyRunRdocKey = "<leader>r"
" let g:speckySpecSwitcherKey = "<leader>t"
let g:speckyRunSpecKey = "<leader>T"
let g:speckyRunSpecCmd = "bundle exec rspec -fs"
" let g:speckyRunSpecCmd = "rspec -r ~/.vim/bundle/specky/ruby/specky_formatter.rb -f SpeckyFormatter"
let g:speckyWindowType = 1
" taglist
" map <leader>m :TlistToggle<CR>
" let Tlist_Exit_OnlyWindow = 1 " exit if taglist is last window open
" let Tlist_Show_One_File = 1 " Only show tags for current buffer
" bufexplorer
let g:bufExplorerShowRelativePath=1 " Show relative paths.
map <silent> <leader>bb :BufExplorer<CR>
let g:SuperTabDefaultCompletionType = "context"
function IndentV()
Tabularize /\s=\s/l0c0
Tabularize /^[^:]*\zs:/l0
Tabularize /=>/
" Tabularize /^[^=>]*\zs=>/l1
endfunction
map <Leader>iv :call IndentV()<cr>
" Comment line out to 80 characters
map <leader>co O<Esc>85A#<Esc>==<ESC>0<ESC>80l<ESC>100x<ESC>l
" NERDCommenter
" Add a space after the comment delimiter
let NERDSpaceDelims = 1
" Next and last buffer switching
map <leader>k :bprev<CR>
map <leader>l :bnext<CR>
" CTRLP
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
" let g:ctrlp_root_markers = ''
let g:ctrlp_working_path_mode = 'ra'
nnoremap <leader>y "=strftime("%c")<CR>P
compiler rubyunit
nmap <Leader>a :cf /tmp/autotest.txt<CR> :compiler rubyunit<CR>
nmap <Leader>kd a<C-R>=strftime("%D %A")<CR><Esc>o <Esc>,kt
nmap <Leader>kt a<C-R>=strftime("%H%M")<CR> -
imap <Leader>kt <C-R>=strftime("%H%M")<CR> -