feat: add venv-selector, update blink config
All checks were successful
check-commits / Check commits (pull_request) Successful in 8s
build-flake / build (pull_request) Successful in 4m2s

This commit is contained in:
2025-11-12 17:09:40 +02:00
parent 512086bffe
commit b614474c26
10 changed files with 70 additions and 169 deletions

View File

@@ -2,10 +2,6 @@
plugins.blink-cmp = {
enable = true;
settings = {
appearance = {
nerd_font_variant = "normal";
use_nvim_cmp_as_default = true;
};
completion = {
accept = {
auto_brackets = {
@@ -15,39 +11,17 @@
};
};
};
trigger = {
show_on_keyword = true;
show_on_trigger_character = true;
};
documentation = {
auto_show = true;
auto_show_delay_ms = 500;
};
menu = {
auto_show = true;
};
};
keymap = {
preset = "default";
};
signature = {
enabled = true;
};
sources = {
default = [
"omni"
"lsp"
"buffer"
"snippets"
"path"
];
providers = {
buffer = {
score_offset = -7;
};
lsp = {
fallbacks = [ ];
};
};
};
};
};

View File

@@ -46,41 +46,8 @@
plugins.conform-nvim = {
enable = true;
autoInstall.enable = true;
settings = {
format_on_save = ''
function(bufnr)
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
if slow_format_filetypes[vim.bo[bufnr].filetype] then
return
end
local function on_format(err)
if err and err:match("timeout$") then
slow_format_filetypes[vim.bo[bufnr].filetype] = true
end
end
return { timeout_ms = 200, lsp_fallback = true }, on_format
end
'';
format_after_save = ''
function(bufnr)
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
if not slow_format_filetypes[vim.bo[bufnr].filetype] then
return
end
return { lsp_fallback = true }
end
'';
notify_on_error = true;
formatters_by_ft = {
html = {
__unkeyed-1 = "prettierd";
@@ -112,7 +79,7 @@
__unkeyed-2 = "prettier";
stop_after_first = true;
};
python = [ "ruff" ];
python = [ "ruff_format" ];
lua = [ "stylua" ];
nix = [ "nixfmt-rfc-style" ];
markdown = {
@@ -132,43 +99,14 @@
"shfmt"
];
json = [ "jq" ];
go = [
"goimports"
"gofmt"
];
"_" = [ "trim_whitespace" ];
};
formatters = {
ruff = {
command = "${lib.getExe pkgs.ruff}";
};
nixfmt-rfc-style = {
command = "${lib.getExe pkgs.nixfmt-rfc-style}";
};
alejandra = {
command = "${lib.getExe pkgs.alejandra}";
};
jq = {
command = "${lib.getExe pkgs.jq}";
};
prettier = {
command = "${lib.getExe pkgs.nodePackages.prettier}";
};
prettierd = {
command = "${lib.getExe pkgs.prettierd}";
};
stylua = {
command = "${lib.getExe pkgs.stylua}";
};
shellcheck = {
command = "${lib.getExe pkgs.shellcheck}";
};
shfmt = {
command = "${lib.getExe pkgs.shfmt}";
};
shellharden = {
command = "${lib.getExe pkgs.shellharden}";
};
yamlfmt = {
command = "${lib.getExe pkgs.yamlfmt}";
};
terraform_fmt = {
command = "${lib.getExe (
pkgs.terraform.overrideAttrs (oldAttrs: {

View File

@@ -17,59 +17,8 @@
./lua_ls.nix
./marksman.nix
./nixd.nix
./ruff.nix
./pyright.nix
./tflint.nix
./yamlls.nix
];
# lsp.keymaps = [
# {
# key = "gd";
# lspBufAction = "definition";
# }
# {
# key = "gD";
# lspBufAction = "references";
# }
# {
# key = "gt";
# lspBufAction = "type_definition";
# }
# {
# key = "gi";
# lspBufAction = "implementation";
# }
# {
# key = "K";
# lspBufAction = "hover";
# }
# {
# action = lib.nixvim.mkRaw "function() vim.diagnostic.jump({ count=-1, float=true }) end";
# key = "<leader>k";
# }
# {
# action = lib.nixvim.mkRaw "function() vim.diagnostic.jump({ count=1, float=true }) end";
# key = "<leader>j";
# }
# {
# action = "<CMD>LspStop<Enter>";
# key = "<leader>lx";
# }
# {
# action = "<CMD>LspStart<Enter>";
# key = "<leader>ls";
# }
# {
# action = "<CMD>LspRestart<Enter>";
# key = "<leader>lr";
# }
# # {
# # action = lib.nixvim.mkRaw "require('telescope.builtin').lsp_definitions";
# # key = "gd";
# # }
# {
# action = "<CMD>Lspsaga hover_doc<Enter>";
# key = "K";
# }
# ];
}

View File

@@ -0,0 +1,3 @@
{
lsp.servers.pyright.enable = true;
}

View File

@@ -1,3 +0,0 @@
{
lsp.servers.ruff.enable = true;
}

View File

@@ -23,9 +23,11 @@
treesitter-textobjects = {
enable = true;
select = {
enable = true;
lookahead = true;
settings = {
select = {
enable = true;
lookahead = true;
};
};
};
};

View File

@@ -0,0 +1,26 @@
{ lib, ... }:
{
plugins.venv-selector = {
enable = true;
settings = {
dap_enabled = true;
name = [
"venv"
".venv"
];
pyenv_path = lib.nixvim.mkRaw "vim.fn.expand('$HOME/.pyenv/versions')";
};
};
keymaps = [
{
mode = "n";
key = "<leader>cv";
action = "<cmd>VenvSelect<CR>";
options = {
desc = "Select Python virtual env";
};
}
];
}