Skip to content
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

Make automatic installation script in wiki tips compatible to windows #1169

Open
DanielW10001 opened this issue Apr 4, 2022 · 0 comments
Open

Comments

@DanielW10001
Copy link

DanielW10001 commented Apr 4, 2022

Current automatic installation script in wiki is not compatible with Windows, mostly due to these two problems:

  1. autoload should be in ~/vimfiles instead of ~/.vim on Windows.
  2. The cURL comes with Windows (namely C:/Windows/System32/curl.exe) and cmd.exe/PowerShell will not expand ~ with ! invocation.

I wrote a compatible version, tested to solve these two problems, making it compatible with Windows:

let data_dir = has('nvim') ? stdpath('data') . '/site' : has('win32') ? '~/vimfiles' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
  silent execute '!curl -fLo '.fnamemodify(data_dir.'/autoload/plug.vim', ':p:S').' --create-dirs  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

Only few words changed.

If we get this updated to wiki, we can benefit the users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant