From 4bd4d87f5b718c620c66669db213eb4bcd551277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20L=C3=BCdecke?= Date: Mon, 8 Sep 2025 08:28:03 +0200 Subject: [PATCH] Dropped AI integration, inline diagnostics, orgmode completion Keymaps: - key binding for viewing git log of current file: =l - blink keybindings simplified, added orgmode as source Plugins: - folke todo comments disabled - dropped all AI integration - added tiny-inline-diagnostic for easier and(!) wrapped diagnostic messages - added sqlua.ncim plugin to connect to SQL databases --- lua/config/alpha-nvim.lua | 1 - lua/keybindings.lua | 2 +- lua/lsp.lua | 1 + lua/plugins.lua | 232 ++++++++++---------------------------- 4 files changed, 59 insertions(+), 177 deletions(-) diff --git a/lua/config/alpha-nvim.lua b/lua/config/alpha-nvim.lua index 6b33ccb..1709c7a 100644 --- a/lua/config/alpha-nvim.lua +++ b/lua/config/alpha-nvim.lua @@ -82,7 +82,6 @@ local adjustedLogo = logo .. '\n' .. paddedGreeting .. '\n\n' .. userNamePadded dashboard.section.header.val = vim.split(adjustedLogo, '\n') dashboard.section.buttons.val = { - dashboard.button('o', '󱙺 AI Chat', 'OGPT'), dashboard.button('d', ' Diary Entry', 'Diary'), dashboard.button('n', ' New file', ':ene startinsert '), dashboard.button('s', ' Settings', 'WorkspacesOpen config-nvim'), diff --git a/lua/keybindings.lua b/lua/keybindings.lua index 8c25591..b3a492c 100644 --- a/lua/keybindings.lua +++ b/lua/keybindings.lua @@ -93,7 +93,7 @@ vim.keymap.set('n', 'mc', mywords.uhl_all, { desc = "Clear all highlights ------------------------------------------ -- --- Some convenience keybindings +-- Moving lines up and down -- ------------------------------------------ diff --git a/lua/lsp.lua b/lua/lsp.lua index 2e2bfc5..02a8a33 100644 --- a/lua/lsp.lua +++ b/lua/lsp.lua @@ -34,6 +34,7 @@ vim.api.nvim_create_autocmd('LspAttach', { vim.keymap.set('n', ']', vim.diagnostic.goto_next, { desc = "Previous diagnostics" }) local gitsigns = require('gitsigns') + vim.keymap.set('n', '=l', ":NeogitLogCurrent", { desc = "Neogit: log for this file" }) vim.keymap.set('n', '==', gitsigns.preview_hunk_inline, { desc = "Git hunk preview" }) vim.keymap.set('n', '=B', gitsigns.blame, { desc = "Git blame file" }) vim.keymap.set('n', '=D', function() gitsigns.diffthis('~') end, { desc = "Git diff this (~)" }) diff --git a/lua/plugins.lua b/lua/plugins.lua index fd141fc..7bd30c4 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -46,13 +46,16 @@ require("lazy").setup({ -- -- See :h blink-cmp-config-keymap for defining your own keymap keymap = { - preset = 'enter', - [''] = { 'select_prev', 'fallback' }, - [''] = { 'select_next', 'fallback' }, - [''] = { 'select_prev', 'fallback' }, - [''] = { 'select_next', 'fallback' }, + -- preset = 'enter', + preset = 'default', + -- [''] = { 'select_prev', 'fallback' }, + -- [''] = { 'select_next', 'fallback' }, + -- [''] = { 'select_prev', 'fallback' }, + -- [''] = { 'select_next', 'fallback' }, [''] = { 'select_and_accept', 'fallback' }, - [''] = { 'show', 'fallback' }, + [''] = { 'show_and_insert', 'fallback' }, + -- [''] = { 'show', 'fallback' }, + -- [''] = { 'accept', 'fallback' }, }, signature = { enabled = true }, @@ -80,7 +83,19 @@ require("lazy").setup({ -- Default list of enabled providers defined so that you can extend it -- elsewhere in your config, without redefining it, due to `opts_extend` sources = { - default = { 'lsp', 'path', 'snippets', 'buffer' }, + default = { 'lsp', 'path', 'snippets', 'buffer', 'orgmode' }, + -- per_filetype = { + -- org = { 'orgmode' } + -- }, + + providers = { + orgmode = { + name = 'Orgmode', + module = 'orgmode.org.autocompletion.blink', + fallbacks = { 'lsp', 'path', 'snippets', 'buffer' }, + -- fallbacks = { 'buffer' }, + }, + }, }, snippets = { preset = 'luasnip' }, @@ -385,15 +400,15 @@ require("lazy").setup({ -- TODO, WARN, HACK, PERF, NOTE, TEST and others highlighting and searching - { - "folke/todo-comments.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - } - }, + -- { + -- "folke/todo-comments.nvim", + -- dependencies = { "nvim-lua/plenary.nvim" }, + -- opts = { + -- -- your configuration comes here + -- -- or leave it empty to use the default settings + -- -- refer to the configuration section below + -- } + -- }, -- highlight word under cursor { @@ -450,6 +465,7 @@ require("lazy").setup({ }, }, + -- show indent markers { "lukas-reineke/indent-blankline.nvim", @@ -459,166 +475,32 @@ require("lazy").setup({ opts = {}, }, - -- ollama and LLM integration + + -- improved (wrapping!) diagnostics { - { - "huynle/ogpt.nvim", - event = "VeryLazy", - opts = { - default_provider = "ollama", - edgy = true, -- enable this! - single_window = false, -- set this to true if you want only one OGPT window to appear at a time - providers = { - ollama = { - api_host = os.getenv("OLLAMA_API_HOST") or "http://localhost:11434", - api_key = os.getenv("OLLAMA_API_KEY") or "", - model = "llama3.2-vision:sl", - } + "rachartier/tiny-inline-diagnostic.nvim", + event = "VeryLazy", -- one of LspAttach, VeryLazy + priority = 1000, -- needs to be loaded in first + config = function() + require('tiny-inline-diagnostic').setup({ + options = { + use_icons_from_diagnostic = true, + enable_on_insert = true, + show_all_diags_on_cursorline = true, } - }, - dependencies = { - "MunifTanjim/nui.nvim", - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope.nvim" - } - }, - { - "folke/edgy.nvim", - event = "VeryLazy", - init = function() - vim.opt.laststatus = 3 - vim.opt.splitkeep = "screen" -- or "topline" or "screen" - end, - opts = { - exit_when_last = false, - animate = { - enabled = false, - }, - wo = { - winbar = true, - winfixwidth = true, - winfixheight = false, - winhighlight = "WinBar:EdgyWinBar,Normal:EdgyNormal", - spell = false, - signcolumn = "no", - }, - keys = { - -- -- close window - ["q"] = function(win) - win:close() - end, - -- close sidebar - ["Q"] = function(win) - win.view.edgebar:close() - end, - -- increase width - [""] = function(win) - win:resize("width", 3) - end, - -- decrease width - [""] = function(win) - win:resize("width", -3) - end, - -- increase height - [""] = function(win) - win:resize("height", 3) - end, - -- decrease height - [""] = function(win) - win:resize("height", -3) - end, - }, - right = { - { - title = "OGPT Popup", - ft = "ogpt-popup", - size = { width = 0.2 }, - wo = { - wrap = true, - }, - }, - { - title = "OGPT Parameters", - ft = "ogpt-parameters-window", - size = { height = 6 }, - wo = { - wrap = true, - }, - }, - { - title = "OGPT Template", - ft = "ogpt-template", - size = { height = 6 }, - }, - { - title = "OGPT Sessions", - ft = "ogpt-sessions", - size = { height = 6 }, - wo = { - wrap = true, - }, - }, - { - title = "OGPT System Input", - ft = "ogpt-system-window", - size = { height = 6 }, - }, - { - title = "OGPT", - ft = "ogpt-window", - size = { height = 0.5 }, - wo = { - wrap = true, - }, - }, - { - title = "OGPT {{{selection}}}", - ft = "ogpt-selection", - size = { width = 80, height = 4 }, - wo = { - wrap = true, - }, - }, - { - title = "OGPt {{{instruction}}}", - ft = "ogpt-instruction", - size = { width = 80, height = 4 }, - wo = { - wrap = true, - }, - }, - { - title = "OGPT Chat", - ft = "ogpt-input", - size = { width = 80, height = 4 }, - wo = { - wrap = true, - }, - }, - }, - }, - }, - - -- improved (wrapping!) diagnostics - { - "rachartier/tiny-inline-diagnostic.nvim", - event = "VeryLazy", -- one of LspAttach, VeryLazy - priority = 1000, -- needs to be loaded in first - config = function() - require('tiny-inline-diagnostic').setup({ - options = { - use_icons_from_diagnostic = true, - enable_on_insert = true, - show_all_diags_on_cursorline = true, - } - }) - vim.diagnostic.config({ virtual_text = false }) -- Only if needed in your configuration, if you already have native LSP diagnostics - end - }, - - - - -- new plugins here - + }) + vim.diagnostic.config({ virtual_text = false }) -- Only if needed in your configuration, if you already have native LSP diagnostics + end }, + + + -- 2025-05-21 not yet clear if this is a good thing or not + { + 'xemptuous/sqlua.nvim', + lazy = true, + cmd = 'SQLua', + config = function() require('sqlua').setup() end + }, + + -- new plugins BEFORE here })