gnu: vim: Automatically find vim plugins.
[jackhill/guix/guix.git] / gnu / packages / vim.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
3 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
5 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
7 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2019 HiPhish <hiphish@posteo.de>
9 ;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
10 ;;; Copyright © 2019, 2020 Jakub Kądziołka <kuba@kadziolka.net>
11 ;;; Copyright © 2020 Jack Hill <jackhill@jackhill.us>
12 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages vim)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix utils)
32 #:use-module (guix download)
33 #:use-module (guix git-download)
34 #:use-module (guix build-system cmake)
35 #:use-module (guix build-system copy)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix build-system python)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages acl)
40 #:use-module (gnu packages admin) ; For GNU hostname
41 #:use-module (gnu packages attr)
42 #:use-module (gnu packages autotools)
43 #:use-module (gnu packages base)
44 #:use-module (gnu packages fontutils)
45 #:use-module (gnu packages gawk)
46 #:use-module (gnu packages gettext)
47 #:use-module (gnu packages glib)
48 #:use-module (gnu packages gperf)
49 #:use-module (gnu packages groff)
50 #:use-module (gnu packages gtk)
51 #:use-module (gnu packages image)
52 #:use-module (gnu packages jemalloc)
53 #:use-module (gnu packages libevent)
54 #:use-module (gnu packages linux)
55 #:use-module (gnu packages lua)
56 #:use-module (gnu packages ncurses)
57 #:use-module (gnu packages perl)
58 #:use-module (gnu packages pkg-config)
59 #:use-module (gnu packages python)
60 #:use-module (gnu packages python-xyz)
61 #:use-module (gnu packages ruby)
62 #:use-module (gnu packages serialization)
63 #:use-module (gnu packages shells)
64 #:use-module (gnu packages tcl)
65 #:use-module (gnu packages text-editors)
66 #:use-module (gnu packages terminals)
67 #:use-module (gnu packages xdisorg)
68 #:use-module (gnu packages xorg))
69
70 (define-public vim
71 (package
72 (name "vim")
73 (version "8.2.2067")
74 (source (origin
75 (method git-fetch)
76 (uri (git-reference
77 (url "https://github.com/vim/vim")
78 (commit (string-append "v" version))))
79 (file-name (git-file-name name version))
80 (sha256
81 (base32
82 "02cd953h69k9klrcwi756namwg39ka7if9ccc399ihb1l5f3kr66"))))
83 (build-system gnu-build-system)
84 (arguments
85 `(#:test-target "test"
86 #:parallel-tests? #f
87 #:phases
88 (modify-phases %standard-phases
89 (add-after 'configure 'patch-absolute-paths
90 (lambda _
91 (substitute* "runtime/tools/mve.awk"
92 (("/usr/bin/nawk") (which "gawk")))
93 (substitute* '("src/testdir/Makefile"
94 "src/testdir/test_normal.vim"
95 "src/testdir/test_popupwin.vim"
96 "src/testdir/test_system.vim"
97 "src/testdir/test_terminal.vim"
98 "src/testdir/test_terminal2.vim")
99 (("/bin/sh") (which "sh")))
100 (substitute* "src/testdir/test_autocmd.vim"
101 (("/bin/kill") (which "kill")))
102 #t))
103 (add-before 'check 'set-environment-variables
104 (lambda* (#:key inputs #:allow-other-keys)
105 ;; One of the tests tests timezone-dependent functions.
106 (setenv "TZDIR"
107 (string-append (assoc-ref inputs "tzdata")
108 "/share/zoneinfo"))
109
110 ;; Make sure the TERM environment variable is set for the tests
111 (setenv "TERM" "xterm")
112 #t))
113 (add-before 'check 'skip-or-fix-failing-tests
114 (lambda _
115 ;; This test assumes that PID 1 is run as root and that the user
116 ;; running the test suite does not have permission to kill(1, 0)
117 ;; it. This is not true in the build container, where both PID 1
118 ;; and the test suite are run as the same user. Skip the test.
119 ;; An alternative fix would be to patch the PID used to a random
120 ;; 32-bit value and hope it never shows up in the test environment.
121 (substitute* "src/testdir/test_swap.vim"
122 (("if !IsRoot\\(\\)") "if 0"))
123
124 ;; These tests check how the terminal looks after executing some
125 ;; actions. The path of the bash binary is shown, which results in
126 ;; a difference being detected. Patching the expected result is
127 ;; non-trivial due to the special format used, so skip the test.
128 (substitute* "src/testdir/test_terminal.vim"
129 ((".*Test_terminal_postponed_scrollback.*" line)
130 (string-append line "return\n")))
131 (substitute* "src/testdir/test_popupwin.vim"
132 ((".*Test_popup_drag_termwin.*" line)
133 (string-append line "return\n")))
134
135 ;; This test compares output against a golden ‘…/|b|i|n|/|s|h…’
136 ;; literal. We need to match that and substitute a similarly
137 ;; ‘spliced’ path to ‘sh’ in the store, truncated to the last
138 ;; 44 (spliced: 88) characters.
139 (let ((splice (lambda (s separator)
140 (string-join (map string (string->list s))
141 separator))))
142 (substitute* "src/testdir/dumps/Test_terminal_from_cmd.dump"
143 (((splice "/bin/sh" "\\|"))
144 (splice (string-take-right (which "sh") 44) "|"))
145 ;; Blindly fix some other differences based on error output.
146 (("^\\|!") "|<")
147 (("@37") "")))
148 #t))
149 (add-after 'install 'install-guix.vim
150 (lambda* (#:key inputs outputs #:allow-other-keys)
151 (let ((vimdir (string-append (assoc-ref outputs "out") "/share/vim")))
152 (mkdir-p vimdir)
153 (copy-file (assoc-ref inputs "guix.vim")
154 (string-append vimdir "/vimrc"))
155 #t))))))
156 (inputs
157 `(("gawk" ,gawk)
158 ("ncurses" ,ncurses)
159 ("perl" ,perl)
160 ("tcsh" ,tcsh))) ; For runtime/tools/vim32
161 (native-inputs
162 `(("libtool" ,libtool)
163 ("guix.vim" ,(search-auxiliary-file "guix.vim"))
164
165 ;; For tests.
166 ("tzdata" ,tzdata-for-tests)))
167 (home-page "https://www.vim.org/")
168 (synopsis "Text editor based on vi")
169 ;; The description shares language with the vim-full package. When making
170 ;; changes, check if the other description also needs to be updated.
171 (description
172 "Vim is a highly configurable text editor built to enable efficient text
173 editing. It is an improved version of the vi editor distributed with most UNIX
174 systems.
175
176 Vim is often called a \"programmer's editor,\" and so useful for programming
177 that many consider it an entire IDE. It's not just for programmers, though.
178 Vim is perfect for all kinds of text editing, from composing email to editing
179 configuration files.")
180 (license license:vim)))
181
182 (define-public xxd
183 (package (inherit vim)
184 (name "xxd")
185 (arguments
186 `(#:make-flags (list ,(string-append "CC=" (cc-for-target)))
187 #:tests? #f ; there are none
188 #:phases
189 (modify-phases %standard-phases
190 (delete 'configure)
191 (add-after 'unpack 'chdir
192 (lambda _
193 (chdir "src/xxd")
194 #t))
195 (replace 'install
196 (lambda* (#:key outputs #:allow-other-keys)
197 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
198 (install-file "xxd" bin)
199 #t))))))
200 (inputs `())
201 (native-inputs `())
202 (synopsis "Hexdump utility from vim")
203 (description "This package provides the Hexdump utility xxd that comes
204 with the editor vim.")))
205
206 (define-public vim-full
207 (package
208 ;; This package should share its source with Vim, but it doesn't
209 ;; build reliably, and we want to keep Vim up to date due to the
210 ;; frequency of important bug fixes.
211 (inherit vim)
212 (name "vim-full")
213 (arguments
214 `(#:configure-flags
215 (list (string-append "--with-lua-prefix="
216 (assoc-ref %build-inputs "lua"))
217 "--with-features=huge"
218 "--enable-python3interp=yes"
219 "--enable-perlinterp=yes"
220 "--enable-rubyinterp=yes"
221 "--enable-tclinterp=yes"
222 "--enable-luainterp=yes"
223 "--enable-cscope"
224 "--enable-sniff"
225 "--enable-multibyte"
226 "--enable-xim"
227 "--disable-selinux"
228 "--enable-gui")
229 ;; This flag fixes the following error:
230 ;; .../libpython3.7m.a(pyexpat.o): undefined reference to symbol 'XML_FreeContentModel'
231 ;; .../libexpat.so.1: error adding symbols: DSO missing from command line
232 #:make-flags '("LDFLAGS=-lexpat")
233 ,@(substitute-keyword-arguments (package-arguments vim)
234 ((#:phases phases)
235 `(modify-phases ,phases
236 (add-before 'check 'start-xserver
237 (lambda* (#:key inputs #:allow-other-keys)
238 ;; Some tests require an X server, but does not start one.
239 (let ((xorg-server (assoc-ref inputs "xorg-server"))
240 (display ":1"))
241 (setenv "DISPLAY" display)
242 (zero? (system (string-append xorg-server "/bin/Xvfb "
243 display " &")))))))))))
244 (native-inputs
245 `(("pkg-config" ,pkg-config)
246 ("xorg-server" ,xorg-server-for-tests)
247 ,@(package-native-inputs vim)))
248 (inputs
249 `(("acl" ,acl)
250 ("atk" ,atk)
251 ("attr" ,attr)
252 ("cairo" ,cairo)
253 ("fontconfig" ,fontconfig)
254 ("freetype" ,freetype)
255 ("gdk-pixbuf" ,gdk-pixbuf)
256 ("gettext" ,gettext-minimal)
257 ("glib" ,glib)
258 ("gpm" ,gpm)
259 ("gtk" ,gtk+-2)
260 ("harfbuzz" ,harfbuzz)
261 ("libice" ,libice)
262 ("libpng" ,libpng)
263 ("libsm" ,libsm)
264 ("libx11" ,libx11)
265 ("libxdmcp" ,libxdmcp)
266 ("libxt" ,libxt)
267 ("libxpm" ,libxpm)
268 ("lua" ,lua)
269 ("pango" ,pango)
270 ("pixman" ,pixman)
271 ("python-3" ,python)
272 ("ruby" ,ruby)
273 ("tcl" ,tcl)
274 ,@(package-inputs vim)))
275 ;; The description shares language with the vim package. When making
276 ;; changes, check if the other description also needs to be updated.
277 (description "Vim is a highly configurable text editor built to enable efficient text
278 editing. It is an improved version of the vi editor distributed with most UNIX
279 systems.
280
281 Vim is often called a \"programmer's editor,\" and so useful for programming
282 that many consider it an entire IDE. It's not just for programmers, though.
283 Vim is perfect for all kinds of text editing, from composing email to editing
284 configuration files.
285
286 This package provides a version of Vim with many optional features enabled.
287 It includes a graphical interface, @command{gvim}, and support for plugins
288 written in the Python 3, Perl, Ruby, Tcl, and Lua programming languages.")))
289
290 (define-public vim-neocomplete
291 (package
292 (name "vim-neocomplete")
293 (version "2.1")
294 (source
295 (origin
296 (method git-fetch)
297 (uri (git-reference
298 (url "https://github.com/Shougo/neocomplete.vim")
299 (commit (string-append "ver." version))))
300 (file-name (git-file-name name version))
301 (sha256
302 (base32
303 "1h6sci5mhdfg6sjsjpi8l5li02hg858zcayiwl60y9j2gqnd18lv"))))
304 (build-system copy-build-system)
305 (arguments
306 '(#:install-plan
307 '(("autoload" "share/vim/vimfiles/")
308 ("doc" "share/vim/vimfiles/")
309 ("plugin" "share/vim/vimfiles/"))))
310 (synopsis "Next generation completion framework for Vim")
311 (description
312 "@code{neocomplete}, an abbreviation of 'neo-completion with cache',
313 is a plugin for Vim.
314 It provides keyword completion system by maintaining a cache of keywords in
315 the current buffer. Neocomplete can be customized easily and has many more
316 features than Vim's built-in completion.")
317 (home-page "https://github.com/Shougo/neocomplete.vim/")
318 (license license:expat)))
319
320 ;; There are no release tarballs.
321 (define-public vim-neosnippet-snippets
322 (let ((commit "8e2b1c0cab9ed9a832b3743dbb65e9966a64331a")
323 (revision "1"))
324 (package
325 (name "vim-neosnippet-snippets")
326 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
327 (source
328 (origin
329 (method git-fetch)
330 (uri (git-reference
331 (url "https://github.com/Shougo/neosnippet-snippets")
332 (commit commit)))
333 (file-name (string-append name "-" version "-checkout"))
334 (sha256
335 (base32
336 "151wpvbj6jb9jdkbhj3b77f5sq7y328spvwfbqyj1y32rg4ifmc6"))))
337 (build-system copy-build-system)
338 (arguments
339 '(#:install-plan
340 '(("neosnippets" "share/vim/vimfiles/"))))
341 (synopsis "Snippets for neosnippet")
342 (description
343 "@code{neosnippet-snippets} provides standard snippets for the Vim plugin
344 @code{neosnippet}. Snippets are small templates for commonly used code that
345 you can fill in on the fly.")
346 (home-page "https://github.com/Shougo/neosnippet-snippets")
347 (license license:expat))))
348
349 ;; The released tarball is too old for our Vim.
350 (define-public vim-neosnippet
351 (let ((commit "1bd7e23c79b73da16eb0c9469b25c376d3594583")
352 (revision "1"))
353 (package
354 (name "vim-neosnippet")
355 (version (string-append "4.2-" revision "." (string-take commit 7)))
356 (source
357 (origin
358 (method git-fetch)
359 (uri (git-reference
360 (url "https://github.com/Shougo/neosnippet.vim/")
361 (commit commit)))
362 (file-name (string-append name "-" version "-checkout"))
363 (sha256
364 (base32
365 "0k80syscmpnj38ks1fq02ds59g0r4jlg9ll7z4qc048mgi35alw5"))))
366 (build-system copy-build-system)
367 (arguments
368 '(#:install-plan
369 '(("autoload" "share/vim/vimfiles/")
370 ("doc" "share/vim/vimfiles/")
371 ("ftdetect" "share/vim/vimfiles/")
372 ("ftplugin" "share/vim/vimfiles/")
373 ("indent" "share/vim/vimfiles/")
374 ("plugin" "share/vim/vimfiles/")
375 ("rplugin" "share/vim/vimfiles/")
376 ("syntax" "share/vim/vimfiles/"))))
377 (synopsis "Snippet support for Vim")
378 (description
379 "@code{neosnippet}, is a plugin for Vim which adds snippet support to Vim.
380 Snippets are small templates for commonly used code that you can fill in on
381 the fly. To use snippets can increase your productivity in Vim a lot.
382 The functionality of this plug-in is quite similar to plug-ins like
383 @code{snipMate.vim} or @code{snippetsEmu.vim}. But since you can choose
384 snippets with the neocomplcache / neocomplete interface, you might have less
385 trouble using them, because you do not have to remember each snippet name.")
386 (home-page "https://github.com/Shougo/neosnippet.vim/")
387 (license license:expat))))
388
389 (define-public vim-scheme
390 (let ((commit "93827987c10f2d5dc519166a761f219204926d5f")
391 (revision "1"))
392 (package
393 (name "vim-scheme")
394 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
395 (source
396 (origin
397 (method git-fetch)
398 (uri (git-reference
399 (url "http://git.foldling.org/vim-scheme.git")
400 (commit commit)))
401 (file-name (string-append name "-" version "-checkout"))
402 (sha256
403 (base32
404 "1ynjr1109dxgj0lz261gmzz3wf5ap1m6j6hnvl3lcyv66a4y8pjv"))))
405 (build-system copy-build-system)
406 (arguments
407 '(#:install-plan
408 '(("after" "share/vim/vimfiles/")
409 ("ftplugin" "share/vim/vimfiles/")
410 ("syntax" "share/vim/vimfiles/"))))
411 (synopsis "Scheme syntax for Vim")
412 (description
413 "@code{vim-scheme} provides Scheme support for Vim (R7RS and CHICKEN).")
414 (home-page "https://foldling.org/git/vim-scheme.git/")
415 (license license:public-domain))))
416
417 (define-public vim-luna
418 (let ((commit "633619953dcf8577168e255230f96b05f28d6371")
419 (revision "1"))
420 (package
421 (name "vim-luna")
422 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
423 (source
424 (origin
425 (method git-fetch)
426 (uri (git-reference
427 (url "https://github.com/notpratheek/vim-luna")
428 (commit commit)))
429 (file-name (string-append name "-" version "-checkout"))
430 (sha256
431 (base32
432 "0ka3qbhsh8lix1vyj4678j7dnchkd8khhirrnn3aylxxf8fpqyg8"))))
433 (build-system copy-build-system)
434 (arguments
435 '(#:install-plan
436 '(("colors" "share/vim/vimfiles/"))))
437 (synopsis "Dark color theme for Vim")
438 (description
439 "@code{vim-luna} is a dark color theme for Vim.")
440 (home-page "https://github.com/notpratheek/vim-luna")
441 (license license:expat))))
442
443 ;; There are no tarball releases.
444 (define-public vim-context-filetype
445 (let ((commit "5e85f8cae26806f391aefe2661791a6de53bcea2")
446 (revision "1"))
447 (package
448 (name "vim-context-filetype")
449 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
450 (source
451 (origin
452 (method git-fetch)
453 (uri (git-reference
454 (url "https://github.com/Shougo/context_filetype.vim")
455 (commit commit)))
456 (file-name (string-append name "-" version "-checkout"))
457 (sha256
458 (base32
459 "0alvrfhmd91zkd9h83s8wvgyq4iakcf6rybsyjd369qbgpcqky89"))))
460 (build-system copy-build-system)
461 (arguments
462 '(#:install-plan
463 '(("doc" "share/vim/vimfiles/")
464 ("autoload" "share/vim/vimfiles/"))))
465 (synopsis "Context filetype library for Vim")
466 (description
467 "@code{vim-context-filetype} is context filetype library for Vim script.")
468 (home-page "https://github.com/Shougo/context_filetype.vim")
469 (license license:expat)))) ; ??? check again
470
471 (define-public vim-fugitive
472 (package
473 (name "vim-fugitive")
474 (version "3.2")
475 (source
476 (origin
477 (method git-fetch)
478 (uri (git-reference
479 (url "https://github.com/tpope/vim-fugitive")
480 (commit (string-append "v" version))))
481 (file-name (git-file-name name version))
482 (sha256
483 (base32
484 "1jbn5jxadccmcz01j94d0i1bp74cixr0fpxxf1h0aqdf1ljk3d7n"))))
485 (build-system copy-build-system)
486 (arguments
487 '(#:install-plan
488 '(("autoload" "share/vim/vimfiles/")
489 ("doc" "share/vim/vimfiles/")
490 ("ftdetect" "share/vim/vimfiles/")
491 ("plugin" "share/vim/vimfiles/")
492 ("syntax" "share/vim/vimfiles/"))))
493 (home-page "https://github.com/tpope/vim-fugitive")
494 (synopsis "Vim plugin to work with Git")
495 (description "Vim-fugitive is a wrapper for Vim that complements the
496 command window, where you can stage and review your changes before the next
497 commit or run any Git arbitrary command.")
498 (license license:vim))) ; distributed under the same license as vim
499
500 (define-public vim-airline
501 (package
502 (name "vim-airline")
503 (version "0.11")
504 (source
505 (origin
506 (method git-fetch)
507 (uri (git-reference
508 (url "https://github.com/vim-airline/vim-airline")
509 (commit (string-append "v" version))))
510 (file-name (git-file-name name version))
511 (sha256
512 (base32
513 "1aksmr73648pvyc75pfdz28k2d4ky52rn7xiwcv7lz87q3vqld7k"))))
514 (build-system copy-build-system)
515 (arguments
516 '(#:install-plan
517 '(("autoload" "share/vim/vimfiles/")
518 ("doc" "share/vim/vimfiles/")
519 ("plugin" "share/vim/vimfiles/"))))
520 (synopsis "Statusline for Vim")
521 (description
522 "@code{vim-airline} is an extensible statusline for Vim.
523 It can be extended and costumized with themes, works with unicode fonts
524 and powerline symbols, etc.")
525 (home-page "https://github.com/vim-airline/vim-airline")
526 (license license:expat)))
527
528 ;; There are no tarball releases.
529 (define-public vim-airline-themes
530 (let ((commit "e6f233231b232b6027cde6aebeeb18d9138e5324")
531 (revision "2"))
532 (package
533 (name "vim-airline-themes")
534 (version (git-version "0.0.0" revision commit))
535 (source
536 (origin
537 (method git-fetch)
538 (uri (git-reference
539 (url "https://github.com/vim-airline/vim-airline-themes")
540 (commit commit)))
541 (file-name (git-file-name name version))
542 (sha256
543 (base32
544 "1sb7nb7j7bz0pv1c9bgdy0smhr0jk2b1vbdv9yzghg5lrknpsbr6"))))
545 (build-system copy-build-system)
546 (arguments
547 '(#:install-plan
548 '(("autoload" "share/vim/vimfiles/")
549 ("doc" "share/vim/vimfiles/")
550 ("plugin" "share/vim/vimfiles/"))))
551 (synopsis "Collection of themes for Vim-airline")
552 (description
553 "@code{vim-airline-themes} is a collection of themes for @code{vim-airline}.")
554 (home-page "https://github.com/vim-airline/vim-airline-themes")
555 (license license:expat))))
556
557 (define-public vim-syntastic
558 (package
559 (name "vim-syntastic")
560 (version "3.10.0")
561 (source
562 (origin
563 (method git-fetch)
564 (uri (git-reference
565 (url "https://github.com/vim-syntastic/syntastic")
566 (commit version)))
567 (file-name (git-file-name name version))
568 (sha256
569 (base32 "0j91f72jaz1s6aw1hpjiz30vk2ds2aqd9gisk91grsldy6nz6hhz"))))
570 (build-system copy-build-system)
571 (arguments
572 '(#:install-plan
573 '(("autoload" "share/vim/vimfiles/")
574 ("doc" "share/vim/vimfiles/")
575 ("plugin" "share/vim/vimfiles/")
576 ("syntax_checkers" "share/vim/vimfiles/"))))
577 (synopsis "Syntax checking plugin for Vim")
578 (description
579 "Vim-syntastic is a syntax checking plugin for Vim. It runs files through
580 external syntax checkers and displays any resulting errors to the user. This
581 can be done on demand, or automatically as files are saved. If syntax errors
582 are detected, the user is notified.")
583 (home-page "https://github.com/vim-syntastic/syntastic")
584 (license license:wtfpl2)))
585
586 (define-public editorconfig-vim
587 (package
588 (name "editorconfig-vim")
589 (version "1.1.1")
590 (source
591 (origin
592 (method git-fetch)
593 (uri (git-reference
594 (url "https://github.com/editorconfig/editorconfig-vim")
595 (commit (string-append "v" version))))
596 (file-name (git-file-name name version))
597 (sha256
598 (base32
599 "0mp80bi2m56bb93szw87vy6q5s85yk9g91sl4pr51316rgdv5kkv"))))
600 (build-system copy-build-system)
601 (arguments
602 '(#:install-plan
603 '(("autoload" "share/vim/vimfiles/")
604 ("doc" "share/vim/vimfiles/")
605 ("plugin" "share/vim/vimfiles/"))))
606 (home-page "https://editorconfig.org/")
607 (synopsis "EditorConfig plugin for Vim")
608 (description "EditorConfig makes it easy to maintain the correct coding
609 style when switching between different text editors and between different
610 projects. The EditorConfig project maintains a file format and plugins for
611 various text editors which allow this file format to be read and used by those
612 editors.")
613 (license license:bsd-2)))
614
615 (define-public neovim-syntastic
616 (package
617 (inherit vim-syntastic)
618 (name "neovim-syntastic")
619 (arguments
620 '(#:install-plan
621 '(("autoload" "share/nvim/site/")
622 ("doc" "share/nvim/site/")
623 ("plugin" "share/nvim/site/")
624 ("syntax_checkers" "share/nvim/site/"))))
625 (synopsis "Syntax checking plugin for Neovim")
626 (description
627 "Vim-syntastic is a syntax checking plugin for Neovim. It runs files through
628 external syntax checkers and displays any resulting errors to the user. This
629 can be done on demand, or automatically as files are saved. If syntax errors
630 are detected, the user is notified.")))
631
632 (define-public neovim
633 (package
634 (name "neovim")
635 (version "0.4.4")
636 (source
637 (origin
638 (method git-fetch)
639 (uri (git-reference
640 (url "https://github.com/neovim/neovim")
641 (commit (string-append "v" version))))
642 (file-name (git-file-name name version))
643 (sha256
644 (base32 "11zyj6jvkwas3n6w1ckj3pk6jf81z1g7ngg4smmwm7c27y2a6f2m"))))
645 (build-system cmake-build-system)
646 (arguments
647 `(#:modules ((srfi srfi-26)
648 (guix build cmake-build-system)
649 (guix build utils))
650 #:configure-flags '("-DPREFER_LUA:BOOL=YES")
651 #:phases
652 (modify-phases %standard-phases
653 (add-after 'unpack 'set-lua-paths
654 (lambda* (#:key inputs #:allow-other-keys)
655 (let* ((lua-version "5.1")
656 (lua-cpath-spec
657 (lambda (prefix)
658 (let ((path (string-append prefix "/lib/lua/" lua-version)))
659 (string-append path "/?.so;" path "/?/?.so"))))
660 (lua-path-spec
661 (lambda (prefix)
662 (let ((path (string-append prefix "/share/lua/" lua-version)))
663 (string-append path "/?.lua;" path "/?/?.lua"))))
664 (lua-inputs (map (cute assoc-ref %build-inputs <>)
665 '("lua"
666 "lua-luv"
667 "lua-lpeg"
668 "lua-bitop"
669 "lua-libmpack"))))
670 (setenv "LUA_PATH"
671 (string-join (map lua-path-spec lua-inputs) ";"))
672 (setenv "LUA_CPATH"
673 (string-join (map lua-cpath-spec lua-inputs) ";"))
674 #t)))
675 (add-after 'unpack 'prevent-embedding-gcc-store-path
676 (lambda _
677 ;; nvim remembers its build options, including the compiler with
678 ;; its complete path. This adds gcc to the closure of nvim, which
679 ;; doubles its size. We remove the refirence here.
680 (substitute* "cmake/GetCompileFlags.cmake"
681 (("\\$\\{CMAKE_C_COMPILER\\}") "/gnu/store/.../bin/gcc"))
682 #t)))))
683 (inputs
684 `(("libuv" ,libuv)
685 ("msgpack" ,msgpack)
686 ("libtermkey" ,libtermkey)
687 ("libvterm" ,libvterm)
688 ("unibilium" ,unibilium)
689 ("jemalloc" ,jemalloc)
690 ("libiconv" ,libiconv)
691 ("lua" ,lua-5.1)
692 ("lua-luv" ,lua5.1-luv)
693 ("lua-lpeg" ,lua5.1-lpeg)
694 ("lua-bitop" ,lua5.1-bitop)
695 ("lua-libmpack" ,lua5.1-libmpack)))
696 (native-inputs
697 `(("pkg-config" ,pkg-config)
698 ("gettext" ,gettext-minimal)
699 ("gperf" ,gperf)))
700 (home-page "https://neovim.io")
701 (synopsis "Fork of vim focused on extensibility and agility")
702 (description "Neovim is a project that seeks to aggressively
703 refactor Vim in order to:
704
705 @itemize
706 @item Simplify maintenance and encourage contributions
707 @item Split the work between multiple developers
708 @item Enable advanced external UIs without modifications to the core
709 @item Improve extensibility with a new plugin architecture
710 @end itemize\n")
711 ;; Neovim is licensed under the terms of the Apache 2.0 license,
712 ;; except for parts that were contributed under the Vim license.
713 (license (list license:asl2.0 license:vim))))
714
715 (define-public vifm
716 (package
717 (name "vifm")
718 (version "0.11")
719 (source
720 (origin
721 (method url-fetch)
722 (uri (list
723 (string-append "https://github.com/vifm/vifm/releases/download/v"
724 version "/vifm-" version ".tar.bz2")
725 (string-append "https://sourceforge.net/projects/vifm/files/vifm/"
726 "vifm-" version ".tar.bz2")))
727 (sha256
728 (base32
729 "0rqyd424y0g5b5basw2ybb60r9gar4f40d1xgzr3c2dsy4jpwvyh"))))
730 (build-system gnu-build-system)
731 (arguments
732 '(#:configure-flags '("--disable-build-timestamp")
733 #:phases
734 (modify-phases %standard-phases
735 (add-after 'patch-source-shebangs 'patch-test-shebangs
736 (lambda _
737 (substitute* (cons* "src/background.c"
738 "src/cfg/config.c"
739 (find-files "tests" "\\.c$"))
740 (("/bin/sh") (which "sh"))
741 (("/bin/bash") (which "bash")))
742 ;; This test segfaults
743 (substitute* "tests/Makefile"
744 (("misc") ""))
745 #t))
746 (add-after 'install 'install-vim-plugin-files
747 (lambda* (#:key outputs #:allow-other-keys)
748 (let* ((out (assoc-ref outputs "out"))
749 (vifm (string-append out "/share/vifm"))
750 (vimfiles (string-append out "/share/vim/vimfiles")))
751 (copy-recursively (string-append vifm "/colors")
752 (string-append vimfiles "/colors"))
753 (copy-recursively (string-append vifm "/vim")
754 vimfiles)
755 (delete-file-recursively (string-append vifm "/colors"))
756 (delete-file-recursively (string-append vifm "/vim")))
757 #t)))))
758 (native-inputs
759 `(("groff" ,groff))) ; for the documentation
760 (inputs
761 `(("libx11" ,libx11)
762 ("ncurses" ,ncurses)
763 ("perl" ,perl)))
764 (home-page "https://vifm.info/")
765 (synopsis "Flexible vi-like file manager using ncurses")
766 (description "Vifm is a file manager providing a @command{vi}-like usage
767 experience. It has similar keybindings and modes (e.g. normal, command line,
768 visual). The interface uses ncurses, thus vifm can be used in text-only
769 environments. It supports a wide range of features, some of which are known
770 from the @command{vi}-editor:
771 @enumerate
772 @item utf8 support
773 @item user mappings (almost like in @code{vi})
774 @item ranges in command
775 @item line commands
776 @item user defined commands (with support for ranges)
777 @item registers
778 @item operation undoing/redoing
779 @item fuse file systems support
780 @item trash
781 @item multiple files renaming
782 @item support of filename modifiers
783 @item colorschemes support
784 @item file name color according to file type
785 @item path specific colorscheme customization
786 @item bookmarks
787 @item operation backgrounding
788 @item customizable file viewers
789 @item handy @code{less}-like preview mode
790 @item filtering out and searching for files using regular expressions
791 @item one or two panes view
792 @end enumerate
793 With the package comes a plugin to use vifm as a vim file selector.")
794 (license license:gpl2+)))
795
796 (define-public python-pynvim
797 (package
798 (name "python-pynvim")
799 (version "0.4.2")
800 (source (origin
801 (method url-fetch)
802 (uri (pypi-uri "pynvim" version))
803 (sha256
804 (base32
805 "13qgwkqbx012j5spis1aw8rb120rw0zphgjy1j58irax8r6j1ikb"))))
806 (build-system python-build-system)
807 (propagated-inputs
808 `(("python-greenlet" ,python-greenlet)
809 ("python-msgpack" ,python-msgpack)))
810 (arguments
811 `(#:tests? #f))
812 (home-page "https://github.com/neovim/pynvim")
813 (synopsis "Python client and plugin host for neovim")
814 (description "Pynvim implements support for python plugins in neovim. It
815 also works as a library for connecting to and scripting neovim processes
816 through its msgpack-rpc API.")
817 (license license:asl2.0)))
818
819 (define-public python2-pynvim
820 (package-with-python2 python-pynvim))
821
822 (define-public vim-guix-vim
823 (package
824 (name "vim-guix-vim")
825 (version "0.1.1")
826 (source (origin
827 (method git-fetch)
828 (uri (git-reference
829 (url "https://gitlab.com/Efraim/guix.vim")
830 (commit version)))
831 (file-name (git-file-name name version))
832 (sha256
833 (base32
834 "10bfy0dgwizxr56b4272b7sqajpr6lnz332pzx055dis2zzjap8z"))))
835 (build-system copy-build-system)
836 (arguments
837 '(#:install-plan
838 '(("compiler" "share/vim/vimfiles/")
839 ("doc" "share/vim/vimfiles/")
840 ("indent" "share/vim/vimfiles/")
841 ("ftdetect" "share/vim/vimfiles/")
842 ("ftplugin" "share/vim/vimfiles/")
843 ("syntax" "share/vim/vimfiles/"))))
844 (home-page "https://gitlab.com/Efraim/guix.vim")
845 (synopsis "Guix integration in Vim")
846 (description "This package provides support for GNU Guix in Vim.")
847 (license license:vim)))
848
849 (define-public vim-asyncrun
850 (package
851 (name "vim-asyncrun")
852 (version "2.7.5")
853 (source (origin
854 (method git-fetch)
855 (uri (git-reference
856 (url "https://github.com/skywind3000/asyncrun.vim")
857 (commit version)))
858 (file-name (git-file-name name version))
859 (sha256
860 (base32
861 "02fiqf4rcrxbcgvj02mpd78wkxsrnbi54aciwh9fv5mnz5ka249m"))))
862 (build-system copy-build-system)
863 (arguments
864 '(#:install-plan
865 '(("plugin" "share/vim/vimfiles/")
866 ("doc/" "share/vim/vimfiles/doc" #:include ("asyncrun.txt")))))
867 (home-page "https://github.com/skywind3000/asyncrun.vim")
868 (synopsis "Run Async Shell Commands in Vim")
869 (description "This plugin takes the advantage of new APIs in Vim 8 (and
870 NeoVim) to enable you to run shell commands in background and read output in the
871 quickfix window in realtime.")
872 (license license:expat)))
873
874 (define-public vim-dispatch
875 (package
876 (name "vim-dispatch")
877 (version "1.8")
878 (source
879 (origin
880 (method git-fetch)
881 (uri (git-reference
882 (url "https://github.com/tpope/vim-dispatch")
883 (commit (string-append "v" version))))
884 (file-name (git-file-name name version))
885 (sha256
886 (base32
887 "1m8b5mn2zqlphzs6xfwykwmghf6p0wabrhpjmh7vav35jgcxc4wl"))))
888 (build-system copy-build-system)
889 (arguments
890 '(#:install-plan
891 '(("autoload" "share/vim/vimfiles/")
892 ("doc" "share/vim/vimfiles/")
893 ("plugin" "share/vim/vimfiles/"))))
894 (home-page "https://github.com/tpope/vim-dispatch")
895 (synopsis "Asynchronous build and test dispatcher")
896 (description "Leverage the power of Vim's compiler plugins without being
897 bound by synchronicity. Kick off builds and test suites using one of several
898 asynchronous adapters (including tmux, screen, and a headless mode), and when
899 the job completes, errors will be loaded and parsed automatically.")
900 (license license:vim)))
901
902 (define-public vim-eunuch
903 (let ((commit "33e875b31c8b811a0a47908884a5e2339106bbe8")
904 (revision "1"))
905 (package
906 (name "vim-eunuch")
907 (version (git-version "1.2" revision commit))
908 (source
909 (origin
910 (method git-fetch)
911 (uri (git-reference
912 (url "https://github.com/tpope/vim-eunuch")
913 (commit commit)))
914 (file-name (git-file-name name version))
915 (sha256
916 (base32
917 "1xadb22kd40swmww0qxmmkcpcq6viy8l167pjck5q32hfngll5d3"))))
918 (build-system copy-build-system)
919 (arguments
920 '(#:install-plan
921 '(("doc" "share/vim/vimfiles/")
922 ("plugin" "share/vim/vimfiles/"))))
923 (home-page "https://github.com/tpope/vim-eunuch")
924 (synopsis "Vim sugar for the UNIX shell commands")
925 (description "Vim sugar for the UNIX shell commands that need it the most.
926 This package includes commands such as @code{SudoWrite} and @code{SudoEdit} and
927 help working on Vim buffers and the files they reference with one command.")
928 (license license:vim))))