Thursday, March 18, 2010

Re: set keymap to none/default

On 19/03/10 01:24, Kenneth R. Beesley wrote:
>
>
> On Mar 18, 5:08 pm, Gary Johnson<garyj...@spocom.com> wrote:
>> On 2010-03-18, Kenneth Reid Beesley wrote:
>>
>>
>>
>>
>>
>>> I've successfully written a number of keymap files, and I
>>> successfully choose them with the set command, e.g.
>>
>>> :set keymap=myKeymapFile_utf-8
>>
>>> and I know that CTRL-^ will toggle back and forth between the
>>> current keymap and the previous keymap.
>>
>>> My Problem: I often use multiple keymaps, one after another, and
>>> sometimes I need to switch from using the currently active keymap,
>>> whatever it might be, back to the neutral keymap (or lack of a
>>> keymap). CTRL-^ toggles me back to the previous keymap, which
>>> might not be the neutral one.
>>
>>> Question: How do I explicitly "turn off" keymap usage? or 'set
>>> keymap' to some neutral value?
>>
>> According to ":help keymap", the default is "", so either
>>
>> :set keymap=
>>
>> or
>>
>> :let&keymap = ''
>>
>> should do it. I don't know anything about keymaps, so I haven't
>> verified this.
>>
>> HTH,
>> Gary
>
> I had already tried
>
> :set keymap=
> and
> :set keymap=""
> without success. But your
>
> :let&keymap=""
>
> (adding a second double quote) worked.
>
> Many thanks,
>
> Ken
>

The results of

:set keymap=
and of
:let &keymap = ""

ought to be identical. (For the record, what Gary proposed wasn't
:let &keymap = "
with one double quote, but
:let &keymap = ''
with two single ones, which should also give the same result.


Note that since 'keymap' is a buffer-local option, it is recommended to
set it using ":setlocal" if you want to set it for one file without
clobbering other present and future files' setting.


In Normal mode, Ctrl-^ has a different meaning. To toggle (from Normal
mode) whether keymaps will apply (in the current buffer) to the argument
of r f t F T etc. (as well as the next time you start Insert mode), you
can use
:let &l:imi = !&l:imi
(see :help 'iminsert')

assuming that you aren't using an Input Method (you cannot use both an
IM and a keymap in the same buffer at the same time anyway).

I have found the following mappings useful:

" F8: toggle keymaps
:map <F8> :set &l:imi = !&l:imi<CR>
:map! <F8> <C-^>

(especially on keyboards like mine, where Ctrl-^ can only be reached by
holding down both Ctrl and AltGr while hitting unshifted 6).


Best regards,
Tony.
--
ZOOT: I'm afraid our life must seem very dull and quiet compared to yours.
We are but eightscore young blondes, all between sixteen and
nineteen-and-a-half, cut off in this castle, with no one to
protect us.
Oooh. It is a lonely life ... bathing ... dressing ...
undressing ...
making exciting underwear....
"Monty Python and the Holy Grail" PYTHON (MONTY)
PICTURES LTD

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Re: Cursor column on line 1 not remembered

On Thu, 18 Mar 2010, Benjamin R. Haskell wrote:

> On Thu, 18 Mar 2010, Jean Johner wrote:
>
> > On Mar 17, 6:36 pm, "Brian L. Matthews" <blmatth...@gmail.com> wrote:
> > > It works for me, but I might be restoring the cursor position
> >
> > Hi Brian,
> >
> > Adding your 8 lines of code in my .vimrc results in good
> > memorization of cursor column even on line 1.
> >
> > [...]
> >
>
> I can't speak for Brian, but in my (g)vim at work when I tested
> yesterday, it worked fine without anything like Brian's autocmd.

Turns out there's something in Gentoo's /etc/vim/vimrc that defeats
restoring the cursor column:

" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif |
\ endif

OpenSUSE (at work) has the non-broken (abbreviated):

if has("autocmd")
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
endif

The difference in the executed commands is subtle:
g'"
versus
g`"

But, perhaps your distribution has something that uses (perhaps inadvertently)
'if line("'\"") > 1', for example. What system are you on, precisely?

Ubuntu (9.10) doesn't have any cursor restoration in its vimrc, AFAICT, for
example.

--
Best,
Ben

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Re: ?kb in redo-register

On Thu, 18 Mar 2010 16:43:27 +0800, anna wrote:

> Hi all,
>
> I am quite puzzled why the backspace in redo-register is represented
> as '?kb'. How to differentiate a backspace with string "?kb"?
> Thank you.
>
> Anna
>

I'm puzzled by your question also; what do you mean by "represensted as
'?kb'? Do you mean the ". register contains '?kb'? what do you try to do?
and What :version? (gui or terminal)?

--
Dasn

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Re: +/- clientserver

On Thu, 18 Mar 2010 21:00:03 -0400
MK <halfcountplus@intergate.com> wrote:
> What determines whether clientserver is compiled in? There is nothing
> about it under "configure --help".

apt-get build-dep resolved this (thanks again John) but I am still
curious which package would be required, if anyone knows...

Is there any file I can check, post config, for the "+" an "-"? (IMO
vim would benefit from some more informative reporting after configure.)

--
MK <halfcountplus@intergate.com>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Re: can't find X headers

On Thu, 18 Mar 2010 17:25:26 -0700 (PDT)
John Little <john.b.little@gmail.com> wrote:
> I expect you're missing libxt-dev. Vim's configure checks for
> Intrinsic.h in that package.
>
> IIUC gnewsense is Debian based, so you should be to
>
> sudo apt-get build-dep vim-gtk

Thanks much John.

--
MK <halfcountplus@intergate.com>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Re: paste via "shift+insert" in gnome-terminal sucks when set fo+=cro

On Fri, Mar 19, 2010 at 7:52 AM, John Little <john.b.little@gmail.com> wrote:

>
> No, vim is just getting the pasted text from gnome-terminal, as if
> you'd typed it.  It seems to be hard coded into gnome-terminal (or the
> terminal widget it uses); there's chatter about it in the bug
> trackers.  If you press shift-insert while in normal mode and your
> selected text on the other tab starts with 100dd, you'll delete 100
> lines.

Good to know that I am not the only one to hate it...

>
>> I know I can map a shortkey, such as "map <F5> :set paste!",
>> but i hate it since it need two more hits.
>
> You could use mappings like:
>
> map  <Insert> "*p`]
> imap <Insert> <c-o>"*p<c-o>`]
>
> though you might have to tweak the cursor position to suit what you
> expect; maybe
>
> imap <insert> <esc>"*P']ji
>
>

I have tested your maps, seems not working.
anyway, I decide to map F5 and strike when needed...

--
FIXME if it is wrong.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

+/- clientserver

My gnewsense compile is getting wierder.

I use clientserver mode in vim, and up until now it has always been
available with a straight compile of 7.2:

./configure

But for some reason after compile when I check :version I have
"-clientconfig". I am using the exact same source tarball I always do.

What determines whether clientserver is compiled in? There is nothing
about it under "configure --help".

--
MK <halfcountplus@intergate.com>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Re: select/copy a line every 6 lines

Jorge Timón wrote:
> Hi, I have a file numbers in gropus of four that i want to separate
> this way:
>
> -
> 0,2010
> 0.149036564840167 ----------------> To File A
> 0.174286165702154 ----------------> To File B
> 0.148561021969625 ----------------> To File C
> 0.197299757855822 ----------------> To File D
> -
> 0,2020
> 0.148538114790534 ----------------> To File A
> 0.174768764182483 ----------------> To File B
> 0.152110261402346 ----------------> To File C
> 0.204325268521311 ----------------> To File D
> -
> 0,2030
> 0.14405206434384 ...
> 0.172445966573654
> 0.157687637653766
> 0.203154350077063
> -
> ...
>
> I'm just starting to learn how to use vim, but I'm sure this
> repetitive task can be managed efficiently using vim.

Though almost opaque in its terseness, my first attempt processes
the whole file into its respective bits in one pass:

:g/^/if (line('.')%6>2 || !(line('.')%6)) | exec '.w! >> '.(['D',
'', '', 'A', 'B', 'C'][line('.')%6]) | endif

or depending on the format, if the data lines are the only ones
with periods in them (identified by the regexp "^\d\+\.") then
that can be reduced to:

g/^\d\+\./exec '.w! >> '.(['D', '', '', 'A', 'B', 'C'][line('.')%6])

> But is there a way to select certain lines or something similar?

I archived this email from Preben "Peppe" Guldberg (speaking of
whom, I don't remember seeing him on the list recently and hope
he's okay) which does something like what you describe in
response to a similar question:

P> Assuming you want to keep the first and every tenth line in
the buffer,
P> you could use eg.
P>
P> :g/^/+d9
P>
P> If you want to keep every tenth line, you need a little magic:
P>
P> :g/^/d9|m.
P>
P> Here nine lines are deleted and the tenth is moved after itself.
P> This little trick removes the tenth line from the list of
lines that
P> :global processes (as does the deletion of line 2 to 9).

You might be able to adapt it for your purposes.

> Any suggestion to do it faster will be appreciated.

However, if you don't want to process each case by hand, you can
use my ugly stunt above that does the whole thing in one pass.

-tim


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Re: select/copy a line every 6 lines

Assuming the pattern /^-$/ matches lines 1,7,13,19 and so on, you can
use g with relative line numbers to delete lines.

For File A, copy and use

:g/^-$/d2|+,+3d

for File B, copy and use

:g/^-$/d3|+,+2d

for File C, copy and use

:g/^-$/d4|+d

for File D, copy and

:g/^-$/d5

Regards, John

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Re: can't find X headers

On Mar 19, 3:01 am, MK <halfcountp...@intergate.com> wrote:
> I'm trying to build vim on gnewsense.  I have the relevent x11 dev
> packages...

I expect you're missing libxt-dev. Vim's configure checks for
Intrinsic.h in that package.

IIUC gnewsense is Debian based, so you should be to

sudo apt-get build-dep vim-gtk

Regards, John

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Re: set keymap to none/default

On Mar 18, 5:08 pm, Gary Johnson <garyj...@spocom.com> wrote:
> On 2010-03-18, Kenneth Reid Beesley wrote:
>
>
>
>
>
> > I've successfully written a number of keymap files, and I
> > successfully choose them with the set command, e.g.
>
> > :set keymap=myKeymapFile_utf-8
>
> > and I know that  CTRL-^  will toggle back and forth between the
> > current keymap and the previous keymap.
>
> > My Problem:  I often use multiple keymaps, one after another, and
> > sometimes I need to switch from using the currently active keymap,
> > whatever it might be, back to the neutral keymap (or lack of a
> > keymap).  CTRL-^ toggles me back to the previous keymap, which
> > might not be the neutral one.
>
> > Question:  How do I explicitly "turn off" keymap usage? or 'set
> > keymap' to some neutral value?
>
> According to ":help keymap", the default is "", so either
>
>     :set keymap=
>
> or
>
>     :let &keymap = ''
>
> should do it.  I don't know anything about keymaps, so I haven't
> verified this.
>
> HTH,
> Gary

I had already tried

:set keymap=
and
:set keymap=""
without success. But your

:let &keymap=""

(adding a second double quote) worked.

Many thanks,

Ken

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.