From 6b0adb86bb5f7a3a8609c48ac4d0ddc8cddc5247 Mon Sep 17 00:00:00 2001 From: Tilo Klarenbeek Date: Fri, 24 Mar 2023 17:27:00 +0100 Subject: [PATCH] Stuff --- init.lua | 52 +++++++++------------------------- lua/custom/plugins/icons.lua | 7 +++++ lua/custom/plugins/impulse.lua | 8 ++++++ lua/custom/plugins/trouble.lua | 18 ++++++++++++ 4 files changed, 47 insertions(+), 38 deletions(-) create mode 100644 lua/custom/plugins/icons.lua create mode 100644 lua/custom/plugins/impulse.lua create mode 100644 lua/custom/plugins/trouble.lua diff --git a/init.lua b/init.lua index 75d2f1f..da6c3a7 100644 --- a/init.lua +++ b/init.lua @@ -1,41 +1,3 @@ ---[[ - -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== - -Kickstart.nvim is *not* a distribution. - -Kickstart.nvim is a template for your own configuration. - The goal is that you can read every line of code, top-to-bottom, and understand - what your configuration is doing. - - Once you've done that, you should start exploring, configuring and tinkering to - explore Neovim! - - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example: - - https://learnxinyminutes.com/docs/lua/ - - And then you can explore or search through `:help lua-guide` - - -Kickstart Guide: - -I have left several `:help X` comments throughout the init.lua -You should run that command and read that help section for more information. - -In addition, I have some `NOTE:` items throughout the file. -These are for you, the reader to help understand what is happening. Feel free to delete -them once you know what you're doing, but they should serve as a guide for when you -are first encountering a few different constructs in your nvim config. - -I hope you enjoy your Neovim journey, -- TJ - -P.S. You can delete this when you're done too. It's your config now :) ---]] - -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) @@ -501,3 +463,17 @@ vim.api.nvim_set_keymap('n', '', ':wincmd j', {silent = true}) vim.api.nvim_set_keymap('n', '', ':wincmd h', {silent = true}) vim.api.nvim_set_keymap('n', '', ':wincmd l', {silent = true}) + +vim.api.nvim_set_keymap('n', 'sn', 'lua require("impulse").menu_search()', {noremap = true}) + +vim.api.nvim_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', { noremap = true, silent = true }) + +-- Apply the keymap to all buffers +vim.cmd([[ + augroup lsp_keymaps + autocmd! + autocmd BufEnter * lua vim.api.nvim_buf_set_keymap(0, 'n', 'gd', 'lua vim.lsp.buf.definition()', { noremap = true, silent = true }) + augroup END +]]) + +vim.api.nvim_buf_set_keymap(vim.fn.bufnr(), 'n', 'rs', 'lua vim.lsp.buf.rename()', { noremap = true, silent = true }) diff --git a/lua/custom/plugins/icons.lua b/lua/custom/plugins/icons.lua new file mode 100644 index 0000000..382ec7f --- /dev/null +++ b/lua/custom/plugins/icons.lua @@ -0,0 +1,7 @@ +return { + "kyazdani42/nvim-web-devicons", + module = "nvim-web-devicons", + config = function() + require("nvim-web-devicons").setup() + end, +} diff --git a/lua/custom/plugins/impulse.lua b/lua/custom/plugins/impulse.lua new file mode 100644 index 0000000..ae26f22 --- /dev/null +++ b/lua/custom/plugins/impulse.lua @@ -0,0 +1,8 @@ +return { + "chrsm/impulse.nvim", + version = "*", + dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim", }, + config = function() + require("impulse").setup( {api_key="secret_dlT76iEObyGwCLyedqct1PKlspozXFtS0T3ckpUWtZH"} ) + end, +} diff --git a/lua/custom/plugins/trouble.lua b/lua/custom/plugins/trouble.lua new file mode 100644 index 0000000..fe17c3c --- /dev/null +++ b/lua/custom/plugins/trouble.lua @@ -0,0 +1,18 @@ +return { + "folke/trouble.nvim", + requires = "kyazdani42/nvim-web-devicons", + config = function() + require("trouble").setup { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + } + + -- Add keybindings to open and close the Trouble window + vim.api.nvim_set_keymap("n", "xx", "TroubleToggle", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "xw", "TroubleToggle lsp_workspace_diagnostics", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "xd", "TroubleToggle lsp_document_diagnostics", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "xl", "TroubleToggle loclist", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "xq", "TroubleToggle quickfix", { noremap = true, silent = true }) + end +}