1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-13 15:29:10 +08:00

feat: add autocomplete toggle for deoplete (#4125)

Signed-off-by: Ben Anson <benansondev@gmail.com>
This commit is contained in:
Ben Anson 2021-03-11 13:16:37 +00:00 committed by GitHub
parent db4820ac67
commit 5af5b0d508
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 19 deletions

View File

@ -249,6 +249,14 @@ function! SpaceVim#layers#autocomplete#getprfile() abort
endfunction
function! SpaceVim#layers#autocomplete#toggle_deoplete() abort
if deoplete#custom#_get_option('auto_complete')
call deoplete#custom#option('auto_complete', v:false)
else
call deoplete#custom#option('auto_complete', v:true)
endif
endfunction
function! s:apply_sequence_delay() abort

View File

@ -83,6 +83,10 @@ function! SpaceVim#layers#ui#config() abort
call SpaceVim#mapping#space#def('nnoremap', ['t', '8'], 'call call('
\ . string(s:_function('s:toggle_fill_column')) . ', [])',
\ 'highlight-long-lines', 1)
if g:spacevim_autocomplete_method ==# 'deoplete'
call SpaceVim#mapping#space#def('nnoremap', ['t', 'a'], 'call SpaceVim#layers#autocomplete#toggle_deoplete()',
\ 'toggle autocomplete', 1)
endif
call SpaceVim#mapping#space#def('nnoremap', ['t', 'b'], 'call call('
\ . string(s:_function('s:toggle_background')) . ', [])',
\ 'toggle background', 1)

View File

@ -528,25 +528,26 @@ Also note that changing this value has no effect if you are running Vim/Neovim i
Some UI indicators can be toggled on and off (toggles start with t and T):
| Key Bindings | Descriptions |
| ------------ | -------------------------------------------------------- |
| `SPC t 8` | highlight any character past the 80th column |
| `SPC t f` | display the fill column (by default `max_column` is 120) |
| `SPC t h h` | toggle highlight of the current line |
| `SPC t h i` | toggle highlight indentation levels (TODO) |
| `SPC t h c` | toggle highlight indentation current column |
| `SPC t h s` | toggle syntax highlighting |
| `SPC t i` | toggle indentation guide at point |
| `SPC t n` | toggle line numbers |
| `SPC t b` | toggle background |
| `SPC t c` | toggle conceal |
| `SPC t p` | toggle paste mode |
| `SPC t t` | open tabs manager |
| `SPC T ~` | display ~ in the fringe on empty lines |
| `SPC T F` | toggle frame fullscreen |
| `SPC T f` | toggle display of the fringe |
| `SPC T m` | toggle menu bar |
| `SPC T t` | toggle tool bar |
| Key Bindings | Descriptions |
| ------------ | -------------------------------------------------------------------------- |
| `SPC t 8` | highlight any character past the 80th column |
| `SPC t a` | toggle autocomplete (only available with `autocomplete_method = deoplete`) |
| `SPC t f` | display the fill column (by default `max_column` is 120) |
| `SPC t h h` | toggle highlight of the current line |
| `SPC t h i` | toggle highlight indentation levels (TODO) |
| `SPC t h c` | toggle highlight indentation current column |
| `SPC t h s` | toggle syntax highlighting |
| `SPC t i` | toggle indentation guide at point |
| `SPC t n` | toggle line numbers |
| `SPC t b` | toggle background |
| `SPC t c` | toggle conceal |
| `SPC t p` | toggle paste mode |
| `SPC t t` | open tabs manager |
| `SPC T ~` | display ~ in the fringe on empty lines |
| `SPC T F` | toggle frame fullscreen |
| `SPC T f` | toggle display of the fringe |
| `SPC T m` | toggle menu bar |
| `SPC T t` | toggle tool bar |
### Statusline