Closed d0u9 closed 3 years ago
I don't understand it. But you want to select the candidates when popup is visible.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? StabsTab() :
\ deoplete#manual_complete()
function! s:check_back_space() abort "{{{
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction"}}}
You should read the documentation though... https://github.com/Thyrum/vim-stabs#cocnvim
Note: We don't have ESP skills. You need to describe the problem more clearly.
vim-stab
and deoplete
both relay on tab key to take actions. vim-stab
inserts <space>
instead of <tab>
if it is not for indentation. It works fine until a mix use of deoplete
and vim-stab
.
For example, if we have a simple Golang code snippet like this:
package main
import "fmt"
func main() {
fmt.Print```HIT TAB HERE```
}
Once the t
character is inputed deoplete
pops a menu of candidate words for user to select. Hitting tab key here intuitively walks through the menu in normal scenario. BUT, due to the interference of vim-stab
, tab key does noting but insert spaces after the fmt.Print
.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? StabsTab():
\ deoplete#manual_complete()
function! s:check_back_space() abort "{{{
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction"}}}
This configuration seems disable vim-stab
totally. Only single space is inserted afterwards, and a trail of tab follows.
› fmt.Printf(•› › › › ›
What I want is something like this
› fmt.Printf(•••••••••••••
Note: •
== space, ›
== tab
Really??? It is deoplete problem? OK, I need to check the behavior. Please wait.
Please use this configuration instead.
let g:stabs_maps = 'boOc='
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" : StabsTab()
function! s:check_back_space() abort "{{{
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction"}}}
It is my fault. I remapped
Comment here for reference.
Fixed, thank you. Please close this issue.
Warning: I will close the issue without the minimal init.vim and the reproduction instructions.
Problems summary
I want to indent code with tab, and align with space. https://github.com/Thyrum/vim-stabs is a handy plugin for this purpose. However, both deoplete and vim-stabs content spacebar when completion and alignment happen same time.
Expected
Environment Information
deoplete version (SHA1): 27be5ec
OS: Linux & MacOS
neovim/Vim
:version
output: NVIM v0.4.4 Build type: Release LuaJIT 2.1.0-beta3Provide a minimal init.vim/vimrc with less than 50 lines (Required!)
How to reproduce the problem from neovim/Vim startup (Required!)