feat(nvim): add hmts.nvim
This commit is contained in:
parent
31012a6274
commit
0c591c0435
6 changed files with 43 additions and 19 deletions
|
|
@ -50,22 +50,22 @@ in
|
|||
${exportedVariables}
|
||||
'';
|
||||
functions = {
|
||||
gi = with pkgs; ''
|
||||
gi = ''
|
||||
set url https://www.gitignore.io/api
|
||||
|
||||
if test (count $argv) -eq 0
|
||||
set choice ( curl -sL $url/list \
|
||||
| string split "," \
|
||||
| ${fzf}/bin/fzf -m \
|
||||
| ${getExe pkgs.fzf} -m \
|
||||
| string join "," )
|
||||
else
|
||||
set choice (string join "," $argv[1..])
|
||||
end
|
||||
|
||||
if ${gum}/bin/gum confirm "Overwrite current .gitignore?"
|
||||
${curl}/bin/curl -sL $url/$choice > .gitignore
|
||||
if ${getExe pkgs.gum} confirm "Overwrite current .gitignore?"
|
||||
${getExe pkgs.curl} -sL $url/$choice > .gitignore
|
||||
else
|
||||
${curl}/bin/curl -sL $url/$choice >> .gitignore
|
||||
${getExe pkgs.curl} -sL $url/$choice >> .gitignore
|
||||
end
|
||||
'';
|
||||
fish_greeting = "";
|
||||
|
|
|
|||
|
|
@ -12,14 +12,8 @@ let
|
|||
id = x: x;
|
||||
listToString = sep: f: list: ''{ ${concatStringsSep sep (map f list)} }'';
|
||||
listToStringOneLine = listToString ", ";
|
||||
listToStringMultiLine = listToString ",\n";
|
||||
keybinding =
|
||||
{ key
|
||||
, cmd
|
||||
, func
|
||||
, mode
|
||||
, desc
|
||||
}:
|
||||
listToStringMultiLine' = listToString ",\n" id;
|
||||
keybinding = { key, cmd, func, mode, desc }:
|
||||
let
|
||||
cmdString =
|
||||
if cmd != null
|
||||
|
|
@ -62,7 +56,7 @@ let
|
|||
++ (optional (priority != null) "priority = ${toString priority}")
|
||||
);
|
||||
lazySpecs = listToStringMultiLine id (map lazySpecFromPlugin cfg.plugins);
|
||||
lazy = ''
|
||||
lazy = /* lua */ ''
|
||||
require("lazy").setup(${lazySpecs})
|
||||
'';
|
||||
in
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ with builtins;
|
|||
{ key = "<leader>st"; cmd = "<cmd>TodoTelescope<cr>"; desc = "Todo"; }
|
||||
{
|
||||
key = "[q";
|
||||
func = ''function()
|
||||
func = /* lua */ ''function()
|
||||
if require("trouble").is_open() then
|
||||
require("trouble").previous({ skip_groups = true, jump = true })
|
||||
else
|
||||
|
|
@ -58,7 +58,7 @@ with builtins;
|
|||
}
|
||||
{
|
||||
key = "]q";
|
||||
func = ''function()
|
||||
func = /* lua */ ''function()
|
||||
if require("trouble").is_open() then
|
||||
require("trouble").next({ skip_groups = true, jump = true })
|
||||
else
|
||||
|
|
@ -200,7 +200,7 @@ with builtins;
|
|||
{
|
||||
plugin = comment-nvim;
|
||||
event = [ "BufReadPost" "BufNewFile" ];
|
||||
conf = ''
|
||||
conf = /* lua */ ''
|
||||
require("Comment").setup()
|
||||
'';
|
||||
}
|
||||
|
|
@ -243,14 +243,14 @@ with builtins;
|
|||
{
|
||||
plugin = nvim-surround;
|
||||
event = [ "BufReadPost" "BufNewFile" ];
|
||||
conf = ''
|
||||
conf = /* lua */ ''
|
||||
require("nvim-surround").setup({})
|
||||
'';
|
||||
}
|
||||
{
|
||||
plugin = nvim-treesitter-context;
|
||||
event = [ "BufReadPost" "BufNewFile" ];
|
||||
conf = ''
|
||||
conf = /* lua */ ''
|
||||
require("treesitter-context").setup({})
|
||||
'';
|
||||
}
|
||||
|
|
@ -258,5 +258,9 @@ with builtins;
|
|||
plugin = dressing-nvim;
|
||||
event = [ "VeryLazy" ];
|
||||
}
|
||||
{
|
||||
plugin = hmts-nvim;
|
||||
ft = [ "nix" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue