thalesmello / webcomplete.vim

A plugin for Vim that completes words from your browser
110 stars 10 forks source link

webcomplete.vim

A Vim plugin that completes words from the currently open web page in your browser.

Currently works with:

demo

Installation

With vim-plug:

Plug 'thalesmello/webcomplete.vim'

Using with deoplete

deoplete is an awesome asynchronous completion engine for Neovim. webcomplete works with deoplete out of the box. Just start typing to see suggestions of words comming from your browser.

Using with ncm2

ncm2 is also supported. Once ncm2 is configured in your configuration files, the completions for webcomplete should be enabled by default.

Using with coc

coc is also supported. Once coc is configured in your configuration files, the completions for webcomplete should be enabled by default.

Using with completefunc or omnifunc

Vim allows you to define a completefunc or an omnifunc to give you completions during insert mode. webcomplete provides you with a function that you can plug into these built in features.

To set it up, use either of the two lines below:

" Use <C-X><C-U> in insert mode to get completions
set completefunc=webcomplete#complete

" Use <C-X><C-O> in insert mode to get completions
set omnifunc=webcomplete#complete

Using with Google Chrome

Currently this plugin only supports Google Chrome on Mac OS.

To use it, you must enable "Allow JavaScript from Apple Events" in View > Developer submenu.

Using with Qutebrowser

Set one of the _webcomplete_script variables (described above) to $plugin_dir/sh/qutebrowser/webcomplete, where $plugin_dir is the location of this plugin.

Using with Firefox

Currently there is no official support for Firefox, but there is a fork with Firefox support

Limitations

Contributing

If you would like to contribute to the project by supporting your browser or operating system, I would be happy to accept pull requests.

Inspiration

The project was only possible with the help of Reddit user 18252 and by looking at tmux-complete.vim as reference when implementing this plugin.