1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016, 2017 ng0 <ng0@no-reply.pragmatique.xyz>
5 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages vim)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix packages)
26 #:use-module (guix utils)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix build-system cmake)
30 #:use-module (guix build-system gnu)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages acl)
33 #:use-module (gnu packages admin) ; For GNU hostname
34 #:use-module (gnu packages attr)
35 #:use-module (gnu packages base)
36 #:use-module (gnu packages fontutils)
37 #:use-module (gnu packages gawk)
38 #:use-module (gnu packages gettext)
39 #:use-module (gnu packages glib)
40 #:use-module (gnu packages gperf)
41 #:use-module (gnu packages groff)
42 #:use-module (gnu packages gtk)
43 #:use-module (gnu packages image)
44 #:use-module (gnu packages jemalloc)
45 #:use-module (gnu packages libevent)
46 #:use-module (gnu packages linux)
47 #:use-module (gnu packages lua)
48 #:use-module (gnu packages ncurses)
49 #:use-module (gnu packages perl)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages ruby)
53 #:use-module (gnu packages serialization)
54 #:use-module (gnu packages shells)
55 #:use-module (gnu packages tcl)
56 #:use-module (gnu packages terminals)
57 #:use-module (gnu packages xdisorg)
58 #:use-module (gnu packages xorg))
66 (uri (string-append "https://github.com/vim/vim/archive/v"
68 (file-name (string-append name "-" version ".tar.gz"))
71 "0qq9pj8391sikzaahlqi289l5wdkbvsdhz8qb6np268yqizpg4p2"))))
72 (build-system gnu-build-system)
74 `(#:test-target "test"
77 (modify-phases %standard-phases
78 (add-after 'unpack 'make-bit-reproducable
80 (substitute* "src/version.c"
81 ((" VIM_VERSION_LONG_DATE") " VIM_VERSION_LONG")
85 (add-after 'configure 'patch-config-files
87 (substitute* "runtime/tools/mve.awk"
88 (("/usr/bin/nawk") (which "gawk")))
89 (substitute* '("src/testdir/Makefile"
90 "src/testdir/test_normal.vim")
91 (("/bin/sh") (which "sh")))
95 ("inetutils" ,inetutils)
98 ("tcsh" ,tcsh))) ; For runtime/tools/vim32
99 (home-page "http://www.vim.org/")
100 (synopsis "Text editor based on vi")
102 "Vim is a highly configurable text editor built to enable efficient text
103 editing. It is an improved version of the vi editor distributed with most UNIX
106 Vim is often called a \"programmer's editor,\" and so useful for programming
107 that many consider it an entire IDE. It's not just for programmers, though.
108 Vim is perfect for all kinds of text editing, from composing email to editing
109 configuration files.")
110 (license license:vim)))
112 (define-public vim-full
118 (list (string-append "--with-lua-prefix="
119 (assoc-ref %build-inputs "lua"))
120 "--with-features=huge"
121 "--enable-python3interp=yes"
122 "--enable-perlinterp=yes"
123 "--enable-rubyinterp=yes"
124 "--enable-tclinterp=yes"
125 "--enable-luainterp=yes"
132 ,@(substitute-keyword-arguments (package-arguments vim)
134 `(modify-phases ,phases
135 (add-after 'build 'drop-failing-tests
137 ;; These tests fail mysteriously with GUI enabled.
138 ;; https://github.com/vim/vim/issues/1460
139 (substitute* "src/testdir/test_cmdline.vim"
140 (("call assert_equal\\(.+getcmd.+\\(\\)\\)") ""))
142 (add-before 'check 'start-xserver
143 (lambda* (#:key inputs #:allow-other-keys)
144 ;; Some tests require an X server, but does not start one.
145 (let ((xorg-server (assoc-ref inputs "xorg-server"))
147 (setenv "DISPLAY" display)
148 (zero? (system (string-append xorg-server "/bin/Xvfb "
149 display " &")))))))))))
151 `(("pkg-config" ,pkg-config)
152 ("xorg-server" ,xorg-server)))
158 ("fontconfig" ,fontconfig)
159 ("freetype" ,freetype)
160 ("gdk-pixbuf" ,gdk-pixbuf)
161 ("gettext" ,gettext-minimal)
165 ("harfbuzz" ,harfbuzz)
170 ("libxdmcp" ,libxdmcp)
179 ,@(package-inputs vim)))))
181 (define-public vim-neocomplete
183 (name "vim-neocomplete")
188 (uri (string-append "https://github.com/Shougo/neocomplete.vim/"
189 "archive/ver." version ".tar.gz"))
190 (file-name (string-append name "-" version ".tar.gz"))
193 "1307gbrdwam2akq9w2lpijc41740i4layk2qkd9sjkqxfch5lni2"))))
194 (build-system gnu-build-system)
198 (modify-phases %standard-phases
202 (lambda* (#:key outputs #:allow-other-keys)
203 (let* ((out (assoc-ref outputs "out"))
204 (vimfiles (string-append out "/share/vim/vimfiles"))
205 (autoload (string-append vimfiles "/autoload"))
206 (doc (string-append vimfiles "/doc"))
207 (plugin (string-append vimfiles "/plugin")))
208 (copy-recursively "autoload" autoload)
209 (copy-recursively "doc" doc)
210 (copy-recursively "plugin" plugin)
212 (synopsis "Next generation completion framework for Vim")
214 "@code{neocomplete}, an abbreviation of 'neo-completion with cache',
216 It provides keyword completion system by maintaining a cache of keywords in
217 the current buffer. Neocomplete can be customized easily and has many more
218 features than Vim's built-in completion.")
219 (home-page "https://github.com/Shougo/neocomplete.vim/")
220 (license license:expat)))
222 ;; There are no release tarballs.
223 (define-public vim-neosnippet-snippets
224 (let ((commit "8e2b1c0cab9ed9a832b3743dbb65e9966a64331a")
227 (name "vim-neosnippet-snippets")
228 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
233 (url "https://github.com/Shougo/neosnippet-snippets")
235 (file-name (string-append name "-" version "-checkout"))
238 "151wpvbj6jb9jdkbhj3b77f5sq7y328spvwfbqyj1y32rg4ifmc6"))))
239 (build-system gnu-build-system)
243 (modify-phases %standard-phases
247 (lambda* (#:key outputs #:allow-other-keys)
248 (let* ((out (assoc-ref outputs "out"))
249 (vimfiles (string-append out "/share/vim/vimfiles")))
250 (copy-recursively "neosnippets"
251 (string-append vimfiles "/neosnippets"))
253 (synopsis "Snippets for neosnippet")
255 "@code{neosnippet-snippets} provides standard snippets for the Vim plugin
256 @code{neosnippet}. Snippets are small templates for commonly used code that
257 you can fill in on the fly.")
258 (home-page "https://github.com/Shougo/neosnippet-snippets")
259 (license license:expat))))
261 ;; The released tarball is too old for our Vim.
262 (define-public vim-neosnippet
263 (let ((commit "1bd7e23c79b73da16eb0c9469b25c376d3594583")
266 (name "vim-neosnippet")
267 (version (string-append "4.2-" revision "." (string-take commit 7)))
272 (url "https://github.com/Shougo/neosnippet.vim/")
274 (file-name (string-append name "-" version "-checkout"))
277 "0k80syscmpnj38ks1fq02ds59g0r4jlg9ll7z4qc048mgi35alw5"))))
278 (build-system gnu-build-system)
282 (modify-phases %standard-phases
286 (lambda* (#:key outputs #:allow-other-keys)
287 (let* ((out (assoc-ref outputs "out"))
288 (vimfiles (string-append out "/share/vim/vimfiles"))
289 (autoload (string-append vimfiles "/autoload"))
290 (doc (string-append vimfiles "/doc"))
291 (ftdetect (string-append vimfiles "/ftdetect"))
292 (ftplugin (string-append vimfiles "/ftplugin"))
293 (indent (string-append vimfiles "/indent"))
294 (plugin (string-append vimfiles "/plugin"))
295 (rplugin (string-append vimfiles "/rplugin"))
296 (syntax (string-append vimfiles "/syntax")))
297 (copy-recursively "autoload" autoload)
298 (copy-recursively "doc" doc)
299 (copy-recursively "ftdetect" ftdetect)
300 (copy-recursively "ftplugin" ftplugin)
301 (copy-recursively "indent" indent)
302 (copy-recursively "plugin" plugin)
303 (copy-recursively "rplugin" rplugin)
304 (copy-recursively "syntax" syntax)
306 (synopsis "Snippet support for Vim")
308 "@code{neosnippet}, is a plugin for Vim which adds snippet support to Vim.
309 Snippets are small templates for commonly used code that you can fill in on
310 the fly. To use snippets can increase your productivity in Vim a lot.
311 The functionality of this plug-in is quite similar to plug-ins like
312 @code{snipMate.vim} or @code{snippetsEmu.vim}. But since you can choose
313 snippets with the neocomplcache / neocomplete interface, you might have less
314 trouble using them, because you do not have to remember each snippet name.")
315 (home-page "https://github.com/Shougo/neosnippet.vim/")
316 (license license:expat))))
318 (define-public vim-scheme
319 (let ((commit "93827987c10f2d5dc519166a761f219204926d5f")
323 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
328 (url "http://git.foldling.org/vim-scheme.git")
330 (file-name (string-append name "-" version "-checkout"))
333 "1ynjr1109dxgj0lz261gmzz3wf5ap1m6j6hnvl3lcyv66a4y8pjv"))))
334 (build-system gnu-build-system)
338 (modify-phases %standard-phases
342 (lambda* (#:key outputs #:allow-other-keys)
343 (let* ((out (assoc-ref outputs "out"))
344 (vimfiles (string-append out "/share/vim/vimfiles"))
345 (after (string-append vimfiles "/after"))
346 (syntax (string-append vimfiles "/syntax"))
347 (ftplugin (string-append vimfiles "/ftplugin")))
348 (copy-recursively "after" after)
349 (copy-recursively "ftplugin" ftplugin)
350 (copy-recursively "syntax" syntax)
352 (synopsis "Scheme syntax for Vim")
354 "@code{vim-scheme} provides Scheme support for Vim (R7RS and CHICKEN).")
355 (home-page "http://foldling.org/git/vim-scheme.git/")
356 (license license:public-domain))))
358 (define-public vim-luna
359 (let ((commit "633619953dcf8577168e255230f96b05f28d6371")
363 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
368 (url "https://github.com/notpratheek/vim-luna")
370 (file-name (string-append name "-" version "-checkout"))
373 "0ka3qbhsh8lix1vyj4678j7dnchkd8khhirrnn3aylxxf8fpqyg8"))))
374 (build-system gnu-build-system)
378 (modify-phases %standard-phases
382 (lambda* (#:key outputs #:allow-other-keys)
383 (let* ((out (assoc-ref outputs "out"))
384 (vimfiles (string-append out "/share/vim/vimfiles"))
385 (colors (string-append vimfiles "/colors")))
386 (copy-recursively "colors" colors)
388 (synopsis "Dark color theme for Vim")
390 "@code{vim-luna} is a dark color theme for Vim.")
391 (home-page "https://github.com/notpratheek/vim-luna")
392 (license license:expat))))
394 ;; There are no tarball releases.
395 (define-public vim-context-filetype
396 (let ((commit "5e85f8cae26806f391aefe2661791a6de53bcea2")
399 (name "vim-context-filetype")
400 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
405 (url "https://github.com/Shougo/context_filetype.vim")
407 (file-name (string-append name "-" version "-checkout"))
410 "0alvrfhmd91zkd9h83s8wvgyq4iakcf6rybsyjd369qbgpcqky89"))))
411 (build-system gnu-build-system)
415 (modify-phases %standard-phases
419 (lambda* (#:key outputs #:allow-other-keys)
420 (let* ((out (assoc-ref outputs "out"))
421 (vimfiles (string-append out "/share/vim/vimfiles"))
422 (doc (string-append vimfiles "/doc"))
423 (autoload (string-append vimfiles "/autoload")))
424 (copy-recursively "doc" doc)
425 (copy-recursively "autoload" autoload)
427 (synopsis "Context filetype library for Vim")
429 "@code{vim-context-filetype} is context filetype library for Vim script.")
430 (home-page "https://github.com/Shougo/context_filetype.vim")
431 (license license:expat)))) ; ??? check again
433 (define-public vim-airline
440 (uri (string-append "https://github.com/vim-airline/vim-airline/"
441 "archive/v" version ".tar.gz"))
442 (file-name (string-append name "-" version ".tar.gz"))
445 "053sfq3jmgdc5y7zbg6jrk7r2hp0raj3y3mxa2h1c1bnkb6wvcaz"))))
446 (build-system gnu-build-system)
450 (modify-phases %standard-phases
454 (lambda* (#:key outputs #:allow-other-keys)
455 (let* ((out (assoc-ref outputs "out"))
456 (vimfiles (string-append out "/share/vim/vimfiles"))
457 (autoload (string-append vimfiles "/autoload"))
458 (doc (string-append vimfiles "/doc"))
459 (t (string-append vimfiles "/t"))
460 (plugin (string-append vimfiles "/plugin")))
461 (copy-recursively "autoload" autoload)
462 (copy-recursively "doc" doc)
463 (copy-recursively "plugin" plugin)
464 (copy-recursively "t" t)
466 (synopsis "Statusline for Vim")
468 "@code{vim-airline} is an extensible statusline for Vim.
469 It can be extended and costumized with themes, works with unicode fonts
470 and powerline symbols, etc.")
471 (home-page "https://github.com/vim-airline/vim-airline")
472 (license license:expat)))
474 ;; There are no tarball releases.
475 (define-public vim-airline-themes
476 (let ((commit "6026eb78bf362cb3aa875aff8487f65728d0f7d8")
479 (name "vim-airline-themes")
480 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
485 (url "https://github.com/vim-airline/vim-airline-themes")
487 (file-name (string-append name "-" version "-checkout"))
490 "13ijkavh1r0935cn2rjsfbdd1q3ka8bi26kw0bdkrqlrqxwvpss8"))))
491 (build-system gnu-build-system)
495 (modify-phases %standard-phases
499 (lambda* (#:key outputs #:allow-other-keys)
500 (let* ((out (assoc-ref outputs "out"))
501 (vimfiles (string-append out "/share/vim/vimfiles"))
502 (doc (string-append vimfiles "/doc"))
503 (plugin (string-append vimfiles "/plugin"))
504 (autoload (string-append vimfiles "/autoload")))
505 (copy-recursively "doc" doc)
506 (copy-recursively "autoload" autoload)
507 (copy-recursively "plugin" plugin)
509 (synopsis "Collection of themes for Vim-airline")
511 "@code{vim-airline-themes} is a collection of themes for @code{vim-airline}.")
512 (home-page "https://github.com/vim-airline/vim-airline-themes")
513 (license license:expat))))
515 (define-public vim-syntastic
517 (name "vim-syntastic")
522 (uri (string-append "https://github.com/vim-syntastic/syntastic/archive/"
524 (file-name (string-append name "-" version ".tar.gz"))
527 "0wsnd9bsp5x6yiw96h1bnd1vyxdkh130hb82kyyxydgsplx92ima"))))
528 (build-system gnu-build-system)
532 (modify-phases %standard-phases
536 (lambda* (#:key outputs #:allow-other-keys)
537 (let* ((out (assoc-ref outputs "out"))
538 (vimfiles (string-append out "/share/vim/vimfiles"))
539 (doc (string-append vimfiles "/doc"))
540 (plugin (string-append vimfiles "/plugin"))
541 (autoload (string-append vimfiles "/autoload"))
542 (syntax-checkers (string-append vimfiles "/syntax_checkers")))
543 (copy-recursively "doc" doc)
544 (copy-recursively "autoload" autoload)
545 (copy-recursively "plugin" plugin)
546 (copy-recursively "syntax_checkers" syntax-checkers)
548 (synopsis "Syntax checking plugin for Vim")
550 "Vim-syntastic is a syntax checking plugin for Vim. It runs files through
551 external syntax checkers and displays any resulting errors to the user. This
552 can be done on demand, or automatically as files are saved. If syntax errors
553 are detected, the user is notified.")
554 (home-page "https://github.com/vim-syntastic/syntastic")
555 (license license:wtfpl2)))
557 (define-public neovim-syntastic
559 (inherit vim-syntastic)
560 (name "neovim-syntastic")
564 (modify-phases %standard-phases
568 (lambda* (#:key outputs #:allow-other-keys)
569 (let* ((out (assoc-ref outputs "out"))
570 (vimfiles (string-append out "/share/nvim/site"))
571 (doc (string-append vimfiles "/doc"))
572 (plugin (string-append vimfiles "/plugin"))
573 (autoload (string-append vimfiles "/autoload"))
574 (syntax-checkers (string-append vimfiles "/syntax_checkers")))
575 (copy-recursively "doc" doc)
576 (copy-recursively "autoload" autoload)
577 (copy-recursively "plugin" plugin)
578 (copy-recursively "syntax_checkers" syntax-checkers)
580 (synopsis "Syntax checking plugin for Neovim")
582 "Vim-syntastic is a syntax checking plugin for Neovim. It runs files through
583 external syntax checkers and displays any resulting errors to the user. This
584 can be done on demand, or automatically as files are saved. If syntax errors
585 are detected, the user is notified.")))
587 (define-public neovim
594 (uri (string-append "https://github.com/neovim/neovim/"
595 "archive/v" version ".tar.gz"))
596 (file-name (string-append name "-" version ".tar.gz"))
599 "1db27zm6cldm1aw0570vii1bxc16a34x8lissl1h9rizsbwn7qkj"))))
600 (build-system cmake-build-system)
602 `(#:modules ((srfi srfi-26)
603 (guix build cmake-build-system)
606 (modify-phases %standard-phases
607 (add-after 'unpack 'set-lua-paths
608 (lambda* (#:key inputs #:allow-other-keys)
609 (let* ((lua-version "5.2")
612 (let ((path (string-append prefix "/lib/lua/" lua-version)))
613 (string-append path "/?.so;" path "/?/?.so"))))
616 (let ((path (string-append prefix "/share/lua/" lua-version)))
617 (string-append path "/?.lua;" path "/?/?.lua"))))
618 (lua-inputs (map (cute assoc-ref %build-inputs <>)
624 (string-join (map lua-path-spec lua-inputs) ";"))
626 (string-join (map lua-cpath-spec lua-inputs) ";"))
631 ("libtermkey" ,libtermkey)
632 ("libvterm" ,libvterm)
633 ("unibilium" ,unibilium)
634 ("jemalloc" ,jemalloc)
635 ("libiconv" ,libiconv)
637 ("lua-lpeg" ,lua5.2-lpeg)
638 ("lua-bitop" ,lua5.2-bitop)
639 ("lua-libmpack" ,lua5.2-libmpack)))
641 `(("pkg-config" ,pkg-config)
642 ("gettext" ,gettext-minimal)
644 (home-page "http://neovim.io")
645 (synopsis "Fork of vim focused on extensibility and agility")
646 (description "Neovim is a project that seeks to aggressively
647 refactor Vim in order to:
650 @item Simplify maintenance and encourage contributions
651 @item Split the work between multiple developers
652 @item Enable advanced external UIs without modifications to the core
653 @item Improve extensibility with a new plugin architecture
655 ;; Neovim is licensed under the terms of the Apache 2.0 license,
656 ;; except for parts that were contributed under the Vim license.
657 (license (list license:asl2.0 license:vim))))
666 (uri (string-append "mirror://sourceforge/vifm/vifm/vifm-"
670 "07r15kq7kjl3a41sd11ncpsii866xxps4f90zh3lv8jqcrv6silb"))))
671 (build-system gnu-build-system)
674 (modify-phases %standard-phases
675 (add-after 'patch-source-shebangs 'patch-test-shebangs
677 (substitute* (find-files "tests" "\\.c$")
678 (("/bin/sh") (which "sh")))
681 `(("groff" ,groff) ; for the documentation
685 ("ncurses" ,ncurses)))
686 (home-page "http://vifm.info/")
687 (synopsis "Flexible vi-like file manager using ncurses")
688 (description "Vifm is a file manager providing a @command{vi}-like usage
689 experience. It has similar keybindings and modes (e.g. normal, command line,
690 visual). The interface uses ncurses, thus vifm can be used in text-only
691 environments. It supports a wide range of features, some of which are known
692 from the @command{vi}-editor:
695 @item user mappings (almost like in @code{vi})
696 @item ranges in command
698 @item user defined commands (with support for ranges)
700 @item operation undoing/redoing
701 @item fuse file systems support
703 @item multiple files renaming
704 @item support of filename modifiers
705 @item colorschemes support
706 @item file name color according to file type
707 @item path specific colorscheme customization
709 @item operation backgrounding
710 @item customizable file viewers
711 @item handy @code{less}-like preview mode
712 @item filtering out and searching for files using regular expressions
713 @item one or two panes view
715 With the package comes a plugin to use vifm as a vim file selector.")
716 (license license:gpl2+)))