GithubHelp home page GithubHelp logo

supertab's Issues

supertab inserts two lines when hitting cr/enter/return

Hey,

when using your supertab, and hitting the enter key, i get the cursor moved down two lines... so, in ruby:

def foo <tab>

   |

is where the cursor position is.... not awesome :(

anywhere i should start looking to debug?

thx!

I can't figure out how to get SuperTab to fallback to keyword matching.

For the most part SuperTab gets context right but there are times when, say inside a Python function, where Python OmniComplete cannot detect the filetype of an object and seems to fail to complete. I'd like SuperTab to fallback to keyword completion when OmniCompletion fails (i.e., doesn't give any matches). I can't figure out how to do this. Is there a way to do this?

Invoke supertab when the preceding char is blank

Hi,

I have the following scenario. My omni func is smart enough to provide parameters for Oracle functions and may be invoked after a left bracket, a comma or a lbraket/comma followed by an indefinite number of blanks. The problem I have is when I try to invoke supertab and the preceding character is a blank. e.g:

exec dbms_stats( |<-- super tab here

Instead of displaying the omni completion list an actual tab is inserted. Of course, I can use C-x C-o but this is ugly and I like, of course, the Supertab way. Are there any configuration tips to address this issue?

Many thanks!

filetype with supertab

hi

This is not the bug issue.

I am using eclim with supertab,and I using these two plugins to develop java application.

And I prefer to use neocomplcache to develop other language application.

The problem is,How can I use supertab only when I open a buffer with java file.

for example, I have a cpp file buffer and java file buffer in a vim window, It dosen't use supertab feature when I switch to cpp file buffer from java file buffer. Is it possible to do so?

by the way, The default completion key is tab , but my completion key is shift-tab.I don't know why this happen?

How can I change back to shift-tab completion?

Here is my setting with supertab:

let g:SuperTabDefaultCompletionTypeDiscovery = [
\ "&completefunc:< c-x > < c-u >",
\ "&omnifunc:< c-x >< c-o >",
\ ]
let g:SuperTabLongestHighlight = 1

Thanks in advance.

SuperTab Context Completion not completing PHP variables

In vim if I hit "tab" with context completion (default completion is set to omnicomplete), if I hit "TAB" inside a PHP class it completes all PHP methods just fine but it won't complete PHP variables?

Help?? I would really like this to work!

Double <CR> in input mode

Hey,

I have the following line in my .vimrc to add undos in insert blocks when I add a new line:
inoremap <cr> <c-g>u<cr>

When I use supertab, it sends two s. I was looking through the source and found the following in the s:SelectCompletion(cr) function.

From what I can tell:

      " only return a cr if nothing else is mapped to it since we don't want
      " to duplicate a cr returned by another mapping.
      return a:cr ? "\<cr>" : ""

Earlier, there is this code that calls SelectCompletion:

    elseif maparg('<CR>','i') =~ '<CR>'
      let map = maparg('<cr>', 'i')
      let cr = (map =~? '\(^\|[^)]\)<cr>')
      let map = s:ExpandMap(map)
      exec "inoremap <script> <cr> <c-r>=<SID>SelectCompletion(" . cr . ")<cr>" . map

I can't easily fully understand that regex, but I think it checks if my <cr> is mapped to something that has <cr> in it. I checked that manually, and it returns 1 (true).

But then this is passed into the SelectCompletion function... which then seems to assume the opposite value of a:cr...

C-n and C-p

C-n and C-p triggers supertab! It's SuperTab! Not SuperControlN!!! ;c)

I use C-p and C-n to Up and Down, SuperTab overwrites it at the After Function. There's no way to keep my settings unless I disable it (or learn a little VimScript).

How to setup both omni and keyword completion?

I can't manage to setup both omni and keyword completion. From my understanding the completion should use the DefaultCompletionType and if that returns no results it should then use ContextDefaultCompletionType.

What I want to achieve is to use Omni first and if that returns no results use standard keyword completion. However I can't get it working. My setup is:

  let g:SuperTabDefaultCompletionType = 'context'
  let g:SuperTabContextDefaultCompletionType = '<c-o>'
  let g:SuperTabContextTextOmniPrecedence = ['&omnifunc', '&completefunc']
  let g:SuperTabLongestEnhanced = 1

When editing a php file, the omni is used as expected and a list of, say, variables is proposed exactly the same as when manually invoking <c-x><c-o>. But when writing a comment keyword completion is not invoked as it does when manually using <c-x><c-n>. The same thing happens in html, ie. tags are completed by omni but text is not completed by keyword.

When I switch g:SuperTabContextDefaultCompletionType to '<c-n>' the effect is opposite. In php only keyword completion is triggered, ie. pushing TAB after $ shows keywords not variables and I need to manually use <c-x><c-o>. In html it's the same and even worse because the built-in omni closing of html tags doesn't work, ie. pushing TAB after </ triggers filename completion instead of omni.

I guess, I don't quite understand the config options. How this should be set up to work as I described?

Problems with neocomplcache integration (related to g:SuperTabCrMapping)

neocomplcache provides the following default config, which causes problems
with supertab's g:SuperTabCrMapping=1:
inoremap neocomplcache#smart_close_popup() . ""

This combination will cause the following imap:
=81_SelectCompletion(1)neocomplcache#smart_close_popup() . ""

It looks like the flag gets lost in the process.

A workaround appears to be using the following map for neocomplcache
instead:
inoremap =neocomplcache#smart_close_popup()

This however then triggers another issue with SuperTab.

AFAICS it gets detected properly as "original map sends ", but then
SuperTab sends a CR itself via s:SelectCompletion.
Is the logic in the last statement there inversed?

Super-tab with c-space

Super tab is great, thank you so much for your work!

I like using for my complete, and while you can remap supertab for this shortcut it still isn't perfect. Even when I have set the noCompleteAfter/Before to empty lists, it still will insert a tab when I press C-space after a blank. Ideally, it would just open an autocomplete list; this is useful behavior when, for example you are editing a css file and you can't remember the name of the attribute you want to add; pressing opens up the full list so you can "browse" the options. Said another way, it would be nice to be able to turn off the automatic tab-insertion, because if you have remapped to C-space, it no longer makes sense to insert a tab. It would also be nice if a message saying "no completion found" were displayed when none of the completes match anything.

Perhaps these are features that other people would be interested in?

Thanks again for everything!

David

Defaulting to inserting tab if completion fails

Thanks for an amazing plugin. I'd been looking for something like this for sometime but nothing truly satisfied me :)

I've one suggestion which can probably improve the user experience. Can supertab be made to insert true tabs in case auto-completion gives no results at all.

SuperTab breaks abbreviations

This is my today's chat on irc://freenode#vim:

[22:20] <cubuanic>  hi all
[22:21] <cubuanic>  i have following abbreviation: iab !D <C-R>=strftime("%Y-%m-%d")<CR>
[22:21] <cubuanic>  it seems not works when i type "some test !D" and then Enter
[22:21] <cubuanic>  could you explain why?
[22:22] <cubuanic>  btw, same abbreviation works fine if i enter "so,e text !D " (with space at the ned) or "sometext !D" + ESC
[22:22] <cubuanic>  vim version is 7.2
[22:23] <cubuanic>  any thoughts?
[22:24] <graywh>    oh, that's matter of how abbrevs are triggered
[22:26] <graywh>    it triggers after <CR> for me in 7.3
[22:26] <strull>    cubuanic: what gives :imap <cr> ?
[22:26] <graywh>    and 7.2.330
[22:27] <cubuanic>  strull: i <CR> * <C-R>=<SNR>17_SelectCompletion()<CR>
[22:27] <strull>    that may be the culprit then
[22:27] <cubuanic>  could you explain, please
[22:27] <cubuanic>  i'm not so familiar with this
[22:28] <strull>    this mapping may disturb the iab triggering.
[22:28] <strull>    why do you have it?
[22:28] <graywh>    it does
[22:28] <strull>    check with :verbose imap <cr> where it is defined
[22:28] <cubuanic>  not sure. anyway, it's here not because of me
[22:29] <cubuanic>  i'm using standart vim from debian lenny
[22:29] <strull>    with some plugins, i guess
[22:29] <cubuanic>  may be, it was defined somewhere in system files
[22:29] <graywh>    it's a plugin, #17 on your brochure, i mean :scriptnames
[22:29] <cubuanic>  ouch....
[22:29] <cubuanic>  ~/.vim/plugin/supertab.vim
[22:30] <cubuanic>  seems, bug in supertab?
[22:30] <graywh>    notabugitsafeature

I'm using SuprtTab version 1.1 on vim-7.2.445+hg~cb94c42c0e1a-1 (Debian Lenny).
Will be glad to see this problem fixed.
Thanks in advance!

Completion Chaining fails if plugin#Complete() uses complete_add

Some plugins (f.ex. vimerl ) are using complete_add() to fill the completion list and will return an empty list.
Unfortunately this will break supertabs chaining function as it is only checking for the length of the return list. Every completion will therefore trigger the use of the fallback completion mode and the user will see f.ex. the omnicompletion for some milliseconds before it will be replaced by the other list.

Maybe one could check if the returned list isnt empty or if complete_add() has been used or if the menu is already showing?
Im not that used to vim plugins so i couldn't really provide a fix

using dictionary completions

I searched through the help and found no mention of dictionary completion. I primarily write prose and what I would like to do is have first suggest completions from the file being edited and then have a way to jump to dictionary completions (or automatically do so if no completions are found in the file being edited... is this possible with supertab?

SuperTabContextDefaultCompletionType used to initiate and continue completions

Normally, I like to use the 'context' completion for the smart filename completion. I also set <c-n> as my fall-back so that the highlight traverses the list top to bottom as I hit tab, I just find this more intuitive than the default bottom-up.

So I've added the following to my .vimrc:

let g:SuperTabDefaultCompletionType = 'context'
let g:SuperTabContextDefaultCompletionType = "<c-n>"

This seems to work because <c-n> can be used to both initiate a completion and navigate down the list of values. Peachy.

The problem arises when I want my default to be omnicompletion. I have the following in a filetype hook for haskell so that I can use the omnicompletion provided by the haskellmode plugin by just hitting tab:

let g:SuperTabContextDefaultCompletionType = '<c-x><c-o>'

This works in that the correct completion is used when I hit tab, but my subsequent tabs just select the first item and start a new completion. It behaves as if I'm hitting <c-x><c-o> <c-x><c-o> ... rather than <c-x><c-o> <c-o> <c-o> ... which is what I'd want.

Setting the ContextDefaultCompletionType to <c-o> only fails, because it never initiates the completion; however, if I initiate the completion manually via <c-x><c-o> then start hitting tab -- it works like I want it to...

I'm sorry if this doesn't make sense, I'm still figuring out how all these Default and Context and Discovery options interrelate.

Thanks

Inserting a literal tab

It would be nice if there was an easy way to insert a literal tab instead of triggering auto completion. Other editors have solved this problem by binding <Shift> + <Tab> to insert a literal tab.

excluding paths

Hello. Is it possible to exclude paths in a project from autocompletion? I mean, I wish I could exclude my RSpec scenarios from completion when writing straight Ruby code.

Incompatibility with delimitMate

With both SuperTab and delimitMate enabled, the <CR> expansion in delimitMate does not work (tested for C files). For example, if I type:

if (condition) {<CR>

I would expect to get the following, where | is the cursor key:

if (condition) {
|
}

However, I get this:

if (condition) {
|}

Without SuperTab, I get the expected behaviour.

delimitMate reports me the following mappings:
....
i * =82_SelectCompletion(1)
Last set from ~/work/dotvim/bundles/supertab/plugin/supertab.vim

Is there a way to work around this issue, because I would like to use both plugins?

Chaining with omnifunc not working

I am having the hardest time getting SuperTab chaining to work. I read through the solution you gave on issue #52, but alas I'm still not getting any omni completions.

Here are my omni completions settings (set before SuperTab settings):

autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete

...and my SuperTab settings:

let g:SuperTabCrMapping = 0
let g:SuperTabDefaultCompletionType = 'context'
 autocmd FileType *
     \ if &omnifunc != '' |
     \     call SuperTabChain(&omnifunc, '<c-p>') |
     \ endif

The only thing I can think of is that maybe the omnifunctions listed above use complete_add().

Thanks in advance for your time!

items in pum are highlighted in wrong direction.

Hi.
When pop up menu is visible with options to choose pressing tab causes changing highlighted item from bottom to top. Pressing tab highlights third item, then second, then first one. It works like completion, not
I've got SuperTabDefaultCompletionType set to , SuperTabMappingForward set to and SuperTabMappingBackward set to .
completion works good.
Is there any other setting I should consider for making this to work right?
I'll try to investigate and provide some more details.

help craeting supertab function to omnicomplete on perl isms

I am trying to get supertab to omni complete on the following and I am having problems.

random text $wor->supertab
random %w->supertab
random &w->supertab

Where the key to have it omnicomplete is if the begining of the current word has the following char
%,$,&
Thanks

How to use more than one completion?

Hi, sorry if this is not the place to ask a question.
My variable g:SuperTabContextTextOmniPrecedence has the value
['&omnifunc', '&completefunc']

when using python I set completefunc=pysmell#Complete

so when I try to complete something starting by self. supertab will use
the default omnifunc which is usually what I want because it is very fast.
But sometimes omnifunc does not return any completion and in this case
I can get completion if I explicitly type to invoke user completion.

Would it be possible for somehow supertab go the next completion in this case if no completion is
returned by omnifunc?

Thanks!

problem with completion after dot

Hi, I am trying to use your script to auto-complete python code. It seems to work in most cases but if I press tab after a dot, strange things happen. For example:
test="test"
test.

After pressing Tab I get:
testself.

If I put some text after the dot, then everything works fine, e.g.:
test.low

Here I correctly get lower() as choice. I am using the console version of vim-7.3.322 and the latest supertab script. Any ideas?

Latest version - error on first <Tab>

Vim 7.3 / Windows, build from cream.sourceforge.net

On first usage get this error

Error detected while processing function 46_ReleaseKeyPresses:
E767: Too many arguments to printf()

All next s work ok

vim crash - Ruby completion

Hello,

I have just installed this plugin and I am having some issue making it work. every time I try to use the SuperTab on some simple ruby code (a string) it just crashes my vim.

Is anyone else also having this issue?

Environment:
Windows 7 x64 (with latest patches)
rubyinstaller-1.9.3-p0.exe
DevKit-tdm-32-4.5.2-20110712-1620-sfx.exe
gvim73_46.exe

Best regards,
Sebastian

Error messages

Using latest version, but this error appeared with prev commit.
Not able to reproduce it always, but got it today 2nd time (updated to latest today)

Happens on first Tab, then works ok

Error detected while processing function 47_SuperTab..47_WillComplete:
line   15:
E121: Undefined variable: b:SuperTabNoCompleteAfter
Error detected while processing function 47_SuperTab..47_WillComplete:
line   15:
E15: Invalid expression: b:SuperTabNoCompleteAfter
Error detected while processing function 47_SuperTab..47_WillComplete:
line   24:
E121: Undefined variable: b:SuperTabNoCompleteBefore
Error detected while processing function 47_SuperTab..47_WillComplete:
line   24:
E15: Invalid expression: b:SuperTabNoCompleteBefore

Non-zero exit status using supertab

I'm getting a non-zero exit status when I install and use supertab. I've both installed it with Vundle and without and the error only goes away when supertab is uninstalled.

The reason I found this is that git complains about it when you use it to edit commit messages and the exit status is not 0.

Scroll order

I have for a while trying to figure out why sometimes (eg. filename completion) the tab key scrolls down and s-tab scrolls up, and some times (keyword completion) it is the other way around.

I am using supertab 1.6 in a MacOS 10.6 box. MacVim (vim 7.3).

Supertab behaving erratically

Im using macvim 7.3 1-390, in iTerm2. this is my vimrc https://github.com/jhogendorn/Configs/blob/master/Vim/.vimrc

Im finding that when im editing files, for example php, supertab will not fire the completion, but instead moves the cursor to the next blank line. I assume i have it configured incorrectly for my usage but no idea how. Completion seems to work inside things like Gcommit buffers. Calling completion directly via <c-x><c-o> works.

Any ideas? help is greatly appreciated.

very slow when used with syntax highlighting

I'm mostly editing ruby files, and I noticed that supertab was being incredibly slow in some places (6 seconds for a simple completion without many buffers open). investigating more, i found that if i set "syntax off", supertab behaved much much faster. at the same time, the syntax highlighting doesn't significantly affect vim's performance outside of using supertab. any ideas on why syntax highlighting causes supertab specifically to behave so slowly?

incompatible with vim-endwise

if I load both supertab and endwise, then whenever I press (in insert mode) the following text is inserted into the buffer:

pumvisible() ? "\ " : "
"
supertab is otherwise working (on presses).

In latex how to complete words starting with \ from dict?

Hi,

vim-latex plugin has a file with latex keywords. I would like to use the words in this file to complete words in vim.

The way I would like to to this would be:

if I am typing a word say \le and hit and it would use the words in the dictionary to complete. If the word doesn't start with \ then it would just use normal completion.

Right now if I hit tab in a word starting with a \ it will try the filename completion.

Hope you can help.

Thank you.

Swapping Ctrl-n and Ctrl-p

Apologies if this is just a n00b issue, but when I installed SuperTab it seemed to swap the two completion chords. Now Ctrl-n does what Ctrl-p used to do. It starts at the bottom of the list, and moves up, instead of starting at the top and moving down like it used to. Tab has the same behavior, so I have to press Shift-Tab for what I would have thought would be the default completion behavior. I've tried removing my entire vim configuration apart from this plugin, and I've confirmed that it happens when the plugin is the only thing installed. Is this intended?

<Tab> inserts '<t_ý>SSuperTabForward' instead of triggering completions

I have replaced the very old tsaleh/vim-supertab with your project. After updating my .vimrc file, I am experiencing weird issues on Ubuntu 12.04, both in Vim and gVim.

When using <C-P>, <C-N> or <Tab>, I get either <t_ý>SSuperTabBackward or <t_ý>SSuperTabForward inserted. This happens in all buffers at any position.

That seems to be related to msanders/snipmate.vim. After disabling the Snipmate plug-in, Supertab behaves correctly.

Are the two plug-in incompatible? I can see there's code in Supertab to handle Snipmate, but it doesn't seem to be working or is outdated? Anything I can do to help debug/narrow this down?

keyword completion search order is from bottom to top

when tab into the keyword completion mode, tab as well as c-n will scroll from bottom to top, while in other completion mode, say dictionary, the order is from top, to bottom. I think the behavior of scrolling from bottom to top is quite weird.

break undo sequence on first invocation

Hi,

and first of all thanks for this great plugin. It really speeds my work up and makes it more fun...

Nevertheless i have a suggestion to improve supertab further. For justification i describe two common situations that could easily be simplified by someone who see through the source code (i've tried it by myself but failed pitiful)

Once in a while the following situations arises:

  • i had a lot of editing done in insert mode. Still in insert mode i want to complete sth. The result of the completion is not what i want.
  • i had to complete a whole pathname. After some completed paths i decide me for a wrong folder/filename by mistake.

After that an undo would discard all changes since the last undo break sequence. So instead of invoking undo one have to delete the changes by hand (what definitely sucks ;) ).

It would be great if a 'u' (see :help i_CTRL-G_u) could be added before a first invocation of supertab with regard to one completion cycle, so a simple undo discard only the last completion.

Maybe one can add a new global variable, that toggles this behavior (for example 'g:SuperTabBreakUndoSequence').

It would be great if somebody could add this feature or can give me a hint where the appropriate code section for this feature is.

With best regards

PS: i asked a related question on the vim-user mailing-list (see: Here)

SuperTab breaks delimitMate <BS>

delimitMate is plugin for autoclose
http://github.com/Raimondi/delimitMate

One of its feature - if you type brace, the 2nd is auto typed and cursor is put inside them.
If you 'BS' in that position both braces are removed.

I've noticed that i loose default behavior sometimes.

Turns out that it's caused by SuperTab.vim, which imaps 'BS' when popup is shown and removes mapping when it's closed

Steps to reproduce:

Start typing in insert mode, hit "Tab" so that completion list appears
Hit "BS" few times
Hit "ESC" to get to normal mode.
Go to insert, type (, so that () appear

Typing "BS" after that - inside () doesn't remove bracket.
:verbose imap shows nothing

Is it possible to workaround it somehow? Thanks

supertab + my own tabcomplete

Hey,

So i have an iabbrev:

iabbrev rd require 'ruby-debug'; Debugger.start; debugger

How do I make this work in conjunction with supertab? :)

auto suggest?

was digging through help but did not find what i was looking for.
is there a way to have supertab auto suggest / auto popup?

iabbrev breaks (Inconsistent behavior)

I have

autocmd FileType java iabbrev psvm public static void main(String[] args){}$

in my vimrc file to allow me to quickly add a main statement to my java file however with supertab 2.0 installed it replaces psvm literally instead of replacing the with carriage returns etc. This does not seem to happen with supertab 1.6.

edit: escaped angle brackets

Cursor moves one line upwards after exact match and completeopt=longest

( This issue is based on my comment at e026beb#comments )

completeopt=longest triggers this.

Sample file would be just:
foobar
foo

Put the cursor after "foo" in the second line and trigger completion. It gets completed to foobar, and the cursor moves upwards (after "foobar" in the first line).

I could not reproduce it with "gvim -u NONE" and sourcing SuperTab only, but when using my vimrc [1], with all bundles (e.g. SnipMate moved out of the way).

1: https://github.com/blueyed/dotfiles/blob/master/vimrc

Autocompleting functions with no arguments

When supertab finds a match using omni-complete and the match is a function with no arguments, pressing Enter selects name of the function with only 1 paranthesis.

import os
os.path.j_

If I press super-tab at this point, 'join' is the only method so it is selected and code looks like :

import os
os.path.join(_

However, as this particular function takes in no arguments, it'd have been better if closing paranthesis was also printed automatically. Is it possible to modify/configure supertab for allowing such a behavior?

Thanks in advance :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.