2022-05-30 10:32:20 +02:00
{
pkgs ,
sqlformat
} :
2022-03-11 14:03:07 +01:00
let
2022-03-15 08:41:41 +01:00
# The folder contains the expected `~/.config/nvim/` structure
# This structure is the same for plugins.
# I therefore just load this folder as plugin.
2023-10-02 09:56:37 +02:00
configuration = pkgs . vimUtils . buildVimPlugin {
2022-10-04 07:59:26 +02:00
pname = " c o n f i g u r a t i o n " ;
2023-10-19 19:49:15 +02:00
version = " 1 . 0 . 0 " ;
2022-03-15 08:00:46 +01:00
src = ./neovim/configuration ;
2022-03-11 14:03:07 +01:00
} ;
2023-10-02 09:56:37 +02:00
colorscheme-smyckblue = pkgs . vimUtils . buildVimPlugin rec {
2022-10-04 07:59:26 +02:00
pname = " c o l o r s c h e m e - s m y c k b l u e " ;
2023-10-30 15:06:57 +01:00
version = " 1 . 5 . 0 " ;
2022-03-11 14:03:07 +01:00
src = pkgs . fetchgit {
2023-01-03 07:59:52 +01:00
url = " h t t p s : / / g i t . d a n i e l - s i e p m a n n . d e / d a n i e l s i e p m a n n / v i m - ${ pname } . g i t " ;
2023-10-19 19:49:15 +02:00
rev = " v ${ version } " ;
2023-10-30 15:06:57 +01:00
sha256 = " v p v K I m O 4 C 2 d p 5 d M d U e N a X d p S V J 8 Z q E r M H l m A J F r 4 l N w = " ;
2022-03-11 14:03:07 +01:00
} ;
} ;
2023-10-02 09:56:37 +02:00
neotags = pkgs . vimUtils . buildVimPlugin rec {
2022-10-04 07:59:26 +02:00
pname = " n e o t a g s " ;
2023-10-19 19:49:15 +02:00
version = " 0 . 3 . 0 " ;
2022-03-11 14:03:07 +01:00
src = pkgs . fetchgit {
2023-01-03 07:59:52 +01:00
url = " h t t p s : / / g i t . d a n i e l - s i e p m a n n . d e / d a n i e l s i e p m a n n / ${ pname } . g i t " ;
2023-10-19 19:49:15 +02:00
rev = " v ${ version } " ;
2022-03-11 14:03:07 +01:00
sha256 = " u J 7 c l + 1 N g f f 0 F K z j m h 1 i 7 O / P k N j P v P T + Z E H g c e e Z c z 0 = " ;
} ;
2022-05-16 12:03:05 +02:00
nativeBuildInputs = [
pkgs . python3
] ;
preInstall = ''
rm - rf Dockerfile readme . rst . gitlab-ci . yml rplugin/test
python - m compileall rplugin
'' ;
2022-03-11 14:03:07 +01:00
} ;
2023-10-02 09:56:37 +02:00
syntax-typoscript = pkgs . vimUtils . buildVimPlugin rec {
2022-10-04 07:59:26 +02:00
pname = " s y n t a x - t y p o s c r i p t " ;
2023-10-19 19:49:15 +02:00
version = " 2 . 0 . 0 " ;
2022-03-23 17:41:47 +01:00
src = pkgs . fetchgit {
2023-01-03 07:59:52 +01:00
url = " h t t p s : / / g i t . d a n i e l - s i e p m a n n . d e / d a n i e l s i e p m a n n / v i m - ${ pname } . g i t " ;
2023-10-19 19:49:15 +02:00
rev = " v ${ version } " ;
sha256 = " f C B + i k D m k f E P / W 0 p F Y G r s Z i H 3 0 v T 0 g 3 z 6 G Z p R G k 0 R h c = " ;
2022-03-11 14:03:07 +01:00
} ;
} ;
2023-10-02 09:56:37 +02:00
syntax-fluid = pkgs . vimUtils . buildVimPlugin rec {
2022-10-04 07:59:26 +02:00
pname = " s y n t a x - f l u i d " ;
2023-10-19 19:49:15 +02:00
version = " 2 0 1 6 - 0 6 - 2 2 " ;
2022-03-11 14:03:07 +01:00
src = pkgs . fetchFromGitHub {
owner = " m i p m i p " ;
repo = " v i m - f l u i d " ;
2023-10-19 19:49:15 +02:00
rev = " c e d c 4 a d 8 7 1 9 4 1 e 8 f 7 1 3 4 d 1 d 7 1 f 9 4 3 4 f 1 b c 3 d 9 3 d 5 " ;
2022-03-11 14:03:07 +01:00
sha256 = " L i S 2 D q w 1 K 1 F u 5 V f H Q n x I B D x D z E a r m S A U U a v Q c w H R D s Q = " ;
} ;
} ;
2023-10-02 09:56:37 +02:00
syntax-mustache = pkgs . vimUtils . buildVimPlugin rec {
2023-10-19 19:49:15 +02:00
pname = " s y n t a x - m u s t a c h e - h a n d l e b a r s " ;
version = " 2 0 2 1 - 1 1 - 3 0 " ;
2022-03-15 09:08:32 +01:00
src = pkgs . fetchFromGitHub {
owner = " m u s t a c h e " ;
repo = " v i m - m u s t a c h e - h a n d l e b a r s " ;
2023-10-19 19:49:15 +02:00
rev = " 0 1 5 3 f e 0 3 a 9 1 9 a d d 2 d 6 c f 2 d 4 1 b 2 d 5 b 6 e 1 1 8 8 b c 0 e 0 " ;
2022-03-15 09:08:32 +01:00
sha256 = " l m Y t + G K u X h b O h u 3 H u f q I F E 2 D v z U Y l k 5 v G q U 6 t p J 2 y j Y = " ;
} ;
} ;
2023-10-18 15:14:05 +02:00
rg = pkgs . vimUtils . buildVimPlugin rec {
pname = " r g " ;
2023-10-19 19:49:15 +02:00
version = " 2 0 2 3 - 0 8 - 1 2 " ;
2022-03-11 14:03:07 +01:00
src = pkgs . fetchFromGitHub {
2023-10-19 19:49:15 +02:00
owner = " d u a n e 9 " ;
2023-10-18 15:14:05 +02:00
repo = " n v i m - r g " ;
2023-10-19 19:49:15 +02:00
rev = " c 2 4 e 3 7 0 9 3 9 2 9 a 6 0 e 6 1 7 6 1 b d f a 5 9 1 a f 6 9 8 4 e 4 9 b 5 1 " ;
2023-10-18 15:14:05 +02:00
sha256 = " P B D d k h Z q 5 O n Y p W S b L R G 8 k r M T c u a C R n 0 m S p R L C q n E g L k = " ;
2022-03-11 14:03:07 +01:00
} ;
} ;
2023-10-02 09:56:37 +02:00
vdebug = pkgs . vimUtils . buildVimPlugin rec {
2022-10-04 07:59:26 +02:00
pname = " v d e b u g " ;
2023-10-19 19:49:15 +02:00
version = " 2 0 2 2 - 0 2 - 2 7 " ;
2022-03-11 14:03:07 +01:00
src = pkgs . fetchFromGitHub {
owner = " j o o n t y " ;
2022-10-04 07:59:26 +02:00
repo = pname ;
2023-10-19 19:49:15 +02:00
rev = " f 9 7 9 c c 0 6 5 e 6 3 7 9 6 b d f 6 0 f 0 1 4 a e 2 2 8 0 c e 8 e 7 2 c d e d " ;
sha256 = " 0 p v R d q o g x Y s 2 Q M H 1 u H T J z L Y 5 Q t v e n S y o w c q k G h t a u L Y = " ;
2022-03-11 14:03:07 +01:00
} ;
} ;
2023-10-19 19:49:15 +02:00
# TODO: Check changes of forks: https://github.com/sgeb/vim-diff-fold/network
2023-10-02 09:56:37 +02:00
diff-fold = pkgs . vimUtils . buildVimPlugin rec {
2022-10-04 07:59:26 +02:00
pname = " d i f f - f o l d " ;
2023-10-19 19:49:15 +02:00
version = " 2 0 1 2 - 0 9 - 1 4 " ;
2022-03-11 14:03:07 +01:00
src = pkgs . fetchFromGitHub {
owner = " s g e b " ;
2022-10-04 07:59:26 +02:00
repo = " v i m - ${ pname } " ;
2023-10-19 19:49:15 +02:00
rev = " 4 8 b 4 5 0 5 c 1 b 6 f 1 4 c e b 4 e 4 b e 7 3 2 a a d 3 3 7 1 4 7 e f 3 6 c d " ;
2022-03-11 14:03:07 +01:00
sha256 = " M 3 C A U u e E h L D 0 J 6 s L U p R k F v + v K 4 a G Y O + X n o k x m n + V x q U = " ;
} ;
} ;
2023-10-02 09:56:37 +02:00
neoterm = pkgs . vimUtils . buildVimPlugin rec {
2022-10-04 07:59:26 +02:00
pname = " n e o t e r m " ;
2023-10-19 19:49:15 +02:00
version = " 2 0 2 3 - 0 3 - 0 9 " ;
2022-03-11 14:03:07 +01:00
src = pkgs . fetchFromGitHub {
owner = " k a s s i o " ;
2022-10-04 07:59:26 +02:00
repo = pname ;
2023-10-19 19:49:15 +02:00
rev = " e c a 2 2 d c 9 0 a 9 d b 5 e 5 2 d 8 b a f 9 1 f 3 1 9 9 1 a d 5 4 0 f f e 3 6 " ;
2022-03-11 14:03:07 +01:00
sha256 = " 0 w 9 6 2 x f c g i g d w 4 1 w b l r v 1 l 5 5 x k i 0 k l 5 v w k d b m 6 j l r 4 4 h z i i 0 n h g z " ;
} ;
patches = [
./neovim/patches/disable_neoterm_repl.patch
] ;
} ;
2023-10-02 09:56:37 +02:00
tagbar = pkgs . vimUtils . buildVimPlugin rec {
2022-10-04 07:59:26 +02:00
pname = " t a g b a r " ;
2023-10-19 19:49:15 +02:00
version = " 2 . 7 " ;
2022-03-11 14:03:07 +01:00
src = pkgs . fetchFromGitHub {
owner = " m a j u t s u s h i " ;
2022-10-04 07:59:26 +02:00
repo = pname ;
2023-10-19 19:49:15 +02:00
rev = " v ${ version } " ;
2022-03-11 14:03:07 +01:00
sha256 = " E g 6 x R w i s o p m B e x q k W j R b S i 9 a Q C 4 u C X b F O 6 S C K 1 L Y + O w = " ;
} ;
} ;
2023-09-21 07:47:16 +02:00
# Use `let g:test#last_command="<command>"` to set a test to execute when repeating last.
# Note that you need to set further variables, or execute a matching test beforehand.
2023-10-02 09:56:37 +02:00
test = pkgs . vimUtils . buildVimPlugin rec {
2022-10-04 07:59:26 +02:00
pname = " t e s t " ;
2023-10-19 19:49:15 +02:00
version = " 2 0 2 3 - 0 9 - 3 0 " ;
2022-03-15 17:29:34 +01:00
src = pkgs . fetchFromGitHub {
2022-10-04 07:59:26 +02:00
owner = " v i m - ${ pname } " ;
repo = " v i m - ${ pname } " ;
2023-10-19 19:49:15 +02:00
rev = " 5 3 c 6 c 7 2 f 3 a 0 c 6 a 2 4 a 7 4 e 6 5 9 e a a 7 6 9 d 7 0 5 7 e f 2 e c d " ;
2023-02-20 14:36:45 +01:00
sha256 = " f e X B 4 A H a l J g J D x S / k M 3 a X G w y i 3 x v S f M l F U L U G N I E 7 b M = " ;
2022-03-15 17:29:34 +01:00
} ;
patches = [
./neovim/patches/disable_test_paratest.patch
2023-02-20 14:36:45 +01:00
./neovim/patches/test_fix_codeception_nearest.patch
2022-05-23 16:22:27 +02:00
./neovim/patches/test_limit_codeception.patch
2022-03-15 17:29:34 +01:00
] ;
} ;
2023-10-18 13:28:32 +02:00
telescope-ctags-outline = pkgs . vimUtils . buildVimPlugin rec {
pname = " t e l e s c o p e - c t a g s - o u t l i n e " ;
2023-10-19 19:49:15 +02:00
version = " 2 0 2 3 - 0 8 - 2 1 " ;
2023-03-08 15:58:46 +01:00
src = pkgs . fetchFromGitHub {
2023-10-18 13:28:32 +02:00
owner = " f c y i n g " ;
repo = " ${ pname } . n v i m " ;
2023-10-19 19:49:15 +02:00
rev = " 7 4 7 4 5 d 8 c 0 8 6 1 7 f 6 8 a d 8 8 f d 0 8 e a 4 d 3 4 2 c a 8 5 4 9 d 8 d " ;
sha256 = " J O D 3 6 D u k g J z q t N q A v e Q p c / L b s i h Y w 6 O g a X + b M X b S c 8 o = " ;
2023-03-08 15:58:46 +01:00
} ;
} ;
2022-03-11 14:03:07 +01:00
in {
enable = true ;
2022-03-16 09:04:03 +01:00
# TODO: Check out these plugins as additions / replacements:
2022-03-17 08:04:13 +01:00
2022-05-18 19:54:03 +02:00
# - https://github.com/NTBBloodbath/rest.nvim recommended by Sascha, allows to write and execute requests
2022-03-17 08:04:13 +01:00
# - https://github.com/glacambre/firenvim Give it another try, integrates neovim into firefox
2022-03-23 17:42:04 +01:00
# - https://github.com/sindrets/diffview.nvim/
2022-03-17 09:01:15 +01:00
# - https://github.com/weilbith/nvim-code-action-menu/ Check again in future, right now not of much useness on my setup.
2022-03-16 09:04:03 +01:00
#
# Alternatives:
# - https://github.com/mfussenegger/nvim-dap Alternative to Vdebug, more modern and should work with firefox as well? But needs node …)
2022-03-17 08:04:13 +01:00
# - https://github.com/nvim-neo-tree/neo-tree.nvim (General tree, not only filesystem, alternative to nerdtree but can also be used for buffers etc.)
# - https://github.com/simrat39/symbols-outline.nvim/ Replacement for tagbar using lsp, combine with https://github.com/jose-elias-alvarez/null-ls.nvim once it supports Workspace Symbols / Document Symbol
2022-03-16 09:04:03 +01:00
2022-03-14 10:43:50 +01:00
plugins = with pkgs . vimPlugins ; [
2022-03-11 14:03:07 +01:00
# My own plugins
colorscheme-smyckblue
neotags
2022-05-30 10:32:20 +02:00
{
plugin = configuration ;
config = ''
au FileType sql setlocal formatprg = $ { sqlformat } /bin/sqlformat
'' ;
}
2022-03-11 14:03:07 +01:00
syntax-typoscript
# More UI related
{
2022-10-31 09:21:17 +01:00
plugin = nerdtree ;
config = builtins . readFile ( ./neovim/plugins/nerdtree.vim ) ;
2022-03-11 14:03:07 +01:00
}
{
2022-03-14 10:43:50 +01:00
plugin = undotree ;
2022-08-15 08:26:12 +02:00
config = builtins . readFile ( ./neovim/plugins/undotree.vim ) ;
2022-03-11 14:03:07 +01:00
}
{
# Use pinned to 2.7 as I don't need any of the new features.
# Instead they make it hard to only show what I'm interested in within PHP files.
# As they changed the building with nested structures.
plugin = tagbar ;
2022-08-15 08:26:12 +02:00
config = builtins . readFile ( ./neovim/plugins/tagbar.vim ) ;
2022-03-11 14:03:07 +01:00
}
{
2023-10-18 13:28:32 +02:00
plugin = telescope-nvim ;
type = " l u a " ;
config = builtins . readFile ( ./neovim/plugins/telescope.lua ) ;
}
2023-03-02 14:24:16 +01:00
2023-10-18 13:28:32 +02:00
{
plugin = telescope-ctags-outline ;
2022-03-16 14:44:49 +01:00
type = " l u a " ;
2023-10-18 13:28:32 +02:00
config = builtins . readFile ( ./neovim/plugins/telescope-ctags-outline.lua ) ;
2022-03-11 14:03:07 +01:00
}
2022-06-08 08:51:31 +02:00
dressing-nvim
2022-06-08 08:47:55 +02:00
2022-03-11 14:03:07 +01:00
# Syntax
2022-03-15 09:08:32 +01:00
syntax-mustache
2022-03-16 09:03:51 +01:00
i3config-vim
2022-03-31 15:15:52 +02:00
typescript-vim
2022-03-11 14:03:07 +01:00
syntax-fluid
2022-05-17 21:40:52 +02:00
vim-twig
2022-08-16 08:05:13 +02:00
# PHP Syntax is loaded via xdg config file.
2023-10-19 07:52:02 +02:00
# This is necessary as Vim provides a native syntax which would be loaded before the one defined here.
2022-08-16 08:05:13 +02:00
# See: https://github.com/NixOS/nixpkgs/commit/cda1f8ae46869c429971323717d622d5b17d9854 where runtimepath is not set.
2022-03-11 14:03:07 +01:00
# Adding features
2023-10-18 15:14:05 +02:00
rg
2022-03-11 14:03:07 +01:00
diff-fold
2022-05-18 19:47:03 +02:00
BufOnly-vim
2022-03-11 14:03:07 +01:00
{
2022-03-14 10:43:50 +01:00
plugin = vim-snipmate ;
2022-03-15 08:41:41 +01:00
# I didn't migrate snippets to new format, yet.
2022-03-11 14:03:07 +01:00
config = ''
2022-03-14 09:46:26 +01:00
let g:snipMate = { ' snippet_version' : 0 }
2022-03-11 14:03:07 +01:00
'' ;
}
2022-03-23 17:28:36 +01:00
fugitive
2022-03-14 10:43:50 +01:00
vim-commentary
vim-indent-object
vim-textobj-comment
2022-03-11 14:03:07 +01:00
{
plugin = vdebug ;
2022-08-15 08:26:12 +02:00
config = builtins . readFile ( ./neovim/plugins/vdebug.vim ) ;
2022-03-11 14:03:07 +01:00
}
{
# Seems to be broken: https://github.com/kassio/neoterm/issues/338
# Therefore I install my own version where this bug is disabled
plugin = neoterm ;
2022-08-15 08:26:12 +02:00
config = builtins . readFile ( ./neovim/plugins/neoterm.vim ) ;
2022-03-11 14:03:07 +01:00
}
{
plugin = phpactor ;
config = ''
2022-05-17 19:29:18 +02:00
" M a k e e m p t y , a s w e h a v e a f u l l b l o w n w r a p p e r t h a n k s t o n i x .
" A d d i n g a p h p i n f r o n t w o u l d i n t e r p r e t t h e w r a p p e r v i a P H P .
2022-05-17 08:34:40 +02:00
let g:phpactorPhpBin = " "
2022-05-17 19:29:18 +02:00
let g:phpactorOmniError = v:true
2022-03-11 14:03:07 +01:00
'' ;
}
2022-04-21 07:36:01 +02:00
# LSP (=Language Server Protocol)
2023-02-07 11:46:36 +01:00
# I remove diagnostics as I use ale instead.
# Maybe some day I need both or use lsp for some languages, docs:
# - https://neovim.io/doc/user/diagnostic.html#diagnostic-api
# - https://github.com/neovim/nvim-lspconfig/issues/662
2023-07-11 09:02:20 +02:00
# Add nix: https://discourse.nixos.org/t/nixd-1-1-0-released/29416
2022-04-21 07:36:01 +02:00
{
plugin = nvim-lspconfig ;
type = " l u a " ;
config = ''
2023-02-07 11:46:36 +01:00
vim . diagnostic . config ( {
2023-07-11 09:02:20 +02:00
virtual_text = true ,
2023-03-15 08:31:28 +01:00
underline = false ,
2023-02-07 11:46:36 +01:00
} )
2022-04-21 07:36:01 +02:00
require ( ' lspconfig' ) . phpactor . setup ( {
cmd = {
2023-06-19 07:11:35 +02:00
' $ { pkgs . phpactor } /bin/phpactor ' ,
2022-04-21 07:36:01 +02:00
' language-server' ,
} ,
} )
'' ;
}
{
plugin = lsp_signature-nvim ;
type = " l u a " ;
2022-08-15 08:26:12 +02:00
config = builtins . readFile ( ./neovim/plugins/lsp-signature.lua ) ;
2022-04-21 07:36:01 +02:00
}
2023-10-19 07:52:02 +02:00
# Tree Sitter (Syntax, Parsing, …)
{
plugin = pkgs . vimPlugins . nvim-treesitter . withPlugins ( p : with p ; [
bash
dockerfile
html
javascript
json
lua
markdown
nix
php
2023-10-30 15:06:57 +01:00
phpdoc
2023-10-19 07:52:02 +02:00
rst
scss
sql
typescript
vim
yaml
] ) ;
type = " l u a " ;
config = builtins . readFile ( ./neovim/plugins/treesitter.lua ) ;
}
{
# Used to inspect node types to extend colorscheme
# Installed for ":TSHighlightCapturesUnderCursor"
plugin = playground ;
type = " l u a " ;
config = ''
require ( " n v i m - t r e e s i t t e r . c o n f i g s " ) . setup ( {
playground = {
enable = true ,
} ,
} )
'' ;
}
2022-03-11 14:03:07 +01:00
# More related to testing, linting, …
{
2022-03-14 10:43:50 +01:00
plugin = ale ;
2022-08-15 08:26:12 +02:00
config = builtins . readFile ( ./neovim/plugins/ale.vim )
2022-03-16 17:12:48 +01:00
# Keep line break as fileContents strips last EOL
+ ''
2022-04-14 14:31:19 +02:00
let g:ale_yaml_yamllint_executable = ' ${ pkgs . yamllint } /bin/yamllint '
2022-03-16 17:12:48 +01:00
let g:ale_xml_xmllint_executable = ' ${ pkgs . libxml2 } /bin/xmllint '
2022-03-29 11:50:01 +02:00
let g:ale_gitcommit_gitlint_executable = ' ${ pkgs . gitlint } /bin/gitlint '
2022-03-30 15:49:54 +02:00
let g:ale_nix_statix_check_executable = ' ${ pkgs . statix } /bin/statix '
2022-05-23 18:26:37 +02:00
let g:ale_languagetool_executable = ' ${ pkgs . languagetool } /bin/languagetool-commandline '
2023-02-05 16:43:48 +01:00
let g:ale_rstcheck_executable = ' ${ pkgs . rstcheck } /bin/rstcheck '
2022-03-16 17:12:48 +01:00
'' ;
2022-03-11 14:03:07 +01:00
}
{
2022-03-15 17:29:34 +01:00
plugin = test ;
2022-08-15 08:26:12 +02:00
config = builtins . readFile ( ./neovim/plugins/test.vim ) ;
2022-03-11 14:03:07 +01:00
}
2022-07-04 07:36:52 +02:00
# Presentations
presenting-vim
goyo-vim
2022-03-11 14:03:07 +01:00
# Dependencies for other plugins
2022-03-14 10:43:50 +01:00
vim-addon-mw-utils
vim-textobj-user
2022-03-16 14:44:49 +01:00
plenary-nvim
2022-03-11 14:03:07 +01:00
] ;
}