From 4848edd489c36554ecc260ce041d2123af5adce2 Mon Sep 17 00:00:00 2001 From: Aarron Hulswitt Date: Thu, 29 Feb 2024 19:46:42 -0500 Subject: [PATCH] adding goto preview --- lazy-lock.json | 11 +++-------- lua/kameleon/lazy/goto.lua | 11 +++++++++++ lua/kameleon/lazy/lsp.lua | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 lua/kameleon/lazy/goto.lua diff --git a/lazy-lock.json b/lazy-lock.json index 95c5270..b5ae4c9 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,7 +1,5 @@ { "LuaSnip": { "branch": "master", "commit": "f3b3d3446bcbfa62d638b1903ff00a78b2b730a1" }, - "ale": { "branch": "master", "commit": "5e8904cd3da4565130c09b77179ae7dddd07358f" }, - "asyncomplete.vim": { "branch": "master", "commit": "016590d2ca73cefe45712430e319a0ef004e2215" }, "cellular-automaton.nvim": { "branch": "main", "commit": "b7d056dab963b5d3f2c560d92937cb51db61cb5b" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, @@ -10,8 +8,7 @@ "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "editorconfig.nvim": { "branch": "master", "commit": "5b9e303e1d6f7abfe616ce4cc8d3fffc554790bf" }, "fidget.nvim": { "branch": "main", "commit": "4e854f3299e21d1c18279add340428a97520fc44" }, - "fzf": { "branch": "master", "commit": "99a7beba575bf50170dada5b4681ccaad40263d1" }, - "fzf.vim": { "branch": "master", "commit": "8ea9574b3ebdc44fbe3dc6381a13f9ce0c290e2f" }, + "goto-preview": { "branch": "main", "commit": "527fd81a827234e26ca47891abe90497215db2a6" }, "harpoon": { "branch": "harpoon2", "commit": "a38be6e0dd4c6db66997deab71fc4453ace97f9c" }, "lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "fe4cce44dec93c69be17dad79b21de867dde118a" }, @@ -19,11 +16,9 @@ "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, "nvim-lightbulb": { "branch": "master", "commit": "8f00b89dd1b1dbde16872bee5fbcee2e58c9b8e9" }, "nvim-lspconfig": { "branch": "master", "commit": "d1bab4cf4b69e49d6058028fd933d8ef5e74e680" }, - "nvim-treesitter": { "branch": "master", "commit": "504fe1043298c468f56a6ef6dc61f35b2d69495a" }, - "omnisharp-vim": { "branch": "master", "commit": "f9c5d3e3375e8b5688a4506e813cb21bdc7329b1" }, + "nvim-treesitter": { "branch": "master", "commit": "e04ce8bcec4dec3551d7ec4fa6d737d183433bfd" }, "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "rose-pine": { "branch": "main", "commit": "f977eeba34b030b37f93ece2fbd792477606203b" }, "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, - "tokyonight.nvim": { "branch": "main", "commit": "610179f7f12db3d08540b6cc61434db2eaecbcff" }, - "vim-sharpenup": { "branch": "master", "commit": "1c309e0fade7e3049a730a88b89ff722b993b6c3" } + "tokyonight.nvim": { "branch": "main", "commit": "610179f7f12db3d08540b6cc61434db2eaecbcff" } } \ No newline at end of file diff --git a/lua/kameleon/lazy/goto.lua b/lua/kameleon/lazy/goto.lua new file mode 100644 index 0000000..810504d --- /dev/null +++ b/lua/kameleon/lazy/goto.lua @@ -0,0 +1,11 @@ +return { + 'rmagatti/goto-preview', + config = function() + require('goto-preview').setup {} + vim.keymap.set('n', 'gd','lua require("goto-preview").goto_preview_definition()', {noremap=true}) + vim.keymap.set('n', 'gt','lua require("goto-preview").goto_preview_type_definition()',{noremap=true}) + vim.keymap.set('n', 'gi','lua require("goto-preview").goto_preview_implementation()',{noremap=true}) + vim.keymap.set('n', 'gD','lua require("goto-preview").goto_preview_declaration()', {noremap=true}) + vim.keymap.set('n', 'gc','lua require("goto-preview").close_all_win()',{noremap=true}) + end +} diff --git a/lua/kameleon/lazy/lsp.lua b/lua/kameleon/lazy/lsp.lua index 87a1784..563cd44 100644 --- a/lua/kameleon/lazy/lsp.lua +++ b/lua/kameleon/lazy/lsp.lua @@ -61,7 +61,7 @@ return mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.select_prev_item(cmp_select), [''] = cmp.mapping.select_next_item(cmp_select), - [''] = cmp.mapping.confirm({ select = true }), + [''] = cmp.mapping.confirm({ select = true }), [""] = cmp.mapping.complete(), }), sources = cmp.config.sources({