LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 05:33 AM   #1
cola
Senior Member
 
Registered: Sep 2007
Posts: 1,035

Rep: Reputation: 65
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, 06: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, 06:24 AM   #3
cola
Senior Member
 
Registered: Sep 2007
Posts: 1,035

Original Poster
Rep: Reputation: 65
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, 06:25 AM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,996

Rep: Reputation: 3187Reputation: 3187Reputation: 3187Reputation: 3187Reputation: 3187Reputation: 3187Reputation: 3187Reputation: 3187Reputation: 3187Reputation: 3187Reputation: 3187
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, 06: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, 10:18 AM   #6
cola
Senior Member
 
Registered: Sep 2007
Posts: 1,035

Original Poster
Rep: Reputation: 65
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 09:41 PM
Vim cursor position Tischbein Linux - Newbie 4 03-31-2008 01:32 AM
Remember last cursor position in VIM rangalo Debian 4 05-12-2007 09:52 AM
vim: startup at last cursor position chrism01 Solaris / OpenSolaris 3 02-20-2007 11:25 AM

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

All times are GMT -5. The time now is 03:12 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
Open Source Consulting | Domain Registration