Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not map <c-x> if already mapped to something else #135

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/supertab.txt
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ something that is supported. Alternatively, you can escape the <tab> with
Enhanced longest match support *supertab-longestenhanced*
*g:SuperTabLongestEnhanced*

g:SuperTabMappingTabManual (default value: <c-x>)

g:SuperTabLongestEnhanced (default value: 0)

When enabled and 'longest' is in your |completeopt| setting, supertab will
Expand Down
8 changes: 7 additions & 1 deletion plugin/supertab.vim
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ set cpo&vim

" Global Variables {{{

if !exists("g:SuperTabMappingTabManual")
let g:SuperTabMappingTabManual='<c-x>'
endif

if !exists("g:SuperTabDefaultCompletionType")
let g:SuperTabDefaultCompletionType = "<c-p>"
endif
Expand Down Expand Up @@ -905,7 +909,9 @@ endfunction " }}}
" map a regular tab to ctrl-tab (note: doesn't work in console vim)
exec 'inoremap ' . g:SuperTabMappingTabLiteral . ' <tab>'

imap <silent> <c-x> <c-r>=<SID>ManualCompletionEnter()<cr>
if !hasmapto( g:SuperTabMappingTabManual , 'i')
exec 'inoremap <silent> ' . g:SuperTabMappingTabManual . ' <c-r>=<SID>ManualCompletionEnter()<cr>'
endif

imap <script> <Plug>SuperTabForward <c-r>=SuperTab('n')<cr>
imap <script> <Plug>SuperTabBackward <c-r>=SuperTab('p')<cr>
Expand Down