LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Vim cursor position (https://www.linuxquestions.org/questions/linux-newbie-8/vim-cursor-position-631669/)

Tischbein 03-30-2008 06:48 AM

Vim cursor position
 
Hello,

Do you know how I can find out the current cursor position in Vi? Likewide how do I jump to a specified position?

Vi functions ar described here:
http://vimdoc.sourceforge.net/htmldo...html#functions

but I can't get them to work. For example:

:call setpos( "cursor", 1)

doesn't move the cursor, no matter where I start.

Regards, Entenflügel

raskin 03-30-2008 08:45 AM

Well, does
:call cusor (2,2)
work for you? What about
:echo line('.')
:echo col('.')
?

getpos() and setpos() are more complicated, chances are you do not really need them..

Tischbein 03-30-2008 08:29 PM

Yes, that works, thanks!

Can you recommend some documentation for vim? Or is there a database of examples? Often it's just a few examples such as the ones that you have kindly provided that are all the documentation I need. Vim has :help, does it have :examples?

(I fixed my problem - getting a quick way of typing ascii trees - but only by going over to the dark side - emacs - black body illumination provided in the form of a 900 page manual written to excellent academic standards. Job's done now but it would be nice to be able to stay with Vi next time!)

Regards, Fischbein

raskin 03-30-2008 09:47 PM

I actually only use :help .. There are some examples in User Manual (as opposed to function reference; I mean the one accessible through :help). I use quick "/" through :help functions to locate needed function.

chakka.lokesh 03-31-2008 01:32 AM

vim commands...
 
hello people,

the following link may be useful.

http://www.fprintf.net/vimCheatSheet.html

cheers.....


All times are GMT -5. The time now is 09:15 PM.