From 46cb5dacb9c1b09fbaafb9c0182c6d40c8b08192 Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Thu, 10 Nov 2022 13:14:53 +0100 Subject: [PATCH] feat(nvim): add legendary and dressing plugins for easy access to keymaps, commands and autocommands --- nvim/after/plugin/dressing.lua | 7 +++++++ nvim/after/plugin/legendary.lua | 13 +++++++++++++ nvim/lua/kogakure/keymaps.lua | 3 +++ nvim/lua/kogakure/plugins.lua | 2 ++ 4 files changed, 25 insertions(+) create mode 100644 nvim/after/plugin/dressing.lua create mode 100644 nvim/after/plugin/legendary.lua diff --git a/nvim/after/plugin/dressing.lua b/nvim/after/plugin/dressing.lua new file mode 100644 index 0000000..a959657 --- /dev/null +++ b/nvim/after/plugin/dressing.lua @@ -0,0 +1,7 @@ +-- https://github.com/stevearc/dressing.nvim +local status, dressing = pcall(require, "dressing") +if not status then + return +end + +dressing.setup() diff --git a/nvim/after/plugin/legendary.lua b/nvim/after/plugin/legendary.lua new file mode 100644 index 0000000..e93a7fc --- /dev/null +++ b/nvim/after/plugin/legendary.lua @@ -0,0 +1,13 @@ +-- https://github.com/mrjones2014/legendary.nvim +local status, legendary = pcall(require, "legendary") +if not status then + return +end + +local keymap = vim.keymap.set +local opts = { noremap = true, silent = true } + +legendary.setup({ which_key = { auto_register = true } }) + +-- Keymaps +keymap("n", "LL", "Legendary", opts) diff --git a/nvim/lua/kogakure/keymaps.lua b/nvim/lua/kogakure/keymaps.lua index 2c39d01..05f49cf 100644 --- a/nvim/lua/kogakure/keymaps.lua +++ b/nvim/lua/kogakure/keymaps.lua @@ -148,3 +148,6 @@ keymap("x", "al", ":normal! $v0", opts) -- LSP formatting keymap("n", "o", "lua vim.lsp.buf.format()", opts) + +-- Manual Prettier +keymap("n", "P", "Prettier", opts) diff --git a/nvim/lua/kogakure/plugins.lua b/nvim/lua/kogakure/plugins.lua index 49834f8..ad2bec0 100644 --- a/nvim/lua/kogakure/plugins.lua +++ b/nvim/lua/kogakure/plugins.lua @@ -125,6 +125,7 @@ return packer.startup(function(use) use("antoinemadec/FixCursorHold.nvim") -- This is needed to fix lsp doc highlight use("MattesGroeger/vim-bookmarks") -- Bookmarks use("folke/which-key.nvim") -- Display possible keybindings + use("mrjones2014/legendary.nvim") -- Legend for keymaps, commands, and autocommands use("karb94/neoscroll.nvim") -- Smooth scrolling use("APZelos/blamer.nvim") -- Git Blame use("tpope/vim-fugitive") -- Git plugin @@ -133,6 +134,7 @@ return packer.startup(function(use) use("ruanyl/vim-gh-line") -- Open current line in GitHub use("pwntester/octo.nvim") -- GitHub in Neovim use("nvim-pack/nvim-spectre") -- Search and replace + use("stevearc/dressing.nvim") -- Improve the default vim.ui interfaces use("folke/zen-mode.nvim") -- Zen Mode (2) use("tpope/vim-eunuch") -- UNIX Shell commands use("folke/twilight.nvim") -- Dim inactive code