So, for me, the Insert key toggle was driving me to distraction on Mac since Ubuntu is my main OS. I had to hunt down the key mapping and duplicate it in macvim. How I've done this so far is to do:
- Start up vim on Ubuntu. Type
:scriptnames
to get the list of possibles. Cut and past that into a file named ~/file.list and remove anything that isn't a full path. Specifically the line numbers. Save the file. The file contains:
/usr/share/vim/vimrc /usr/share/vim/vim80/debian.vim /usr/share/vim/vim80/syntax/syntax.vim /usr/share/vim/vim80/syntax/synload.vim /usr/share/vim/vim80/syntax/syncolor.vim /usr/share/vim/vim80/filetype.vim /usr/share/vim/vim80/defaults.vim /usr/share/vim/vim80/syntax/nosyntax.vim /usr/share/vim/vim80/ftplugin.vim /usr/share/vim/vim80/indent.vim /usr/share/vim/vim80/plugin/getscriptPlugin.vim /usr/share/vim/vim80/plugin/gzip.vim /usr/share/vim/vim80/plugin/logiPat.vim /usr/share/vim/vim80/plugin/manpager.vim /usr/share/vim/vim80/plugin/matchparen.vim /usr/share/vim/vim80/plugin/netrwPlugin.vim /usr/share/vim/vim80/plugin/rrhelper.vim /usr/share/vim/vim80/plugin/spellfile.vim /usr/share/vim/vim80/plugin/tarPlugin.vim /usr/share/vim/vim80/plugin/tohtml.vim /usr/share/vim/vim80/plugin/vimballPlugin.vim /usr/share/vim/vim80/plugin/zipPlugin.vim
For the record, I've already manually checked everything in /etc/vim/
and ~/.vimrc
To find out where the references are, I tried:
for I in $(cat ~/file.list); do if [ -f $I ];then grep -Hn Insert $I;fi;done
This produced the following:
/usr/share/vim/vim80/debian.vim:44: autocmd GUIEnter * if !<SID>MapExists("<S-Insert>", "nvso") | execute "map <S-Insert> <MiddleMouse>" | endif
/usr/share/vim/vim80/debian.vim:45: autocmd GUIEnter * if !<SID>MapExists("<S-Insert>", "ic") | execute "map! <S-Insert> <MiddleMouse>" | endif
/usr/share/vim/vim80/plugin/matchparen.vim:67: " not found, in Insert mode try character before the cursor
Unfortunately none of these is the right animal. I'm assuming that <S-Insert>
is a reference to the Insert key as modified by some other key. Perhaps the Super key.
Argh! :-/
What I've discovered is that MacOS actually intercepts the key. As a consequence, one cannot use it in vim.
Instructions to figure this out about your OS:
My solution was to create an alias that maps the
vim
command tonano
.