refactor(nvim): better name and lazy loading

This commit is contained in:
Moritz Böhme 2023-07-15 12:45:11 +02:00
parent 0f5f81539b
commit 4dbec7bade
Signed by: moritz
GPG key ID: 970C6E89EB0547A9
2 changed files with 15 additions and 12 deletions

View file

@ -48,9 +48,9 @@ let
listToStringMultiLine id listToStringMultiLine id
([ ([
"dir = ${quote plugin}" "dir = ${quote plugin}"
"name = ${quote plugin.name}" "name = ${quote (getName plugin)}"
"lazy = ${boolToString lazy}"
] ]
++ (optional (!lazy) "lazy = ${boolToString lazy}")
++ (optional (!enabled) "enabled = ${boolToString enabled}") ++ (optional (!enabled) "enabled = ${boolToString enabled}")
++ (optional (dependencies != [ ]) "dependencies = ${listToStringMultiLine id (map lazySpecFromPlugin dependencies)}") ++ (optional (dependencies != [ ]) "dependencies = ${listToStringMultiLine id (map lazySpecFromPlugin dependencies)}")
++ (optional (init != null) "init = function(plugin)\n${toString init}\nend") ++ (optional (init != null) "init = function(plugin)\n${toString init}\nend")

View file

@ -200,8 +200,7 @@ with builtins;
conf = readFile ./smartcolumn-nvim.lua; conf = readFile ./smartcolumn-nvim.lua;
} }
{ {
plugin = telescope-fzf-native-nvim; plugin = telescope-nvim;
conf = readFile ./telescope-fzf-native-nvim.lua;
cmd = [ "Telescope" ]; cmd = [ "Telescope" ];
keys = [ keys = [
{ key = "<leader>ff"; cmd = "<cmd>Telescope find_files<cr>"; desc = "Find files"; } { key = "<leader>ff"; cmd = "<cmd>Telescope find_files<cr>"; desc = "Find files"; }
@ -220,13 +219,15 @@ with builtins;
{ key = "<leader>gs"; cmd = "<cmd>Telescope git_status<cr>"; desc = "Status"; } { key = "<leader>gs"; cmd = "<cmd>Telescope git_status<cr>"; desc = "Status"; }
]; ];
dependencies = [ dependencies = [
{ { plugin = plenary-nvim; }
plugin = telescope-nvim; { plugin = which-key-nvim; }
dependencies = [ ];
{ plugin = plenary-nvim; } }
{ plugin = which-key-nvim; } {
]; plugin = telescope-fzf-native-nvim;
} conf = readFile ./telescope-fzf-native-nvim.lua;
dependencies = [
{ plugin = telescope-nvim; }
]; ];
} }
{ {
@ -241,7 +242,9 @@ with builtins;
{ {
plugin = comment-nvim; plugin = comment-nvim;
event = [ "BufReadPost" "BufNewFile" ]; event = [ "BufReadPost" "BufNewFile" ];
conf = "require('Comment').setup()"; conf = ''
require("Comment").setup()
'';
} }
{ {
plugin = leap-nvim; plugin = leap-nvim;