Port of the neco-look plugin for NCM2
look
is a BSD binary that comes default with many Linux and macOS
installations that allows you to lookup words. look.vim uses this binary to
provide word completion, useful for writing prose.
look.vim may also use your custom spellfile (See :h spellfile
) to provide
custom words
- ncm2
- nvim-yarp (required by ncm2)
look
binary. runwhich look
on your terminal to see if it's available;
Use your favorite plugin manager. I recommend vim-plug:
" NCM and it's requirements
Plug 'ncm2/ncm2'
Plug 'roxma/nvim-yarp'
" Look.vim completion plugin
Plug 'filipekiss/ncm2-look.vim'
" enable ncm2 for all buffer
autocmd BufEnter * call ncm2#enable_for_buffer()
" note that must keep noinsert in completeopt, the others is optional
set completeopt=noinsert,menuone,noselect
By default, look.vim will be disabled. After all, if you're writing code you don't want the completion popup jumping at you everytime you type something that remotely looks like a word.
Put this in your .vimrc
let g:ncm2_look_enabled = 1
:let b:ncm2_look_enabled = 1
Let's say you want to enable it for markdown files.
- Create a file in
~/.vim/ftplugin/markdown.vim
- Put
let b:ncm2_look_enabled = 1
on the file - Save and open a markdown file
Possible values: 0 (default), 1
Scopes: global (g:ncm2_look_enabled
), buffer (b:ncm2_look_enabled
)
This option enables the look completion either globally or for the current buffer.
Possible values: 0 (default), 1
Scopes: global (g:ncm2_look_use_spell
)
If this option is enabled, use &spellfile
as complimentary sources for word
completion. See :h spellfile
for more details on how that works
Possible values: Any valid string (default: look)
Scopes: global (g:ncm2_look_mark
)
Change the mark used in the completion menu. Default is look
, as you can see
on the first gif, but any UTF-8 string is valid. For example:
let g:ncm2_look_mark = '👀'
Will result in this:
look.vim © 2018+, Filipe Kiss Released under the MIT License.
Authored and maintained by Filipe Kiss.
GitHub @filipekiss · Twitter @filipekiss