Disable <F1> Help

36 views
Skip to first unread message

Joseph Wulf

unread,
Jan 19, 2022, 10:23:29 AMJan 19
to vim_use
When using vim I wish to disable the <F1> from popping up the help.  I use vim exclusively via shell terminal windows in Linux.  I've not yet been successful, though below is what I've attempted so far.  Further, I searched this google group for such a thing but didn't come up with any relevant results.

I have found this <seemingly> helpful link:   "https://vim.fandom.com/wiki/Disable_F1_built-in_help_key", yet none of the facets of its implementation have worked for me.  I have experimented with placing:  ":nmap <F1> <nop>" manually in a vim session---that manual effort seems to correctly provide the result I want (i.e. <F1> does no operation) during command-mode.  I place the SAME string without the quotes or leading colon in .vimrc, close/open a new vim session, and <F1> immediately brings up the help menu.  Other combinations attempted from the same link, ":nmap <F1> :echo<CR> " and ":imap <F1> <C-o>:echo<CR>" in the .vimrc, but once vim is reloaded,<F1> still brings up the help.

Next, grasping at straws---in my .vimrc I have placed:
     cmap <F1> <nop>
     imap <F1> <nop>
     ljjmap <F1> <nop>
     nmap <F1> <nop>
     omap <F1> <nop>
     vmap <F1> <nop>
Which hasn't solved the problem, either.

I would like to understand this problem I am having, better.  Additionally I wish to put in my .vimrc the right commands/functions to prevent <F1> from bringing up the HELP during 'command' and 'insert' modes.

Thank you.
R,
-Joe Wulf

Tim Chase

unread,
Jan 19, 2022, 10:50:55 AMJan 19
to Joseph Wulf, vim...@googlegroups.com
On 2022-01-19 07:23, Joseph Wulf wrote:
> When using vim I wish to disable the <F1> from popping up the help.
[snip]
> :nmap <F1> <nop>
[snip]
> I place the SAME string without the quotes or leading colon in
> .vimrc, close/open a new vim session, and <F1> immediately brings
> up the help menu.

You're on the right track, but it sounds like something is
re-instituting the F1=help mapping after you set it. Are you putting
it at the top of your vimrc, the bottom of your vimrc, or somewhere
in the middle?

If it's not at the bottom, try moving it to the bottom so it trumps
other settings/plugins in your vimrc.

If it *is* already at the bottom, it might help to check if it only
happens with certain file-types (in which case some filetype plugin
might be playing the jerk and messing with it). You might have to
try selectively disabling plugins until you find the guilty party.

But I feel your pain -- I create mappings similar to yours,
doing

inoremap <f1> <esc>

in my vimrc because the ESC key is right next to the F1 key on my
laptop and I often accidentally hit F1 when I'm mashing for ESC.

-tim



Gary Johnson

unread,
Jan 19, 2022, 1:04:27 PMJan 19
to vim...@googlegroups.com
On 2022-01-19, Tim Chase wrote:
> On 2022-01-19 07:23, Joseph Wulf wrote:
> > When using vim I wish to disable the <F1> from popping up the help.
> [snip]
> > :nmap <F1> <nop>
> [snip]
> > I place the SAME string without the quotes or leading colon in
> > .vimrc, close/open a new vim session, and <F1> immediately brings
> > up the help menu.
>
> You're on the right track, but it sounds like something is
> re-instituting the F1=help mapping after you set it.

:verbose map <f1>

should show where the mapping was done.

Regards,
Gary

Joseph Wulf

unread,
Jan 19, 2022, 6:48:45 PMJan 19
to vim...@googlegroups.com
Gary,

Thank you.

That's interesting.
In doing  ":verbose map <f1>", I get the following output:
x  <F1>          <Nop>               Last set from ~/.vimrc
s  <F1>          <Nop>               Last set from ~/.vimrc
o  <F1>          <Nop>               Last set from ~/.vimrc
n  <F1>          <Nop>               Last set from ~/.vimrc

While in my .vimrc, I have:
cmap <F1> <nop>
imap <F1> <nop>
lmap <F1> <nop>

nmap <F1> <nop>
omap <F1> <nop>
smap <F1> <nop>
vmap <F1> <nop>
xmap <F1> <nop>

At the moment, in command-mode, <F1> is properly NOT working, while in INSERT mode, <F1> still does bring up the help.
I can see I'm getting closer, as I'm half-way there.


R,
-Joe Wulf;  RHCSA(RHEL7), FITSP-D, CISSP, VCP3, CPO(USN/RET)
Tony Robbins:  "Management is focusing on getting someone to get a result. Leadership is producing a standard in someone that when you’re gone, they will live by to produce higher level results consistently".




--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20220119180458.GA5754%40phoenix.

Gary Johnson

unread,
Jan 19, 2022, 7:38:41 PMJan 19
to vim...@googlegroups.com
On 2022-01-19, Joseph Wulf wrote:
> Gary,
>
> Thank you.
>
> That's interesting.
> In doing  ":verbose map <f1>", I get the following output:
> x  <F1>          <Nop>               Last set from ~/.vimrc
> s  <F1>          <Nop>               Last set from ~/.vimrc
> o  <F1>          <Nop>               Last set from ~/.vimrc
> n  <F1>          <Nop>               Last set from ~/.vimrc
>
> While in my .vimrc, I have:
> cmap <F1> <nop>
> imap <F1> <nop>
> lmap <F1> <nop>
> nmap <F1> <nop>
> omap <F1> <nop>
> smap <F1> <nop>
> vmap <F1> <nop>
> xmap <F1> <nop>
>
> At the moment, in command-mode, <F1> is properly NOT working, while in INSERT
> mode, <F1> still does bring up the help.
> I can see I'm getting closer, as I'm half-way there.

Joe,

Thanks for showing all that. Interesting that your insert-mode
mapping doesn't work. I was thinking that

verbose map <f1>

would show all maps of <f1>, but it doesn't. It doesn't show
insert-mode maps. Obvious on reflection, but I don't always
reflect. To see those, execute

:verbose imap <f1>

HTH,
Gary

Joseph Wulf

unread,
Jan 20, 2022, 10:26:27 AMJan 20
to vim...@googlegroups.com
Gary,

Little closer......The results for "i' were:
i  <F1>          <Nop>         Last set from ~/.vimrc
In my previous email, I showed that (I thought) I'd addressed ALL the modes (c, i, l, n, o, s, v, x).

R,
-Joe Wulf;  RHCSA(RHEL7), FITSP-D, CISSP, VCP3, CPO(USN/RET)
Tony Robbins:  "Management is focusing on getting someone to get a result. Leadership is producing a standard in someone that when you’re gone, they will live by to produce higher level results consistently".


--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.

Tony Mechelynck

unread,
Jan 20, 2022, 4:30:34 PMJan 20
to vim_use
On Thu, Jan 20, 2022 at 4:26 PM Joseph Wulf <joseph...@gmail.com> wrote:
>
> Gary,
>
> Little closer......The results for "i' were:
> i <F1> <Nop> Last set from ~/.vimrc
> In my previous email, I showed that (I thought) I'd addressed ALL the modes (c, i, l, n, o, s, v, x).

Normally, using

map <F1> <Nop>
map! <F1> <Nop>

ought to work for all usual modes: with exclamation mark for Insert
and Command-line modes, without it for Normal, Visual (i.e. s+x) and
Operator-pending. If you use the terminal window you may have to add a
tmap. Language mappings are used when keymaps are active (i.e.
'iminsert' is equal to 1, toggled by Ctrl-^), any key with no langmap
defined defaults to whatever it does in "standard" Insert mode. See
:help :map-commands

Best regards,
Tony.
> To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJ8cad-aZORqWSjdqiZMexQwUQ%2BsSyQ%2BzLazhpzO2GQVxE1XTw%40mail.gmail.com.

Joseph Wulf

unread,
Jan 20, 2022, 8:29:50 PMJan 20
to vim...@googlegroups.com
Tony,

"map <F1> <Nop>" is all that works for me, so far, during Normal/Command mode to prevent bringing up VIM HELP.
This is placed at the bottom of my .vimrc.

Attempting, "map! <F1> <Nop>"  is accepted, but does not prevent the <F1>, while in INSERT mode, from bringing up VIM HELP .
No form I tried of 'tmap' would be accepted by vim.

For what it is worth, I'm using CentOS 7.9, with KDE desktop, Konsole terminal windows, patched via the latest yum update.
VIM is version 7.4 (2013 Aug 10, compiled Dec 15 2020 16:44:08);  Included patches: 1-207, 209-629
Konsole terminals are standardized black background, zero transparency and green text.

I've included my entire .vimrc (current state) below my signature (and in-between the lines of dashes), for critique/reference/review.
I'm really proud of my status line, too.

Thank you to everyone who's been helping me on this!

R,
-Joe Wulf;  RHCSA(RHEL7), FITSP-D, CISSP, VCP3, CPO(USN/RET)
Tony Robbins:  "Management is focusing on getting someone to get a result. Leadership is producing a standard in someone that when you’re gone, they will live by to produce higher level results consistently".

-----------------------------------------------------------------------------------
" .vimrc

" Standardized .vimrc file;  Written/implemented by:  Joe Wulf, 20220120@1925.
" Leading DoubleQuote--This is the right way to comment out a line in .vimrc.
" Primary Reference:  man 1 vim    -and-  :help (while in vim)

let $TMPDIR = expand('~/tmp')  " Should ease using VIM 'help', among other benefits of a local per-user-based 'tmp' storage.
                               " Supported by standard linux user-creation template which has ~/.tmp inherently there.

" Available/default colorschemes (RHEL7x/8x -- vim74+); typically found at: /usr/share/vim/vim<vernum>/colors
"colo blue
"colo darkblue
"colo default    " default
"colo delek      " ok; hard though with tons of RED
"colo desert
"colo elflord
"colo evening
"colo industry   " Only in RHEL8x
 colo koehler    " good +1 for GreenText w/ BlackBackground
"colo morning
"colo murphy
"colo pablo      " ok
"colo peachpuff
"colo ron
"colo shine
"colo slate      " good
"colo torte
"colo zellner

scriptencoding utf-8           " Do all the sets
set autoread                   " Attempts to monitor currently open file(s); watching for changes outside of VI/VIM and notifying you
set background=dark            "
set bs=eol,indent,start        " Allow backspacing over everything while in insert mode
set confirm                    " Always raise a dialog instead of failing out
set cursorline                 " Default highlight current line; opposite of [set nocursorline]; on by default
set fileencoding=utf-8         " Rounds out environment locale compliance with  'LANG=en_US.UTF-8'
set encoding=utf-8             " Rounds out environment locale compliance with  'LANG=en_US.UTF-8'
set history=10000              " Sufficiently voluminous history of VIM commands, per user
set hlsearch                   " Highlight search-term/matches
set incsearch                  " Highlight / immediately search as characters are typed
set laststatus=2               " Always display the status line
set modelines=0                " Addresses security issues; Ref:  https://www.gilesorr.com/blog/vim-tips-22-modelines.html
set mouse-=a                   " Disable automatically entering visual mode
"et mouse=a                    " Enable the mouse for scrolling (bad for pasting via mouse)
set noeb novb t_vb=            " NoErrorbells and t_VisualBell; unset; is another opportunity to achieve blessed silence
set noflash                    " Disable visual flashing for error(s)
set noignorecase               " Force ignoring cAsE when [/?] searching, off by default
set novb                       " Disable visual bell for error(s)
"et number                     " Would enable line numbering; not advisable as a default
set paste                      " Allows pasting in, without typical auto-formatting
"et scrolloff=5                " This will keep the cursor at least 5 lines away from the top or bottom of the editor window (not advisable); Nbr can be locally adjusted
"et showcmd                    " Shows partial commands in the last line of the screen, but by default, do not want this behavior
set showmatch                  " Highlight matching pairs of the following sets of character-pairs:  "[{('``')}]", even works across multiple lines
set showmode                   " Always indicate mode (Command/Insert) on the ruler/status line
set t_Co=256                   " Explicitly force the state where the terminal has 256 colors
set title                      " Change the terminal's title based on the file being edited; very useful in a terminal window with multiple tabs (i.e. KDE Konsole)
set undolevels=1000            " Provide for many mucho levels of undo, per vi-session, per file

                               " Next are the unsets
set nocompatible               " Gets rid of the crap that Vim does to be vi compatible, thus vim is substantially improved
"et nocursorline               " Does the opposite of (set cursorline) which highlights the current line with and edge-to-edge underline; off by default
set noerrorbells               " No damned audible 'bell' to bother with;    Ref:  https://vim.fandom.com/wiki/Disable_beeping
set nomodeline                 " Addresses security issues; Ref:  https://alioth-lists-archive.debian.net/pipermail/pkg-vim-maintainers/2007-June/004020.html
"et nopaste                    " Toggled off, allows formatting of pasted content; opposite of 'set paste'
set novisualbell               " No damned visual 'bell' to be bothered by;  Ref:  https://vim.fandom.com/wiki/Disable_beeping

syntax reset                   " Puts syntax color highlighting back to sane defaults
set syntax=on                  " Set syntax color highlighting on by default or use:  ':syntax off' to disable
syntax on                      " Further ensures syntax highlighting is on/enabled

" Reference:  https://vim.fandom.com/wiki/Have_Vim_check_automatically_if_the_file_has_changed_externally; specifically see:  'Alternative Solutions'!
" -- Will reload target file content when entering the buffer or gaining focus; trigger autoread reload when changing buffers or coming back to vim
au FocusGained,BufEnter * :silent! !
" -- Will save when exiting the buffer or losing focus; not enabled by default; must still TEST, use with caution.
" au FocusLost,WinLeave * :silent! w

if has('autocmd') && has('gui_running')
   " Disables beeping and visual bells even in Vim GUI.
   " If-check prevents error when /usr/bin/vim isn't compiled with autoCMD; typically it is by default.
   autoCMD GUIEnter * set noerrorbells novisualbell t_vb=
endif

" Set this StatusLine look/feel 'after' the colorscheme is merged in (up above).
" Reference:  http://vimdoc.sourceforge.net/htmldoc/options.html#'statusline'
" This statusline example is 'OK' on Green Text w/ Black Background
" hi StatusLine     term=bold,reverse  cterm=bold ctermfg=black ctermbg=cyan gui=bold guifg=blue guibg=white"
" This statusline example is 'Great' on GreenText w/ BlackBackground
hi StatusLine     term=bold,reverse  cterm=bold ctermfg=white ctermbg=blue gui=bold guifg=blue guibg=white"

" Must still document this line structure!!!
" Construct a highly useful standard status line to be displayed [example ruler/status line view; 'set' command which achieves it].
" Modern version--viable in a terminal only 80 columns wide; generally most useful in terminal 90+ columns wide (based on length of filename being edited).
" [RO] [+] -(x)- Buf[1]                                          Fmt[unix[conf]] (C:001|L:001/329)  A[035] H[23] (  0%|b:00001)-
"
set statusline=%<%r\ %m\ -(%f)-%w\ Buf[%n]%=\ Fmt[%{&ff}%y]\ (C:%03c\|L:%03l/%03L)\ A[\%03.3b]\ H[%02.2B]\ (%3p%%\|b:%05o)-

" This will center the next forward (/) found search result into the center of the shell window.
" Reference:  https://vi.stackexchange.com/questions/13641/how-can-i-center-the-window-on-each-search-result
function! CenteredFindNext(forward)
    " save the current value for later restore
    let s:so_curr=&scrolloff
    set scrolloff=999
    try
        if a:forward
            silent normal! n
        else
            silent normal! N
        endif
    finally
        " restore no matter what
        let &scrolloff=s:so_curr
    endtry
endfunction
nnoremap <silent>n :call CenteredFindNext(1)<CR>
nnoremap <silent>N :call CenteredFindNext(0)<CR>

" Unmap <F1> from being the ESC out to VI help.  ":help" clearly will always continue to work.
" Reference:  https://vim.fandom.com/wiki/Disable_F1_built-in_help_key
cmap <F1> <Nop>
imap <F1> <Nop>
lmap <F1> <Nop>
map <F1> <Nop>
map! <F1> <nop>
nmap <F1> <Nop>
omap <F1> <Nop>
smap <F1> <Nop>
vmap <F1> <Nop>
xmap <F1> <Nop>
"
"map! <F1> <nop>   " Doesn't work
"tmap <F1> <Nop>   " Doesn't work
"imap! <F1> <nop>  " BAD
"nmap! <F1> <nop>  " BAD
"iu <F1>           " BAD
"unm <F1>          " BAD
"imap <F1> :echo<CR>
"nmap <F1> :echo<CR>
"inoremap <F1> <esc>
"inoremap <F1> <Nop>

"
" NUGGETS/LessonsLearned of vim goodies:
" -  /[^\x00-\x7f]   " This will do a NEGATIVE search; good for finding non-ascii characters.
" -  :%s/\\n/\r/g    " This will convert all null's (\n) in a given text file, to real CR's
" -  set nowrap      " This will stop vi from wrapping lines of text in the window (leaveing some longer lines visually 'chopped off'; sometimes helpful).
"
" Additional helpful VI references:
" -  https://unix.stackexchange.com/questions/199203/why-does-vim-indent-pasted-code-incorrectly
" -  https://vim.fandom.com/wiki/Disable_automatic_comment_insertion
" -  https://vim.fandom.com/wiki/Pasting_code_with_syntax_coloring_in_emails
"

-----------------------------------------------------------------------------------


Gary Johnson

unread,
Jan 21, 2022, 2:00:18 AMJan 21
to vim...@googlegroups.com
On 2022-01-20, Joseph Wulf wrote:

Joe,

> "map <F1> <Nop>" is all that works for me, so far, during Normal/Command mode
> to prevent bringing up VIM HELP.
> This is placed at the bottom of my .vimrc.
>
> Attempting, "map! <F1> <Nop>"  is accepted, but does not prevent the <F1>,
> while in INSERT mode, from bringing up VIM HELP .
> No form I tried of 'tmap' would be accepted by vim.
>
> For what it is worth, I'm using CentOS 7.9, with KDE desktop, Konsole terminal
> windows, patched via the latest yum update.
> VIM is version 7.4 (2013 Aug 10, compiled Dec 15 2020 16:44:08);  Included
> patches: 1-207, 209-629
> Konsole terminals are standardized black background, zero transparency and
> green text.
>
> I've included my entire .vimrc (current state) below my signature (and
> in-between the lines of dashes), for critique/reference/review.
> I'm really proud of my status line, too.

I didn't see anything there that should cause this.

I know we've been through this before in bits and pieces, but I'd
like to be sure that we're all on the same page.

Please try the following.

1. Start vim without any arguments:

vim

2. Enter insert mode by typing

a

3. Type the F1 key. This will presumably bring up Vim's help.

4. Exit the help window by executing

:q

5. Execute this:

:verbose map! <f1>

6. Let us know the results of that last command.

Regards,
Gary

Joseph Wulf

unread,
Jan 21, 2022, 2:08:26 AMJan 21
to vim...@googlegroups.com
Gary,

I moved .vimrc out of the way.
Executed "\vim"   to negate my bash alias which does:  "alias vim='/usr/bin/vim -u ~/.vimrc'"

I first did '<F1>' and got the help, and quit out of it ":q"
I next did 'a' and then did '<F1>' and got the help, and quit out of it ":q"

The results from ":verbose map! <F1>" was "No mapping found"---------same for ":verbose map <F1>.

Thank you... I appreciate the help.
I've spent a couple hours this evening browsing through the VIM ":help".... to see what more I could learn.


R,
-Joe Wulf;  RHCSA(RHEL7), FITSP-D, CISSP, VCP3, CPO(USN/RET)
Tony Robbins:  "Management is focusing on getting someone to get a result. Leadership is producing a standard in someone that when you’re gone, they will live by to produce higher level results consistently".



--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.

Gary Johnson

unread,
Jan 21, 2022, 3:04:04 AMJan 21
to vim...@googlegroups.com
On 2022-01-21, Joseph Wulf wrote:
> Gary,
>
> I moved .vimrc out of the way.
> Executed "\vim"   to negate my bash alias which does:  "alias vim='/usr/bin/vim
> -u ~/.vimrc'"
>
> I first did '<F1>' and got the help, and quit out of it ":q"
> I next did 'a' and then did '<F1>' and got the help, and quit out of it ":q"
>
> The results from ":verbose map! <F1>" was "No mapping found"---------same for "
> :verbose map <F1>.
>
> Thank you... I appreciate the help.
> I've spent a couple hours this evening browsing through the VIM ":help".... to
> see what more I could learn.

Joe,

The point of the experiment was to try to discover what it is in
your setup that causes the insert- and command-mode mapping of <f1>
(i.e., "map! <f1> <nop>") to disappear or become ineffective. If
you move your ~/.vimrc out of the way, we don't learn anything.

That said, it may not have been a very good experiment because the
:verbose command would not have said where F1 became unmapped.
(I'm experimenting with a very old 7.2.330 Vim on an even older
Ubuntu 10.04 system.)

One approach would be to create a file, say f1test, put in this one
line:

map! <f1> <nop>

and start vim like this:

/usr/bin/vim -N -u f1test

Then see if typing the F1 while in insert mode still brings up help.

If that works to stop F1 from bringing up help, then slowly add
lines to f1test from your ~/.vimrc until it fails.

If that doesn't work, then it may be a plugin. You can start Vim as

/usr/bin/vim -N -u f1test --noplugin

to see if that works.

I did see something in your ~/.vimrc that you should change.
I don't know whether or not it affects this problem, but it will
likely cause other problems. You have

set nocompatible

in the middle of that file. It should be at the very top, the first
thing executed. See

:help 'compatible'

Regards,
Gary

Joseph Wulf

unread,
Jan 21, 2022, 3:22:27 AMJan 21
to vim...@googlegroups.com
Gary,

Thank you for all you've said, including explaining.  Roger all that!
I fixed the 'set nocompatible' as you pointed out into my core .vimrc.

I echo'd  "map! <f1> <nop"  > f1test

Next I did:  "/usr/bin/vim -N -u f1test --noplugin"

<F1> in CommandMode brought up help.  Did ":q".
Did 'i' for insert mode and <F1>  and NADA!!!
Very helpful directive troubleshooting.

I then added "map <f1> <nop" into f1test; now it looks like:
map <F1> <Nop>
map! <F1> <Nop>
Retried "/usr/bin/vim -N -u f1test --noplugin"--- and CommandMode/InsertMode attempts to <F1> properly FAIL!
VOILA!!

My fallacy was that I KNEW everything else in my .vimrc was good to go---just needed one more little detail to 'work right'.

Ok, I'm off to layer back in my .vimrc content to find the real source of my problem.
I'll follow up with what I find.

Thank you, Gary (and everyone else who has helped)!!

R,
-Joe Wulf;  RHCSA(RHEL7), FITSP-D, CISSP, VCP3, CPO(USN/RET)
Tony Robbins:  "Management is focusing on getting someone to get a result. Leadership is producing a standard in someone that when you’re gone, they will live by to produce higher level results consistently".



--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.

Joseph Wulf

unread,
Jan 21, 2022, 4:05:04 AMJan 21
to vim...@googlegroups.com
And the answer is:  "set paste" prevents the mapping of <F1> out of existence.
Cannot set paste before or after the "map! <F1> <nop>"; just cannot set it at all.

Which is a problem in my/our world.... as we use vim and paste a lot.

R,
-Joe Wulf;  RHCSA(RHEL7), FITSP-D, CISSP, VCP3, CPO(USN/RET)
Tony Robbins:  "Management is focusing on getting someone to get a result. Leadership is producing a standard in someone that when you’re gone, they will live by to produce higher level results consistently".



Tim Chase

unread,
Jan 21, 2022, 8:56:09 AMJan 21
to Joseph Wulf, vim...@googlegroups.com
On 2022-01-21 04:04, Joseph Wulf wrote:
> And the answer is: "set paste" prevents the mapping of <F1> out of
> existence.
> Cannot set paste before or after the "map! <F1> <nop>"; just cannot
> set it at all.
>
> Which is a problem in my/our world.... as we use vim and paste a
> lot.

You might want to read up at

:help 'pastetoggle'

which is a setting that allows you to toggle 'paste', documented in

:help new-options-5.4

saying

'pastetoggle' option: Key sequence that toggles 'paste'. Works
around the problem that mappings don't work in Insert mode when
'paste' is set.

There might be a way to abuse this into turning <f1> into a <nop>

-tim


Gary Johnson

unread,
Jan 21, 2022, 11:50:56 AMJan 21
to vim...@googlegroups.com
On 2022-01-21, Joseph Wulf wrote:
> And the answer is:  "set paste" prevents the mapping of <F1> out of existence.
> Cannot set paste before or after the "map! <F1> <nop>"; just cannot set it at
> all.

Congratulations!

> Which is a problem in my/our world.... as we use vim and paste a lot.

I'm fortunate to work in an environment where Vim knows about my
mouse clicks and paste usually just works. In addition to what Tim
wrote, you might try Ingo Karkat's UnconditionalPaste plugin. I've
been using its glp and gcp commands a lot recently to have more
control over how things are pasted.

Regards,
Gary

Reply all
Reply to author
Forward
0 new messages