vim.scm 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
  3. ;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
  4. ;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
  5. ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
  6. ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
  7. ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
  8. ;;;
  9. ;;; This file is part of GNU Guix.
  10. ;;;
  11. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  12. ;;; under the terms of the GNU General Public License as published by
  13. ;;; the Free Software Foundation; either version 3 of the License, or (at
  14. ;;; your option) any later version.
  15. ;;;
  16. ;;; GNU Guix is distributed in the hope that it will be useful, but
  17. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. ;;; GNU General Public License for more details.
  20. ;;;
  21. ;;; You should have received a copy of the GNU General Public License
  22. ;;; 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 autotools)
  36. #:use-module (gnu packages base)
  37. #:use-module (gnu packages fontutils)
  38. #:use-module (gnu packages gawk)
  39. #:use-module (gnu packages gettext)
  40. #:use-module (gnu packages glib)
  41. #:use-module (gnu packages gperf)
  42. #:use-module (gnu packages groff)
  43. #:use-module (gnu packages gtk)
  44. #:use-module (gnu packages image)
  45. #:use-module (gnu packages jemalloc)
  46. #:use-module (gnu packages libevent)
  47. #:use-module (gnu packages linux)
  48. #:use-module (gnu packages lua)
  49. #:use-module (gnu packages ncurses)
  50. #:use-module (gnu packages perl)
  51. #:use-module (gnu packages pkg-config)
  52. #:use-module (gnu packages python)
  53. #:use-module (gnu packages ruby)
  54. #:use-module (gnu packages serialization)
  55. #:use-module (gnu packages shells)
  56. #:use-module (gnu packages tcl)
  57. #:use-module (gnu packages terminals)
  58. #:use-module (gnu packages xdisorg)
  59. #:use-module (gnu packages xorg))
  60. (define-public vim
  61. (package
  62. (name "vim")
  63. (version "8.1.0644")
  64. (source (origin
  65. (method git-fetch)
  66. (uri (git-reference
  67. (url "https://github.com/vim/vim")
  68. (commit (string-append "v" version))))
  69. (file-name (git-file-name name version))
  70. (sha256
  71. (base32
  72. "1xksb2v8rw1zgrd5fwqvrh44lf277k85sad2y4ia1z17y7i8j2fl"))))
  73. (build-system gnu-build-system)
  74. (arguments
  75. `(#:test-target "test"
  76. #:parallel-tests? #f
  77. #:phases
  78. (modify-phases %standard-phases
  79. (add-after 'configure 'patch-config-files
  80. (lambda _
  81. (substitute* "runtime/tools/mve.awk"
  82. (("/usr/bin/nawk") (which "gawk")))
  83. (substitute* '("src/testdir/Makefile"
  84. "src/testdir/test_normal.vim"
  85. "src/testdir/test_terminal.vim")
  86. (("/bin/sh") (which "sh")))
  87. #t))
  88. (add-before 'check 'patch-failing-tests
  89. (lambda _
  90. ;; XXX A single test fails with “Can't create file /dev/stdout” (at
  91. ;; Test_writefile_sync_dev_stdout line 5) while /dev/stdout exists.
  92. (substitute* "src/testdir/test_writefile.vim"
  93. (("/dev/stdout") "a-regular-file"))
  94. ;; XXX: This test fails when run in the build container:
  95. ;; <https://github.com/vim/vim/issues/3348>.
  96. (substitute* "src/testdir/test_search.vim"
  97. ((".*'Test_incsearch_substitute_03'.*" all)
  98. (string-append "\"" all "\n")))
  99. #t)))))
  100. (inputs
  101. `(("gawk" ,gawk)
  102. ("ncurses" ,ncurses)
  103. ("perl" ,perl)
  104. ("tcsh" ,tcsh))) ; For runtime/tools/vim32
  105. (native-inputs
  106. `(("libtool" ,libtool)))
  107. (home-page "https://www.vim.org/")
  108. (synopsis "Text editor based on vi")
  109. (description
  110. "Vim is a highly configurable text editor built to enable efficient text
  111. editing. It is an improved version of the vi editor distributed with most UNIX
  112. systems.
  113. Vim is often called a \"programmer's editor,\" and so useful for programming
  114. that many consider it an entire IDE. It's not just for programmers, though.
  115. Vim is perfect for all kinds of text editing, from composing email to editing
  116. configuration files.")
  117. (license license:vim)))
  118. (define-public xxd
  119. (package (inherit vim)
  120. (name "xxd")
  121. (arguments
  122. `(#:make-flags '("CC=gcc")
  123. #:tests? #f ; there are none
  124. #:phases
  125. (modify-phases %standard-phases
  126. (delete 'configure)
  127. (add-after 'unpack 'chdir
  128. (lambda _
  129. (chdir "src/xxd")
  130. #t))
  131. (replace 'install
  132. (lambda* (#:key outputs #:allow-other-keys)
  133. (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
  134. (install-file "xxd" bin)
  135. #t))))))
  136. (inputs `())
  137. (native-inputs `())
  138. (synopsis "Hexdump utility from vim")
  139. (description "This package provides the Hexdump utility xxd that comes
  140. with the editor vim.")))
  141. (define-public vim-full
  142. (package
  143. ;; This package should share its source with Vim, but it doesn't
  144. ;; build reliably, and we want to keep Vim up to date due to the
  145. ;; frequency of important bug fixes.
  146. (inherit vim)
  147. (name "vim-full")
  148. (arguments
  149. `(#:configure-flags
  150. (list (string-append "--with-lua-prefix="
  151. (assoc-ref %build-inputs "lua"))
  152. "--with-features=huge"
  153. "--enable-python3interp=yes"
  154. "--enable-perlinterp=yes"
  155. "--enable-rubyinterp=yes"
  156. "--enable-tclinterp=yes"
  157. "--enable-luainterp=yes"
  158. "--enable-cscope"
  159. "--enable-sniff"
  160. "--enable-multibyte"
  161. "--enable-xim"
  162. "--disable-selinux"
  163. "--enable-gui")
  164. ,@(substitute-keyword-arguments (package-arguments vim)
  165. ((#:phases phases)
  166. `(modify-phases ,phases
  167. (add-before 'check 'skip-test87
  168. ;; This test fails for unknown reasons after switching
  169. ;; to a git checkout.
  170. (lambda _
  171. (delete-file "src/testdir/test87.ok")
  172. (delete-file "src/testdir/test87.in")
  173. (substitute* '("src/Makefile"
  174. "src/testdir/Make_vms.mms")
  175. (("test87") ""))
  176. (substitute* "src/testdir/Make_all.mak"
  177. (("test86.out \\\\") "test86")
  178. (("test87.out") ""))
  179. #t))
  180. (add-before 'check 'start-xserver
  181. (lambda* (#:key inputs #:allow-other-keys)
  182. ;; Some tests require an X server, but does not start one.
  183. (let ((xorg-server (assoc-ref inputs "xorg-server"))
  184. (display ":1"))
  185. (setenv "DISPLAY" display)
  186. (zero? (system (string-append xorg-server "/bin/Xvfb "
  187. display " &")))))))))))
  188. (native-inputs
  189. `(("pkg-config" ,pkg-config)
  190. ("xorg-server" ,xorg-server)
  191. ,@(package-native-inputs vim)))
  192. (inputs
  193. `(("acl" ,acl)
  194. ("atk" ,atk)
  195. ("attr" ,attr)
  196. ("cairo" ,cairo)
  197. ("fontconfig" ,fontconfig)
  198. ("freetype" ,freetype)
  199. ("gdk-pixbuf" ,gdk-pixbuf)
  200. ("gettext" ,gettext-minimal)
  201. ("glib" ,glib)
  202. ("gpm" ,gpm)
  203. ("gtk" ,gtk+-2)
  204. ("harfbuzz" ,harfbuzz)
  205. ("libice" ,libice)
  206. ("libpng" ,libpng)
  207. ("libsm" ,libsm)
  208. ("libx11" ,libx11)
  209. ("libxdmcp" ,libxdmcp)
  210. ("libxt" ,libxt)
  211. ("libxpm" ,libxpm)
  212. ("lua" ,lua)
  213. ("pango" ,pango)
  214. ("pixman" ,pixman)
  215. ("python-3" ,python)
  216. ("ruby" ,ruby)
  217. ("tcl" ,tcl)
  218. ,@(package-inputs vim)))))
  219. (define-public vim-neocomplete
  220. (package
  221. (name "vim-neocomplete")
  222. (version "2.1")
  223. (source
  224. (origin
  225. (method url-fetch)
  226. (uri (string-append "https://github.com/Shougo/neocomplete.vim/"
  227. "archive/ver." version ".tar.gz"))
  228. (file-name (string-append name "-" version ".tar.gz"))
  229. (sha256
  230. (base32
  231. "1307gbrdwam2akq9w2lpijc41740i4layk2qkd9sjkqxfch5lni2"))))
  232. (build-system gnu-build-system)
  233. (arguments
  234. `(#:tests? #f
  235. #:phases
  236. (modify-phases %standard-phases
  237. (delete 'configure)
  238. (delete 'build)
  239. (replace 'install
  240. (lambda* (#:key outputs #:allow-other-keys)
  241. (let* ((out (assoc-ref outputs "out"))
  242. (vimfiles (string-append out "/share/vim/vimfiles"))
  243. (autoload (string-append vimfiles "/autoload"))
  244. (doc (string-append vimfiles "/doc"))
  245. (plugin (string-append vimfiles "/plugin")))
  246. (copy-recursively "autoload" autoload)
  247. (copy-recursively "doc" doc)
  248. (copy-recursively "plugin" plugin)
  249. #t))))))
  250. (synopsis "Next generation completion framework for Vim")
  251. (description
  252. "@code{neocomplete}, an abbreviation of 'neo-completion with cache',
  253. is a plugin for Vim.
  254. It provides keyword completion system by maintaining a cache of keywords in
  255. the current buffer. Neocomplete can be customized easily and has many more
  256. features than Vim's built-in completion.")
  257. (home-page "https://github.com/Shougo/neocomplete.vim/")
  258. (license license:expat)))
  259. ;; There are no release tarballs.
  260. (define-public vim-neosnippet-snippets
  261. (let ((commit "8e2b1c0cab9ed9a832b3743dbb65e9966a64331a")
  262. (revision "1"))
  263. (package
  264. (name "vim-neosnippet-snippets")
  265. (version (string-append "0.0.0-" revision "." (string-take commit 7)))
  266. (source
  267. (origin
  268. (method git-fetch)
  269. (uri (git-reference
  270. (url "https://github.com/Shougo/neosnippet-snippets")
  271. (commit commit)))
  272. (file-name (string-append name "-" version "-checkout"))
  273. (sha256
  274. (base32
  275. "151wpvbj6jb9jdkbhj3b77f5sq7y328spvwfbqyj1y32rg4ifmc6"))))
  276. (build-system gnu-build-system)
  277. (arguments
  278. `(#:tests? #f
  279. #:phases
  280. (modify-phases %standard-phases
  281. (delete 'configure)
  282. (delete 'build)
  283. (replace 'install
  284. (lambda* (#:key outputs #:allow-other-keys)
  285. (let* ((out (assoc-ref outputs "out"))
  286. (vimfiles (string-append out "/share/vim/vimfiles")))
  287. (copy-recursively "neosnippets"
  288. (string-append vimfiles "/neosnippets"))
  289. #t))))))
  290. (synopsis "Snippets for neosnippet")
  291. (description
  292. "@code{neosnippet-snippets} provides standard snippets for the Vim plugin
  293. @code{neosnippet}. Snippets are small templates for commonly used code that
  294. you can fill in on the fly.")
  295. (home-page "https://github.com/Shougo/neosnippet-snippets")
  296. (license license:expat))))
  297. ;; The released tarball is too old for our Vim.
  298. (define-public vim-neosnippet
  299. (let ((commit "1bd7e23c79b73da16eb0c9469b25c376d3594583")
  300. (revision "1"))
  301. (package
  302. (name "vim-neosnippet")
  303. (version (string-append "4.2-" revision "." (string-take commit 7)))
  304. (source
  305. (origin
  306. (method git-fetch)
  307. (uri (git-reference
  308. (url "https://github.com/Shougo/neosnippet.vim/")
  309. (commit commit)))
  310. (file-name (string-append name "-" version "-checkout"))
  311. (sha256
  312. (base32
  313. "0k80syscmpnj38ks1fq02ds59g0r4jlg9ll7z4qc048mgi35alw5"))))
  314. (build-system gnu-build-system)
  315. (arguments
  316. `(#:tests? #f
  317. #:phases
  318. (modify-phases %standard-phases
  319. (delete 'configure)
  320. (delete 'build)
  321. (replace 'install
  322. (lambda* (#:key outputs #:allow-other-keys)
  323. (let* ((out (assoc-ref outputs "out"))
  324. (vimfiles (string-append out "/share/vim/vimfiles"))
  325. (autoload (string-append vimfiles "/autoload"))
  326. (doc (string-append vimfiles "/doc"))
  327. (ftdetect (string-append vimfiles "/ftdetect"))
  328. (ftplugin (string-append vimfiles "/ftplugin"))
  329. (indent (string-append vimfiles "/indent"))
  330. (plugin (string-append vimfiles "/plugin"))
  331. (rplugin (string-append vimfiles "/rplugin"))
  332. (syntax (string-append vimfiles "/syntax")))
  333. (copy-recursively "autoload" autoload)
  334. (copy-recursively "doc" doc)
  335. (copy-recursively "ftdetect" ftdetect)
  336. (copy-recursively "ftplugin" ftplugin)
  337. (copy-recursively "indent" indent)
  338. (copy-recursively "plugin" plugin)
  339. (copy-recursively "rplugin" rplugin)
  340. (copy-recursively "syntax" syntax)
  341. #t))))))
  342. (synopsis "Snippet support for Vim")
  343. (description
  344. "@code{neosnippet}, is a plugin for Vim which adds snippet support to Vim.
  345. Snippets are small templates for commonly used code that you can fill in on
  346. the fly. To use snippets can increase your productivity in Vim a lot.
  347. The functionality of this plug-in is quite similar to plug-ins like
  348. @code{snipMate.vim} or @code{snippetsEmu.vim}. But since you can choose
  349. snippets with the neocomplcache / neocomplete interface, you might have less
  350. trouble using them, because you do not have to remember each snippet name.")
  351. (home-page "https://github.com/Shougo/neosnippet.vim/")
  352. (license license:expat))))
  353. (define-public vim-scheme
  354. (let ((commit "93827987c10f2d5dc519166a761f219204926d5f")
  355. (revision "1"))
  356. (package
  357. (name "vim-scheme")
  358. (version (string-append "0.0.0-" revision "." (string-take commit 7)))
  359. (source
  360. (origin
  361. (method git-fetch)
  362. (uri (git-reference
  363. (url "http://git.foldling.org/vim-scheme.git")
  364. (commit commit)))
  365. (file-name (string-append name "-" version "-checkout"))
  366. (sha256
  367. (base32
  368. "1ynjr1109dxgj0lz261gmzz3wf5ap1m6j6hnvl3lcyv66a4y8pjv"))))
  369. (build-system gnu-build-system)
  370. (arguments
  371. `(#:tests? #f
  372. #:phases
  373. (modify-phases %standard-phases
  374. (delete 'configure)
  375. (delete 'build)
  376. (replace 'install
  377. (lambda* (#:key outputs #:allow-other-keys)
  378. (let* ((out (assoc-ref outputs "out"))
  379. (vimfiles (string-append out "/share/vim/vimfiles"))
  380. (after (string-append vimfiles "/after"))
  381. (syntax (string-append vimfiles "/syntax"))
  382. (ftplugin (string-append vimfiles "/ftplugin")))
  383. (copy-recursively "after" after)
  384. (copy-recursively "ftplugin" ftplugin)
  385. (copy-recursively "syntax" syntax)
  386. #t))))))
  387. (synopsis "Scheme syntax for Vim")
  388. (description
  389. "@code{vim-scheme} provides Scheme support for Vim (R7RS and CHICKEN).")
  390. (home-page "http://foldling.org/git/vim-scheme.git/")
  391. (license license:public-domain))))
  392. (define-public vim-luna
  393. (let ((commit "633619953dcf8577168e255230f96b05f28d6371")
  394. (revision "1"))
  395. (package
  396. (name "vim-luna")
  397. (version (string-append "0.0.0-" revision "." (string-take commit 7)))
  398. (source
  399. (origin
  400. (method git-fetch)
  401. (uri (git-reference
  402. (url "https://github.com/notpratheek/vim-luna")
  403. (commit commit)))
  404. (file-name (string-append name "-" version "-checkout"))
  405. (sha256
  406. (base32
  407. "0ka3qbhsh8lix1vyj4678j7dnchkd8khhirrnn3aylxxf8fpqyg8"))))
  408. (build-system gnu-build-system)
  409. (arguments
  410. `(#:tests? #f
  411. #:phases
  412. (modify-phases %standard-phases
  413. (delete 'configure)
  414. (delete 'build)
  415. (replace 'install
  416. (lambda* (#:key outputs #:allow-other-keys)
  417. (let* ((out (assoc-ref outputs "out"))
  418. (vimfiles (string-append out "/share/vim/vimfiles"))
  419. (colors (string-append vimfiles "/colors")))
  420. (copy-recursively "colors" colors)
  421. #t))))))
  422. (synopsis "Dark color theme for Vim")
  423. (description
  424. "@code{vim-luna} is a dark color theme for Vim.")
  425. (home-page "https://github.com/notpratheek/vim-luna")
  426. (license license:expat))))
  427. ;; There are no tarball releases.
  428. (define-public vim-context-filetype
  429. (let ((commit "5e85f8cae26806f391aefe2661791a6de53bcea2")
  430. (revision "1"))
  431. (package
  432. (name "vim-context-filetype")
  433. (version (string-append "0.0.0-" revision "." (string-take commit 7)))
  434. (source
  435. (origin
  436. (method git-fetch)
  437. (uri (git-reference
  438. (url "https://github.com/Shougo/context_filetype.vim")
  439. (commit commit)))
  440. (file-name (string-append name "-" version "-checkout"))
  441. (sha256
  442. (base32
  443. "0alvrfhmd91zkd9h83s8wvgyq4iakcf6rybsyjd369qbgpcqky89"))))
  444. (build-system gnu-build-system)
  445. (arguments
  446. `(#:tests? #f
  447. #:phases
  448. (modify-phases %standard-phases
  449. (delete 'configure)
  450. (delete 'build)
  451. (replace 'install
  452. (lambda* (#:key outputs #:allow-other-keys)
  453. (let* ((out (assoc-ref outputs "out"))
  454. (vimfiles (string-append out "/share/vim/vimfiles"))
  455. (doc (string-append vimfiles "/doc"))
  456. (autoload (string-append vimfiles "/autoload")))
  457. (copy-recursively "doc" doc)
  458. (copy-recursively "autoload" autoload)
  459. #t))))))
  460. (synopsis "Context filetype library for Vim")
  461. (description
  462. "@code{vim-context-filetype} is context filetype library for Vim script.")
  463. (home-page "https://github.com/Shougo/context_filetype.vim")
  464. (license license:expat)))) ; ??? check again
  465. (define-public vim-fugitive
  466. (package
  467. (name "vim-fugitive")
  468. (version "2.5")
  469. (source
  470. (origin
  471. (method git-fetch)
  472. (uri (git-reference
  473. (url "https://github.com/tpope/vim-fugitive.git")
  474. (commit (string-append "v" version))))
  475. (file-name (git-file-name name version))
  476. (sha256
  477. (base32
  478. "17yz7gxn7a49jzndr4z5vnk1y4a6c22qss3mwxzmq4m46fni0k8q"))))
  479. (build-system gnu-build-system)
  480. (arguments
  481. '(#:tests? #f
  482. #:phases
  483. (modify-phases %standard-phases
  484. (delete 'configure)
  485. (delete 'build)
  486. (replace 'install
  487. (lambda* (#:key outputs #:allow-other-keys)
  488. (let* ((out (assoc-ref outputs "out"))
  489. (vimfiles (string-append out "/share/vim/vimfiles"))
  490. (autoload (string-append vimfiles "/autoload"))
  491. (doc (string-append vimfiles "/doc"))
  492. (ftdetect (string-append vimfiles "/ftdetect"))
  493. (plugin (string-append vimfiles "/plugin")))
  494. (copy-recursively "autoload" autoload)
  495. (copy-recursively "doc" doc)
  496. (copy-recursively "ftdetect" ftdetect)
  497. (copy-recursively "plugin" plugin)
  498. #t))))))
  499. (home-page "https://github.com/tpope/vim-fugitive")
  500. (synopsis "Vim plugin to work with Git")
  501. (description "Vim-fugitive is a wrapper for Vim that complements the
  502. command window, where you can stage and review your changes before the next
  503. commit or run any Git arbitrary command.")
  504. (license license:vim))) ; distributed under the same license as vim
  505. (define-public vim-airline
  506. (package
  507. (name "vim-airline")
  508. (version "0.10")
  509. (source
  510. (origin
  511. (method git-fetch)
  512. (uri (git-reference
  513. (url "https://github.com/vim-airline/vim-airline")
  514. (commit (string-append "v" version))))
  515. (file-name (git-file-name name version))
  516. (sha256
  517. (base32
  518. "0k3c6p3xy6514n1n347ci4q9xjm9wwqirpdysam6f7r39crgmfhd"))))
  519. (build-system gnu-build-system)
  520. (arguments
  521. `(#:tests? #f
  522. #:phases
  523. (modify-phases %standard-phases
  524. (delete 'configure)
  525. (delete 'build)
  526. (replace 'install
  527. (lambda* (#:key outputs #:allow-other-keys)
  528. (let* ((out (assoc-ref outputs "out"))
  529. (vimfiles (string-append out "/share/vim/vimfiles"))
  530. (autoload (string-append vimfiles "/autoload"))
  531. (doc (string-append vimfiles "/doc"))
  532. (t (string-append vimfiles "/t"))
  533. (plugin (string-append vimfiles "/plugin")))
  534. (copy-recursively "autoload" autoload)
  535. (copy-recursively "doc" doc)
  536. (copy-recursively "plugin" plugin)
  537. (copy-recursively "t" t)
  538. #t))))))
  539. (synopsis "Statusline for Vim")
  540. (description
  541. "@code{vim-airline} is an extensible statusline for Vim.
  542. It can be extended and costumized with themes, works with unicode fonts
  543. and powerline symbols, etc.")
  544. (home-page "https://github.com/vim-airline/vim-airline")
  545. (license license:expat)))
  546. ;; There are no tarball releases.
  547. (define-public vim-airline-themes
  548. (let ((commit "6026eb78bf362cb3aa875aff8487f65728d0f7d8")
  549. (revision "1"))
  550. (package
  551. (name "vim-airline-themes")
  552. (version (string-append "0.0.0-" revision "." (string-take commit 7)))
  553. (source
  554. (origin
  555. (method git-fetch)
  556. (uri (git-reference
  557. (url "https://github.com/vim-airline/vim-airline-themes")
  558. (commit commit)))
  559. (file-name (string-append name "-" version "-checkout"))
  560. (sha256
  561. (base32
  562. "13ijkavh1r0935cn2rjsfbdd1q3ka8bi26kw0bdkrqlrqxwvpss8"))))
  563. (build-system gnu-build-system)
  564. (arguments
  565. `(#:tests? #f
  566. #:phases
  567. (modify-phases %standard-phases
  568. (delete 'configure)
  569. (delete 'build)
  570. (replace 'install
  571. (lambda* (#:key outputs #:allow-other-keys)
  572. (let* ((out (assoc-ref outputs "out"))
  573. (vimfiles (string-append out "/share/vim/vimfiles"))
  574. (doc (string-append vimfiles "/doc"))
  575. (plugin (string-append vimfiles "/plugin"))
  576. (autoload (string-append vimfiles "/autoload")))
  577. (copy-recursively "doc" doc)
  578. (copy-recursively "autoload" autoload)
  579. (copy-recursively "plugin" plugin)
  580. #t))))))
  581. (synopsis "Collection of themes for Vim-airline")
  582. (description
  583. "@code{vim-airline-themes} is a collection of themes for @code{vim-airline}.")
  584. (home-page "https://github.com/vim-airline/vim-airline-themes")
  585. (license license:expat))))
  586. (define-public vim-syntastic
  587. (package
  588. (name "vim-syntastic")
  589. (version "3.9.0")
  590. (source
  591. (origin
  592. (method git-fetch)
  593. (uri (git-reference
  594. (url "https://github.com/vim-syntastic/syntastic")
  595. (commit version)))
  596. (file-name (git-file-name name version))
  597. (sha256
  598. (base32
  599. "121a1mxgfng2y5zmivyyk02mca8pyw72crivf4f1q9nhn0barf57"))))
  600. (build-system gnu-build-system)
  601. (arguments
  602. `(#:tests? #f
  603. #:phases
  604. (modify-phases %standard-phases
  605. (delete 'configure)
  606. (delete 'build)
  607. (replace 'install
  608. (lambda* (#:key outputs #:allow-other-keys)
  609. (let* ((out (assoc-ref outputs "out"))
  610. (vimfiles (string-append out "/share/vim/vimfiles"))
  611. (doc (string-append vimfiles "/doc"))
  612. (plugin (string-append vimfiles "/plugin"))
  613. (autoload (string-append vimfiles "/autoload"))
  614. (syntax-checkers (string-append vimfiles "/syntax_checkers")))
  615. (copy-recursively "doc" doc)
  616. (copy-recursively "autoload" autoload)
  617. (copy-recursively "plugin" plugin)
  618. (copy-recursively "syntax_checkers" syntax-checkers)
  619. #t))))))
  620. (synopsis "Syntax checking plugin for Vim")
  621. (description
  622. "Vim-syntastic is a syntax checking plugin for Vim. It runs files through
  623. external syntax checkers and displays any resulting errors to the user. This
  624. can be done on demand, or automatically as files are saved. If syntax errors
  625. are detected, the user is notified.")
  626. (home-page "https://github.com/vim-syntastic/syntastic")
  627. (license license:wtfpl2)))
  628. (define-public neovim-syntastic
  629. (package
  630. (inherit vim-syntastic)
  631. (name "neovim-syntastic")
  632. (arguments
  633. `(#:tests? #f
  634. #:phases
  635. (modify-phases %standard-phases
  636. (delete 'configure)
  637. (delete 'build)
  638. (replace 'install
  639. (lambda* (#:key outputs #:allow-other-keys)
  640. (let* ((out (assoc-ref outputs "out"))
  641. (vimfiles (string-append out "/share/nvim/site"))
  642. (doc (string-append vimfiles "/doc"))
  643. (plugin (string-append vimfiles "/plugin"))
  644. (autoload (string-append vimfiles "/autoload"))
  645. (syntax-checkers (string-append vimfiles "/syntax_checkers")))
  646. (copy-recursively "doc" doc)
  647. (copy-recursively "autoload" autoload)
  648. (copy-recursively "plugin" plugin)
  649. (copy-recursively "syntax_checkers" syntax-checkers)
  650. #t))))))
  651. (synopsis "Syntax checking plugin for Neovim")
  652. (description
  653. "Vim-syntastic is a syntax checking plugin for Neovim. It runs files through
  654. external syntax checkers and displays any resulting errors to the user. This
  655. can be done on demand, or automatically as files are saved. If syntax errors
  656. are detected, the user is notified.")))
  657. (define-public neovim
  658. (package
  659. (name "neovim")
  660. (version "0.3.4")
  661. (source
  662. (origin
  663. (method url-fetch)
  664. (uri (string-append "https://github.com/neovim/neovim/"
  665. "archive/v" version ".tar.gz"))
  666. (file-name (string-append name "-" version ".tar.gz"))
  667. (sha256
  668. (base32
  669. "03mwfhr9rq86p8lypbdfyl7c7xyn6nzv2ipd8jc33bxzvs5i0hd6"))))
  670. (build-system cmake-build-system)
  671. (arguments
  672. `(#:modules ((srfi srfi-26)
  673. (guix build cmake-build-system)
  674. (guix build utils))
  675. #:configure-flags '("-DPREFER_LUA:BOOL=YES")
  676. #:phases
  677. (modify-phases %standard-phases
  678. (add-after 'unpack 'set-lua-paths
  679. (lambda* (#:key inputs #:allow-other-keys)
  680. (let* ((lua-version "5.2")
  681. (lua-cpath-spec
  682. (lambda (prefix)
  683. (let ((path (string-append prefix "/lib/lua/" lua-version)))
  684. (string-append path "/?.so;" path "/?/?.so"))))
  685. (lua-path-spec
  686. (lambda (prefix)
  687. (let ((path (string-append prefix "/share/lua/" lua-version)))
  688. (string-append path "/?.lua;" path "/?/?.lua"))))
  689. (lua-inputs (map (cute assoc-ref %build-inputs <>)
  690. '("lua"
  691. "lua-lpeg"
  692. "lua-bitop"
  693. "lua-libmpack"))))
  694. (setenv "LUA_PATH"
  695. (string-join (map lua-path-spec lua-inputs) ";"))
  696. (setenv "LUA_CPATH"
  697. (string-join (map lua-cpath-spec lua-inputs) ";"))
  698. #t))))))
  699. (inputs
  700. `(("libuv" ,libuv)
  701. ("msgpack" ,msgpack)
  702. ("libtermkey" ,libtermkey)
  703. ("libvterm" ,libvterm)
  704. ("unibilium" ,unibilium)
  705. ("jemalloc" ,jemalloc)
  706. ("libiconv" ,libiconv)
  707. ("lua" ,lua-5.2)
  708. ("lua-lpeg" ,lua5.2-lpeg)
  709. ("lua-bitop" ,lua5.2-bitop)
  710. ("lua-libmpack" ,lua5.2-libmpack)))
  711. (native-inputs
  712. `(("pkg-config" ,pkg-config)
  713. ("gettext" ,gettext-minimal)
  714. ("gperf" ,gperf)))
  715. (home-page "https://neovim.io")
  716. (synopsis "Fork of vim focused on extensibility and agility")
  717. (description "Neovim is a project that seeks to aggressively
  718. refactor Vim in order to:
  719. @itemize
  720. @item Simplify maintenance and encourage contributions
  721. @item Split the work between multiple developers
  722. @item Enable advanced external UIs without modifications to the core
  723. @item Improve extensibility with a new plugin architecture
  724. @end itemize\n")
  725. ;; Neovim is licensed under the terms of the Apache 2.0 license,
  726. ;; except for parts that were contributed under the Vim license.
  727. (license (list license:asl2.0 license:vim))))
  728. (define-public vifm
  729. (package
  730. (name "vifm")
  731. (version "0.10")
  732. (source
  733. (origin
  734. (method url-fetch)
  735. (uri (list
  736. (string-append "https://github.com/vifm/vifm/releases/download/v"
  737. version "/vifm-" version ".tar.bz2")
  738. (string-append "https://sourceforge.net/projects/vifm/files/vifm/"
  739. "vifm-" version ".tar.bz2")))
  740. (sha256
  741. (base32
  742. "1f380xcyjnm4xmcdazs6dj064bwddhywvn3mgm36k7r7b2gnjnp0"))))
  743. (build-system gnu-build-system)
  744. (arguments
  745. '(#:configure-flags '("--disable-build-timestamp")
  746. #:phases
  747. (modify-phases %standard-phases
  748. (add-after 'patch-source-shebangs 'patch-test-shebangs
  749. (lambda _
  750. (substitute* (cons* "src/background.c"
  751. "src/cfg/config.c"
  752. (find-files "tests" "\\.c$"))
  753. (("/bin/sh") (which "sh"))
  754. (("/bin/bash") (which "bash")))
  755. ;; This test segfaults
  756. (substitute* "tests/Makefile"
  757. (("misc") ""))
  758. #t))
  759. (add-after 'install 'install-vim-plugin-files
  760. (lambda* (#:key outputs #:allow-other-keys)
  761. (let* ((out (assoc-ref outputs "out"))
  762. (vifm (string-append out "/share/vifm"))
  763. (vimfiles (string-append out "/share/vim/vimfiles")))
  764. (copy-recursively (string-append vifm "/colors")
  765. (string-append vimfiles "/colors"))
  766. (copy-recursively (string-append vifm "/vim")
  767. vimfiles)
  768. (delete-file-recursively (string-append vifm "/colors"))
  769. (delete-file-recursively (string-append vifm "/vim")))
  770. #t)))))
  771. (native-inputs
  772. `(("groff" ,groff))) ; for the documentation
  773. (inputs
  774. `(("libx11" ,libx11)
  775. ("ncurses" ,ncurses)
  776. ("perl" ,perl)))
  777. (home-page "https://vifm.info/")
  778. (synopsis "Flexible vi-like file manager using ncurses")
  779. (description "Vifm is a file manager providing a @command{vi}-like usage
  780. experience. It has similar keybindings and modes (e.g. normal, command line,
  781. visual). The interface uses ncurses, thus vifm can be used in text-only
  782. environments. It supports a wide range of features, some of which are known
  783. from the @command{vi}-editor:
  784. @enumerate
  785. @item utf8 support
  786. @item user mappings (almost like in @code{vi})
  787. @item ranges in command
  788. @item line commands
  789. @item user defined commands (with support for ranges)
  790. @item registers
  791. @item operation undoing/redoing
  792. @item fuse file systems support
  793. @item trash
  794. @item multiple files renaming
  795. @item support of filename modifiers
  796. @item colorschemes support
  797. @item file name color according to file type
  798. @item path specific colorscheme customization
  799. @item bookmarks
  800. @item operation backgrounding
  801. @item customizable file viewers
  802. @item handy @code{less}-like preview mode
  803. @item filtering out and searching for files using regular expressions
  804. @item one or two panes view
  805. @end enumerate
  806. With the package comes a plugin to use vifm as a vim file selector.")
  807. (license license:gpl2+)))