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 " ;
2024-05-22 08:53:04 +02:00
version = " 1 . 7 . 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 } " ;
2024-05-22 08:53:04 +02:00
sha256 = " E g 8 T t D c o 3 + Q q 2 p V n O M Z z K D G h 4 b K u 2 Z l W 6 q 3 H k J D u H d g = " ;
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 " ;
2024-04-04 08:42:53 +02:00
version = " 2 0 2 4 - 0 3 - 1 6 " ;
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 " ;
2024-04-04 08:42:53 +02:00
rev = " 4 8 3 5 3 9 d e 6 8 7 2 e 8 2 9 3 c a 9 f 3 f 5 a f 7 c 5 6 f 5 e c 3 3 b a 6 5 " ;
sha256 = " v 0 i 4 L 1 i O I / v m r + I 0 8 E q b F h O O r f F j X a U b c X A / l o 0 4 d T A = " ;
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-31 11:26:45 +01:00
version = " 2 0 2 3 - 1 0 - 2 8 " ;
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-31 11:26:45 +01:00
rev = " 5 8 8 0 b 1 7 c 3 b a f 3 1 a 2 2 0 7 7 5 3 8 d a d 5 d 8 8 c 6 5 8 8 7 4 3 0 3 " ;
sha256 = " f 6 T 5 L 3 x 2 T 6 E w H o R m c H 1 z m r B X 1 F D q h l f s e P B 8 I n L T g s g = " ;
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 " ;
2024-03-28 17:11:00 +01:00
version = " 2 0 2 4 - 0 3 - 2 4 " ;
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 " ;
2024-03-28 17:11:00 +01:00
rev = " d 1 2 8 c 8 1 7 5 8 9 2 7 4 c 7 6 0 c 2 7 c 9 7 5 0 0 d 3 9 2 9 2 9 f 3 c 1 d d " ;
sha256 = " Q C M w e H V S Q d b 7 X H 8 F h n A P r q d W / E U J B W A h F w 4 Z w w V 2 8 3 w = " ;
2023-03-08 15:58:46 +01:00
} ;
2024-03-28 17:11:00 +01:00
patches = [
./neovim/patches/ctags-outline-exclude.patch
] ;
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
}
{
# 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
2024-04-04 08:39:37 +02:00
{
plugin = rg ;
config = ''
let g:rg_command = ' rg - - vimgrep - - smart-case'
'' ;
}
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
2024-02-12 07:13:47 +01:00
css
2024-03-24 17:37:55 +01:00
c
2023-10-19 07:52:02 +02:00
sql
typescript
vim
2024-02-28 12:17:56 +01:00
vimdoc
2023-10-19 07:52:02 +02:00
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 '
2024-02-28 12:18:47 +01:00
let g:ale_sh_shellcheck_executable = ' ${ pkgs . shellcheck } /bin/shellcheck '
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
] ;
}