LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 03-28-2010, 06:33 AM   #1
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,019

Rep: Reputation: 63
How to get the cursor position line at the mid of the windows in vim?


Suppose the cursor position line at bottom or top.
What's the vim command to get the cursor position line at the mid of the windows in vim?
 
Old 03-28-2010, 07:14 AM   #2
Maligree
Member
 
Registered: Mar 2008
Distribution: Gentoo, CentOS, Fedora, Arch
Posts: 231
Blog Entries: 1

Rep: Reputation: 42
M to get to the middle line, then gm to get to the middle column?
 
1 members found this post helpful.
Old 03-28-2010, 07:24 AM   #3
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,019

Original Poster
Rep: Reputation: 63
Quote:
Originally Posted by Maligree View Post
M to get to the middle line, then gm to get to the middle column?
No,this is not what i'm looking for.
Suppose the cursor is at the line number 35.
35 is the last line number of that window/page.
Now i want to get this line number 35 at the middle of that window/page.

And there will be same number of lines above and bottom the line number 35.

I know about H,M,L.
 
Old 03-28-2010, 07:25 AM   #4
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,698

Rep: Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988
cola ... I am curious if you have man and / or access to the internet to search?

I only ask as you have asked several questions recently related to vim and as far as I can tell most
would have been easily answered by one of the two methods I mention above.

Just a thought
 
Old 03-28-2010, 07:48 AM   #5
perforser
LQ Newbie
 
Registered: Nov 2008
Posts: 4

Rep: Reputation: 2
zz does what you want
 
2 members found this post helpful.
Old 03-28-2010, 11:18 AM   #6
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,019

Original Poster
Rep: Reputation: 63
Thanks.
 
  


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
deletion of line above the cursor position. dina3e Linux - Newbie 1 04-07-2008 10:41 PM
Vim cursor position Tischbein Linux - Newbie 4 03-31-2008 02:32 AM
Remember last cursor position in VIM rangalo Debian 4 05-12-2007 10:52 AM
vim: startup at last cursor position chrism01 Solaris / OpenSolaris 3 02-20-2007 12:25 PM


All times are GMT -5. The time now is 10:16 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration