Vim: bringing the cursor to 1st char in current line (command mode).
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Vim: bringing the cursor to 1st char in current line (command mode).
Just in case someone can reply a silly question, I've quite forgotten the vi/vim command to bring the cursor to the 1st char in the current line. I do remember that for bringing it to EOL is '$'. And the help is so big I made up my mind to consul LQ firstly. Regards.
There must be some misunderstanding. I'm pressing ESC twice (just in case), then capital o, and, as a result, vim enters insert mode. Perhaps you speak about vi, and vi behaves unllike vim in this point.
There must be some misunderstanding. I'm pressing ESC twice (just in case), then capital o, and, as a result, vim enters insert mode. Perhaps you speak about vi, and vi behaves unllike vim in this point.
It's a zero, not a capital letter 'o', just like the vim cheat sheet listed above says ;-)
the MAN for vim clears up any of the o O 0 confusion:
-o[N] Open N windows stacked. When N is omitted, open one window for each file.
-O[N] Open N windows side by side. When N is omitted, open one window for each file.
Whilst zero is not mentioned, clearly upper case O is not character zero of the current line.
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855
Rep:
To get to the first character of the current line its capital L.
'o' and 'O' are for creating new line below and above the current line. Just checked om my pc (vim 7.3) .
...
-o[N] Open N windows stacked. When N is omitted, open one window for each file.
-O[N] Open N windows side by side. When N is omitted, open one window for each file.
...
The lowercase letter o opens a new line below the current line and enters the insertmode.
The uppercase letter O begins a new line above the current line and enters the insertmode.
Markus
EDIT: SilverBack was faster than me
Last edited by markush; 12-04-2010 at 09:30 AM.
Reason: inserted a smilie
...The L command here moves to the first character of the last line, same as G. There is almost certainly a difference between L and G. Any ideas?
Yes, G moves to the last line in the file (important: G with number "n" as an argument moves to the n'th line)
L moves to the first column in the last line of the current screen.
You misread the cheatsheet, that's a 0 (zero), not an uppercase O.
bigrigdriver is not to blame. This is only one of the shortcomings of graphical user interfaces: zeroes confused with uppercase O, capital i confused with lowercase l (el).
Plus, why lowercase at all? In the old days of fortran, letters were all capitals, since this contributed readability for the data entry.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.