Closed alem0lars closed 9 years ago
This is meant to be consistent with vim's wildmenu. When wildmenu is open, the statusline is replaced with the menu options.
It is not possible to integrate with airline at the moment. To do so, the render
function of Cmd2 needs to be modified, but I have no plans to do this at the moment. Forks are welcome.
I do plan to include a feature where you can do more advanced customisation of the current menuline (currently you can only change the colours and separators). Using this, it should be possible to have a menuline that looks similar to the airline statusbar.
The custom renderer feature has been added in 379ecc4b3910d686a9b3fd9f75e369cf2419e63b.
To use the Airline menu, include the following entry in the Cmd2_options
dictionary:
\ '_suggest_render': 'Cmd2#render#New().WithInsertCursor().WithAirlineMenu()',
The menu colours will now need to be changed. To use the default airline theme colours, use
\ 'menu_hl': 'airline_x',
\ 'menu_selected_hl': 'airline_y',
\ 'menu_separator_hl': 'airline_x',
You can set your custom colours if these are not to your liking.
Thanks, it's almost working now.
However I'm having some color issues in the status line (it's white):
This is the relevant config:
" {{{ Options.
let g:Cmd2_cmd_mappings = {
\ 'iw': {'command': 'iw', 'type': 'text', 'flags': 'Cpv'},
\ 'ap': {'command': 'ap', 'type': 'line', 'flags': 'pv'},
\ '^': {'command': '^', 'type': 'normal!', 'flags': 'r'},
\ 'w': {'command': 'Cmd2#functions#Cword',
\ 'type': 'function', 'flags': 'Cr'},
\ }
let g:Cmd2_options = {
\ '_complete_ignorecase': 1,
\ '_complete_uniq_ignorecase': 0,
\ '_quicksearch_ignorecase': 1,
\ '_complete_start_pattern': '\<\(\k\+\(_\|\#\)\)\?',
\ '_complete_fuzzy': 1,
\ '_suggest_render': 'Cmd2#render#New().WithInsertCursor().WithAirlineMenu()',
\ 'menu_hl': 'airline_x',
\ 'menu_selected_hl': 'airline_y',
\ 'menu_separator_hl': 'airline_x',
\ }
" Character to type to start wildcard expansion in the command-line.
set wildcharm=<Tab>
" }}}
" {{{ Configure hotkeys.
" : or /: Enable Cmd2 automatically.
nmap : :<F11>
nmap / /<F11>
" <F11>: Enable Cmd2 manually.
cmap <F11> <Plug>(Cmd2Suggest)
" <Tab>: Perform completion using Cmd2.
cmap <expr> <Tab> Cmd2#ext#complete#InContext() ?
\ '\<Plug>(Cmd2Complete)' :
\ '\<Tab>'
" }}}
This should be due to the colorscheme used. The airline_x
and airline_y
highlights are either not set, or are not matching with the airline highlight.
Can you try changing airline_x
to airline_c
and airline_y
to airline_b
?
Also, can I confirm which colorscheme you are using?
jellybeans
both as vim colorscheme and airline theme.
It is working fine on my setup.
Can you test with other colorschemes to see if this occurs throughout?
If the problem persists, a minimal .vimrc would be good to troubleshoot.
Ok thanks a lot for the awesome support :)
I'm closing this issue now since the feature has been implemented :smiley:
I've installed both
Cmd2
andairline
plugins.The problem here is that Cmd2 replaces airline as statusbar when autocompleting. I'd like instead that Cmd2 displays autocomplete results inside the airline.
Is that possible?
Thanks, Alessandro