Jelajahi Sumber

nixpkgs/neovim: add typescript compiler

Thomas Dy 9 bulan lalu
induk
melakukan
f4afce80c4

+ 6 - 2
.config/nixpkgs/neovim/neovim.nix

@@ -88,8 +88,8 @@ let
       let g:loaded_node_provider = 0
       let g:loaded_perl_provider = 0
 
-      set runtimepath^=${placeholder "out"}/lib
-      set packpath^=${placeholder "out"}/lib
+      set runtimepath=${placeholder "out"}/lib,$VIMRUNTIME
+      set packpath=${placeholder "out"}/lib
 
       ${initText}
     '';
@@ -107,6 +107,10 @@ let
         ln -s "${p}" "lib/pack/nixpkgs/start/${lib.getName p}"
       '') enabledPlugins}
 
+      # copy in overrides
+      mkdir -p lib/pack/nixpkgs/start
+      cp -r ${./overrides} lib/pack/nixpkgs/start/overrides
+
       # create config file
       mkdir etc
       cp "$initVimPath" etc/init.vim

+ 2 - 0
.config/nixpkgs/neovim/overrides/after/compiler/typescript.lua

@@ -0,0 +1,2 @@
+vim.bo.makeprg = "tsc --noEmit --incremental $*"
+vim.bo.errorformat = "%+A %#%f %#(%l\\,%c): %m,%C%m"

+ 1 - 0
.config/nixpkgs/neovim/overrides/after/ftplugin/javascript.vim

@@ -0,0 +1 @@
+compiler typescript

+ 1 - 0
.config/nixpkgs/neovim/overrides/after/ftplugin/typescript.vim

@@ -0,0 +1 @@
+compiler typescript

+ 1 - 0
.config/nixpkgs/neovim/overrides/after/ftplugin/typescriptreact.vim

@@ -0,0 +1 @@
+compiler typescript