Permalink
Browse files

Fold vim/plugin functionality back into vimrc

  • Loading branch information...
1 parent ced4ca5 commit e76f8b0ba649db0c1cea8e520d0136273534e65a @nelstrom committed Nov 14, 2012
@@ -1,23 +0,0 @@
-" Wipe all buffers which are not active (i.e. not visible in a window/tab)
-" Using elements from each of these:
-" http://stackoverflow.com/questions/2974192
-" http://stackoverflow.com/questions/1534835
-command! -nargs=* Only call CloseHiddenBuffers()
-function! CloseHiddenBuffers()
- " figure out which buffers are visible in any tab
- let visible = {}
- for t in range(1, tabpagenr('$'))
- for b in tabpagebuflist(t)
- let visible[b] = 1
- endfor
- endfor
- " close any buffer that are loaded and not visible
- let l:tally = 0
- for b in range(1, bufnr('$'))
- if bufloaded(b) && !has_key(visible, b)
- let l:tally += 1
- exe 'bw ' . b
- endif
- endfor
- echon "Deleted " . l:tally . " buffers"
-endfun
@@ -1,10 +0,0 @@
-" Shortcuts for opening file in same directory as current file {{{2
-cnoremap <expr> %% getcmdtype() == ':' ? expand('%:h').'/' : '%%'
-
-map <leader>ew :e %%
-map <leader>es :sp %%
-map <leader>ev :vsp %%
-map <leader>et :tabe %%
-
-" Prompt to open file with same name, different extension
-map <leader>er :e <C-R>=expand("%:r")."."<CR>
@@ -1,3 +0,0 @@
-" http://stackoverflow.com/questions/6926034/creating-a-mapping-for-insert-mode-but-not-for-autocomplete-submode/6926691#6926691
-inoremap <expr> <c-e> pumvisible() ? "\<c-e>" : "\<c-o>A"
-inoremap <C-a> <C-o>I
@@ -1,43 +0,0 @@
-" netrw.vim {{{1
-let g:netrw_banner=0
-" Fugitive.vim {{{1
-if has("autocmd")
-
- " Auto-close fugitive buffers
- autocmd BufReadPost fugitive://* set bufhidden=delete
-
- " Navigate up one level from fugitive trees and blobs
- autocmd User fugitive
- \ if fugitive#buffer().type() =~# '^\%(tree\|blob\)$' |
- \ nnoremap <buffer> .. :edit %:h<CR> |
- \ endif
-
-endif
-
-" Add git branch to statusline.
-if exists("*fugitive#statusline")
- set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
-endif
-
-" Gundo.vim {{{1
-map <Leader>u :GundoToggle<CR>
-
-" Space.vim {{{1
-let g:space_disable_select_mode=1
-let g:space_no_search = 1
-
-" Solarized {{{1
-let g:solarized_menu=0
-set background=light
-silent! colorscheme solarized
-if exists('*togglebg#map')
- call togglebg#map("<F5>")
-endif
-
-" Vim wiki {{{1
-let g:vimwiki_menu=''
-
-" vim: nowrap fdm=marker
-" Ctlr-P {{{1
-let g:ctrlp_jump_to_buffer = 0
-let g:ctrlp_working_path_mode = 0
@@ -1,14 +0,0 @@
-" <c-x>{char} - paste register into search field, escaping sensitive chars
-" http://stackoverflow.com/questions/7400743/
-cnoremap <c-x> <c-r>=<SID>PasteEscaped()<cr>
-function! s:PasteEscaped()
- echo "\\".getcmdline()."\""
- let char = getchar()
- if char == "\<esc>"
- return ''
- else
- let register_content = getreg(nr2char(char))
- let escaped_register = escape(register_content, '\'.getcmdtype())
- return substitute(escaped_register, '\n', '\\n', 'g')
- endif
-endfunction
@@ -1,3 +0,0 @@
-" nmap gV `[v`]
-" http://stackoverflow.com/questions/6228079/remove-newlines-from-a-register-in-vim/6235707#6235707
-nnoremap <expr> gV "`[".getregtype(v:register)[0]."`]"
View
@@ -1,28 +0,0 @@
-" Set tabstop, softtabstop and shiftwidth to the same value
-" From http://vimcasts.org/episodes/tabs-and-spaces/
-command! -nargs=* Stab call Stab()
-function! Stab()
- let l:tabstop = 1 * input('set tabstop = softtabstop = shiftwidth = ')
- if l:tabstop > 0
- let &l:sts = l:tabstop
- let &l:ts = l:tabstop
- let &l:sw = l:tabstop
- endif
- call SummarizeTabs()
-endfunction
-
-function! SummarizeTabs()
- try
- echohl ModeMsg
- echon 'tabstop='.&l:ts
- echon ' shiftwidth='.&l:sw
- echon ' softtabstop='.&l:sts
- if &l:et
- echon ' expandtab'
- else
- echon ' noexpandtab'
- end
- finally
- echohl None
- endtry
-endfunction
@@ -1,15 +0,0 @@
-" Strip trailing whitespace
-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>
@@ -1,2 +0,0 @@
-nnoremap & :&&<Enter>
-xnoremap & :&&<Enter>
View
@@ -1,11 +0,0 @@
-" Crude visualmode-only mappings for block level XML tags
-nnoremap viT vitVkoj
-nnoremap vaT vatV
-
-" textobj-entire defines: ie/ae maps
-" Instead, use: ia/aa
-let g:textobj_entire_no_default_key_mappings = 1
-xmap aa <Plug>(textobj-entire-a)
-omap aa <Plug>(textobj-entire-a)
-xmap ia <Plug>(textobj-entire-i)
-omap ia <Plug>(textobj-entire-i)
@@ -1,8 +0,0 @@
-nmap <silent> <leader>l :set list!<CR>
-nmap <silent> <leader>w :set wrap!<CR>
-nmap <silent> <buffer> <leader>s :set spell!<CR>
-nmap <silent> <leader>n :silent :nohlsearch<CR>
-
-" Commands to quickly set >1 option in one go
-command! -nargs=* Wrap set wrap linebreak nolist
-command! -nargs=* Maxsize set columns=1000 lines=1000
View
@@ -1,23 +0,0 @@
-" Only do this part when compiled with support for autocommands.
-if has("autocmd")
- filetype plugin indent on
-
- " Put these in an autocmd group, so that we can delete them easily.
- augroup vimrcEx
- au!
-
- " When editing a file, always jump to the last known cursor position.
- " Don't do it when the position is invalid or when inside an event handler
- " (happens when dropping a file on gvim).
- " Also don't do it when the mark is in the first line, that is the default
- " position when opening a file.
- autocmd BufReadPost *
- \ if line("'\"") > 1 && line("'\"") <= line("$") |
- \ exe "normal! g`\"" |
- \ endif
-
- augroup END
-
-else
- set autoindent " always set autoindenting on
-endif
@@ -1,19 +0,0 @@
-" Speed up buffer switching
-nnoremap <C-k> <C-W>k
-nnoremap <C-j> <C-W>j
-nnoremap <C-h> <C-W>h
-nnoremap <C-l> <C-W>l
-
-" Speed up tab switching
-nnoremap <D-S-]> gt
-nnoremap <D-S-[> gT
-nnoremap <D-1> 1gt
-nnoremap <D-2> 2gt
-nnoremap <D-3> 3gt
-nnoremap <D-4> 4gt
-nnoremap <D-5> 5gt
-nnoremap <D-6> 6gt
-nnoremap <D-7> 7gt
-nnoremap <D-8> 8gt
-nnoremap <D-9> 9gt
-nnoremap <D-0> :tablast<CR>
@@ -1,12 +0,0 @@
-" These come in handy when the following settings are enabled:
-" :set linebreak wrap nolist
-vmap <D-j> gj
-vmap <D-k> gk
-vmap <D-4> g$
-vmap <D-6> g^
-vmap <D-0> g^
-nmap <D-j> gj
-nmap <D-k> gk
-nmap <D-4> g$
-nmap <D-6> g^
-nmap <D-0> g^
Oops, something went wrong.

0 comments on commit e76f8b0

Please sign in to comment.