Compare commits

..

6 commits

10 changed files with 194 additions and 51 deletions

View file

@ -521,6 +521,22 @@
"type": "github"
}
},
"leap-spooky-nvim": {
"flake": false,
"locked": {
"lastModified": 1687792124,
"narHash": "sha256-EPqbsG7KFHdnbW430+BSrPeOoVy99KtIC8OpFbV1ycw=",
"owner": "ggandor",
"repo": "leap-spooky.nvim",
"rev": "e003f2aa376190148f2e7731a60c89239335013c",
"type": "github"
},
"original": {
"owner": "ggandor",
"repo": "leap-spooky.nvim",
"type": "github"
}
},
"lowdown-src": {
"flake": false,
"locked": {
@ -956,6 +972,7 @@
"hypr-contrib": "hypr-contrib",
"hyprland": "hyprland",
"hyprpaper": "hyprpaper",
"leap-spooky-nvim": "leap-spooky-nvim",
"lspsaga-nvim": "lspsaga-nvim",
"master": "master",
"neovim-nightly-overlay": "neovim-nightly-overlay",
@ -966,7 +983,8 @@
"pre-commit-hooks": "pre-commit-hooks",
"rofi-wayland": "rofi-wayland",
"smartcolumn-nvim": "smartcolumn-nvim",
"stable": "stable"
"stable": "stable",
"telekasten-nvim": "telekasten-nvim"
}
},
"rust-overlay": {
@ -1041,6 +1059,22 @@
"type": "github"
}
},
"telekasten-nvim": {
"flake": false,
"locked": {
"lastModified": 1689074017,
"narHash": "sha256-yBw0Ja9xBhHcEdzvKvg6LCDzmIgW9kg0XaXS7hcr958=",
"owner": "renerocksai",
"repo": "telekasten.nvim",
"rev": "4a5e57eee9c5154ed77423bb7fa6619fdb0784cd",
"type": "github"
},
"original": {
"owner": "renerocksai",
"repo": "telekasten.nvim",
"type": "github"
}
},
"wlroots": {
"flake": false,
"locked": {

View file

@ -50,6 +50,12 @@
smartcolumn-nvim.flake = false;
smartcolumn-nvim.url = "github:m4xshen/smartcolumn.nvim";
leap-spooky-nvim.flake = false;
leap-spooky-nvim.url = "github:ggandor/leap-spooky.nvim";
telekasten-nvim.flake = false;
telekasten-nvim.url = "github:renerocksai/telekasten.nvim";
# Hyprland
hypr-contrib.url = "github:hyprwm/contrib";
hyprland.url = "github:hyprwm/Hyprland";

View file

@ -14,6 +14,18 @@ let
'';
};
nom-system-command = command: "${nom-system}/bin/nom-system && ${command}";
f = pkgs.writeFishApplication {
name = "f";
runtimeInputs = with pkgs; [ fzf bat ];
text = ''
#!/usr/bin/env fish
fzf --query "$argv" --multi --bind "enter:become($EDITOR {+})" --preview "bat --color=always --style=header,grid --line-range :500 {+}"
'';
completions = ''
complete -c f
'';
};
in
{
users.users.moritz = {
@ -45,8 +57,6 @@ in
mv = "mv -i";
cd = "z";
f = ''fzf --multi --bind "enter:become($EDITOR {+})" --preview "bat --color=always --style=header,grid --line-range :500 {+}"'';
nixos-switch = nom-system-command "sudo nixos-rebuild switch --flake ~/.dotfiles";
nixos-boot = nom-system-command "sudo nixos-rebuild boot --flake ~/.dotfiles";
nixos-update = "pushd ~/.dotfiles && nix flake update && popd";
@ -118,6 +128,7 @@ in
viu
wget
vim
f
];
fonts.fonts = with pkgs; [

View file

@ -48,9 +48,9 @@ let
listToStringMultiLine id
([
"dir = ${quote plugin}"
"name = ${quote plugin.name}"
"lazy = ${boolToString lazy}"
"name = ${quote (getName plugin)}"
]
++ (optional (!lazy) "lazy = ${boolToString lazy}")
++ (optional (!enabled) "enabled = ${boolToString enabled}")
++ (optional (dependencies != [ ]) "dependencies = ${listToStringMultiLine id (map lazySpecFromPlugin dependencies)}")
++ (optional (init != null) "init = function(plugin)\n${toString init}\nend")
@ -231,7 +231,6 @@ in
nil
nixpkgs-fmt
nodePackages.bash-language-server
nodePackages.cspell
rustfmt
shellcheck
shfmt

View file

@ -200,8 +200,7 @@ with builtins;
conf = readFile ./smartcolumn-nvim.lua;
}
{
plugin = telescope-fzf-native-nvim;
conf = readFile ./telescope-fzf-native-nvim.lua;
plugin = telescope-nvim;
cmd = [ "Telescope" ];
keys = [
{ 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"; }
];
dependencies = [
{
plugin = telescope-nvim;
dependencies = [
{ plugin = plenary-nvim; }
{ plugin = which-key-nvim; }
];
}
{ 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,65 @@ with builtins;
{
plugin = comment-nvim;
event = [ "BufReadPost" "BufNewFile" ];
conf = "require('Comment').setup()";
conf = ''
require("Comment").setup()
'';
}
{
plugin = leap-nvim;
lazy = false;
conf = ''
require("leap").add_default_mappings()
'';
}
{
plugin = leap-spooky-nvim;
lazy = false;
conf = ''
require("leap-spooky").setup()
'';
dependencies = [
{
plugin = leap-nvim;
}
];
}
{
plugin = telekasten-nvim;
dependencies = [
{ plugin = telescope-nvim; }
];
cmd = [ "Telekasten" ];
keys = [
{ key = "<leader>z"; cmd = "<cmd>Telekasten<cr>"; desc = "zettelkasten"; }
];
conf = ''
require("telekasten").setup({
home = vim.fn.expand("~/Nextcloud/Notes/zettelkasten"),
auto_set_filetype = false,
auto_set_syntax = false,
image_subdir = "assets",
})
vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
pattern = "*/zettelkasten/*",
callback = function(event)
vim.api.nvim_buf_set_keymap(0, "n", "<CR>", "", {
callback = function()
local current_word = vim.fn.expand("<cWORD>")
if vim.fn.match(current_word, "[[") == 0 then
require("telekasten").follow_link()
else
require("telekasten").toggle_todo()
end
end,
})
end,
})
'';
}
{
plugin = markdown-preview-nvim;
lazy = false;
}
];
}

View file

@ -1,9 +1,48 @@
require("mini.align").setup()
require("mini.surround").setup()
require("mini.move").setup()
require("mini.pairs").setup()
require("mini.starter").setup()
require("mini.surround").setup({
-- Add custom surroundings to be used on top of builtin ones. For more
-- information with examples, see `:h MiniSurround.config`.
custom_surroundings = nil,
-- Duration (in ms) of highlight when calling `MiniSurround.highlight()`
highlight_duration = 500,
-- Module mappings. Use `''` (empty string) to disable one.
mappings = {
add = "gSa", -- Add surrounding in Normal and Visual modes
delete = "gSd", -- Delete surrounding
find = "gSf", -- Find surrounding (to the right)
find_left = "gSF", -- Find surrounding (to the left)
highlight = "gSh", -- Highlight surrounding
replace = "gSr", -- Replace surrounding
update_n_lines = "gSn", -- Update `n_lines`
suffix_last = "l", -- Suffix to search with "prev" method
suffix_next = "n", -- Suffix to search with "next" method
},
-- Number of lines within which surrounding is searched
n_lines = 20,
-- Whether to respect selection type:
-- - Place surroundings on separate lines in linewise mode.
-- - Place surroundings on each line in blockwise mode.
respect_selection_type = false,
-- How to search for surrounding (first inside current line, then inside
-- neighborhood). One of 'cover', 'cover_or_next', 'cover_or_prev',
-- 'cover_or_nearest', 'next', 'prev', 'nearest'. For more details,
-- see `:h MiniSurround.config`.
search_method = "cover",
-- Whether to disable showing non-error feedback
silent = false,
})
require("mini.tabline").setup()
local tabline_current = vim.api.nvim_get_hl(0, { name = "MiniTablineCurrent" })
vim.api.nvim_set_hl(0, "MiniTablineCurrent", {

View file

@ -3,14 +3,12 @@ local null_ls = require("null-ls")
null_ls.setup({
sources = {
-- Code actions
null_ls.builtins.code_actions.cspell,
null_ls.builtins.code_actions.gitsigns,
null_ls.builtins.code_actions.shellcheck,
null_ls.builtins.code_actions.statix,
-- Completion
null_ls.builtins.completion.spell,
-- Diagnostics
null_ls.builtins.diagnostics.cspell,
null_ls.builtins.diagnostics.deadnix,
null_ls.builtins.diagnostics.shellcheck,
null_ls.builtins.diagnostics.statix,
@ -18,7 +16,6 @@ null_ls.setup({
})
-- disable (c)spell initially
null_ls.disable("cspell")
null_ls.disable("spell")
-- make sources toggle able
@ -31,11 +28,5 @@ require("which-key").register({
end,
"spell",
},
S = {
function()
null_ls.toggle("cspell")
end,
"cspell",
},
},
}, { prefix = "<leader>t" })

View file

@ -4,30 +4,6 @@ with lib;
let
cfg = config.my.programs.tmux;
fzf1 = pkgs.writeShellApplication {
name = "fzf1";
runtimeInputs = with pkgs; [ coreutils fzf ];
text = ''
#!/usr/bin/env bash
options=$(fzf --filter "''$*" < /dev/stdin)
if [[ -z $options ]]; then
exit 1
elif [[ $(wc -l <<< "$options") -eq 1 ]]; then
selected="$options"
else
selected=$(echo "$options" | fzf --query="$*")
fi
if [[ -z $selected ]]; then
exit 0
fi
echo "$selected"
'';
};
tmux-switch = pkgs.writeShellApplication {
name = "tmux-switch";
runtimeInputs = with pkgs; [ tmux ];

View file

@ -1,6 +1,6 @@
{ inputs, lib, ... }:
_: prev:
final: prev:
{
agenix = inputs.agenix.packages.${prev.system}.default;
hyprpaper = inputs.hyprpaper.packages.${prev.system}.default;
@ -10,4 +10,20 @@ _: prev:
src = inputs.rofi-wayland;
version = lib.my.mkVersionInput inputs.rofi-wayland;
});
fzf1 = final.writeShellApplication {
name = "fzf1";
runtimeInputs = with final; [ coreutils fzf fd ];
text = ''
#!/usr/bin/env bash
selected=$(fzf --query="$*" -1 < /dev/stdin)
if [[ -z $selected ]]; then
exit 0
fi
echo "$selected"
'';
};
}

View file

@ -31,5 +31,17 @@ with lib.my;
version = mkVersionInput inputs.cmp-async-path;
src = inputs.cmp-async-path;
});
leap-spooky-nvim = prev.vimUtils.buildVimPluginFrom2Nix {
pname = "leap-spooky-nvim";
version = mkVersionInput inputs.leap-spooky-nvim;
src = inputs.leap-spooky-nvim;
};
telekasten-nvim = prev.vimUtils.buildVimPluginFrom2Nix {
pname = "telekasten-nvim";
version = mkVersionInput inputs.telekasten-nvim;
src = inputs.telekasten-nvim;
};
};
}