Răsfoiți Sursa

Add NeoVim XDG config, update vim-plug

NeoVim has moved the normal `.vim/` and `.vimrc` files to locations that
comply with the XDG Base Directory Specification. We now additionally
add links to cater to both versions of vim configuration.

http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
Weiyi Lou 10 ani în urmă
părinte
comite
e3215b1c37
4 a modificat fișierele cu 16 adăugiri și 12 ștergeri
  1. 5 4
      .gitignore
  2. 2 2
      README.md
  3. 8 5
      setup.sh
  4. 1 1
      vim/autoload/plug.vim

+ 5 - 4
.gitignore

@@ -1,14 +1,15 @@
 # Vim plugin
-vim/plugged
-vim/spell
 vim/.netrwhist
 vim/autoload/plug.vim.old
-vim/use-solarized-palette
 vim/current-colour
+vim/init.vim
+vim/plugged
+vim/spell
+vim/use-solarized-palette
 
 # Vimperator info/history/local settings
 vimperator/info
 
 # Irssi config files
-irssi/config*
 irssi/*.theme
+irssi/config*

+ 2 - 2
README.md

@@ -2,7 +2,7 @@
 
 These are configuration files for:
 
-- Vim (7.4+ or NEOVIM!!)
+- Vim 7.4+ or NeoVim
 - Vimperator (3.8+)
 - Tmux
 - Zsh
@@ -21,7 +21,7 @@ The configs reflect a heavy preference for `vim`-like bindings.
 - The [Solarized][] dark colour palette makes the `zsh` prompt nicer.
 - The [Meslo][] font (Menlo, patched for powerline), makes `vim` and `tmux` look
   better, and has [Rainbarf][] graph glyphs.
-- [Vim-Plug][] needs `vim` with Python or Ruby support or neovim to perform
+- Vim with Python/Ruby support or NeoVim is needed for [Vim-Plug][] to perform
   parallel downloads.
 - [The Silver Searcher][] should be installed where possible. If not available,
   [Ack][] (part of this repo) will be used as a fallback (requires Perl 5.8.8).

+ 8 - 5
setup.sh

@@ -19,7 +19,7 @@ linkup() {
 
 # Prepare folders
 backup_dir=~/.dotfilesbackup/$(date)
-mkdir -p "$backup_dir" ~/.ssh
+mkdir -p "$backup_dir" ~/.ssh ${XDG_CONFIG_HOME:=$HOME/.config}
 echo "Prepared folders."
 
 # Make known_hosts file if none
@@ -63,13 +63,16 @@ echo "Irssi linked."
 linkup ~/dotfiles/ack/ackrc ~/.ackrc
 echo "Ack linked."
 
-# Vim (and NeoVim)
-linkup ~/dotfiles/vim/vimrc ~/.vimrc
-linkup ~/dotfiles/vim/vimrc ~/.nvimrc
+# Vim
 linkup ~/dotfiles/vim ~/.vim
-linkup ~/dotfiles/vim ~/.nvim
+linkup ~/dotfiles/vim/vimrc ~/.vimrc
 echo "Vim linked."
 
+# NeoVim XDG Config
+linkup ~/dotfiles/vim $XDG_CONFIG_HOME/nvim
+linkup ~/dotfiles/vim/vimrc $XDG_CONFIG_HOME/nvim/init.vim
+echo "NeoVim linked."
+
 # vim-plug install process. Starts with plugin list and `nocompatible` flag.
 vim -u ~/dotfiles/vim/plugins.vim -N +PlugClean! +PlugUpdate! +quitall!
 echo "Vim plugins done."

+ 1 - 1
vim/autoload/plug.vim

@@ -646,7 +646,7 @@ function! s:do(pull, force, todo)
     endif
     let installed = has_key(s:update.new, name)
     let updated = installed ? 0 :
-      \ (a:pull && !empty(s:system_chomp('git log --pretty=format:"%h" "HEAD...HEAD@{1}"', spec.dir)))
+      \ (a:pull && index(s:update.errors, name) < 0 && !empty(s:system_chomp('git log --pretty=format:"%h" "HEAD...HEAD@{1}"', spec.dir)))
     if a:force || installed || updated
       execute 'cd' s:esc(spec.dir)
       call append(3, '- Post-update hook for '. name .' ... ')