From ba838cfab2972c304056b92325d632059cd6f64c Mon Sep 17 00:00:00 2001 From: Mira Kristipati Date: Tue, 21 May 2024 18:21:37 -0400 Subject: [PATCH] grapple --- .gitignore | 10 ++++++++++ lua/chadrc.lua | 10 +++++++--- lua/configs/lspconfig.lua | 1 + lua/mappings.lua | 8 ++++++++ lua/plugins.lua | 18 +++++++++++------- 5 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..82aa4a5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +plugin +#custom +spell +ftplugin +syntax +coc-settings.json +.luarc.json +lazy-lock.json +after +**/.DS_Store diff --git a/lua/chadrc.lua b/lua/chadrc.lua index 121a700..e2357f6 100644 --- a/lua/chadrc.lua +++ b/lua/chadrc.lua @@ -10,9 +10,13 @@ M.ui = { hl_add = highlights.add, statusline = { - overriden_modules = function(modules) - modules[10] = vim.o.columns > 140 and "%#StText# [%l,%c]" or "" - end, + order = { "mode", "file", "git", "%=", "lsp_msg", "%=", "diagnostics", "lsp", "cwd", "cursor", "grapple" }, + modules = { + cursor = function() + return "%#St_pos_sep#" .. "" .. "%#St_pos_icon# %#St_pos_text# [%l,%c]" + end, + grapple = require("grapple").statusline, + }, }, } diff --git a/lua/configs/lspconfig.lua b/lua/configs/lspconfig.lua index 15294be..eb1854e 100644 --- a/lua/configs/lspconfig.lua +++ b/lua/configs/lspconfig.lua @@ -11,6 +11,7 @@ local servers = { "clangd", "gopls", "astro", + "lua_ls", "docker_compose_language_service", "ast_grep", -- "basedpyright", diff --git a/lua/mappings.lua b/lua/mappings.lua index 7a108a5..eaaa0eb 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -23,6 +23,14 @@ M.General = function() map("n", "ci", "Lspsaga incoming_calls", { desc = "LSPSaga incoming calls" }) map("n", "co", "Lspsaga outgoing_calls", { desc = "LSPSaga outgoing calls" }) map("n", "", "Lspsaga outline", { desc = "LSPSaga outline" }) + map("n", "sm", require("grapple").toggle, { desc = "Grapple Toggle" }) + map("n", "sn", function() + require("grapple").cycle_tags "next" + end, { desc = "Grapple cycle next" }) + map("n", "sN", function() + require("grapple").cycle_tags "prev" + end, { desc = "Grapple cycle prev" }) + map("n", "sM", "Telescope grapple tags", { desc = "Grapple View tags" }) end M.Ufo = function() diff --git a/lua/plugins.lua b/lua/plugins.lua index e856f7f..7c907e3 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -41,13 +41,13 @@ return { }, }, }, - -- { - -- "cbochs/grapple.nvim", - -- dependencies = { - -- { "nvim-tree/nvim-web-devicons", lazy = true }, - -- }, - -- lazy = false, - -- }, + { + "cbochs/grapple.nvim", + dependencies = { + { "nvim-tree/nvim-web-devicons", lazy = true }, + }, + lazy = false, + }, { "nvimdev/lspsaga.nvim", config = function() @@ -119,6 +119,10 @@ return { { "junegunn/fzf.vim", lazy = false }, { "nvim-telescope/telescope.nvim", + config = function() + require("telescope").setup() + require("telescope").load_extension "grapple" + end, dependencies = { "nvim-lua/plenary.nvim", "junegunn/fzf.vim" }, },