groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] A not strictly groff question


From: Erich Hoffmann
Subject: Re: [Groff] A not strictly groff question
Date: Thu, 28 Jan 2010 12:33:01 +0100

Am Thu, 28 Jan 2010 22:24:21 +1100
schrieb Miklos Somogyi <address@hidden>:

> Hello Folks,
> 
> This is not a groff question but I suspect that many of you have the
> expertise and experience to solve this riddle.
> 
> I bought a diNovo Edge for Mac, the best keyboard I have ever had.
> Except that the function keys can only be programmed with the actions
> that Logitech deemed worthwhile having.
> 
> I use vi/vim and have lots of map commands in my .exrc file, however,
> I never used the "ab" abbreviation capability. It works in text mode
> and needs a white space around the short string to be expanded. I've
> tried to program lQ for left quote and rQ fro right quote, for the
> use of "text lQ text rQ text".

Try :imap instead of :ab. (:help map, :help imap)

I think :ab(breviate) needs some input after the abbreviation, and if
that is an empty space, that empty space shows up.  In some
circumstances this is handy, in others not.  With the :map family you
can get different results, :nmap is for normal mode, :vmap vor visual
and :imap for input mode.

Here are my mappings for this problem.  I called the mapping not Bq,
but ',,' (two commas) :

imap ,, \(Bq\(lq<ESC>4hi
vmap ,, di,,<Esc>p5l
nmap ,, bve,,

When I insert 2 commas in input mode, I get \(Bq\(lq with the cursor
between the Bq/lq. (For me in Germany Bq instead of bq.)

When I mark a word in visual mode and give two commas ,, - the
highlithted word is deleted ('d'), vim goes insert mode, and the
i-mapping is started.  The cursor is at the right position, and the
deleted hilighted string is placed there.

In normal mode, when the cursor is in the middle or at the end of a
string, it goes back to the beginning ('b'), hilights it in visual mode
('ve'), and starts the v-mapping ',,'

(It took me some time to figure that out at the time.)

Hope this helps, Erch

> For rQ the following space is ok, the proceeding one needs to be
> eliminated:
> 
> ab rQ <Esc>i\(rq                     (that is lower case I before the
> backslash)
> 
> this one does it, though I don't understand how/why.
> 
> However, I can't get rid of the following space of the left quote,
> though I tried moving the cursor, etc (e.g. ^[[5C is the right arrow,
> the ^[ is the single escape character, made by <ctrl>v<ctrl>[), but
> no cigar. I guess that some of you have already encountered and
> solved this problem. If so, please let me know.
> 
> Thanks,
> 
> Miklos
> 
> 
> 
> 
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]