Yes, it is possible. You can load menu.vim
(the default gvim menu definitions), or you can just start from scratch and create your own, then access them through :emenu
. This doesn't give you nano-like always-visible menus, though; it gives you the ability to navigate menus using command-line tab completion.
If the user doesn't have a vimrc, you'll want to start by disabling vi compatibility:
:set nocompatible
Enable smart command line completion on <Tab>
(enable listing all possible choices, and navigating the results with <Up>
, <Down>
, <Left>
, <Right>
, and <Enter>
):
:set wildmenu
Make repeated presses cycle between all matching choices:
:set wildmode=full
Load the default menus (this would happen automatically in gvim, but not in terminal vim):
:source $VIMRUNTIME/menu.vim
After those four commands, you can manually trigger menu completion by invoking tab completion on the :emenu
command, by doing :emenu<space><tab>
You can navigate the results using the tab key and the arrow keys, and the enter key (it both expands submenus and selects items). You can then make that more convenient by going a step further, and binding a mapping to pop up the menu without having to type :emenu
every time:
Make Ctrl-Z in a mapping act like pressing <Tab>
interactively on the command line:
:set wildcharm=<C-Z>
And make a binding that automatically invokes :emenu
completion for you:
:map <F4> :emenu <C-Z>
The issue is caused by the sensible plugin:line 93. :help t_Co
" Allow color schemes to do bright colors without forcing bold.
if &t_Co == 8 && $TERM !~# '^linux'
set t_Co=16 " << --- Causes hickup
endif
If you run vim in verbose log mode (vim -V15load_log.vim
) – and search
for t_Co=
and RedundantSpaces
you'll see that sensible
is actually parsed after your appearance.vim
file.
Quick fix would be to either comment out that section of the code and add it to your .vimrc
, but as you link to git repositories that is perhaps not what you want.
A different approach would be to move it out of the bundle
directory and add it as a separate source
line in your vimrc
, before your glob loop.
I.e.:
source ~/.vim/hacks/vim-sensible/plugin/sensible.vim
for f in split(glob ...
Another way would be to load custom highlight on BufLoad.
Etc. …
Best Answer
The syntax for lookarounds in vim is different from the PCRE syntax that you appear to have assumed. Instead of
(?! )
try\@!
i.e.