Weird behavior with tab mapping #5133
Replies: 4 comments 23 replies
-
Check |
Beta Was this translation helpful? Give feedback.
-
I forgot to mention that I have tried this approach and of course, my custom mapping works, but this way I lose |
Beta Was this translation helpful? Give feedback.
-
Let me show you what's the problem I'm facing. I have the following mapping for tab: " Use Tab to select completion downwards when popup window opened
inoremap <silent><expr> <TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" Use Tab to select completion upwards when popup window opened
inoremap <expr> <S-TAB> pumvisible() ? "\<C-p>" : "\<S-TAB>"
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<cr>" If I disable this and leave if I disable I'm trying to find the golden ratio to make both of them work, with each its own configuration settings. |
Beta Was this translation helpful? Give feedback.
-
@fannheyward Seems like I was very tired to see the right solution to my problem. I did not need to set a custom mapping; just creating a "bridge" between Here's the missing part in "golang": {
"command": "gopls",
"rootPatterns": ["go.mod", ".git/"],
"filetypes": ["go"]
} and the necessary let g:go_highlight_fields = 1
let g:go_highlight_build_constraints = 1
let g:go_highlight_types = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_format_strings = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_function_parameters = 1
let g:go_highlight_operators = 1
let g:go_highlight_variable_declarations = 1
let g:go_code_completion_icase = 1
" Disable GoDoc
let g:go_doc_keywordprg_enabled = 0 This works wonders! |
Beta Was this translation helpful? Give feedback.
-
I have custom mapping for tab key
and when I have it disabled, that is completely commented out, I get
no mapping found
with:verbose imap <tab>
, but as soon as I uncomment it, I getWithout my own version of mapping, I cannot use
vim-go
at all; it does not accept the Enter key to accept the current highlighted / selected word, nor it accepts the tab key of course.I'm really confused...
I have even tried your own suggestion from README
and obviously does not work with
vim-go
at all; it makes things worse of course.If there a way to tell
coc.nvim
to allow me use my own custom mapping for Golang only?Beta Was this translation helpful? Give feedback.
All reactions