From 1a8c7395cef7a93737c80968900eadd46d3cf07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Mon, 17 Feb 2025 17:57:36 +0100 Subject: [PATCH] Update nvim plugins --- flake.lock | 4 +- home/nvim/files/lua/plugins/blink.lua | 2 +- home/nvim/files/lua/plugins/init.lua | 11 ++- home/nvim/files/lua/plugins/nvim-lint.lua | 15 ++-- home/nvim/files/lua/plugins/snacks.lua | 77 +++++++++++++++++- home/nvim/files/lua/plugins/telescope.lua | 98 ----------------------- hosts/Riva/default.nix | 17 +++- 7 files changed, 104 insertions(+), 120 deletions(-) delete mode 100644 home/nvim/files/lua/plugins/telescope.lua diff --git a/flake.lock b/flake.lock index 16ec38b..1790281 100644 --- a/flake.lock +++ b/flake.lock @@ -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" } }, diff --git a/home/nvim/files/lua/plugins/blink.lua b/home/nvim/files/lua/plugins/blink.lua index eba35e8..9a85834 100644 --- a/home/nvim/files/lua/plugins/blink.lua +++ b/home/nvim/files/lua/plugins/blink.lua @@ -89,7 +89,7 @@ return { settings = { basedpyright = { analysis = { - typeCheckingMode = "basic", + typeCheckingMode = "strict", autoImportCompletions = true } } diff --git a/home/nvim/files/lua/plugins/init.lua b/home/nvim/files/lua/plugins/init.lua index 1e712a6..282ecb2 100644 --- a/home/nvim/files/lua/plugins/init.lua +++ b/home/nvim/files/lua/plugins/init.lua @@ -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 = {} } } diff --git a/home/nvim/files/lua/plugins/nvim-lint.lua b/home/nvim/files/lua/plugins/nvim-lint.lua index a7d13b8..f17e764 100644 --- a/home/nvim/files/lua/plugins/nvim-lint.lua +++ b/home/nvim/files/lua/plugins/nvim-lint.lua @@ -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, }) diff --git a/home/nvim/files/lua/plugins/snacks.lua b/home/nvim/files/lua/plugins/snacks.lua index 98d9c4b..510aac2 100644 --- a/home/nvim/files/lua/plugins/snacks.lua +++ b/home/nvim/files/lua/plugins/snacks.lua @@ -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 = { - {"t", function() require("snacks").explorer() end} + {"t", function() require("snacks").explorer() end}, + {"", function() require("snacks").picker.lsp_symbols({layout = {preset = "right"}, focus="list"}) end}, + {"", function() require("snacks").picker.lsp_workspace_symbols({layout = {preset = "vertical"}}) end}, + {"", function() require("snacks").picker.recent({layout = {preset = "vertical"}}) end}, + {"", function() require("snacks").picker({layout = {preset = "vscode"}}) end}, + {"", function() require("snacks").picker.git_files({layout = {preset = "vscode"}}) end}, + {"", function() require("snacks").picker.buffers({layout = {preset = "vscode"}}) end}, + {"", function() require("snacks").picker.grep({layout = {preset = "vertical"}}) end}, + {"", function() require("snacks").words.jump(1) end}, } } diff --git a/home/nvim/files/lua/plugins/telescope.lua b/home/nvim/files/lua/plugins/telescope.lua deleted file mode 100644 index 097a090..0000000 --- a/home/nvim/files/lua/plugins/telescope.lua +++ /dev/null @@ -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, - [""] = require("telescope.actions").move_selection_next, - [""] = 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 = { - [""] = require("telescope-undo.actions").restore, - [""] = require("telescope-undo.actions").yank_additions, - }, - }, - - } - }, - fzy_native = { - override_generic_sorter = false, - override_file_sorter = true, - } - }, - keys = { - { "u", require("telescope").extensions.undo.undo}, - { "", function () - local opts = require('telescope.themes').get_ivy({}) - opts["layout_config"] = {height=0.2} - require("telescope.builtin").oldfiles(opts) - end}, - { "", function () require"telescope.builtin".live_grep({ path_display = { 'smart' }, }) end}, - { "", 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}, - { "", function () -- project files - local opts = require('telescope.themes').get_ivy({}) - opts["layout_config"] = {height=0.2} - require"telescope.builtin".find_files(opts) - end}, - { "", function () -- buffer files - local opts = require('telescope.themes').get_ivy({}) - opts["layout_config"] = {height=0.2} - require"telescope.builtin".buffers(opts) - end}, - { "", 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}, - { "", 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 - } diff --git a/hosts/Riva/default.nix b/hosts/Riva/default.nix index 50f0c6d..bd7a03d 100644 --- a/hosts/Riva/default.nix +++ b/hosts/Riva/default.nix @@ -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"]; + }; }