Vim Tips Wiki
(adding new "File Handling" category)
(Change to TipImported template + severe manual clean)
Line 1: Line 1:
  +
{{TipImported
{{Tip
 
 
|id=725
 
|id=725
  +
|previous=724
|title=Quick mapping for backing up the file
 
  +
|next=726
|created=May 17, 2004 22:54
+
|created=May 17, 2004
 
|complexity=basic
 
|complexity=basic
 
|author=Devin Weaver
 
|author=Devin Weaver
 
|version=5.7
 
|version=5.7
 
|rating=1/1
 
|rating=1/1
|text=
 
 
}}
 
}}
 
 
Add this simple mapping into your vimrc to make a quick way to backup your document by typing "\b" from command mode.
 
Add this simple mapping into your vimrc to make a quick way to backup your document by typing "\b" from command mode.
   
 
<pre>
 
<pre>
" For safe measures lets make a quick backup mapping.
+
" 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;
+
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;
 
</pre>
 
</pre>
   
== Comments ==
+
==Comments==
 
   
  +
----
 
[[Category:File Handling]]
 
[[Category:File Handling]]

Revision as of 01:25, 11 November 2007

Tip 725 Printable Monobook Previous Next

created May 17, 2004 · complexity basic · author Devin Weaver · version 5.7


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

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

Comments