Vim

From Attie's Wiki
(Difference between revisions)
Jump to: navigation, search
m (Registers)
m
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
 
Configuration: [[vimrc]]
 
Configuration: [[vimrc]]
 +
 +
Normalise 4-spaced code to tabbed code... This may require some supervision...
 +
<source lang="text">
 +
:%s/^\(\t*\)    /\1\t/gc
 +
</source>
  
 
==Registers==
 
==Registers==
 
[http://stackoverflow.com/a/1498026 Source]
 
[http://stackoverflow.com/a/1498026 Source]
  
Registers in Vim let you run actions or commands on text stored within them. To access a register, you type "a before a command, where a is the name of a register. If you want to copy the current line into register k, you can type
+
Registers in Vim let you run actions or commands on text stored within them. To access a register, you type <code>"&lt;''a''&gt;</code> before a command, where <code>&lt;''a''&gt;</code> is the name of a register. If you want to copy the current line into register k, you can type
 
<source lang="text">
 
<source lang="text">
"kyy
+
"ky
 
</source>
 
</source>
 
Or you can append to a register by using a capital letter
 
Or you can append to a register by using a capital letter
 
<source lang="text">
 
<source lang="text">
"Kyy
+
"Ky
 
</source>
 
</source>
 
You can then move through the document and paste it elsewhere using
 
You can then move through the document and paste it elsewhere using

Latest revision as of 10:10, 5 January 2015

Configuration: vimrc

Normalise 4-spaced code to tabbed code... This may require some supervision...

:%s/^\(\t*\)    /\1\t/gc

[edit] Registers

Source

Registers in Vim let you run actions or commands on text stored within them. To access a register, you type "<a> before a command, where <a> is the name of a register. If you want to copy the current line into register k, you can type

"ky

Or you can append to a register by using a capital letter

"Ky

You can then move through the document and paste it elsewhere using

"kp

To access all currently defined registers type

:reg
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox