From c38ec7f2e416d795898f1070824761218a62e010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20L=C3=BCdecke?= Date: Tue, 13 May 2025 21:16:59 +0200 Subject: [PATCH] Keybindings: - rust overrides K for hover actions and J for joinLines - F now is dioxus format file - E now is vim.diagnostic.open_float Config: - splash shows OGPT entry - rustaceanvim now requires version ^6 instead of ^5 - dropped sqls.nvim --- after/ftplugin/rust.lua | 6 ++++++ lua/lsp.lua | 2 ++ lua/plugins.lua | 12 ++++-------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/after/ftplugin/rust.lua b/after/ftplugin/rust.lua index e5cd3d5..f2716a8 100644 --- a/after/ftplugin/rust.lua +++ b/after/ftplugin/rust.lua @@ -29,3 +29,9 @@ vim.keymap.set( end, { silent = true, buffer = bufnr, desc = 'RustLSP: show runnables' } ) + + +-- override signature hover to use RustLsp +vim.keymap.set('n', 'K', ":RustLsp hover actions", { desc = "RustLSP show signature" }) +vim.keymap.set('n', 'J', ":RustLsp joinLines", { desc = "RustLSP join lines" }) + diff --git a/lua/lsp.lua b/lua/lsp.lua index 8a34b1b..43cae85 100644 --- a/lua/lsp.lua +++ b/lua/lsp.lua @@ -16,6 +16,7 @@ vim.api.nvim_create_autocmd('LspAttach', { vim.keymap.set("n", "f", function() vim.lsp.buf.format({ async = true }) end, { desc = "LSP Format buffer", unpack(bufopts) }) + vim.keymap.set("n", 'F', ":silent !dx fmt --file %", { desc = "DX format rsx! regions", unpack(bufopts) }) vim.keymap.set("v", "f", LSPRangeFormatFunction, { desc = "LSP Format region" }) -- 2024-09-09 - some ccflow commands for diagnostics, symbols and code actions @@ -26,6 +27,7 @@ vim.api.nvim_create_autocmd('LspAttach', { local new_config = not vim.diagnostic.config().virtual_lines vim.diagnostic.config({ virtual_lines = new_config }) end, { desc = "Virtual line diagnostics" }) + vim.keymap.set('n', 'E', vim.diagnostic.open_float, { desc = "Popup diagnostics" }) vim.keymap.set('n', 's', fzf.lsp_document_symbols, { desc = "Doc symbols" }) vim.keymap.set('n', 'c', fzf.lsp_code_actions, { desc = "Code Actions" }) vim.keymap.set('n', '[', vim.diagnostic.goto_prev, { desc = "Previous diagnostics" }) diff --git a/lua/plugins.lua b/lua/plugins.lua index 3668b6f..958cad0 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -94,7 +94,8 @@ require("lazy").setup({ action = function(exporter) local current_file = vim.api.nvim_buf_get_name(0) local target = vim.fn.fnamemodify(current_file, ':p:r') .. '.html' - local command = { 'pandoc', '--filter', 'pandoc-plot', current_file, '--standalone', '--toc', '--number-sections', '--output', target } + local command = { 'pandoc', '--filter', 'pandoc-plot', current_file, '--standalone', '--toc', + '--number-sections', '--output', target } local on_success = function(output) print('Success!') vim.api.nvim_echo({ { table.concat(output, '\n') } }, true, {}) @@ -488,7 +489,7 @@ require("lazy").setup({ dashboard.section.header.val = vim.split(adjustedLogo, '\n') dashboard.section.buttons.val = { - dashboard.button('h', ' Browse ~', 'Neotree'), + dashboard.button('o', '󱙺 AI Chat', 'OGPT'), dashboard.button('n', ' New file', ':ene startinsert '), dashboard.button('s', ' Settings', 'WorkspacesOpen config-nvim'), dashboard.button('u', '󱐥 Update plugins', 'Lazy update'), @@ -519,7 +520,7 @@ require("lazy").setup({ -- improved Rust support { 'mrcjkb/rustaceanvim', - version = '^5', -- Recommended + version = '^6', -- Recommended lazy = false, -- This plugin is already lazy }, @@ -602,11 +603,6 @@ require("lazy").setup({ opts = {}, }, - -- database connectivity - { - "nanotee/sqls.nvim" - }, - -- ollama and LLM integration { {