From c71db745747c79b2547e0e837e134b9260c51958 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 2 Jul 2021 12:28:16 -0400 Subject: [PATCH] more lush support --- lua/default-config.lua | 1 + lua/lv-which-key/init.lua | 78 +++++++++++++++++++++++++-------------- lua/plugins.lua | 5 ++- 3 files changed, 55 insertions(+), 29 deletions(-) diff --git a/lua/default-config.lua b/lua/default-config.lua index bcb0f333..88f2117d 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -17,6 +17,7 @@ O = { extras = false, ignore_case = true, smart_case = true, + lushmode = false, -- @usage pass a table with your desired languages treesitter = { diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index 519e6dd4..8e4f4b73 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -118,26 +118,26 @@ local mappings = { } }, --- diagnostics vanilla nvim --- -- diagnostic --- function lv_utils.get_all() --- vim.lsp.diagnostic.get_all() --- end --- function lv_utils.get_next() --- vim.lsp.diagnostic.get_next() --- end --- function lv_utils.get_prev() --- vim.lsp.diagnostic.get_prev() --- end --- function lv_utils.goto_next() --- vim.lsp.diagnostic.goto_next() --- end --- function lv_utils.goto_prev() --- vim.lsp.diagnostic.goto_prev() --- end --- function lv_utils.show_line_diagnostics() --- vim.lsp.diagnostic.show_line_diagnostics() --- end + -- diagnostics vanilla nvim + -- -- diagnostic + -- function lv_utils.get_all() + -- vim.lsp.diagnostic.get_all() + -- end + -- function lv_utils.get_next() + -- vim.lsp.diagnostic.get_next() + -- end + -- function lv_utils.get_prev() + -- vim.lsp.diagnostic.get_prev() + -- end + -- function lv_utils.goto_next() + -- vim.lsp.diagnostic.goto_next() + -- end + -- function lv_utils.goto_prev() + -- vim.lsp.diagnostic.goto_prev() + -- end + -- function lv_utils.show_line_diagnostics() + -- vim.lsp.diagnostic.show_line_diagnostics() + -- end -- " Available Debug Adapters: -- " https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/ @@ -214,13 +214,6 @@ local mappings = { "Workspace Symbols" } }, - r = { - name = "Replace", - f = { - "lua require('spectre').open_file_search()", "Current File" - }, - p = {"lua require('spectre').open()", "Project"} - }, s = { name = "Search", b = {"Telescope git_branches", "Checkout branch"}, @@ -245,9 +238,23 @@ local mappings = { name = "Session", s = {"SessionSave", "Save Session"}, l = {"SessionLoad", "Load Session"} + }, + T = { + name = "Treesitter", + i = {":TSConfigInfo", "Info"} } } +if O.plugin.spectre.active then + mappings['r'] = { + name = "Replace", + f = { + "lua require('spectre').open_file_search()", "Current File" + }, + p = {"lua require('spectre').open()", "Project"} + } +end + if O.plugin.trouble.active then mappings['d'] = { name = "Diagnostics", @@ -261,6 +268,14 @@ if O.plugin.trouble.active then end if O.plugin.gitlinker.active then mappings["gy"] = "Gitlink" end + +if O.plugin.ts_playground.active then + vim.api.nvim_set_keymap("n", "Th", + ":TSHighlightCapturesUnderCursor", + {noremap = true, silent = true}) + mappings[""] = "Highlight Capture" +end + if O.plugin.zen.active then vim.api.nvim_set_keymap("n", "z", ":ZenMode", {noremap = true, silent = true}) @@ -293,5 +308,14 @@ if O.lang.latex.active then } end +if O.lushmode then + mappings["L"] = { + name = "+Lush", + l = {":Lushify", "Lushify"}, + t = {":LushRunTutorial", "Lush Tutorial"}, + q = {":LushRunQuickstart", "Lush Quickstart"} + } +end + local wk = require("which-key") wk.register(mappings, opts) diff --git a/lua/plugins.lua b/lua/plugins.lua index 341be8fa..6203c2f2 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -390,8 +390,9 @@ return require("packer").startup(function(use) -- Lush Create Color Schemes use { "rktjmp/lush.nvim", - cmd = {"LushRunQuickstart", "LushRunTutorial", "Lushify"}, - disable = not O.plugin.lush.active, + event = "VimEnter", + -- cmd = {"LushRunQuickstart", "LushRunTutorial", "Lushify"}, + -- disable = not O.plugin.lush.active, } -- HTML preview use {