pgup and back

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

pgup and back

Paolo Veronelli
In editing mode I use PgUp and PgDown to see other pieces of the file,
but it never gets back to the place I was editing.Is this normal behavior?

       

       
               
___________________________________
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it
Reply | Threaded
Open this post in threaded view
|

Re: pgup and back

Tim Chase-2
> In editing mode I use PgUp and PgDown to see other pieces of
> the file, but it never gets back to the place I was editing.Is
> this normal behavior?

Yes, this is normal--because vim keeps the cursor on the screen,
when you pgdn, the cursor ends up as close to your last position
as it can:  the top of the screen.  Likewise with pgup.

Some ways to make this less bothersome:

-mark your place with a bookmark and then just jump back to that
place (see ":help mark-motions" and ":help for more info)

-if you actually inserted text or made a change, you can use
either the carat or the period mark (see ":help '^" and ":help
'.") for immediate jumping there, without the need to drop a mark
there before wandering off.

-if you know you want to continue editing where you left off (at
the point you last inserted some text) before wandering around in
normal mode, you can use "gi" (see ":help gi")

Hope this gives you some ideas,

-tim




Reply | Threaded
Open this post in threaded view
|

RE: pgup and back

David Fishburn
In reply to this post by Paolo Veronelli
 

> -----Original Message-----
> From: Paolo Veronelli [mailto:[hidden email]]
>
> In editing mode I use PgUp and PgDown to see other pieces of
> the file, but it never gets back to the place I was
> editing.Is this normal behavior?

Tony posted a solution/work around for this.  Add the following to your
.vimrc:

" When you page up and down, your cursor will finish on the same
" line it started on
map  <silent> <PageDown>      <C-D><C-D>
map  <silent> <PageUp>        <C-U><C-U>
imap <silent> <PageDown> <C-O><C-D><C-O><C-D>
imap <silent> <PageUp>   <C-O><C-U><C-O><C-U>
 

--
Do you use Vim to edit SQL?
<Plug>
Check the description of these plugins:
dbext.vim - Provides database access to 10 databases (Oracle, Sybase, SQL
Server, MySQL,...) (http://www.vim.org/scripts/script.php?script_id=356)
SQLUtilities - Formatting SQL, generate - columns lists, procedures for
databases (http://www.vim.org/scripts/script.php?script_id=492)
sql.vim - SQL indent file for Sybase ASA and Oracle
(http://www.vim.org/scripts/script.php?script_id=495)
Intellisense for Vim : SQL, C++, CSharp, Java, JSP, XML, HTML
(http://www.vim.org/scripts/script.php?script_id=747)
</Plug>