Update nvim plugins

This commit is contained in:
Thomas Avé 2025-02-17 17:57:36 +01:00
parent 81e8786924
commit 1a8c7395ce
7 changed files with 104 additions and 120 deletions

View File

@ -8,11 +8,11 @@
"locked": {
"lastModified": 1,
"narHash": "sha256-DuhR3y0gPZG0AJ2FDd+nUKzQMwT+c/DFIUWNDQ5Uyx4=",
"path": "/nix/store/wj2s80jgks6fvyb7b8494qxspr7v7kql-source/home/ags",
"path": "/nix/store/1mcbnsa0w6wi9gpmnycj9zdj21gv9yqf-source/home/ags",
"type": "path"
},
"original": {
"path": "/nix/store/wj2s80jgks6fvyb7b8494qxspr7v7kql-source/home/ags",
"path": "/nix/store/1mcbnsa0w6wi9gpmnycj9zdj21gv9yqf-source/home/ags",
"type": "path"
}
},

View File

@ -89,7 +89,7 @@ return {
settings = {
basedpyright = {
analysis = {
typeCheckingMode = "basic",
typeCheckingMode = "strict",
autoImportCompletions = true
}
}

View File

@ -6,6 +6,15 @@ return {
{'windwp/nvim-autopairs', event = "InsertEnter", opts = {}},
{'NeogitOrg/neogit', dependencies = {"nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim", "sindrets/diffview.nvim"}, config = true, lazy = true},
{'lervag/vimtex', ft='latex'},
{'numToStr/Comment.nvim', config = function () require('Comment').setup() end},
{'numToStr/Comment.nvim',
opts = {
mappings = {
basic = false
},
toggler = {
line = "gcc"
}
},
},
{ "folke/todo-comments.nvim", dependencies = { "nvim-lua/plenary.nvim" }, opts = {} }
}

View File

@ -1,13 +1,8 @@
return {
"mfussenegger/nvim-lint",
config = function ()
local dmypy = require("lint").linters.dmypy
dmypy.args = {
'run',
"--timeout",
"50000",
"--export-types",
"--",
local mypy = require("lint").linters.mypy
mypy.args = {
'--show-column-numbers',
'--show-error-end',
'--hide-error-context',
@ -15,7 +10,7 @@ return {
'--no-error-summary',
'--no-pretty',
'--cache-dir',
vim.fn.stdpath("cache") .. '/dmypy',
vim.fn.stdpath("cache") .. '/mypy',
'--cache-fine-grained',
'--sqlite-cache',
'--skip-cache-mtime-checks',
@ -25,12 +20,12 @@ return {
end
}
require("lint").linters_by_ft = {
python = {"dmypy"},
python = {"mypy"},
}
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
callback = function()
-- try_lint without arguments runs the linters defined in `linters_by_ft`
-- for the current filetype
-- for the current tile type
require("lint").try_lint()
end,
})

View File

@ -1,14 +1,83 @@
return {
"folke/snacks.nvim",
config = function()
vim.api.nvim_create_user_command("GitBrowse", function()
lazy = false,
opts = {
gitbrowse = {
open = function(url)
vim.fn.setreg('+', url) -- Copy to clipboard
end
},
bigfile = { enabled = true },
explorer = { enabled = true },
indent = {
enabled = true,
animate = {
enabled = false
}
},
input = { enabled = true },
picker = { enabled = true },
notifier = { enabled = true },
quickfile = { enabled = true },
scope = {
enabled = true,
keys = {
textobject = {
ii = {
min_size = 2, -- minimum size of the scope
edge = false, -- inner scope
cursor = false,
treesitter = { blocks = { enabled = false } },
desc = "inner scope",
},
ai = {
cursor = false,
min_size = 2, -- minimum size of the scope
treesitter = { blocks = { enabled = false } },
desc = "full scope",
},
},
jump = {
["gt"] = {
min_size = 1, -- allow single line scopes
bottom = false,
cursor = false,
edge = true,
treesitter = { blocks = { enabled = false } },
desc = "jump to top edge of scope",
},
["gb"] = {
min_size = 1, -- allow single line scopes
bottom = true,
cursor = false,
edge = true,
treesitter = { blocks = { enabled = false } },
desc = "jump to bottom edge of scope",
},
}
}
},
statuscolumn = { enabled = true },
words = { enabled = true },
},
config = function(_, opts)
vim.api.nvim_create_user_command("GitLink", function()
require("snacks").gitbrowse()
end, {})
vim.api.nvim_create_user_command("GitBlameLine", function()
require("snacks").gitbrowse()
require("snacks").git.blame_line()
end, {})
require("snacks").setup(opts)
end,
keys = {
{"<leader>t", function() require("snacks").explorer() end}
{"<leader>t", function() require("snacks").explorer() end},
{"<c-m>", function() require("snacks").picker.lsp_symbols({layout = {preset = "right"}, focus="list"}) end},
{"<c-s-m>", function() require("snacks").picker.lsp_workspace_symbols({layout = {preset = "vertical"}}) end},
{"<c-space>", function() require("snacks").picker.recent({layout = {preset = "vertical"}}) end},
{"<c-cr>", function() require("snacks").picker({layout = {preset = "vscode"}}) end},
{"<c-p>", function() require("snacks").picker.git_files({layout = {preset = "vscode"}}) end},
{"<c-o>", function() require("snacks").picker.buffers({layout = {preset = "vscode"}}) end},
{"<c-f>", function() require("snacks").picker.grep({layout = {preset = "vertical"}}) end},
{"<c-n>", function() require("snacks").words.jump(1) end},
}
}

View File

@ -1,98 +0,0 @@
return {
'nvim-telescope/telescope.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope-fzy-native.nvim',
},
opts = {
defaults = {
file_ignore_patterns = {
".cache/.*",
"node_modules/.*",
".git/.*",
"Venv/.*",
"venv/.*",
"wandb/.*",
"Resources/.*",
"build/.*"
},
mappings = {
i = {
["jj"] = require("telescope.actions").close,
["<C-j>"] = require("telescope.actions").move_selection_next,
["<C-k>"] = require("telescope.actions").move_selection_previous,
},
},
file_sorter = require'telescope.sorters'.get_fzy_sorter,
generic_sorter = require'telescope.sorters'.get_fzy_sorter,
},
extensions = {
undo = {
side_by_side = false,
layout_strategy = "vertical",
use_delta = true,
layout_config = {
preview_height = 0.5,
},
mappings = {
i = {
["<cr>"] = require("telescope-undo.actions").restore,
["<S-y>"] = require("telescope-undo.actions").yank_additions,
},
},
}
},
fzy_native = {
override_generic_sorter = false,
override_file_sorter = true,
}
},
keys = {
{ "<leader>u", require("telescope").extensions.undo.undo},
{ "<C-Space>", function ()
local opts = require('telescope.themes').get_ivy({})
opts["layout_config"] = {height=0.2}
require("telescope.builtin").oldfiles(opts)
end},
{ "<C-f>", function () require"telescope.builtin".live_grep({ path_display = { 'smart' }, }) end},
{ "<C-p>", function () -- git files
local opts = require('telescope.themes').get_ivy({})
opts["show_untracked"] = true
opts["layout_config"] = {height=0.2}
if not pcall(require"telescope.builtin".git_files, opts) then
require"telescope.builtin".find_files(opts)
end
end},
{ "<C-S-o>", function () -- project files
local opts = require('telescope.themes').get_ivy({})
opts["layout_config"] = {height=0.2}
require"telescope.builtin".find_files(opts)
end},
{ "<C-o>", function () -- buffer files
local opts = require('telescope.themes').get_ivy({})
opts["layout_config"] = {height=0.2}
require"telescope.builtin".buffers(opts)
end},
{ "<C-m>", function () -- methods / classes
local opts = require('telescope.themes').get_ivy({})
opts["layout_config"] = {height=0.2}
opts["symbols"] = { "class", "method", "function" }
require("telescope.builtin").lsp_document_symbols(opts)
end},
{ "<C-S-f>", function () -- fuzzy search
require"telescope.builtin".grep_string({
path_display = { 'smart' },
only_sort_text = true,
word_match = "-w",
search = '',
})
end},
},
config = function (_, opts)
local telescope = require("telescope")
telescope.setup(opts)
telescope.load_extension("undo")
telescope.load_extension('fzy_native')
end
}

View File

@ -1,10 +1,7 @@
{ inputs, config, pkgs, ... }:
let
serverIP = "192.168.1.2";
in {
{
imports = [
(import ../Common/default.nix { inherit inputs config pkgs; })
(import ../Common/nfs.nix { inherit pkgs serverIP; })
];
boot.kernelPackages = pkgs.linuxPackages_latest;
@ -25,4 +22,16 @@ in {
}];
};
};
fileSystems."/home/server/Workspace" = {
device = "/home/server/Workspace";
fsType = "virtiofs";
};
fileSystems."/home/server/.cache/fzgo" = {
device = "/home/server/.cache/fzgo";
fsType = "virtiofs";
};
fileSystems."/home/user/Workspace" = {
device = "/home/server/Workspace";
options = ["bind"];
};
}