I want to set :x in vim gui-mode to delete buffer because I always kill the whole gvim, which is kind of annoying. I know i can specifically set gui problems with if has("gui running") but don’t know how to remap :x
thanks in advance
ps.: maybe the tag/term remap is wrong but I don’t know the correct term, that’s why google didn’t provide any help at all.
I find the safest alternative is to use an expression abbreviation:
This will ensure the abbreviation will only be expanded to
bdwhen:xis used otherwise just expand tox.For more help:
Upon further inspection there appears to be a plugin that does exactly this by Hari Krishna Dara called cmdalias.vim. It uses a variation of the technique above.