Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>I am using putty and vi editor if select 5 lines using mouse and i want to delete those lines how can i do that</p> </blockquote> <p>Forget the mouse. To remove 5 lines, either:</p> <ul> <li>Go to the first line and type <kbd>d5d</kbd> (<kbd>dd</kbd> deletes one line, <kbd>d5d</kbd> deletes 5 lines) ~or~</li> <li>Type <kbd>Shift-v</kbd> to enter <em>linewise selection mode</em>, then move the cursor down using <kbd>j</kbd> (yes, use <kbd>h</kbd>, <kbd>j</kbd>, <kbd>k</kbd> and <kbd>l</kbd> to move <em>left</em>, <em>down</em>, <em>up</em>, <em>right</em> respectively, that's much more efficient than using the arrows) and type <kbd>d</kbd> to delete the selection.</li> </ul> <blockquote> <p>Also how can i select the lines from keyboard like in windows i pres shift and move the arrows to select the text. how can i do that in vi</p> </blockquote> <p>As I said, either use <kbd>Shift-v</kbd> to enter linewise selection mode or <kbd>v</kbd> to enter characterwise selection mode or <kbd>Ctrl-v</kbd> to enter blockwise selection mode. Then move with <kbd>h</kbd>, <kbd>j</kbd>, <kbd>k</kbd> and <kbd>l</kbd>.</p> <p>I suggest spending some time with the VIM Tutor (run <code>vimtutor</code>) to get more familiar with VIM in a very didactic way.</p> <h3>See also</h3> <ul> <li>This answer to <a href="https://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118">What is your most productive shortcut with Vim?</a> (one of my favorite answer on SO).</li> <li><a href="http://jmcpherson.org/editing.html" rel="noreferrer">Efficient Editing With vim</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload