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

No autocompletion #57

Open
xelra opened this Issue Mar 2, 2017 · 20 comments

Comments

Projects
None yet
7 participants
@xelra

xelra commented Mar 2, 2017

When Actual Vim is active, the autocompletion of Sublime doesn't work.

@lunixbochs

This comment has been minimized.

Owner

lunixbochs commented Mar 2, 2017

it should, but tab is intercepted by vim. you'll need a new hotkey, or we need a "sublime mode" that quickly disables vim input interception (with esc returning control to vim).

I'm open to suggestions for keys to enter/exit sublime mode (which just means turning actualvim input off/on). I can add the hotkeys to ActualVim settings. I also just had an idea - allow changing the color scheme based on whether a buffer is in vim or Sublime mode :)

@xelra

This comment has been minimized.

xelra commented Mar 2, 2017

It doesn't show the autocompletion box. No completion at all.

I'm trying a simple html file. As soon as I disable ActualVim, the autocompletion box shows up.

Ideally the navigation of the box should be with C-n and C-p.

@lunixbochs

This comment has been minimized.

Owner

lunixbochs commented Mar 2, 2017

You can press ctrl+space to show completions. I could show it automatically after every keystroke in insert mode. (edit: I tried this. I'm not sure how to navigate it and I don't think I can tell sublime to navigate it). I think it might need to be opt-in, or I can integrate with vim autocompletion popovers unless you're in sublime mode (more likely).

I could also use view.symbols() and show_popup_menu() to manually implement autocompletion.

@jordwalke

This comment has been minimized.

jordwalke commented Mar 12, 2017

How do you enable Vim's autocompletion? NeoVim exposes this.

@lunixbochs

This comment has been minimized.

Owner

lunixbochs commented Mar 12, 2017

I can't easily show vim UI like popovers yet (waiting for neovim remote UI improvements), but any vim commands not requiring UI should work if you press the input for them. Remember the neovim stores vimrc in a different place: https://github.com/neovim/neovim/wiki/FAQ#where-should-i-put-my-config-vimrc

@lunixbochs lunixbochs added this to the 1.0 milestone Mar 13, 2017

@lunixbochs

This comment has been minimized.

Owner

lunixbochs commented Mar 14, 2017

I was wrong about vim's autocompletion, popover menus should be available soon, track #74

@lunixbochs

This comment has been minimized.

Owner

lunixbochs commented Mar 14, 2017

How important is it for you to have sublime's autocompletion? I could potentially also populate vim's autocomplete db with sublime's index if sublime has a better data source.

vim's autocompletion is available now via ^n and ^p:

popupmenu_external

@justinmk justinmk referenced this issue Mar 14, 2017

Open

News #148

@xelra

This comment has been minimized.

xelra commented Mar 14, 2017

One of the reasons I tried ActualVim in the first place was because although Neovim works well on Windows now, a lot of plugins don't. I was hoping to use the IDE-like features for golang from Sublime and combine them with Neovim.

@lunixbochs

This comment has been minimized.

Owner

lunixbochs commented Mar 14, 2017

How does that translate to autocompletion specifically? I'm pretty sure I can feed sublime's autocompletion suggestions into vim if that would be sufficient. Are any other major IDE-like features broken?

@lunixbochs

This comment has been minimized.

Owner

lunixbochs commented Mar 15, 2017

513fbdc now sets up a completefunc which uses Sublime's autocomplete (word completions and plugin completions, but not .sublime-completion files). This means any plugins handling autocomplete should work, and it integrates with my popupmenu stuff.

The default way to trigger completefunc is ^X^U. I think you can do the rest on Vim's side. Anything more I can do here?

@sarahlim

This comment has been minimized.

sarahlim commented Apr 22, 2017

Pardon my ignorance, but would it be possible to emulate the behavior of YouCompleteMe in ActualVim? I'm having trouble getting autocomplete suggestions to appear at all.

Great plugin, thank you!!

@lunixbochs

This comment has been minimized.

Owner

lunixbochs commented Apr 22, 2017

@lunixbochs

This comment has been minimized.

Owner

lunixbochs commented May 4, 2017

I think this can be solved, to the point of restoring Sublime's original preview behavior, by #97

@marciol

This comment has been minimized.

marciol commented May 18, 2017

One thing that I really love on Sublime default autocompletion is the fuzzy search autocompletion, something that I have not found in default vim autocompletion plugins.

@cdt3pm

This comment has been minimized.

cdt3pm commented Dec 23, 2017

I am getting an error with this. ^X ^U throws the following error

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 812, in run_
    return self.run(edit, **args)
  File "/Users/cdt3pm/Library/Application Support/Sublime Text 3/Packages/ActualVim/actual.py", line 63, in run
    v.press(key, edit=edit)
  File "/Users/cdt3pm/Library/Application Support/Sublime Text 3/Packages/ActualVim/view.py", line 535, in press
    _, ready = neo.vim.press(key, onready)
  File "/Users/cdt3pm/Library/Application Support/Sublime Text 3/Packages/ActualVim/neo.py", line 299, in press
    res = self.nv.request('nvim_get_mode') or {}
  File "/Users/cdt3pm/Library/Application Support/Sublime Text 3/Packages/ActualVim/lib/neovim/api/nvim.py", line 134, in request
    res = self._session.request(name, *args, **kwargs)
  File "/Users/cdt3pm/Library/Application Support/Sublime Text 3/Packages/ActualVim/lib/neovim/msgpack_rpc/session.py", line 101, in request
    v = self._yielding_request(method, args, timeout=kwargs.pop('timeout', 0.25))
  File "/Users/cdt3pm/Library/Application Support/Sublime Text 3/Packages/ActualVim/lib/neovim/msgpack_rpc/session.py", line 162, in _yielding_request
    return q.get(timeout=timeout)
  File "./python3.3/queue.py", line 175, in get
queue.Empty
error caught in request handler 'complete ['1', '']'
Traceback (most recent call last):

  File "/Users/cdt3pm/Library/Application Support/Sublime Text 3/Packages/ActualVim/neo.py", line 229, in on_request
    return av.on_complete(args[0], args[1])

  File "/Users/cdt3pm/Library/Application Support/Sublime Text 3/Packages/ActualVim/view.py", line 681, in on_complete
    word = self.view.word(cur())

  File "/Users/cdt3pm/Library/Application Support/Sublime Text 3/Packages/ActualVim/view.py", line 676, in cur
    modified, et, ts, a, b = neo.vim.status()

ValueError: too many values to unpack (expected 5)

Did I do something to break this? Is there a setting which I can change to get the autocomplete to work? For the record, ctrl+space shows me the list of autocomplete options, but I cannot select them; Vim appears to handle enter and tab directly.

@lunixbochs

This comment has been minimized.

Owner

lunixbochs commented Dec 24, 2017

That's a regression on my end, I'll fix it.

@lunixbochs

This comment has been minimized.

Owner

lunixbochs commented Dec 24, 2017

That regression should now be fixed in latest master and the fix was just released in 0.9.16

@li1

This comment has been minimized.

li1 commented Jan 16, 2018

Hi @lunixbochs ,

first of all, thanks for your great work on bringing vim to sublime!

I was wondering what the up-to-date status of this issue is (and perhaps related to that #97?).

Is there currently a way to trigger sublime's and/or vim's autocomplete automatically while typing in insert mode (i.e. without having to press a specific key)?

If not, what has to be done to achieve that? Which issue should I follow for updates on this?

Cheers, Malte

@lunixbochs

This comment has been minimized.

Owner

lunixbochs commented Jan 16, 2018

I think vim-side completion like youcompleteme will work once I add external wildmenu support, which should be a very easy extension of the existing external menu but ActualVim is lower priority for me right now

@li1

This comment has been minimized.

li1 commented Jan 16, 2018

OK, cool, thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment