I'm trying to map f11 to a command within vim, with a line in .vimrc such as:
map <F11> :exe '!ctags -R --python-kinds=-i -f ./tags ' . shellescape(system('python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"'))<CR>
But if you hit F11 it just turns up the volume. Is it possible to remap keys that have OS-wide functions in OSX?
I don't want to remap any more commonly used key here because regenerating tags takes awhile.
The path used by macOS's default vim install is /usr/share/vim/vimrc .
What is the Meta Key ? The Meta Key (denoted as M or Meta ) is a modifier key which mean it temporarily modify the normal action of another key when pressed together. Common modifier keys are shift , alt , or control .
vi mode has two submodes: insert mode and command mode. The default mode is insert. You can toggle between the modes by pressing Esc; alternatively, in command mode, typing a (append) or i (insert) will return you to insert mode.
You have two options that I know of:
1) Enable the regular use of the function keys, ie. f1 - f12 no longer executes the OSX specific command such as decrease volume. Instead you will have to hold the fn
key press the f
key. I have this set up on my computer and I've successfully mapped the function keys in Vim / MacVim. To do this go to System preferences --> Keyboard
and check of the Use all F1, F2,...
2) Use fn
+ F11
to execute the command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With