Vim Tips Wiki
 
(Change <tt> to <code>, perhaps also minor tweak.)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  +
{{TipImported
{{review}}
 
{{Tip
 
 
|id=725
 
|id=725
  +
|previous=719
|title=Quick mapping for backing up the file
 
  +
|next=727
|created=May 17, 2004 22:54
+
|created=2004
 
|complexity=basic
 
|complexity=basic
 
|author=Devin Weaver
 
|author=Devin Weaver
|version=5.7
+
|version=6.0
 
|rating=1/1
 
|rating=1/1
  +
|category1=File Handling
|text=
 
  +
|category2=
Add this simple mapping into your vimrc to make a quick way to backup your document.
 
 
 
 
" For safe measures lets make a quick backup mapping.
 
 
noremap &lt;Leader&gt;b :let x=&amp;backup&lt;Bar&gt;set backup&lt;Bar&gt;write&lt;Bar&gt;let &amp;backup=x&lt;Bar&gt;unlet x&lt;Cr&gt;
 
 
 
 
}}
 
}}
 
Add this simple mapping into your vimrc to make a quick way to backup your document by typing <code>\b</code> in normal mode.
  +
<pre>
 
" For safe measures lets make a quick backup mapping.
 
nnoremap <Leader>b :let x=&backup<Bar>set backup<Bar>write<Bar>let &backup=x<Bar>unlet x<Cr>
  +
</pre>
   
== Comments ==
+
==Comments==
The above noremap should be all one line!
 
 
vim--AT--tritarget.com
 
, May 17, 2004 22:55
 
----
 
How would you execute this? Can we map it to a Function Key?
 
 
gsrojas--AT--netzero.net
 
, July 6, 2004 8:36
 
----
 
<!-- parsed by vimtips.py in 0.423262 seconds-->
 

Latest revision as of 05:45, 13 July 2012

Tip 725 Printable Monobook Previous Next

created 2004 · complexity basic · author Devin Weaver · version 6.0


Add this simple mapping into your vimrc to make a quick way to backup your document by typing \b in normal mode.

" For safe measures lets make a quick backup mapping.
nnoremap <Leader>b :let x=&backup<Bar>set backup<Bar>write<Bar>let &backup=x<Bar>unlet x<Cr>

Comments[]