X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=blobdiff_plain;f=.vimrc;h=1138c837bf5f7437096a23b0e4b4f537d25b0e0f;hp=bb817148862ed8593ef8a5d03979cca28546fa0d;hb=HEAD;hpb=0898329662b09ac156caaba8d23db6e8e8579319 diff --git a/.vimrc b/.vimrc index bb81714..dfa434f 100644 --- a/.vimrc +++ b/.vimrc @@ -91,7 +91,7 @@ set titleold= " string to restore the title to when exiting Vim " set titlestring=%t%(\ %M%)%(\ (%{substitute(expand(\"%:p:h\"),\ $HOME,\ \"~\",\ \"\")})%)%(\ %a%)\ -\ %{toupper(v:progname)} " display filename, modification flag, full path, argument list status, " the current user, host and program name (to distinguish vim/view/etc). -set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:p:h\")})%)%(\ %a%)\ -\ [%{$USER}@%{hostname()}]\ %{v:progname} +set titlestring=%t%(\ %M%)%(\ (%{substitute(expand(\"%:p:h\"),\ $HOME,\ \"~\",\ \"\")})%)%(\ %a%)\ -\ %{v:progname}\ [%{$USER}@%{hostname()}] " 9 using the mouse @@ -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