e50c19784e1e

Paste changes.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 19 Aug 2011 09:54:38 -0400
parents 9cb9df3cc3f1
children 8237628a8193
branches/tags (none)
files vim/.vimrc

Changes

--- a/vim/.vimrc	Thu Aug 18 12:34:49 2011 -0400
+++ b/vim/.vimrc	Fri Aug 19 09:54:38 2011 -0400
@@ -140,7 +140,6 @@
 runtime macros/matchit.vim
 map <tab> %
 
-nnoremap Y y$
 nnoremap D d$
 
 " Make horizontal scrolling less horrible.
@@ -276,9 +275,9 @@
 " Use a swank command that works, and doesn't require new app windows.
 au FileType clojure let g:slimv_swank_cmd='!dtach -n /tmp/dvtm-swank.sock -r winch lein swank'
 
-au BufNewFile,BufRead Slimv.REPL.clj setlocal winfixwidth
+au BufWinEnter Slimv.REPL.clj setlocal winfixwidth
 au BufNewFile,BufRead Slimv.REPL.clj setlocal nowrap
-au BufNewFile,BufRead Slimv.REPL.clj normal! zR
+au BufWinEnter Slimv.REPL.clj normal! zR
 
 " }}}
 " Confluence {{{
@@ -518,6 +517,18 @@
 nnoremap <leader>1 :set cmdheight=1<cr>
 nnoremap <leader>2 :set cmdheight=2<cr>
 
+" Paste intelligently by default, use option+p to paste raw.
+function! YRRunAfterMaps()
+    nnoremap Y :<C-U>YRYankCount 'y$'<CR>
+    nnoremap p :<C-U>YRPaste 'p'<CR>v`]=`]
+    nnoremap P :<C-U>YRPaste 'P'<CR>v`]=`]
+    nnoremap π :<C-U>YRPaste 'p'<CR>
+    nnoremap ∏ :<C-U>YRPaste 'P'<CR>
+endfunction
+
+" Replaste
+nnoremap <D-p> "_ddPV`]=
+
 " Marks and Quotes
 noremap ' `
 noremap æ '
@@ -552,9 +563,6 @@
 " Toggle paste
 set pastetoggle=<F8>
 
-" Replaste
-nnoremap <D-p> "_ddPV`]
-
 " Split/Join
 " ----------
 "