Shougo/dein.vim

README setup example fails with errors

Closed this issue · 1 comments

Description

Using the example in the README:

let $CACHE = expand('~/.cache')
if !($CACHE->isdirectory())
  call mkdir($CACHE, 'p')
endif
if &runtimepath !~# '/dein.vim'
  let s:dir = 'dein.vim'->fnamemodify(':p')
  if !(s:dir->isdirectory())
    let s:dir = $CACHE .. '/dein/repos/github.com/Shougo/dein.vim'
    if !(s:dir->isdirectory())
      execute '!git clone https://github.com/Shougo/dein.vim' s:dir
    endif
  endif
  execute 'set runtimepath^=' .. s:dir->fnamemodify(':p')->
      \ substitute('[/\\]$', '', '')
endif

I get the following error:

Error detected while processing /home/var/ravi/tmp/dein/example:
line   13:
E15: Invalid expression:  substitute('[/\\]$', '', '')
E260: Missing name after ->
Press ENTER or type command to continue

Expected behavior

nvim loads without error

Desktop:

  • OS: [e.g. iOS] Linux svelte 6.1.49-1-MANJARO #1 SMP PREEMPT_DYNAMIC Sun Aug 27 23:08:04 UTC 2023 x86_64 GNU/Linux

  • Vim or Neovim version: [e.g. Vim v9]

NVIM v0.9.1
Build type: Release
LuaJIT 2.1.1692616192
  • Commit/Version: [e.g. full SHA1 signature or link to the commit]
    • Irrelevant -- happens before clone
Shougo commented

Fixed the example. please fix.

  execute 'set runtimepath^=' .. s:dir
      \ ->fnamemodify(':p')->substitute('[/\\]$', '', '')

is correct.