diff --git a/lua/keybindings.lua b/lua/keybindings.lua index a9f94dd..2753031 100644 --- a/lua/keybindings.lua +++ b/lua/keybindings.lua @@ -1,4 +1,4 @@ --- Setup fzf-lua keybindings +-- Setup fzf-lua keybindings and some other searches local fzf = require('fzf-lua') vim.keymap.set('n', 'ff', fzf.files, { desc = "Find file" }) vim.keymap.set('n', 'fs', fzf.blines, { desc = "Search buffer" }) @@ -43,3 +43,22 @@ workspaces_fzf_picker = function(opts) end, opts) end vim.keymap.set('n', 'w', workspaces_fzf_picker, { desc = "Workspaces" } ) + +------------------------------------------ +-- +-- Word higlighting +-- +------------------------------------------ +local mywords = require('mywords') +vim.keymap.set('n', 'mm', mywords.hl_toggle, { desc = "Highlight current word" }) +vim.keymap.set('n', 'mr', mywords.hl_toggle_regex, { desc = "Highlight regexp" }) +vim.keymap.set('n', 'mc', mywords.uhl_all, { desc = "Clear all highlights" }) + + +------------------------------------------ +-- +-- Shortcuts which are known from Emacs +-- +------------------------------------------ +vim.keymap.set('n', '1', ":wincmd o", { desc = "Win: close others" }) +vim.keymap.set('n', '0', ":only", { desc = "Win: close current" }) diff --git a/lua/lsp.lua b/lua/lsp.lua index 00849be..465f25a 100644 --- a/lua/lsp.lua +++ b/lua/lsp.lua @@ -25,8 +25,9 @@ require('mason-lspconfig').setup({ -- Customized on_attach function -- See `:help vim.diagnostic.*` for documentation on any of the below functions local opts = { noremap = true, silent = true } -vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) +vim.keymap.set('n', 'e', vim.diagnostic.open_float, { noremap = true, silent = true, desc = "Popup diagnostics" }) +-- 2024-09-23 - currently unused +-- vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) @@ -58,13 +59,13 @@ local on_attach = function(client, bufnr) -- 2024-09-09 - some ccflow commands local fzf = require('fzf-lua') - vim.keymap.set('n', 'd', fzf.diagnostics_document, { desc = "Doc diagnostics" }) + vim.keymap.set('n', 'd', fzf.diagnostics_document, { desc = "Document diagnostics" }) vim.keymap.set('n', 'D', fzf.diagnostics_workspace, { desc = "Workspace 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', 'gr', vim.lsp.buf.references, bufopts) - vim.keymap.set('n', '', fzf.lsp_references, { desc = "Find References" }) - vim.keymap.set('n', '', fzf.lsp_definitions, { desc = "Find References" }) + vim.keymap.set('n', '', fzf.lsp_references, { desc = "Find References" }) + vim.keymap.set('n', '', fzf.lsp_definitions, { desc = "Find References" }) end -- Set different settings for different languages' LSP diff --git a/lua/options.lua b/lua/options.lua index 0e7929b..09c42cd 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -27,7 +27,7 @@ vim.opt.showmode = false -- we are experienced, wo don't need the "-- INSE -- Searching vim.opt.incsearch = true -- search as characters are entered -vim.opt.hlsearch = false -- do not highlight matches +vim.opt.hlsearch = true -- do not highlight matches vim.opt.ignorecase = true -- ignore case in searches by default vim.opt.smartcase = true -- but make it case sensitive if an uppercase is entered @@ -45,3 +45,11 @@ vim.opt.wrap = false -- Spelling vim.opt.spell = true vim.opt.spelllang = "de,en" + +-------------------------------------------------- +-- +-- Other options +-- +-------------------------------------------------- + +vim.opt.shortmess = vim.opt.shortmess + 'I' diff --git a/lua/plugins.lua b/lua/plugins.lua index 9c621b6..a2febe7 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -43,10 +43,19 @@ require("lazy").setup({ end, }, - -- LSP manager + -- + -- LSP manager and others + -- "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim", "neovim/nvim-lspconfig", + -- show lsp signature while coding + { + "ray-x/lsp_signature.nvim", + event = "VeryLazy", + opts = {}, + config = function(_, opts) require 'lsp_signature'.setup(opts) end + }, -- neogit setup { @@ -90,7 +99,9 @@ require("lazy").setup({ dependencies = { "nvim-tree/nvim-web-devicons" }, config = function() -- calling `setup` is optional for customization - require("fzf-lua").setup({}) + local fzf = require("fzf-lua") + fzf.setup({ "default-title" }) + fzf.register_ui_select() end }, @@ -119,7 +130,7 @@ require("lazy").setup({ { "?", function() - require("which-key").show({ global = false }) + require("which-key").show({ global = true }) end, desc = "Buffer Local Keymaps (which-key)", }, @@ -247,4 +258,25 @@ require("lazy").setup({ -- refer to the configuration section below } }, + + -- highlight word under cursor + { + "dwrdx/mywords.nvim", + }, + + -- Calendar view + { + "itchyny/calendar.vim" + }, + + -------------------------------------------------- + -- + -- Color schemes + -- + -------------------------------------------------- + { + "rktjmp/lush.nvim" + -- if you wish to use your own colorscheme: + -- { dir = '/absolute/path/to/colorscheme', lazy = true }, + }, })