From 9b0cab97090d4742b7b8481bc91780aac5d205fa Mon Sep 17 00:00:00 2001 From: iofq Date: Sun, 6 Apr 2025 01:47:06 -0500 Subject: [PATCH] oil.nvim --- flake.lock | 72 +++++++++++++++++++------------------- flake.nix | 4 +-- nix/neovim-overlay.nix | 5 +-- nvim/lua/plugins/ai.lua | 54 ++++++---------------------- nvim/lua/plugins/debug.lua | 56 ----------------------------- nvim/lua/plugins/lsp.lua | 2 ++ nvim/lua/plugins/misc.lua | 29 +++++++++++++-- 7 files changed, 78 insertions(+), 144 deletions(-) delete mode 100644 nvim/lua/plugins/debug.lua diff --git a/flake.lock b/flake.lock index 2ad9b49..fc325ca 100644 --- a/flake.lock +++ b/flake.lock @@ -74,11 +74,11 @@ ] }, "locked": { - "lastModified": 1741352980, - "narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=", + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", "type": "github" }, "original": { @@ -289,11 +289,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1743293377, - "narHash": "sha256-DqvBHtTslU0E+XMW6xM4SY3UD3+nHAAIXHag0zukrpc=", + "lastModified": 1743898191, + "narHash": "sha256-JCcQDgwYV+C4igYA6DchGpKKA6eyZXLvRrxWHmQbmDk=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "3f10166b5b818227b9d7728f97e67e11cdf27ffd", + "rev": "276567b29d8c9aca7b6a54e93a9183e44a17f19c", "type": "github" }, "original": { @@ -305,11 +305,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1743289921, - "narHash": "sha256-0gsBH+wMZJaXb95GKP6OZmtyhlJh0lS/gsn6J8rxt6k=", + "lastModified": 1743893800, + "narHash": "sha256-i/X0b3b/dAqjNIB5RoryeDvMkVfdoPBwK5xn06W6Wdo=", "owner": "neovim", "repo": "neovim", - "rev": "99529577cc9f5229cbb3dac8ab4782bd43094102", + "rev": "28e819018520a2300eaeeec6794ffcd614b25dd2", "type": "github" }, "original": { @@ -320,11 +320,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1743076231, - "narHash": "sha256-yQugdVfi316qUfqzN8JMaA2vixl+45GxNm4oUfXlbgw=", + "lastModified": 1743689281, + "narHash": "sha256-y7Hg5lwWhEOgflEHRfzSH96BOt26LaYfrYWzZ+VoVdg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6c5963357f3c1c840201eda129a99d455074db04", + "rev": "2bfc080955153be0be56724be6fa5477b4eefabb", "type": "github" }, "original": { @@ -346,22 +346,6 @@ "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" } }, - "nixpkgs-master": { - "locked": { - "lastModified": 1743392618, - "narHash": "sha256-lc4l0nV5WgnS4wuZrX7Na2tRBEpe2IzWmLnhm3+t3Tk=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "cd6f6791e94d08b983fe6d127ec6942176737f6a", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "master", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-stable": { "locked": { "lastModified": 1720386169, @@ -378,13 +362,13 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs-uns": { "locked": { - "lastModified": 1743315132, - "narHash": "sha256-6hl6L/tRnwubHcA4pfUUtk542wn2Om+D4UnDhlDW9BE=", + "lastModified": 1743827369, + "narHash": "sha256-rpqepOZ8Eo1zg+KJeWoq1HAOgoMCDloqv5r2EAa9TSA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "52faf482a3889b7619003c0daec593a1912fddc1", + "rev": "42a1c966be226125b48c384171c44c651c236c22", "type": "github" }, "original": { @@ -394,13 +378,29 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1743962461, + "narHash": "sha256-UaulIYZqwVF7CRYsDG6Jt3k3+Qs21yJT2/CLRWT9qzg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "eb77ff4e9c1f071693be92d144f363ef24701039", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "flake-utils": "flake-utils", "gen-luarc": "gen-luarc", "neovim-nightly-overlay": "neovim-nightly-overlay", "nixpkgs": "nixpkgs_2", - "nixpkgs-master": "nixpkgs-master" + "nixpkgs-uns": "nixpkgs-uns" } }, "systems": { @@ -426,11 +426,11 @@ ] }, "locked": { - "lastModified": 1743081648, - "narHash": "sha256-WRAylyYptt6OX5eCEBWyTwOEqEtD6zt33rlUkr6u3cE=", + "lastModified": 1743748085, + "narHash": "sha256-uhjnlaVTWo5iD3LXics1rp9gaKgDRQj6660+gbUU3cE=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "29a3d7b768c70addce17af0869f6e2bd8f5be4b7", + "rev": "815e4121d6a5d504c0f96e5be2dd7f871e4fd99d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 4571818..dbcbd00 100644 --- a/flake.nix +++ b/flake.nix @@ -2,8 +2,8 @@ description = "Neovim derivation"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - nixpkgs-master.url = "github:NixOS/nixpkgs/master"; + nixpkgs-uns.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/master"; flake-utils.url = "github:numtide/flake-utils"; neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; gen-luarc = { diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index 09e802f..f3219ea 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -26,15 +26,12 @@ with final.pkgs.lib; let neogit nightfox-nvim nvim-autopairs - # nvim-dap - # nvim-dap-go - # nvim-dap-ui nvim-lint nvim-lspconfig - # nvim-nio nvim-treesitter-context nvim-treesitter-textobjects nvim-treesitter.withAllGrammars + oil-nvim refactoring-nvim render-markdown-nvim scope-nvim diff --git a/nvim/lua/plugins/ai.lua b/nvim/lua/plugins/ai.lua index 201beb1..effa2ea 100644 --- a/nvim/lua/plugins/ai.lua +++ b/nvim/lua/plugins/ai.lua @@ -4,48 +4,11 @@ return { cmd = 'Copilot', opts = { panel = { - enabled = true, - auto_refresh = false, - keymap = { - jump_prev = '', - jump_next = '', - accept = '', - toggle = '', - }, + enabled = false, }, suggestion = { enabled = false, }, - completion = { - documentation = { - auto_show = true, - }, - list = { - selection = { - preselect = false, - auto_insert = true, - }, - }, - accept = { - auto_brackets = { - enabled = true, - }, - }, - }, - filetypes = { - go = true, - lua = true, - php = true, - python = true, - ruby = true, - sh = true, - bash = true, - javascript = true, - puppet = true, - yaml = true, - markdown = true, - ['*'] = false, - }, }, }, { @@ -61,14 +24,17 @@ return { chat = { adapter = 'copilot' }, inline = { adapter = 'copilot' }, }, + adapters = { + ollama = function() + return require('codecompanion.adapters').extend('ollama', { + schema = { + model = { default = 'qwen2.5-coder:1.5b' }, + }, + }) + end, + }, }, keys = { - { - 'ac', - 'CodeCompanionChat Toggle', - noremap = true, - desc = 'Copilot chat toggle', - }, { 'as', 'CodeCompanionChat Add', diff --git a/nvim/lua/plugins/debug.lua b/nvim/lua/plugins/debug.lua deleted file mode 100644 index 9679263..0000000 --- a/nvim/lua/plugins/debug.lua +++ /dev/null @@ -1,56 +0,0 @@ -return {} --- { --- 'rcarriga/nvim-dap-ui', --- event = 'VeryLazy', --- dependencies = { --- 'nvim-neotest/nvim-nio', --- }, --- }, --- { --- 'mfussenegger/nvim-dap', --- event = 'VeryLazy', --- dependencies = { --- 'leoluz/nvim-dap-go', --- 'rcarriga/nvim-dap-ui', --- }, --- config = function() --- local d = require('dap') --- local w = require('dap.ui.widgets') --- local ui = require('dapui') --- require('dap-go').setup() --- ui.setup() --- --- local scopes = nil --- vim.keymap.set('n', 'za', function() --- ui.toggle() --- end, { desc = 'toggle dapui' }) --- vim.keymap.set('n', 'zz', function() --- d.continue() --- end, { desc = 'start debugger' }) --- vim.keymap.set('n', 'zn', function() --- d.step_over() --- end, { desc = 'step over' }) --- vim.keymap.set('n', 'zi', function() --- d.step_into() --- end, { desc = 'step into' }) --- vim.keymap.set('n', 'zo', function() --- d.step_out() --- end, { desc = 'step out' }) --- vim.keymap.set('n', 'zx', function() --- d.toggle_breakpoint() --- end, { desc = 'toggle_breakpoint' }) --- vim.keymap.set('n', 'zr', function() --- d.run_last() --- end, { desc = 'run prev' }) --- vim.keymap.set({ 'n', 'v' }, 'zh', function() --- ui.eval() --- end, { desc = 'hover' }) --- vim.keymap.set({ 'n', 'v' }, 'zp', function() --- require('dap.ui.widgets').preview() --- end, { desc = 'preview' }) --- vim.keymap.set('n', 'zf', function() --- local widgets = require('dap.ui.widgets') --- widgets.centered_float(widgets.frames) --- end, { desc = 'view frames' }) --- end, --- }, diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index 54288fe..6848030 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -179,6 +179,8 @@ return { formatters_by_ft = { json = { 'jq' }, puppet = { 'puppet-lint' }, + lua = { 'stylua' }, + python = { 'ruff' }, ['*'] = { 'trim_whitespace' }, }, format_on_save = function(bufnr) diff --git a/nvim/lua/plugins/misc.lua b/nvim/lua/plugins/misc.lua index 9343772..c5da54a 100644 --- a/nvim/lua/plugins/misc.lua +++ b/nvim/lua/plugins/misc.lua @@ -1,8 +1,33 @@ return { { 'windwp/nvim-autopairs', - event = "InsertEnter", - config = true + event = 'InsertEnter', + config = true, + }, + { + 'stevearc/oil.nvim', + opts = { + watch_for_changes = true, + columns = { + 'permissions', + 'size', + }, + view_options = { + show_hidden = true, + }, + keymaps = { + ['wq'] = 'actions.close', + }, + }, + keys = { + { + 'nc', + function() + require('oil').toggle_float() + end, + { noremap = true, silent = true }, + }, + }, }, { 'jinh0/eyeliner.nvim',