@@ -21,6 +21,7 @@ set hidden " Useful for auto setting hidden buffers
2121syntax enable " Enable syntax highlighting
2222set nostartofline " Don't reset cursor to start of line when moving around
2323set ttyfast
24+ set history = 1000
2425
2526" Searching/Moving {{{2
2627" nnoremap / /\v
@@ -35,30 +36,25 @@ nnoremap k gk
3536
3637" Appearance {{{2
3738" set number " Always show line numbers
38- set listchars = tab :▸ \ ,trail: ·,eol :¬ " Use new symbols for tabstops and EOLs
39+ set listchars = tab :\| \ ,trail: ·,eol :¬ " Use new symbols for tabstops and EOLs
3940set ts = 2 sts = 2 sw = 2 noexpandtab " Default tab stops
41+ set backspace = indent ,eol ,start
4042set showcmd " Shows incomplete command
4143set novb noeb " Turn off visual bell and remove error beeps
4244set splitbelow " New window goes below
4345set splitright " New windows goes right
44- set wildignore += * .jpg,* .jpeg,* .gif,* .png,* .gif,* .psd,* .o ,* .obj,* .min .js
45- set wildignore += * /smarty/ * ,* /vendor/ * ,* /node_modules/ * ,* /.git/ * ,* /.hg/ * ,* /.svn/ * ,* /.sass-cache/ * ,* /log/ * ,* /tmp/ * ,* /build/ * ,* /ckeditor/ *
4646set wildmenu " Enhance command-line completion
4747set wildmode = longest:full,full
48+ set wildignore += * .jpg,* .jpeg,* .gif,* .png,* .gif,* .psd,* .o ,* .obj
49+ set wildignore += * /smarty/ * ,* /vendor/ * ,* /node_modules/ * ,* /.git/ * ,* /.hg/ * ,* /.svn/ * ,* /.sass-cache/ * ,* /log/ * ,* /tmp/ * ,* /build/ * ,* /ckeditor/ * ,* .DS_Store
4850set encoding = utf- 8
4951set cursorline " Highlight current line
5052set laststatus = 2 " Always show the statusline
5153set t_Co = 256 " Explicitly tell Vim that the terminal supports 256 colors
52- set backspace = indent ,eol ,start
5354
5455" Colors and Theme {{{2
5556set background = dark
5657colorscheme badwolf
57-
58- " Do I need this
59- if &t_Co > 2 || has (" gui_running" )
60- syntax on " Enable syntax highlighting
61- endif
6258" Auto Commands {{{1
6359" Auto source vimrc on save {{{2
6460augroup reload_vimrc " {
7773
7874" Save on losing focus {{{2
7975au FocusLost * :wa
76+ " Resize splits when window is resized {{{2
77+ au VimResized * exe " normal! \<c-w> ="
8078" Clean up nasty wysiwig html {{{2
8179" Install pandoc first
8280" https://code.google.com/p/pandoc/downloads/list
@@ -97,31 +95,49 @@ if has("autocmd")
9795 autocmd FileType html setlocal formatexpr = FormatprgLocal (pandoc_pipeline)
9896endif
9997" Mappings {{{1
100- inoremap <C-c> <ESC> " Just smart
101- inoremap jj <ESC> :w<CR>
102-
98+ " Stuff {{{2
10399
104100command ! W w " Remap :W to :w
105101
106102nnoremap Y y$ " Yank to end of line with Y
107-
108- " Visually select the text that was last edited/pasted
109- nmap gV `[v`]
103+ nnoremap D d$ " Delete to end of line with D
110104
111105" like gv but for pasted text
112106" nnoremap <leader>v V`]
113107
114108" Not sure about this one quite yet
115109" nnoremap ; :
116110
117- nmap fq :q!<CR>
111+ " :Wrap to wrap lines command! -nargs=* Wrap set wrap linebreak nolist
112+
113+ " Visual Selection {{{2
114+
115+ " Fix linewise visual selection of various text objects
116+ nnoremap Vat vatV
117+ nnoremap Vab vabV
118+ nnoremap VaB vaBV
119+
120+ " Don't move on *
121+ nnoremap * *<c-o>
122+
123+ " Visually select the text that was last edited/pasted
124+ nmap gV `[v`]
125+
126+ " Searching {{{2
127+
118128" Control space to search mode
119129nnoremap <Nul> /
120130
121- " :Wrap to wrap lines command! -nargs=* Wrap set wrap linebreak nolist
131+ " Keep search matches in the middle of the window
132+ nnoremap n nzzzv
133+ nnoremap N Nzzzv
134+ " Escaping {{{2
135+ inoremap <C-c> <ESC> " Just smart
136+ inoremap jj <ESC> :w<CR>
137+
138+ " Force quit that bitch
139+ nmap fq :q!<CR>
122140
123- " Toggle errors
124- nmap <leader> st :SyntasticToggleMode<cr>
125141" Filetype {{{2
126142nmap _ht :set ft=html<CR>
127143nmap _ph :set ft=php<CR>
@@ -136,6 +152,9 @@ nmap _vi :set ft=vim<CR>
136152nnoremap <Space> za
137153" nnoremap <Space> /
138154
155+ " Use ,z to "focus" the current fold
156+ nnoremap <leader> z zMzvzz
157+
139158" Bubble single lines {{{2
140159nmap <C-Up> [e
141160nmap <C-Down> ]e
@@ -160,13 +179,13 @@ nnoremap <C-e> 3<C-e> " Speed up viewport scrolling
160179nnoremap <C-y> 3<C-y>
161180
162181" Syntax highlighting groups for word under cursor {{{2
163- nmap <C-S-P> :call <SID> SynStack()<CR>
164- function ! <SID> SynStack ()
165- if ! exists (" *synstack" )
166- return
167- endif
168- echo map (synstack (line (' .' ), col (' .' )), ' synIDattr(v:val, "name")' )
169- endfunc
182+ " nmap <C-S-P> :call <SID>SynStack()<CR>
183+ " function! <SID>SynStack()
184+ " if !exists("*synstack")
185+ " return
186+ " endif
187+ " echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
188+ " endfunc
170189
171190" Awesome fucking pasting {{{2
172191function ! WrapForTmux (s )
@@ -338,6 +357,16 @@ endfunction
338357" run test runner
339358map <leader> t :call RunTestFile()<cr>
340359map <leader> T :call RunNearestTest()<cr>
360+ " Visual Mode */# from Scrooloose {{{2
361+ function ! s: VSetSearch ()
362+ let temp = @@
363+ norm! gvy
364+ let @/ = ' \V' . substitute (escape (@@ , ' \' ), ' \n' , ' \\n' , ' g' )
365+ let @@ = temp
366+ endfunction
367+
368+ vnoremap * :<C-u> call <SID> VSetSearch()<CR> //<CR><c-o>
369+
341370" Plugins {{{1
342371" Easy-motion {{{2
343372" let g:EasyMotion_leader_key = '<Leader>'
@@ -375,6 +404,8 @@ let g:rbpt_loadcmd_toggle = 0
375404" Syntastic {{{2
376405let g: syntastic_auto_loc_list = 1
377406let g: syntastic_loc_list_height = 5
407+ " Toggle errors
408+ nmap <leader> st :SyntasticToggleMode<cr>
378409" Tabularize {{{2
379410if exists (" :Tabularize" )
380411nmap <Leader> a= :Tabularize /=<CR>
0 commit comments