From d85e9241e97e732b4b4cd51cd7127f96775f8cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Doma=C5=84ski?= Date: Tue, 20 Jan 2026 11:35:53 +0100 Subject: [PATCH] [nvim] ai git --- .config/aliasrc/programs | 2 +- .config/nvim/lazy-lock.json | 8 +- .config/nvim/lua/config/autocmds.lua | 18 +-- .config/nvim/lua/plugins/ai.lua | 146 +++++++++++-------------- .config/nvim/lua/plugins/git.lua | 4 + .config/scriptrc/convert_git_remote.sh | 7 -- 6 files changed, 81 insertions(+), 104 deletions(-) delete mode 100644 .config/scriptrc/convert_git_remote.sh diff --git a/.config/aliasrc/programs b/.config/aliasrc/programs index 9e58905..1561b03 100755 --- a/.config/aliasrc/programs +++ b/.config/aliasrc/programs @@ -13,7 +13,7 @@ alias grep='grep --color=auto' # ls if type eza &>/dev/null; then alias ls='eza --icons -g' - lst() { eza --no-icons --sort=time | head --lines=1; } + lst() { \ls -t | head --lines=1; } fi alias ll='ls -lh' diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 5fbacda..6a44987 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,16 +1,13 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "LuaSnip": { "branch": "master", "commit": "ccf25a5452b8697a823de3e5ecda63ed3d723b79" }, - "avante.nvim": { "branch": "main", "commit": "15ef2a012c8dca7e43bdc4a5e61d122792da5779" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, - "copilot.lua": { "branch": "master", "commit": "93adf9844dcbe09a37e7a72eaa286d33d38bf628" }, + "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, "flutter-tools.nvim": { "branch": "main", "commit": "69db9cdac65ce536e20a8fc9a83002f007cc049c" }, - "fzf-lua": { "branch": "main", "commit": "a8458b79a957a6e3e217d84106a0fd4b9470ff4c" }, "gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" }, "harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" }, - "img-clip.nvim": { "branch": "main", "commit": "e7e29f0d07110405adecd576b602306a7edd507a" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "lazy.nvim": { "branch": "main", "commit": "f0f5bbb9e5bfae5e6468f9359ffea3d151418176" }, "lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" }, @@ -18,7 +15,6 @@ "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, "mini.indentscope": { "branch": "main", "commit": "e9fa0714fc753e1e737940577904e553ee340903" }, "mini.nvim": { "branch": "main", "commit": "ee4a4a4abed25e3d108d985b0553c5271f2f71aa" }, - "mini.pick": { "branch": "main", "commit": "bb764a57b349ad3e8d5e7d8855b0c6104e2cc17c" }, "neo-tree.nvim": { "branch": "main", "commit": "146408d801da2e9d917ca275f86b788fe612df85" }, "noice.nvim": { "branch": "main", "commit": "5099348591f7d3ba9e547b1e631c694c65bbe0b9" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, @@ -32,8 +28,6 @@ "nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" }, "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "render-markdown.nvim": { "branch": "main", "commit": "10126effbafb74541b69219711dfb2c631e7ebf8" }, - "snacks.nvim": { "branch": "main", "commit": "76160be5d38cd67e46557cb5d0b3e36ececdfa3c" }, "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, diff --git a/.config/nvim/lua/config/autocmds.lua b/.config/nvim/lua/config/autocmds.lua index 39d22d8..bb9e39a 100644 --- a/.config/nvim/lua/config/autocmds.lua +++ b/.config/nvim/lua/config/autocmds.lua @@ -2,18 +2,18 @@ vim.o.updatetime = 250 vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]] -local nvim_lsp_omit_dir = os.getenv("NVIM_LSP_OMIT_DIR") - -if not nvim_lsp_omit_dir then +if not os.getenv("NVIM_LSP_OMIT_DIR") then vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("lsp", { clear = true }), callback = function(args) - vim.api.nvim_create_autocmd("BufWritePre", { - buffer = args.buf, - callback = function() - vim.lsp.buf.format {} - end, - }) + if not os.getenv("NVIM_LSP_NO_AUTOFMT") then + vim.api.nvim_create_autocmd("BufWritePre", { + buffer = args.buf, + callback = function() + vim.lsp.buf.format {} + end, + }) + end end }) end diff --git a/.config/nvim/lua/plugins/ai.lua b/.config/nvim/lua/plugins/ai.lua index 4eeeb95..2bb524d 100644 --- a/.config/nvim/lua/plugins/ai.lua +++ b/.config/nvim/lua/plugins/ai.lua @@ -12,84 +12,70 @@ return { vim.keymap.set('i', '', function() return vim.fn['codeium#Clear']() end, { expr = true, silent = true }) end }, - { - "yetone/avante.nvim", - -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` - -- ⚠️ must add this setting! ! ! - build = function() - -- conditionally use the correct build system for the current OS - if vim.fn.has("win32") == 1 then - return "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" - else - return "make" - end - end, - event = "VeryLazy", - version = false, -- Never set this value to "*"! Never! - ---@module 'avante' - ---@type avante.Config - opts = { - -- add any opts here - -- for example - provider = "claude", - providers = { - claude = { - endpoint = "https://api.anthropic.com", - model = "claude-sonnet-4-20250514", - timeout = 30000, -- Timeout in milliseconds - extra_request_body = { - temperature = 0.75, - max_tokens = 20480, - }, - }, - moonshot = { - endpoint = "https://api.moonshot.ai/v1", - model = "kimi-k2-0711-preview", - timeout = 30000, -- Timeout in milliseconds - extra_request_body = { - temperature = 0.75, - max_tokens = 32768, - }, - }, - }, - }, - dependencies = { - "nvim-lua/plenary.nvim", - "MunifTanjim/nui.nvim", - --- The below dependencies are optional, - "echasnovski/mini.pick", -- for file_selector provider mini.pick - "nvim-telescope/telescope.nvim", -- for file_selector provider telescope - "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions - "ibhagwan/fzf-lua", -- for file_selector provider fzf - "stevearc/dressing.nvim", -- for input provider dressing - "folke/snacks.nvim", -- for input provider snacks - "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons - "zbirenbaum/copilot.lua", -- for providers='copilot' - { - -- support for image pasting - "HakonHarnes/img-clip.nvim", - event = "VeryLazy", - opts = { - -- recommended settings - default = { - embed_image_as_base64 = false, - prompt_for_file_name = false, - drag_and_drop = { - insert_mode = true, - }, - -- required for Windows users - use_absolute_path = true, - }, - }, - }, - { - -- Make sure to set this up properly if you have lazy=true - 'MeanderingProgrammer/render-markdown.nvim', - opts = { - file_types = { "markdown", "Avante" }, - }, - ft = { "markdown", "Avante" }, - }, - }, - }, + -- { + -- "yetone/avante.nvim", + -- -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` + -- -- ⚠️ must add this setting! ! ! + -- build = vim.fn.has("win32") ~= 0 + -- and "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" + -- or "make", + -- event = "VeryLazy", + -- version = false, -- Never set this value to "*"! Never! + -- ---@module 'avante' + -- ---@type avante.Config + -- opts = { + -- -- add any opts here + -- -- this file can contain specific instructions for your project + -- instructions_file = "avante.md", + -- -- for example + -- provider = "ollama", + -- providers = { + -- ollama = { + -- -- endpoint = "http://192.168.10.237:11434", + -- endpoint = "http://127.0.0.1:8080", + -- -- model = "qwen2.5-coder:32b", + -- model = "qwen2.5-coder:7b", + -- -- model = "codellama:7b-code", + -- }, + -- } + -- }, + -- dependencies = { + -- "nvim-lua/plenary.nvim", + -- "MunifTanjim/nui.nvim", + -- --- The below dependencies are optional, + -- "nvim-mini/mini.pick", -- for file_selector provider mini.pick + -- "nvim-telescope/telescope.nvim", -- for file_selector provider telescope + -- "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions + -- "ibhagwan/fzf-lua", -- for file_selector provider fzf + -- "stevearc/dressing.nvim", -- for input provider dressing + -- "folke/snacks.nvim", -- for input provider snacks + -- "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons + -- "zbirenbaum/copilot.lua", -- for providers='copilot' + -- { + -- -- support for image pasting + -- "HakonHarnes/img-clip.nvim", + -- event = "VeryLazy", + -- opts = { + -- -- recommended settings + -- default = { + -- embed_image_as_base64 = false, + -- prompt_for_file_name = false, + -- drag_and_drop = { + -- insert_mode = true, + -- }, + -- -- required for Windows users + -- use_absolute_path = true, + -- }, + -- }, + -- }, + -- { + -- -- Make sure to set this up properly if you have lazy=true + -- 'MeanderingProgrammer/render-markdown.nvim', + -- opts = { + -- file_types = { "markdown", "Avante" }, + -- }, + -- ft = { "markdown", "Avante" }, + -- }, + -- }, + -- }, } diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index 2e37f11..4fc2342 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -1,4 +1,8 @@ return { + { + "sindrets/diffview.nvim", + cmd = { "DiffviewOpen", "DiffviewClose", "DiffviewToggleFiles", "DiffviewFocusFiles" }, + }, { "lewis6991/gitsigns.nvim", event = { "BufReadPre", "BufNewFile" }, diff --git a/.config/scriptrc/convert_git_remote.sh b/.config/scriptrc/convert_git_remote.sh deleted file mode 100644 index 05a2fc4..0000000 --- a/.config/scriptrc/convert_git_remote.sh +++ /dev/null @@ -1,7 +0,0 @@ -# converts old https remote to ssh -function convert_git_remote() { - local remote="${1:-origin}" - new_remote=$(git remote get-url ${remote} | sed 's/https:\/\/github.com\//git@github.com:/' | sed 's/$/.git/') - git remote set-url ${remote} ${new_remote} - echo "set ${remote} to ${new_remote}" -}