diff --git a/README.md b/README.md index ba053ca..5b2c801 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud). -_1010 TILs and counting..._ +_1011 TILs and counting..._ --- @@ -1127,6 +1127,7 @@ _1010 TILs and counting..._ - [Select Several Results From An FZF Search](vim/select-several-results-from-an-fzf-search.md) - [Set End Of Line Markers](vim/set-end-of-line-markers.md) - [Set Your Color Scheme](vim/set-your-color-scheme.md) +- [Set Up Vim-Plug With Neovim](vim/set-up-vim-plug-with-neovim.md) - [Setting Filetype With Modelines](vim/setting-filetype-with-modelines.md) - [Show All Syntax Highlighting Rules](vim/show-all-syntax-highlighting-rules.md) - [Show Matching Entries For Help](vim/show-matching-entries-for-help.md) diff --git a/vim/set-up-vim-plug-with-neovim.md b/vim/set-up-vim-plug-with-neovim.md new file mode 100644 index 0000000..d2cac49 --- /dev/null +++ b/vim/set-up-vim-plug-with-neovim.md @@ -0,0 +1,25 @@ +# Set Up Vim-Plug With Neovim + +To get [vim-plug](https://github.com/junegunn/vim-plug) working with Neovim, it +needs to be installed in a known autoload directory. + +The help files say that "plugins installed by user" should be located in the +data home directory at `stdpath("data")` under `site`. For me (on OSX) the data +home directory is `~/.local/share/nvim`, so `~/.local/share/nvim/site`. + +Under this site directory, along with any directories on the `runtimepath`, +Neovim looks for various runtime files and subdirectories. This includes the +`/autoload` directory. That's where you want to install `vim-plug`. + +```bash +sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ + https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' +``` + +This shell statement uses [the `:-` parameter +expansion](unix/provide-a-fallback-value-for-unset-parameter.md) to specify a +path using either the `XDG_DATA_HOME` or `$HOME` as a fallback. This ends up +resolving to `~/.local/share`, so the `plug.vim` file is placed in +`~/.local/share/nvim/site/autload/`. + +See `:h runtimepath` for more details.