Merge remote-tracking branch 'refs/remotes/origin/nixos' into nixos

This commit is contained in:
Moritz Böhme 2023-10-10 11:58:41 +02:00
commit 9ab5495843
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
12 changed files with 94 additions and 46 deletions

View file

@ -123,6 +123,8 @@ in
"|" = "split-window -h";
"C-l" = "send-keys C-l";
"R" = "source-file $XDG_CONFIG_HOME/tmux/tmux.conf \\; display-message 'Reloaded tmux.conf'";
"f" = "new-window ts";
"a" = "new-window ta";
};
copy-mode-vi = {
"v" = "send -X begin-selection";

View file

@ -30,12 +30,17 @@ in
[
alejandra
black
checkmake
deadnix
dotenv-linter
fish
isort
jq
nixd
nixpkgs-fmt
nodePackages.bash-language-server
nodePackages.jsonlint
ruff-lsp
rustfmt
shellcheck
shfmt
@ -46,6 +51,7 @@ in
typst
typst-lsp
yamlfmt
yamllint
];
extraLuaConfig = readFile ./options.lua;
lazy.enable = true;

View file

@ -86,26 +86,13 @@ with builtins;
{ plugin = cmp-cmdline; }
{ plugin = cmp-nvim-lsp; }
{ plugin = cmp_luasnip; }
{
plugin = codeium-nvim;
opts = { };
}
{ plugin = friendly-snippets; }
{ plugin = lspkind-nvim; }
{ plugin = luasnip; }
{
plugin = copilot-cmp;
opts = { };
dependencies = [
{
plugin = copilot-lua;
opts = {
suggestion = { enabled = false; };
panel = { enabled = false; };
};
conf = /* lua */ ''
require("copilot").setup(opts)
vim.cmd("Copilot disable")
'';
}
];
}
];
}
{
@ -117,7 +104,6 @@ with builtins;
event = [ "BufRead" "BufNewFile" ];
conf = readFile ./lua/nvim-lspconfig.lua;
dependencies = [
{ plugin = lsp_signature-nvim; }
{
plugin = null-ls-nvim;
conf = readFile ./lua/null-ls-nvim.lua;

View file

@ -8,9 +8,15 @@ null_ls.setup({
-- Completion
null_ls.builtins.completion.spell,
-- Diagnostics
null_ls.builtins.diagnostics.checkmake,
null_ls.builtins.diagnostics.deadnix,
null_ls.builtins.diagnostics.dotenv_linter,
null_ls.builtins.diagnostics.fish,
null_ls.builtins.diagnostics.jsonlint,
null_ls.builtins.diagnostics.shellcheck,
null_ls.builtins.diagnostics.statix,
null_ls.builtins.diagnostics.trail_space,
null_ls.builtins.diagnostics.yamllint,
},
})

View file

@ -17,7 +17,7 @@ cmp.setup({
maxwidth = 50, -- prevent the popup from showing more than provided characters
ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead
symbol_map = {
Copilot = "",
Codeium = "",
},
}),
},
@ -56,8 +56,8 @@ cmp.setup({
{ name = "async_path", priority = 1 },
{ name = "buffer", priority = 1 },
{ name = "luasnip", priority = 2 },
{ name = "copilot", group_index = 3 },
{ name = "nvim_lsp", priority = 4 },
{ name = "codeium", priority = 3 },
{ name = "nvim_lsp", priority = 3 },
},
})

View file

@ -19,14 +19,14 @@ let
tmux-sessionizer = pkgs.writeFishApplication {
name = "ts";
runtimeInputs = with pkgs; [ tmux findutils coreutils procps fd fzf1 tmux-switch ];
runtimeInputs = with pkgs; [ tmux findutils coreutils procps fd tmux-switch gawk ];
text = readFile ./tmux-sessionizer/script.fish;
completions = readFile ./tmux-sessionizer/completions.fish;
};
tmux-attach = pkgs.writeFishApplication {
name = "ta";
runtimeInputs = with pkgs; [ tmux fzf1 tmux-switch ];
runtimeInputs = with pkgs; [ tmux tmux-switch ];
text = readFile ./tmux-attach/script.fish;
completions = readFile ./tmux-attach/completions.fish;
};
@ -97,7 +97,7 @@ in
if ! fish_is_root_user && test "$TERM_PROGRAM" != 'vscode' && ${insideVariableMissing}
if test -z $tmux_autostarted
set -x tmux_autostarted true
ts
tmux new -A -s home
end
end
'';

View file

@ -1,4 +1,4 @@
set selected (tmux list-sessions -F '#{session_name}' 2>/dev/null | fzf1 $argv)
set selected (tmux list-sessions -F '#{session_name}' 2>/dev/null | fzf --query "$argv")
if not test -n "$selected"
exit 1
end

9
modules/programs/tmux/tmux-sessionizer/script.fish Normal file → Executable file
View file

@ -1,4 +1,11 @@
set selected (fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec dirname {} | fzf1 $argv)
#!/usr/bin/env fish
set pipe (mktemp --dry-run)
mkfifo $pipe
fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec-batch dirname {} | tee $pipe >/dev/null &
fd . ~/ --min-depth 1 --max-depth 3 --type d --exec-batch realpath {} | tee $pipe >/dev/null &
set selected (cat $pipe | awk '!seen[$0]++' | fzf --query "$argv")
rm -f "$pipe"
set selected_name (basename $selected 2>/dev/null | string replace "." "_")