X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=blobdiff_plain;f=.vimrc;h=83458ed39c76bae0a98b6eddf257d497e61ee052;hp=fae0e9f94bc1757db4fc29f6d39fd32c302f265c;hb=HEAD;hpb=0addb50cbc67c7f01d0c34cd77eef7f135ff9c68 diff --git a/.vimrc b/.vimrc index fae0e9f..dfa434f 100644 --- a/.vimrc +++ b/.vimrc @@ -314,26 +314,7 @@ else endif endif - " Bracketed paste mode - " https://github.com/ConradIrwin/vim-bracketed-paste/blob/master/plugin/bracketed-paste.vim - let &t_ti .= "\[?2004h" - let &t_te = "\e[?2004l" . &t_te - - function! XTermPasteBegin(ret) - set pastetoggle= - set paste - return a:ret - endfunction - - execute "set =\[200~" - execute "set =\[201~" - map XTermPasteBegin("i") - imap XTermPasteBegin("") - vmap XTermPasteBegin("c") - cmap - cmap - - "https://coderwall.com/p/if9mda/automatically-set-paste-mode-in-vim-when-pasting-in-insert-mode + " https://coderwall.com/p/if9mda/automatically-set-paste-mode-in-vim-when-pasting-in-insert-mode " https://ttssh2.osdn.jp/manual/en/usage/tips/vim.html function! WrapForScreenTmux(s) if (&term =~ "screen") @@ -542,10 +523,12 @@ endfunction nmap \b :call ExtractOpenURL('') nmap \w :call ExtractOpenURL('-n') nmap \t :call ExtractOpenURL('-t') +nmap \p :call ExtractOpenURL('-p') " Send visual block to a browser vmap \b ""y:call OpenURL('"', '') vmap \w ""y:call OpenURL('"', '-n') vmap \t ""y:call OpenURL('"', '-t') +vmap \p ""y:call OpenURL('"', '-p') " Encode and send visual block to a browser vmap \B ""y:call EncodeOpenURL('"', '') vmap \W ""y:call EncodeOpenURL('"', '-n') @@ -609,13 +592,13 @@ function! W() execute 'set fileencoding=' . e w break - catch /E513: write error, conversion failed/ + catch /E513: [Ww]rite error, conversion failed/ continue endtry endfor if &modified - throw '"' . expand('%') . '" E513: write error, conversion failed; tried ' . join(encodings, ',') + throw '"' . expand('%') . '" E513: Write error, conversion failed; tried ' . join(encodings, ',') elseif has("spell") call SetupSpell() endif @@ -875,5 +858,7 @@ if v:version >= 800 call timer_start(500, 'SetLazyRedraw') endif +autocmd VimLeave * call writefile([getcwd()], expand('~/tmp/vim/cwd')) + " This has to go to the very end of ~/.vimrc to allow reading the .vimrc set secure " safer working with script files in the current directory