From 64b0edf177190f32aed80815fa05063bb5f1aee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 30 Jan 2015 11:40:04 +0100 Subject: vimrc: remove unused crap, add p -> "_dP --- vimrc | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/vimrc b/vimrc index bb18c11..629fb06 100644 --- a/vimrc +++ b/vimrc @@ -103,14 +103,14 @@ map \\\ nmap g inoremap -" Don't use Ex mode, use Q for formatting -map Q gq - " code completion inoremap -" Make p in Visual mode replace the selected text with the "" register. -vnoremap p :let current_reg = @"gvs=current_reg +" replace current selection with content of "" buffer +vmap p "_dP + +" Don't use Ex mode, use Q for formatting +map Q gq " Only do this part when compiled with support for autocommands. if has("autocmd") @@ -163,20 +163,5 @@ if has("autocmd") endif " has("autocmd") -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") -nmap _= :call Preserve("normal gg=G") -" autocmd BufWritePre * :call Preserve("%s/\\s\\+$//e") - source ~/.vim/scripts/bepo-layout.vim -- cgit v1.1-2-g2b99