From e82ab805580e5fb7dc6a11a85160c5f9b44f62c9 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 16 Feb 2018 22:07:37 +1300 Subject: Add Makefile tweak for Neovim installation A cursory test suggests that all of this configuration works well on Neovim, or at least the bad stuff is gracefully ignored. Allow changing the destination path for ~/.vimrc and ~/.vim/config to suit Neovim's paths, including some instructions and some bloviating in README.md. --- Makefile | 56 ++++++++++++++++++++++++++++++-------------------------- README.md | 15 +++++++++++++++ 2 files changed, 45 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index 3b0be55a..c194dc9e 100644 --- a/Makefile +++ b/Makefile @@ -497,6 +497,10 @@ install-urxvt: urxvt/ext/select find urxvt/ext -type f ! -name '*.pl' \ -exec cp -p -- {} $(HOME)/.urxvt/ext \; +# Change these at invocation to install for NeoVim; see README.md +VIMDIR = $(HOME)/.vim +VIMRC = $(HOME)/.vimrc + install-vim: install-vim-after \ install-vim-autoload \ install-vim-bundle \ @@ -513,60 +517,60 @@ install-vim-after: install-vim-after-ftplugin \ install-vim-after-syntax install-vim-after-ftplugin: - mkdir -p $(HOME)/.vim/after/ftplugin + mkdir -p $(VIMDIR)/after/ftplugin for type in vim/after/ftplugin/* ; do \ - mkdir -p -- $(HOME)/.vim/after/ftplugin/"$${type##*/}" ; \ - cp -p -- "$$type"/* $(HOME)/.vim/after/ftplugin/"$${type##*/}" ; \ + mkdir -p -- $(VIMDIR)/after/ftplugin/"$${type##*/}" ; \ + cp -p -- "$$type"/* $(VIMDIR)/after/ftplugin/"$${type##*/}" ; \ done install-vim-after-indent: - mkdir -p $(HOME)/.vim/after/indent - cp -p -- vim/after/indent/*.vim $(HOME)/.vim/after/indent + mkdir -p $(VIMDIR)/after/indent + cp -p -- vim/after/indent/*.vim $(VIMDIR)/after/indent install-vim-after-syntax: - mkdir -p $(HOME)/.vim/after/syntax - cp -p -- vim/after/syntax/*.vim $(HOME)/.vim/after/syntax + mkdir -p $(VIMDIR)/after/syntax + cp -p -- vim/after/syntax/*.vim $(VIMDIR)/after/syntax install-vim-autoload: - mkdir -p -- $(HOME)/.vim/autoload - cp -p -- vim/autoload/*.vim $(HOME)/.vim/autoload + mkdir -p -- $(VIMDIR)/autoload + cp -p -- vim/autoload/*.vim $(VIMDIR)/autoload install-vim-bundle: install-vim-config find vim/bundle/*/* \ -type d -exec sh -c \ - 'mkdir -p -- $(HOME)/.vim/"$${1#vim/bundle/*/}"' _ {} \; + 'mkdir -p -- $(VIMDIR)/"$${1#vim/bundle/*/}"' _ {} \; find vim/bundle/*/*/* \ -type f -exec sh -c \ - 'cp -p -- "$$1" $(HOME)/.vim/"$${1#vim/bundle/*/}"' _ {} \; + 'cp -p -- "$$1" $(VIMDIR)/"$${1#vim/bundle/*/}"' _ {} \; install-vim-compiler: - mkdir -p -- $(HOME)/.vim/compiler - cp -p -- vim/compiler/*.vim $(HOME)/.vim/compiler + mkdir -p -- $(VIMDIR)/compiler + cp -p -- vim/compiler/*.vim $(VIMDIR)/compiler install-vim-config: - mkdir -p -- $(HOME)/.vim/config - cp -p -- vim/vimrc $(HOME)/.vimrc - cp -p -- vim/config/*.vim $(HOME)/.vim/config + mkdir -p -- $(VIMDIR)/config + cp -p -- vim/vimrc $(VIMRC) + cp -p -- vim/config/*.vim $(VIMDIR)/config install-vim-doc: - mkdir -p -- $(HOME)/.vim/doc - cp -p -- vim/doc/*.txt $(HOME)/.vim/doc + mkdir -p -- $(VIMDIR)/doc + cp -p -- vim/doc/*.txt $(VIMDIR)/doc install-vim-ftdetect: - mkdir -p -- $(HOME)/.vim/ftdetect - cp -p -- vim/ftdetect/*.vim $(HOME)/.vim/ftdetect + mkdir -p -- $(VIMDIR)/ftdetect + cp -p -- vim/ftdetect/*.vim $(VIMDIR)/ftdetect install-vim-ftplugin: - mkdir -p -- $(HOME)/.vim/ftplugin - cp -p -- vim/ftplugin/*.vim $(HOME)/.vim/ftplugin + mkdir -p -- $(VIMDIR)/ftplugin + cp -p -- vim/ftplugin/*.vim $(VIMDIR)/ftplugin install-vim-indent: - mkdir -p -- $(HOME)/.vim/indent - cp -p -- vim/indent/*.vim $(HOME)/.vim/indent + mkdir -p -- $(VIMDIR)/indent + cp -p -- vim/indent/*.vim $(VIMDIR)/indent install-vim-plugin: - mkdir -p -- $(HOME)/.vim/plugin - cp -p -- vim/plugin/*.vim $(HOME)/.vim/plugin + mkdir -p -- $(VIMDIR)/plugin + cp -p -- vim/plugin/*.vim $(VIMDIR)/plugin install-vim-gui: install-vim \ install-vim-gui-config diff --git a/README.md b/README.md index 5109afdb..89441b7a 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ Configuration is included for: * [tidy](http://www.html-tidy.org/) -- HTML/XHTML linter and tidier * [tmux](https://tmux.github.io/) -- Terminal multiplexer similar to GNU Screen * [Vim](http://www.vim.org/) -- Vi IMproved, a text editor + * [Neovim](https://neovim.io/) -- An "emphatic fork" of Vim * [X11](https://www.x.org/wiki/) -- Windowing system with network transparency for Unix @@ -364,6 +365,20 @@ script (`sh.vim`). Third-party plugins are in submodules in `~/.vim/bundle`. They are installed into `~/.vim` as normal. +#### Neovim + +I test my configuration every now and then with the [Neovim +fork](https://neovim.io/). To install the configuration where Neovim will use +it, do this: + + $ nvd=${XDG_CONFIG_HOME:-"$HOME"/.config}/nvim + $ make install-vim VIMRC=$nvd/init.vim VIMDIR=$nvd + +Neovim's [godless +arrogance](https://twitter.com/tpope/status/437019518444240896) +notwithstanding, I do rather like it overall, but I'm not presently using it as +my daily driver and so it might balk at recent addenda to my configuration. + Scripts ------- -- cgit v1.2.3