summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/aux-files/guix-nvim.vim10
-rw-r--r--gnu/packages/vim.scm10
2 files changed, 19 insertions, 1 deletions
diff --git a/gnu/packages/aux-files/guix-nvim.vim b/gnu/packages/aux-files/guix-nvim.vim
new file mode 100644
index 00000000000..6ac92573fd1
--- /dev/null
+++ b/gnu/packages/aux-files/guix-nvim.vim
@@ -0,0 +1,10 @@
+lua << EOF
+ -- This appends all applicable neovim paths to the runtimepath.
+ for _, directory in pairs({"/run/current-system/profile", "~/.guix-profile", "~/.guix-home/profile", vim.env.GUIX_PROFILE, vim.env.GUIX_ENVIRONMENT}) do
+ local rtp = vim.fs.abspath(directory .. "/share/nvim/site")
+ local stat = vim.uv.fs_stat(rtp)
+ if stat and stat.type == "directory" then
+ vim.opt.rtp:append(rtp)
+ end
+ end
+EOF
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index 36357598ef8..02182dad488 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -862,7 +862,15 @@ is based on Vim's builtin plugin support.")
;; doubles its size. We remove the reference here.
(substitute* "cmake.config/versiondef.h.in"
(("\\$\\{CMAKE_C_COMPILER\\}") "/gnu/store/.../bin/gcc"))
- #t)))))
+ #t))
+ (add-after 'install 'install-guix-nvim.vim
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((nvimdir (string-append (assoc-ref outputs "out")
+ "/share/nvim")))
+ (mkdir-p nvimdir)
+ (copy-file
+ #$(local-file (search-auxiliary-file "guix-nvim.vim"))
+ (string-append nvimdir "/sysinit.vim"))))))))
(inputs (list libuv-for-luv
msgpack
libtermkey