about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoerg Thalheim <joerg@thalheim.io>2017-11-21 16:40:56 +0000
committerJoerg Thalheim <joerg@thalheim.io>2017-11-21 17:05:55 +0000
commit2c705048927a893962e975eac77100107591fa1e (patch)
treea27122eae386fb85b07adf502503457f772569de
parent73746502d80878780a771a3d8d56fed071016ca4 (diff)
downloadnixlib-2c705048927a893962e975eac77100107591fa1e.tar
nixlib-2c705048927a893962e975eac77100107591fa1e.tar.gz
nixlib-2c705048927a893962e975eac77100107591fa1e.tar.bz2
nixlib-2c705048927a893962e975eac77100107591fa1e.tar.lz
nixlib-2c705048927a893962e975eac77100107591fa1e.tar.xz
nixlib-2c705048927a893962e975eac77100107591fa1e.tar.zst
nixlib-2c705048927a893962e975eac77100107591fa1e.zip
vimPlugins.vim-grammarous: set languagetool path
Otherwise it try to install languagetool into nix store
-rw-r--r--pkgs/misc/vim-plugins/default.nix13
-rw-r--r--pkgs/misc/vim-plugins/patches/vim-grammarous/set_default_languagetool.patch11
-rw-r--r--pkgs/misc/vim-plugins/vim2nix/additional-nix-code/vim-grammarous10
3 files changed, 33 insertions, 1 deletions
diff --git a/pkgs/misc/vim-plugins/default.nix b/pkgs/misc/vim-plugins/default.nix
index a9468e5356df..ffe77f14fcd7 100644
--- a/pkgs/misc/vim-plugins/default.nix
+++ b/pkgs/misc/vim-plugins/default.nix
@@ -5,6 +5,8 @@
 , python3, boost, icu
 , ycmd, makeWrapper, rake
 , pythonPackages, python3Packages
+, substituteAll
+, languagetool
 , Cocoa ? null, git
 }:
 
@@ -1405,7 +1407,16 @@ rec {
       sha256 = "1mm8hd39q2sl4hi83c4zvrl27a8djr1pv35ch0pivg84ad9p7qq5";
     };
     dependencies = [];
-
+    # use `:GrammarousCheck` to initialize checking
+    # In neovim, you also want to use set
+    #   let g:grammarous#show_first_error = 1
+    # see https://github.com/rhysd/vim-grammarous/issues/39
+    patches = [
+      (substituteAll {
+        src = ./patches/vim-grammarous/set_default_languagetool.patch;
+        inherit languagetool;
+      })
+    ];
   };
 
   vim-puppet = buildVimPluginFrom2Nix { # created by nix#NixDerivation
diff --git a/pkgs/misc/vim-plugins/patches/vim-grammarous/set_default_languagetool.patch b/pkgs/misc/vim-plugins/patches/vim-grammarous/set_default_languagetool.patch
new file mode 100644
index 000000000000..72c928d1a971
--- /dev/null
+++ b/pkgs/misc/vim-plugins/patches/vim-grammarous/set_default_languagetool.patch
@@ -0,0 +1,11 @@
+--- vim-grammarous-51ef519.org/autoload/grammarous.vim	1970-01-01 01:00:01.000000000 +0100
++++ vim-grammarous-51ef519/autoload/grammarous.vim	2017-11-21 16:33:27.473403322 +0000
+@@ -22,7 +22,7 @@
+ let g:grammarous#enable_spell_check              = get(g:, 'grammarous#enable_spell_check', 0)
+ let g:grammarous#move_to_first_error             = get(g:, 'grammarous#move_to_first_error', 1)
+ let g:grammarous#hooks                           = get(g:, 'grammarous#hooks', {})
+-let g:grammarous#languagetool_cmd                = get(g:, 'grammarous#languagetool_cmd', '')
++let g:grammarous#languagetool_cmd                = get(g:, 'grammarous#languagetool_cmd', '@languagetool@/bin/languagetool-commandline')
+ let g:grammarous#show_first_error                = get(g:, 'grammarous#show_first_error', 0)
+ 
+ highlight default link GrammarousError SpellBad
diff --git a/pkgs/misc/vim-plugins/vim2nix/additional-nix-code/vim-grammarous b/pkgs/misc/vim-plugins/vim2nix/additional-nix-code/vim-grammarous
new file mode 100644
index 000000000000..66a91b619d16
--- /dev/null
+++ b/pkgs/misc/vim-plugins/vim2nix/additional-nix-code/vim-grammarous
@@ -0,0 +1,10 @@
+    # use `:GrammarousCheck` to initialize checking
+    # In neovim, you also want to use set
+    #   let g:grammarous#show_first_error = 1
+    # see https://github.com/rhysd/vim-grammarous/issues/39
+    patches = [
+      (substituteAll {
+        src = ./patches/vim-grammarous/set_default_languagetool.patch;
+        inherit languagetool;
+      })
+    ];