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.
2022-03-17 11:53:24 +01:00
configuration = pkgs . vimUtils . buildVimPluginFrom2Nix {
2022-10-04 07:59:26 +02:00
pname = " c o n f i g u r a t i o n " ;
version = " v 1 . 0 . 0 " ;
2022-03-15 08:00:46 +01:00
src = ./neovim/configuration ;
2022-03-11 14:03:07 +01:00
} ;
2022-10-04 07:59:26 +02:00
colorscheme-smyckblue = pkgs . vimUtils . buildVimPluginFrom2Nix rec {
pname = " c o l o r s c h e m e - s m y c k b l u e " ;
version = " v 1 . 2 . 0 " ;
2022-03-11 14:03:07 +01:00
src = pkgs . fetchgit {
2022-10-04 07:59:26 +02:00
url = " h t t p s : / / g i t e a . 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 " ;
rev = version ;
2022-08-22 11:45:48 +02:00
sha256 = " s h a 2 5 6 - s P b + o k B t 0 6 0 i 3 e Y P I R w X K 9 O 9 a C E 3 5 z 0 9 v x e x q v + + B H 0 = " ;
2022-03-11 14:03:07 +01:00
} ;
} ;
2022-10-04 07:59:26 +02:00
neotags = pkgs . vimUtils . buildVimPluginFrom2Nix rec {
pname = " n e o t a g s " ;
version = " v 0 . 3 . 0 " ;
2022-03-11 14:03:07 +01:00
src = pkgs . fetchgit {
2022-10-04 07:59:26 +02:00
url = " h t t p s : / / g i t e a . 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 " ;
rev = 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
} ;
2022-10-04 07:59:26 +02:00
syntax-typoscript = pkgs . vimUtils . buildVimPluginFrom2Nix rec {
pname = " s y n t a x - t y p o s c r i p t " ;
version = " v 2 . 0 . 0 " ;
2022-03-23 17:41:47 +01:00
src = pkgs . fetchgit {
2022-10-04 07:59:26 +02:00
url = " h t t p s : / / g i t e a . 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 " ;
rev = version ;
2022-06-15 15:10:32 +02:00
sha256 = " s h a 2 5 6 - 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
} ;
} ;
2022-10-04 07:59:26 +02:00
syntax-nix = pkgs . vimUtils . buildVimPluginFrom2Nix rec {
pname = " s y n t a x - n i x " ;
version = " 6 3 b 4 7 b 3 9 c 8 d 4 8 1 e b c a 3 0 9 2 8 2 2 c a 8 9 7 2 e 0 8 d f 7 6 9 b " ;
2022-03-11 14:03:07 +01:00
src = pkgs . fetchFromGitHub {
owner = " L n L 7 " ;
repo = " v i m - n i x " ;
2022-10-04 07:59:26 +02:00
rev = version ;
2022-03-11 14:03:07 +01:00
sha256 = " w Q z N X f E 7 J F a l g i C Q 2 k s P A U y F K a c m J V 7 m N K m K D e 9 j y S I = " ;
} ;
} ;
2022-10-04 07:59:26 +02:00
syntax-fluid = pkgs . vimUtils . buildVimPluginFrom2Nix rec {
pname = " s y n t a x - f l u i d " ;
version = " 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
src = pkgs . fetchFromGitHub {
owner = " m i p m i p " ;
repo = " v i m - f l u i d " ;
2022-10-04 07:59:26 +02:00
rev = version ;
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 = " ;
} ;
} ;
2022-10-04 07:59:26 +02:00
syntax-mustache = pkgs . vimUtils . buildVimPluginFrom2Nix rec {
pname = " s y n t a x - m u s t a h c e " ;
version = " 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
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 " ;
2022-10-04 07:59:26 +02:00
rev = version ;
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 = " ;
} ;
} ;
2022-10-04 07:59:26 +02:00
ag = pkgs . vimUtils . buildVimPluginFrom2Nix rec {
pname = " a g " ;
version = " c 4 7 8 f 7 9 7 3 0 7 4 f 1 5 b b f 8 2 c 2 9 8 a 1 6 7 8 b 4 e 2 3 f 1 7 6 7 a " ;
2022-03-11 14:03:07 +01:00
src = pkgs . fetchFromGitHub {
owner = " r k i n g " ;
2022-10-04 07:59:26 +02:00
repo = " ${ pname } . v i m " ;
rev = version ;
2022-03-11 14:03:07 +01:00
sha256 = " j l R 8 N F G 7 I R C Y i Q 7 o c Q Q C I 2 n p A P u j g Q F Z 6 R p F X 8 z w T A A = " ;
} ;
} ;
2022-10-04 07:59:26 +02:00
vdebug = pkgs . vimUtils . buildVimPluginFrom2Nix rec {
pname = " v d e b u g " ;
version = " v 2 . 0 . 0 " ;
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 ;
rev = version ;
2022-03-11 14:03:07 +01:00
sha256 = " k o b M C 6 T R F Z c E b g F d O a B g X U z o e W Q U r V z U K y l N 1 N 9 n E n c = " ;
} ;
} ;
2022-10-04 07:59:26 +02:00
diff-fold = pkgs . vimUtils . buildVimPluginFrom2Nix rec {
pname = " d i f f - f o l d " ;
version = " 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
src = pkgs . fetchFromGitHub {
owner = " s g e b " ;
2022-10-04 07:59:26 +02:00
repo = " v i m - ${ pname } " ;
rev = version ;
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 = " ;
} ;
} ;
2022-08-02 13:20:08 +02:00
phpactor = pkgs . callPackage ./neovim/nix-plugins/phpactor.nix { } ;
2022-03-11 14:03:07 +01:00
2022-10-04 07:59:26 +02:00
neoterm = pkgs . vimUtils . buildVimPluginFrom2Nix rec {
pname = " n e o t e r m " ;
version = " e 7 8 1 7 9 a 9 c e b 9 8 d e 8 d 0 c 3 7 b d d a 4 3 5 a 5 d e a b 4 d 5 e 7 1 " ;
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 ;
rev = version ;
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
] ;
} ;
2022-10-04 07:59:26 +02:00
tagbar = pkgs . vimUtils . buildVimPluginFrom2Nix rec {
pname = " t a g b a r " ;
version = " v 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 ;
rev = 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 = " ;
} ;
} ;
2022-10-04 07:59:26 +02:00
test = pkgs . vimUtils . buildVimPluginFrom2Nix rec {
pname = " t e s t " ;
version = " 1 6 a 3 b 6 d a 1 b a b 4 2 4 7 3 d 4 2 d 7 e 0 2 d 8 9 d 5 4 9 d 7 a 5 e 1 3 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 } " ;
rev = version ;
2022-03-15 17:29:34 +01:00
sha256 = " C V S T y / F e B g y z R K 8 N W D M i I y n z 7 D R l F e n r u i C O j o w Y n M I = " ;
} ;
patches = [
./neovim/patches/disable_test_paratest.patch
2022-05-18 14:53:03 +02:00
./neovim/patches/test_extend_codeception_detection.patch
2022-05-23 16:22:27 +02:00
./neovim/patches/test_limit_codeception.patch
2022-03-15 17:29:34 +01:00
] ;
} ;
2022-10-04 07:59:26 +02:00
telescope-ctags-outline = pkgs . vimUtils . buildVimPluginFrom2Nix rec {
pname = " t e l e s c o p e - c t a g s - o u t l i n e " ;
version = " 3 5 b 2 d f 9 5 4 5 f 7 2 3 5 2 5 0 2 7 0 3 b a 0 6 b 7 a b 7 1 1 f a 2 5 e 5 1 " ;
2022-03-16 14:44:49 +01:00
src = pkgs . fetchFromGitHub {
owner = " f c y i n g " ;
2022-10-04 07:59:26 +02:00
repo = " ${ pname } . n v i m " ;
rev = version ;
2022-03-16 14:44:49 +01:00
sha256 = " e 8 Q c D 7 H 2 u n m o a L a N 1 J U x t O G Q Y B J G A X t f S n j 8 s W 6 6 f f 4 = " ;
} ;
} ;
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-03-14 10:43:50 +01:00
plugin = nerdtree ;
2022-08-15 08:26:12 +02:00
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
}
{
2022-03-16 14:44:49 +01:00
plugin = telescope-nvim ;
type = " l u a " ;
2022-08-15 08:26:12 +02:00
config = builtins . readFile ( ./neovim/plugins/telescope.lua ) ;
2022-03-16 14:44:49 +01:00
}
{
plugin = telescope-ctags-outline ;
type = " l u a " ;
2022-08-15 08:26:12 +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
syntax-nix
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.
# This is necessart as Vim provides a native syntax which would be loaded before the one defined here.
# See: https://github.com/NixOS/nixpkgs/commit/cda1f8ae46869c429971323717d622d5b17d9854 where runtimepath is not set.
2022-03-11 14:03:07 +01:00
# Adding features
ag
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)
{
plugin = nvim-lspconfig ;
type = " l u a " ;
config = ''
require ( ' lspconfig' ) . phpactor . setup ( {
cmd = {
' $ { phpactor } /bin/phpactor ' ,
' language-server' ,
} ,
} )
2022-05-17 20:49:00 +02:00
local runtime_path = vim . split ( package . path , ' ; ' )
table . insert ( runtime_path , " l u a / ? . l u a " )
table . insert ( runtime_path , " l u a / ? / i n i t . l u a " )
require ( ' lspconfig' ) . sumneko_lua . setup ( {
cmd = {
' $ { pkgs . sumneko-lua-language-server } /bin/lua-language-server ' ,
} ,
settings = {
Lua = {
runtime = {
- - Tell the language server which version of Lua you're using ( most likely LuaJIT in the case of Neovim )
version = ' LuaJIT' ,
- - Setup your lua path
path = runtime_path ,
} ,
diagnostics = {
- - Get the language server to recognize the ` vim ` global
globals = { ' vim' } ,
} ,
workspace = {
- - Make the server aware of Neovim runtime files
library = vim . api . nvim_get_runtime_file ( " " , true ) ,
} ,
- - Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false ,
} ,
} ,
} ,
} )
2022-04-21 07:36:01 +02:00
'' ;
}
{
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
}
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 '
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-08-22 11:45:48 +02:00
# I don't like the approach of https://github.com/nvim-neotest/neotest.
# It enforces me to use adapters and only supports some frameworks,
# I prefer ultest which is a wrapper around the test plugin from above.
{
plugin = vim-ultest ;
config = ''
let g:ultest_deprecation_notice = 0
'' ;
}
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
] ;
}