f



vim 7.4 nnoremap

I have a odd issue with vim which I traced to nnoremap.

When I edit a file with a name like '*.man', if I press
'q' in command mode vim exits.  With other file names 'q'
works as expected (it starts recording a macro).

for *.man files, I see this mapping for :nnoremap^M
'n  q           *@:q<CR>'
for all other file names this is not mapped.

I read some vim docs but I cannot find a way to disable
it for *.man files.  Does anyone know this behavior can
be disabled ?

Thanks
John
0
John
12/17/2016 8:48:53 PM
comp.editors 4871 articles. 0 followers. Post Follow

4 Replies
227 Views

Similar Articles

[PageSpeed] 25

with <o348bl$moq$1@dont-email.me> John McCue wrote:

*SKIP*
> for *.man files, I see this mapping for :nnoremap^M
> 'n  q           *@:q<CR>'
> for all other file names this is not mapped.

First, you have to find where it comes from.  I mean exact place.  I
believe, inspecting every 'man.vim' file would be a good start.  Then
read documentation for this thing (probably -- none), then comments
around the place.  If everything fails -- read actual code.

Probably there's a way to disable it.  If there's a way then it can be
tricky -- never worked for me, but, maybe, with your luck it would be
better.  If not, then you can place appropriately named, probably,
man.vim somewhere under '.vim/after/' (depends on what imposes this
mapping) and just remove it.

Good luck accumulating cruft.

*CUT*

-- 
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom
0
Eric
12/20/2016 8:11:15 AM
Eric Pozharski <whynot@pozharski.name> wrote:
> with <o348bl$moq$1@dont-email.me> John McCue wrote:
> 
> *SKIP*
>> for *.man files, I see this mapping for :nnoremap^M
>> 'n  q           *@:q<CR>'
>> for all other file names this is not mapped.
> 
<snip>
> 
> Good luck accumulating cruft.

Interesting enough this issue does not happen on NetBSD.
NetBSD has vim version 7.4.1040 where Linux (Slackware)
uses 7.4.1938.

So I temporarily copied vim74 support files:
    from Slackware to NetBSD
      and
    from NetBSD to Slackware
and the behavior did *not* change on either system.

I checked RHEL 7.3 (vim 7.4.629) at work and the letter
'q' works as it should.  Next I will downgrade vim on
Slackware 14.2 to an earlier version to see what happens.

BTW, all 3 systems use the same exact ~/.vimrc

John
0
John
12/21/2016 1:47:42 AM
John McCue <jmccue@jmcnet2.bstnma.east.verizon.net> wrote:
<snip>
> 
> Next I will downgrade vim on Slackware 14.2 
> to an earlier version to see what happens.

I downgraded vim from 7.4.1040 (Slack 14.2) to 7.4.50
(Slack 14.1) and the issue does *not* occur.

I guess it is probably somewhere in vim version 7.4.1040
or a patch made to 7.4.1040 in the slackbuild.

John
0
John
12/21/2016 3:11:19 AM
Eric Pozharski <whynot@pozharski.name> wrote:
> with <o348bl$moq$1@dont-email.me> John McCue wrote:
> 
> *SKIP*
<snip>
> 
> Good luck accumulating cruft.

I found the issue, it is in file
    /usr/share/vim/vim74/ftplugin/man.vim

which came with vim, this line should be removed
or commented out if you want to 'q' for on the
fly macros:

nnoremap <buffer> <silent> q :q<CR>

John
0
John
12/21/2016 11:55:19 PM
Reply: