From ef956a0ed5fc0d3bc2231278f4a68140e34ab9d7 Mon Sep 17 00:00:00 2001 From: aszlig Date: Thu, 2 Aug 2018 00:53:56 +0200 Subject: pkgs/vim: Update Nix plugin This is mainly to catch up with the syntax highlighting fixes that were done in the respective plugins. The setlocals in ftplugin/nix.vim from LnL7's plugin are now gone and it's one setlocal with line continuation, so I had to turn the simple grep into a small sed script. Another thing I added while at it is to add the single quote to iskeyword, because it can be part of a Nix identifier. I did that by replacing the dash, because the latter now is part of the setlocal of the aforementioned ftplugin. Signed-off-by: aszlig --- pkgs/aszlig/vim/default.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'pkgs/aszlig') diff --git a/pkgs/aszlig/vim/default.nix b/pkgs/aszlig/vim/default.nix index 95db41b2..c75c4f30 100644 --- a/pkgs/aszlig/vim/default.nix +++ b/pkgs/aszlig/vim/default.nix @@ -177,15 +177,15 @@ let lnl7 = fetchFromGitHub { owner = "LnL7"; repo = "vim-nix"; - rev = "867488a04c2ddc47f0f235f37599a06472fea299"; - sha256 = "1mwc06z9q45cigyxd0r9qnfs4ph6lbcwx50rf5lmpavakcn3vqir"; + rev = "e9abff9a0f4d594e360a5216c4e8f9ed3bcae2c0"; + sha256 = "1gznb0wlwsx94b620m8ccl5046di525z698mswy8xxq1vyjcimi7"; }; src = fetchFromGitHub { owner = "MarcWeber"; repo = "vim-addon-nix"; - rev = "2aed79ba5d8c5e6abd102de77e55e242f61b17f1"; - sha256 = "0zx1q9994py6jmm0qbbx6fc1dy5la8zfskkbvqqxssxrl5dx7vvi"; + rev = "3001a9db5f816dd7af11384f15415bddd146ef86"; + sha256 = "195z2yz09wirpqjpsha8x7qcr9is1q8qph4j0svws6qbqrkh8ryy"; }; phases = [ "unpackPhase" "patchPhase" "installPhase" ]; @@ -193,12 +193,16 @@ let for what in indent syntax; do install -vD -m 0644 "$lnl7/$what/nix.vim" "$what/nix.vim" done + sed -i -re '/^ *au(group)? /,/^ *au(group)? +end/ { s/^ *au(tocmd)? +((BufRead|BufNewFile),?)+ +[^ ]+ +setl(ocal)?/${ - "& sw=2 sts=2 et iskeyword+=-" + "& sw=2 sts=2 et iskeyword+='\\''" }/ }' plugin/vim-addon-nix.vim - grep '^setlocal' "$lnl7/ftplugin/nix.vim" >> ftplugin/nix.vim + + sed -n -e '/^ *setlocal/ { + h; :l; $ { x; p; b }; n; /^ *\\/ { H; bl }; x; p + }' "$lnl7/ftplugin/nix.vim" >> ftplugin/nix.vim ''; installPhase = '' -- cgit 1.4.1