On Sat, Feb 6, 2010 at 1:50 PM, Girish Venkatasubramanian wrote:
> Thanks John - that took care of the retab issue.
>
> I have another question, though.
>
> I decided against setting a textwidth and formatoptions and au normal
> gqG because of a couple of issues (see below). I am letting wordwrap
> render the file according to the width of the terminal in which it is
> opened. This works fine, except that one paragraph is considered to be
> one line and "j" scrolls down by an entire paragraph and not a virtual
> (or rendered) line.
>
> To help this, I am considering mapping j and k (or the arrow keys) to
> gj and gk so that the scrolling happens from one line to the next
> virtual line and not from to the next actual line.
> 1) My first choice is remapping the arrow keys? Is this a bad idea?
> Should I rempa only for specific modes?

I think it's perfectly reasonable to map the arrow keys to do
something slightly different than j/k.  Obviously, you'd only want
that remap in normal, visual, and operator-pending modes, though.  You
don't want pressing <Down> in insert mode to insert "gj" into the
buffer at the cursor.  So, the command would be

    :noremap <Down> gj
    :noremap <Up> gk

> 2) If not, how do i remap the arrow keys? I mean in the "map key
> mapped_key" command, how do I represent the right arrow in the place
> of key?

See above.

> Issues with tw 80 and fo=crqa
> -------------------------------------------
> 1) When textwdith iss set to 80 and I have two lines of code  like
> //This is a comment; This is a comment This is a comment
> printf("Hello, World\n");
>
> commenting out the printf with a // gives me
> //This is a comment; This is a comment This is a comment printf("Hello, 
> World\n"
> //);
> which seems quite ugly

There's not really any way for this to differentiate between commented
out code and "real" comments, though.  It makes sense that it blends
them together.

> 2) When the file being opened is not a C file, but some document, and
> I have a paragraph like
>
> Introduction
> This is a comment.
> This is another comment
>
> gq on this paragraph gives me
>
> Introduction This is a comment. This is another comment
>
> Is there a better setting for fo?

I'm not sure what the problem with this is?  That sounds like exactly
what gq is supposed to do.

> Thanks
>
> On Sat, Feb 6, 2010 at 4:28 AM, John Little <[email protected]> wrote:
>> On Feb 6, 2:25 pm, Girish Venkatasubramanian <[email protected]>

*snip*

In the future, please bottom post on this mailing list; it's list policy.

~Matt

-- 
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

Reply via email to