LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-03-2011, 02:54 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,652

Rep: Reputation: 51
Vim: Moving around in the file.


Hi:

In vim, how do I go to a given line? In particular, how do I go to the top of the file or to the bottom? And when searching, how do I unhighlight the found words? Thanks.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 04-03-2011, 02:58 PM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
in commandmode "G" goes to the last line, "1G" to the first line and "nG" to the nth line.
After Searching search for anything which isn't in the file, for example "/a÷lsdkjfa÷ls" this will remove the highlighting.

You can use the vimtutor program in a terminal in order to go through a short tutorial of vim.

EDIT: all commands without the quotes!

Markus

Last edited by markush; 04-03-2011 at 03:05 PM. Reason: added an explanation
 
2 members found this post helpful.
Old 04-03-2011, 03:02 PM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
Hi,

This might be helpful too: Vim Commands Cheat Sheet

Hope this helps.
 
1 members found this post helpful.
Old 04-03-2011, 03:07 PM   #4
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,652

Original Poster
Rep: Reputation: 51
Thanks a lot.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vim file.tex !latex file.tex & pdfdvi file.dvi & xpdf -remote sname -reload Mol_Bolom Linux - General 0 07-09-2009 08:46 PM
Editor comparison: vim VS vim-lite, Cleaning vim Ruler2112 *BSD 4 04-13-2009 05:26 PM
vim always says swap file already exists for a particular file leftty Linux - Software 1 09-13-2008 02:53 PM
VIM question: can I stop <Esc> moving the cursor back? xlq Linux - Software 9 06-03-2007 11:46 AM
moving around in vim while in insert mode cleff Linux - Software 3 06-14-2004 11:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration