feat: add venv-selector, update blink config
This commit is contained in:
@@ -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 = [ ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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";
|
||||
# }
|
||||
# ];
|
||||
}
|
||||
|
||||
3
config/modules/plugins/lsp/pyright.nix
Normal file
3
config/modules/plugins/lsp/pyright.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
lsp.servers.pyright.enable = true;
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
lsp.servers.ruff.enable = true;
|
||||
}
|
||||
@@ -23,9 +23,11 @@
|
||||
|
||||
treesitter-textobjects = {
|
||||
enable = true;
|
||||
select = {
|
||||
enable = true;
|
||||
lookahead = true;
|
||||
settings = {
|
||||
select = {
|
||||
enable = true;
|
||||
lookahead = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
26
config/modules/plugins/venv-selector.nix
Normal file
26
config/modules/plugins/venv-selector.nix
Normal 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";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user