From 98f8a77819670ce6012216e01885c135a6d3a289 Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Sat, 24 Jul 2021 21:17:11 -0400 Subject: New contract (#1080) Changes to the global config object O is now lvim user_plugins is now plugins user_autocommands is now autocommands No more lang specific plugins Null-ls has replaced both formatter.nvim and nvim-lint --- lua/core/which-key.lua | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'lua/core/which-key.lua') diff --git a/lua/core/which-key.lua b/lua/core/which-key.lua index 47661df6..1126bea5 100644 --- a/lua/core/which-key.lua +++ b/lua/core/which-key.lua @@ -1,6 +1,6 @@ local M = {} M.config = function() - O.plugin.which_key = { + lvim.builtin.which_key = { active = false, setup = { plugins = { @@ -117,14 +117,15 @@ M.config = function() "Telescope lsp_workspace_diagnostics", "Workspace Diagnostics", }, - f = { "silent FormatWrite", "Format" }, + -- f = { "silent FormatWrite", "Format" }, + f = { "lua vim.lsp.buf.formatting()", "Format" }, i = { "LspInfo", "Info" }, j = { - "lua vim.lsp.diagnostic.goto_next({popup_opts = {border = O.lsp.popup_border}})", + "lua vim.lsp.diagnostic.goto_next({popup_opts = {border = lvim.lsp.popup_border}})", "Next Diagnostic", }, k = { - "lua vim.lsp.diagnostic.goto_prev({popup_opts = {border = O.lsp.popup_border}})", + "lua vim.lsp.diagnostic.goto_prev({popup_opts = {border = lvim.lsp.popup_border}})", "Prev Diagnostic", }, l = { "silent lua require('lint').try_lint()", "Lint" }, @@ -171,29 +172,18 @@ M.setup = function() return end - which_key.setup(O.plugin.which_key.setup) + which_key.setup(lvim.builtin.which_key.setup) - local opts = O.plugin.which_key.opts - local vopts = O.plugin.which_key.vopts + local opts = lvim.builtin.which_key.opts + local vopts = lvim.builtin.which_key.vopts - local mappings = O.plugin.which_key.mappings - local vmappings = O.plugin.which_key.vmappings - - -- 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 }) - mappings["z"] = "Zen" - end + local mappings = lvim.builtin.which_key.mappings + local vmappings = lvim.builtin.which_key.vmappings local wk = require "which-key" wk.register(mappings, opts) wk.register(vmappings, vopts) - wk.register(O.user_which_key, opts) end return M -- cgit v1.2.3