Vscode-neovim: Easymotion now only work in vscode, gives error in nvim

Created on 23 Oct 2020  路  4Comments  路  Source: asvetliakov/vscode-neovim

Hi, I installed the fork of easymotion that works in VScode. However, I cannot use this function in Neovim anymore.

EasyMotion: Vim(call):E117: Unknown function: VSCodeSetTextDecorations

Is there way to make it work in both?

Most helpful comment

Two ways actually:

Lazy loading, my preferred way, as you can have both installable at once:

function! Cond(Cond, ...)
  let opts = get(a:000, 0, {})
  return a:Cond ? opts : extend(opts, { 'on': [], 'for': [] })
endfunction

" inside plug#begin:
Plug 'easymotion/vim-easymotion', Cond(!exists('g:vscode'))
Plug 'asvetliakov/vim-easymotion', Cond(exists('g:vscode'), { 'as': 'vsc-easymotion' })

Branching inside plug, simpler version of your above example, I like this worse because it makes installing confusing:

call plug#begin('/.config/nvim/plugged')
if exists('g:vscode')
  Plug 'asvetliakov/vim-easymotion', { 'as': 'vsc-easymotion' }
else
  Plug 'vim-easymotion/vim-easymotion'
endif
call plug#end()

All 4 comments

You should use upstream version inside Vim and fork inside VSCode.

You should use upstream version inside Vim and fork inside VSCode.

Sorry, could you explain more?

Is it like this in init.vim? :

if exists('g:vscode')
call plug#begin('~/.config/nvim/plugged')
Plug 'https://github.com/asvetliakov/vim-easymotion.git'
call plug#end()
else
call plug#begin('~/.config/nvim/plugged')
Plug 'vim-easymotion/vim-easymotion'
call plug#end()
endif

Yes, exactly. This is the only way.

Two ways actually:

Lazy loading, my preferred way, as you can have both installable at once:

function! Cond(Cond, ...)
  let opts = get(a:000, 0, {})
  return a:Cond ? opts : extend(opts, { 'on': [], 'for': [] })
endfunction

" inside plug#begin:
Plug 'easymotion/vim-easymotion', Cond(!exists('g:vscode'))
Plug 'asvetliakov/vim-easymotion', Cond(exists('g:vscode'), { 'as': 'vsc-easymotion' })

Branching inside plug, simpler version of your above example, I like this worse because it makes installing confusing:

call plug#begin('/.config/nvim/plugged')
if exists('g:vscode')
  Plug 'asvetliakov/vim-easymotion', { 'as': 'vsc-easymotion' }
else
  Plug 'vim-easymotion/vim-easymotion'
endif
call plug#end()
Was this page helpful?
0 / 5 - 0 ratings

Related issues

joshua7v picture joshua7v  路  4Comments

Liquidmantis picture Liquidmantis  路  3Comments

pieterdd picture pieterdd  路  4Comments

DrakeXiang picture DrakeXiang  路  5Comments

erlais picture erlais  路  3Comments