Make automatic installation script in wiki tips compatible to windows

Open Beginner friendly
#1,169 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
86/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
vim
Domain
documentation

Research direction

Open the wiki's Tips page at the Automatic installation section and compare the current script with the Windows-compatible version in the issue. Verify the Vim and Neovim path cases and the Windows curl invocation, then update the wiki example and confirm the instructions render correctly.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Vim Script
Stars
35.8k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from junegunn/vim-plug

All issues in junegunn/vim-plug

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.