I'm using Mac-oriented vimfiles with linux. In this config modifier
D (Cmd key on Mac) is intensively used. I don't want to change every
M, but I want to remap
D to something like
Alt. Is it possible?
D is the "Apple/Cmd" key. The only version of Vim that understands it is MacVim and only in its GUI incarnation:
D is simply a non-existing key for CLI Vim in any terminal emulator and GVim on any platform.
The immediate consequence is that you'll actually need to replace/duplicate all the
<D- mappings in your config if you want it to be portable across environments.
Another somewhat softer way to deal with this issue is to branch your
~/.vimrc. Here is how I do it, there might be better ways:
let os=substitute(system('uname'), '\n', '', '') if has('gui_running') if os == 'Darwin' || os == 'Mac' " GUI-only stuff for Mac OS X elseif os == 'Linux' " GUI-only stuff for Linux endif else if os == 'Darwin' || os == 'Mac' " CLI-only stuff for Mac OS X elseif os == 'Linux' " CLI-only stuff for Linux endif endif
Considering the unnecessary mess introduced by splitting an honest
~/.vimrc into many
plugin_name.vim, I'll let you find the correct location for that block of code on your own.
Vim's ubiquity is a strong plus: using and maintaining platform-specific mappings is both impractical and counter-productive. I strongly suggest you choose a better, more portable, strategy for your custom mappings: use the "Control" key or even better the
<leader> key. See
Also, using someone else's config is a very bad idea. You should drop that "package" and take care of your own config yourself.