-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
executable file
·203 lines (155 loc) · 6.25 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
set nocompatible " Must come first because it changes other options.
let g:rubytest_in_quickfix = 1
let g:LustyJugglerSuppressRubyWarning = 1
let g:erlangHighlightBif = 1
silent! call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
filetype plugin indent on " Turn on file type detection.
syntax enable " Turn on syntax highlighting.
set ofu=syntaxcomplete#Complete
set completeopt=longest,menuone
set modelines=0
if !exists("autocmd_colorscheme_loaded")
let autocmd_colorscheme_loaded = 1
autocmd ColorScheme * highlight TodoRed ctermbg=darkgreen guibg=#002b37 ctermfg=LightRed guifg=#E01B1B
autocmd ColorScheme * highlight TodoOrange ctermbg=darkgreen guibg=#002b37 ctermfg=LightMagenta guifg=#E0841B
autocmd ColorScheme * highlight TodoYellow ctermbg=darkgreen guibg=#002b37 ctermfg=LightYellow guifg=#E0D91B
endif
if has("autocmd")
if v:version > 701
autocmd Syntax * call matchadd('TodoRed', '\W\zs\(TODO1\)')
autocmd Syntax * call matchadd('TodoOrange', '\W\zs\(TODO2\)')
autocmd Syntax * call matchadd('TodoYellow', '\W\zs\(TODO3\)')
endif
endif
" let g:solarized_termcolors=16¬
colorscheme neverland2 " Set theme
runtime macros/matchit.vim " Load the matchit plugin.
set showcmd " Display incomplete commands.
set showmode " Display the mode you're in.
set backspace=indent,eol,start " Intuitive backspacing.
set hidden " Handle multiple buffers better.
set wildmenu " Enhanced command line completion.
set wildmode=list:longest " Complete files like a shell.
set ignorecase " Case-insensitive searching.
set smartcase " But case-sensitive if expression contains a capital letter.
set number " Show line numbers.
set ruler " Show cursor position.
set cursorline
set numberwidth=5
set incsearch " Highlight matches as you type.
set hlsearch " Highlight matches.
set wrap " Turn on line wrapping.
set scrolloff=3 " Show 3 lines of context around the cursor.
set linebreak
set formatoptions=tq
set wrapmargin=4
set textwidth=78
set title " Set the terminal's title
set visualbell " No beeping.
set nobackup " Don't make a backup before overwriting a file.
set nowritebackup " And again.
set directory=$HOME/.vim/tmp//,. " Keep swap files in one location
" Tab and indent settings
set tabstop=2 " Global tab width.
set shiftwidth=2 " And again, related.
set expandtab " Use spaces instead of tabs
set smarttab
set laststatus=2 " Show the status line all the time
set autoindent
set smartindent
set encoding=utf-8
set shell=/bin/bash " Some commands seem to have problems with zsh"
set spl=en_us spell " Enable spell checker
set wildignore+=log,tmp,*.swp " Useful status information at bottom of screen
set statusline=[%n]\ %<%.99f\ %h%w%m%r%y\ %{fugitive#statusline()}%{exists('*CapsLockStatusline')?CapsLockStatusline():''}%=%-16(\ %l,%c-%v\ %)%P
set nofoldenable " Fuck you auto folding, go suck a dick
let mapleader = "," " Change leader to ,
" Better regexp search
nnoremap / /\v
vnoremap / /\v
set gdefault
nnoremap <leader><space> :noh<cr>
nnoremap <tab> %
vnoremap <tab> %
" No more arrow keys to move around
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
nnoremap j gj
nnoremap k gk
" nmap <leader>l :set list!<CR> " Shortcut to rapidly toggle `set list`
set listchars=tab:▸\ ,eol:¬ " Use the same symbols as TextMate for tabstops and EOLs
set list!
" Tab mappings.
"map <leader>tt :tabnew<cr>
"map <leader>te :tabedit
"map <leader>tc :tabclose<cr>
"map <leader>to :tabonly<cr>
"map <leader>tn :tabnext<cr>
"map <leader>tp :tabprevious<cr>
"map <leader>tf :tabfirst<cr>
"map <leader>tl :tablast<cr>
"map <leader>tm :tabmove
"map <leader>T :CommandT<cr>
"map <Leader>r <Plug>RubyTestRun " change from <Leader>t to <Leader>\\\\
map <Leader>R <Plug>RubyFileRun " change from <Leader>T to <Leader>]
map <leader>d :execute 'NERDTreeToggle ' . getcwd()<CR>
" Get rid of awkward Ex-mode
map Q <Esc>
imap <C-l> <space>=><space>
" Automatic fold settings for specific files. Uncomment to use.
" autocmd FileType ruby set foldmethod=syntax
" autocmd FileType css setlocal foldmethod=indent shiftwidth=2 tabstop=2
" For the MakeGreen plugin and Ruby RSpec. Uncomment to use.
" autocmd BufNewFile,BufRead *_spec.rb compiler rspec
set backupdir=~/.backup,.
set directory=~/.backup,~/.tmp,.
let g:yankring_history_file = '.backup/yankring' " Yankring History File Location
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
" Auto complete for ruby files
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
"improve autocomplete menu color
highlight Pmenu ctermbg=238 gui=bold
" display Syntax Errors
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_enable_signs=1
" Clear white spaces
function! Preserve(command)
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
execute a:command
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction
nmap _$ :call Preserve("%s/\\s\\+$//e")<CR>
nmap _= :call Preserve("normal gg=G")<CR>
"nmap <leader>t :LustyBufferExplorer<CR>
" Remove Trailing Whitespace
nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
" Faster Ack search
nnoremap <leader>a :Ack
" html fold tag
nnoremap <leader>ft Vatzf
" Hard wrap
nnoremap <leader>q gqip
inoremap jj <ESC>
set winwidth=84
"set winheight=5
"set winminheight=5
"set winheight=999
cd ~/Code " Set dir