Difference between revisions of "User:Thisoldman"

From ArchWiki
Jump to: navigation, search
(Sandboxing)
(more keypress sandboxing)
Line 2: Line 2:
 
==CODELINE template==
 
==CODELINE template==
 
===Repeating commands===
 
===Repeating commands===
 +
<pre>
 +
<span style="border: 0.01em solid;
 +
border-color: #FFF #BBB #BBB #FFF;
 +
background: {{{background|#EEE}}};
 +
margin: 0 0.05em;
 +
white-space: nowrap;
 +
min-width: 1em;
 +
display: inline-block;
 +
text-align: center">
 +
Ctrl
 +
</span>
 +
</pre>
  
If a command is prefixed by a number, then that command will be executed that number of times over (there are exceptions, but they still make sense, like the {{Codeline|'s'}} command). For example, pressing {{Codeline|'3i'}} then {{Codeline|'Help! '}} then {{Codeline|'ESC'}} will print {{Codeline|'Help! Help! Help!'}}. Pressing {{Codeline|'2}⁣'}} will advance you two paragraphs. This comes in handy with the next few commands…
+
<span style="border: 0.01em solid; border-color: #FFF #BBB #BBB #FFF; background: {{{background|#EEE}}}; margin: 0 0.05em; white-space: nowrap; min-width: 1em; display: inline-block; text-align: center">Ctrl</span> + <span style="border: 0.01em solid; border-color: #FFF #BBB #BBB #FFF; background: {{{background|#EEE}}}; margin: 0 0.05em; white-space: nowrap; min-width: 1em; display: inline-block; text-align: center">Alt</span> + <span style="border: 0.01em solid; border-color: #FFF #BBB #BBB #FFF; background: {{{background|#EEE}}}; margin: 0 0.05em; white-space: nowrap; min-width: 1em; display: inline-block; text-align: center">Del</span>
 +
 
 +
If a command is prefixed by a number, then that command will be executed that number of times over (there are exceptions, but they still make sense, like the <span style="border: 0.01em solid; border-color: #FFF #BBB #BBB #FFF; background: {{{background|#EEE}}}; margin: 0 0.05em; white-space: nowrap; min-width: 1em; display: inline-block; text-align: center">s</span> command). For example, pressing <span style="border: 0.01em solid; border-color: #FFF #BBB #BBB #FFF; background: {{{background|#EEE}}}; margin: 0 0.05em; white-space: nowrap; min-width: 1em; display: inline-block; text-align: center">3</span><span style="border: 0.01em solid; border-color: #FFF #BBB #BBB #FFF; background: {{{background|#EEE}}}; margin: 0 0.05em; white-space: nowrap; min-width: 1em; display: inline-block; text-align: center">i</span> then {{Codeline|'Help! '}} then <span style="border: 0.01em solid; border-color: #FFF #BBB #BBB #FFF; background: {{{background|#EEE}}}; margin: 0 0.05em; white-space: nowrap; min-width: 1em; display: inline-block; text-align: center">ESC</span> will print {{Codeline|'Help! Help! Help!'}}. Pressing <span style="border: 0.01em solid; border-color: #FFF #BBB #BBB #FFF; background: {{{background|#EEE}}}; margin: 0 0.05em; white-space: nowrap; min-width: 1em; display: inline-block; text-align: center">2</span><span style="border: 0.01em solid; border-color: #FFF #BBB #BBB #FFF; background: {{{background|#EEE}}}; margin: 0 0.05em; white-space: nowrap; min-width: 1em; display: inline-block; text-align: center">}⁣</span> will advance you two paragraphs. This comes in handy with the next few commands…
 +
 
 +
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent cursus odio ut est tincidunt vestibulum. Nulla et vulputate orci. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec lorem ligula, tincidunt a dignissim eget, viverra nec nibh. Proin accumsan, felis ut malesuada hendrerit, tellus risus hendrerit tortor, dapibus consectetur augue dolor vel leo. Morbi ultrices mauris nisi, eu feugiat libero. Duis nibh mauris, porttitor sit amet laoreet sed, hendrerit in lacus. Nullam et tellus in sapien condimentum condimentum. Aliquam placerat libero eget nunc scelerisque tincidunt.
  
 
===Deleting===
 
===Deleting===

Revision as of 22:18, 23 October 2011

Sandbox

CODELINE template

Repeating commands

 <span style="border: 0.01em solid;
 border-color: #FFF #BBB #BBB #FFF;
 background: {{{background|#EEE}}};
 margin: 0 0.05em;
 white-space: nowrap;
 min-width: 1em;
 display: inline-block;
 text-align: center">
 Ctrl
 </span>

Ctrl + Alt + Del

If a command is prefixed by a number, then that command will be executed that number of times over (there are exceptions, but they still make sense, like the s command). For example, pressing 3i then Template:Codeline then ESC will print Template:Codeline. Pressing 2}⁣ will advance you two paragraphs. This comes in handy with the next few commands…

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent cursus odio ut est tincidunt vestibulum. Nulla et vulputate orci. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec lorem ligula, tincidunt a dignissim eget, viverra nec nibh. Proin accumsan, felis ut malesuada hendrerit, tellus risus hendrerit tortor, dapibus consectetur augue dolor vel leo. Morbi ultrices mauris nisi, eu feugiat libero. Duis nibh mauris, porttitor sit amet laoreet sed, hendrerit in lacus. Nullam et tellus in sapien condimentum condimentum. Aliquam placerat libero eget nunc scelerisque tincidunt.

Deleting

The Template:Codeline command will delete the character under the cursor. Template:Codeline will delete the character before the cursor. This is where those number functions get fun. Template:Codeline will delete 6 characters. Pressing Template:Codeline (dot) will repeat the previous command. So, lets say you have the word "foobar" in a few places, but after thinking about it, you’d like to see just “foo”. Move the cursor under the "b", hit Template:Codeline, move to the next "foobar" and hit Template:Codeline (dot).

The Template:Codeline will tell vim that you want to delete something. After pressing Template:Codeline, you need to tell vim what to delete. Here you can use the movement commands. Template:Codeline will delete up to the next word. Template:Codeline will delete up unto the beginning of the line. Prefacing the delete command with a number works well too: Template:Codeline will delete the next three words. Template:Codeline (uppercase) is a shortcut to delete until the end of the line (basically Template:Codeline). Pressing Template:Codeline will delete the whole line.

To delete then replace the current word, place the cursor on the word and execute the command Template:Codeline. This will delete the word and change to insert mode. To replace only a single letter use Template:Codeline.

KEYPRESS template

Repeating commands

If a command is prefixed by a number, then that command will be executed that number of times over (there are exceptions, but they still make sense, like the Template:Keypress command). For example, pressing Template:KeypressTemplate:Keypress then “Help! ” then Template:Keypress will print “Help! Help! Help!“. Pressing Template:KeypressTemplate:Keypress will advance you two paragraphs. This comes in handy with the next few commands…

Deleting

The Template:Keypress command will delete the character under the cursor. Template:Keypress will delete the character before the cursor. This is where those number functions get fun. Template:KeypressTemplate:Keypress will delete 6 characters. Pressing Template:Keypress (dot) will repeat the previous command. So, lets say you have the word "foobar" in a few places, but after thinking about it, you’d like to see just “foo”. Move the cursor under the "b", hit Template:KeypressTemplate:Keypress, move to the next "foobar" and hit Template:Keypress (dot).

The Template:Keypress will tell vim that you want to delete something. After pressing Template:Keypress, you need to tell vim what to delete. Here you can use the movement commands. Template:KeypressTemplate:Keypress will delete up to the next word. Template:KeypressTemplate:Keypress will delete up unto the beginning of the line. Prefacing the delete command with a number works well too: Template:KeypressTemplate:KeypressTemplate:Keypress will delete the next three words. Template:Keypress (uppercase) is a shortcut to delete until the end of the line (basically Template:KeypressTemplate:Keypress). Pressing Template:KeypressTemplate:Keypress will delete the whole line.