From 13a10383f190fdc2f4cc95c0b104627fe375c66f Mon Sep 17 00:00:00 2001 From: Luca Matei Pintilie Date: Sat, 1 Apr 2023 21:46:14 +0200 Subject: Improve IDE related configs --- .config/nvim/lua/keybinds.lua | 8 ++++++++ .config/nvim/lua/plugins.lua | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) (limited to '.config/nvim/lua') diff --git a/.config/nvim/lua/keybinds.lua b/.config/nvim/lua/keybinds.lua index 372335a..b017716 100644 --- a/.config/nvim/lua/keybinds.lua +++ b/.config/nvim/lua/keybinds.lua @@ -2,6 +2,7 @@ local telescope = require("telescope.builtin") local wk = require("which-key") local ufo = require("ufo") local nt_api = require("nvim-tree.api") +local spider = require("spider") vim.g.mapleader = " " @@ -23,6 +24,7 @@ vim.keymap.set("n", "f", telescope.find_files) vim.keymap.set("n", "", telescope.buffers) vim.keymap.set("n", "D", telescope.lsp_definitions) vim.keymap.set("n", "R", telescope.lsp_references) +vim.keymap.set("n", "S", telescope.lsp_document_symbols) vim.keymap.set("n", "m", ":MinimapToggle") vim.keymap.set("n", "b", ":Gitsigns blame_line") @@ -36,12 +38,18 @@ vim.keymap.set("n", "[", ufo.openAllFolds) vim.keymap.set("n", "]", ufo.closeAllFolds) vim.keymap.set("n", "r", vim.lsp.buf.rename) +vim.keymap.set({ "n"; "o"; "x" }, "W", function() spider.motion("w") end) +vim.keymap.set({ "n"; "o"; "x" }, "E", function() spider.motion("e") end) +vim.keymap.set({ "n"; "o"; "x" }, "B", function() spider.motion("b") end) +vim.keymap.set({ "n"; "o"; "x" }, "gE", function() spider.motion("ge") end) + vim.opt.whichwrap = "<,>,h,l,[,]" wk.register({ [""] = "Quick Action"; ["K"] = "Hover"; ["D"] = "Definition"; + ["S"] = "Symbols"; ["F"] = "Format"; ["f"] = "Find files"; [""] = "Show buffers"; diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index d261628..f4b9ba5 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -6,6 +6,9 @@ local PKGS = { { url = "https://github.com/kyazdani42/nvim-web-devicons.git" }; { url = "https://github.com/ojroques/nvim-osc52.git" }; { url = "https://github.com/chentoast/marks.nvim.git" }; + { url = "https://github.com/chrisgrieser/nvim-spider.git" }; + { url = "https://github.com/nvim-orgmode/orgmode.git" }; + { url = "https://github.com/rainbowhxch/beacon.nvim.git" }; { url = "https://github.com/kyazdani42/nvim-tree.lua.git" }; { url = "https://github.com/nvim-telescope/telescope.nvim.git" }; @@ -140,6 +143,19 @@ local function init_plugins() -- Available modes: foreground, background mode = "foreground"; -- Set the display mode. }) + require("beacon").setup({ + enable = true; + size = 100; + fade = true; + minimal_jump = 10; + show_jumps = true; + focus_gained = false; + shrink = false; + timeout = 1000; + ignore_buffers = {}; + ignore_filetypes = {}; + }) + vim.g.minimap_auto_start = 0 vim.g.minimap_highlight_range = 1 vim.g.minimap_highlight_search = 1 @@ -170,12 +186,26 @@ local function init_plugins() require("devcontainer").setup({}) require("which-key").setup({}) + local orgmode = require("orgmode") + orgmode.setup_ts_grammar() require("nvim-treesitter.configs").setup({ - ensure_installed = { "javascript"; "typescript"; "lua"; "c_sharp"; "jsonc" }; + ensure_installed = { + "javascript"; + "typescript"; + "lua"; + "c_sharp"; + "jsonc"; + "org"; + }; sync_install = false; auto_install = true; - highlight = { enable = true; disable = { "markdown"; "yaml"; "sql"; "help" } }; + highlight = { + enable = true; + disable = { "markdown"; "yaml"; "sql"; "help" }; + additional_vim_regex_highlighting = { "org" }; + }; }) + orgmode.setup({ org_default_notes_file = "~/.cache/org/refile.org" }) require("mini.surround").setup({}) -- cgit v1.2.3