add which-key
This commit is contained in:
parent
ea865dbd8a
commit
b03ff6e543
2 changed files with 246 additions and 111 deletions
|
@ -1,111 +1,158 @@
|
|||
require("lazy").setup({
|
||||
-- Nvim-tree stuff
|
||||
{ 'nvim-tree/nvim-web-devicons' }, -- optional, for file icons
|
||||
{ 'nvim-tree/nvim-tree.lua',
|
||||
opts = require('plugins.nvim-tree').config,
|
||||
keys = require('plugins.nvim-tree').keys },
|
||||
-- Nvim-tree stuff
|
||||
{ 'nvim-tree/nvim-web-devicons' }, -- optional, for file icons
|
||||
{
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
opts = require('plugins.nvim-tree').config,
|
||||
keys = require('plugins.nvim-tree').keys
|
||||
},
|
||||
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
-- treesitter need to be configured after load,
|
||||
-- so let here be init, not config
|
||||
init = require('plugins.treesitter'),
|
||||
build = ':TSUpdate',
|
||||
priority = 400
|
||||
},
|
||||
-- neovim lsp plugins and depencencies
|
||||
{ 'hrsh7th/cmp-nvim-lsp' },
|
||||
{ 'hrsh7th/cmp-buffer' },
|
||||
{ 'hrsh7th/cmp-cmdline' },
|
||||
{ 'hrsh7th/cmp-path' },
|
||||
{
|
||||
'hrsh7th/nvim-cmp',
|
||||
config = require('plugins.nvim-cmp').init,
|
||||
dependencies = { 'onsails/lspkind.nvim' }
|
||||
},
|
||||
{
|
||||
'williamboman/mason.nvim',
|
||||
opts = {},
|
||||
priority = 200
|
||||
},
|
||||
-- mason-lspconfig might need disabling on first run
|
||||
{
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
opts = require('plugins.mason-lspconfig').config,
|
||||
dependencies = { 'williamboman/mason.nvim' },
|
||||
priority = 150
|
||||
},
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
init = require('plugins.nvim-lspconfig').init,
|
||||
priority = 100
|
||||
},
|
||||
{
|
||||
'mfussenegger/nvim-lint',
|
||||
init = require('plugins.nvim-lint').init
|
||||
},
|
||||
{
|
||||
'folke/trouble.nvim',
|
||||
opts = require('plugins.trouble').config,
|
||||
keys = require("plugins.trouble").keys
|
||||
},
|
||||
|
||||
-- various plugins
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
config = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
require("which-key").setup(
|
||||
require('plugins.which-key').conf)
|
||||
end,
|
||||
},
|
||||
{
|
||||
'lewis6991/gitsigns.nvim',
|
||||
opts = require('plugins.gitsigns').config
|
||||
},
|
||||
{
|
||||
'petertriho/nvim-scrollbar',
|
||||
opts = {}
|
||||
},
|
||||
{
|
||||
'kevinhwang91/nvim-hlslens',
|
||||
opts = {},
|
||||
keys = require('plugins.hlslens').keys
|
||||
},
|
||||
{ 'L3MON4D3/LuaSnip', version = '*' },
|
||||
{ 'saadparwaiz1/cmp_luasnip' },
|
||||
{ 'lambdalisue/suda.vim' },
|
||||
{
|
||||
'akinsho/bufferline.nvim',
|
||||
version = '*',
|
||||
opts = require('plugins.bufferline').config
|
||||
},
|
||||
{
|
||||
'gorbit99/codewindow.nvim',
|
||||
opts = require('plugins.codewindow').config,
|
||||
init = require('plugins.codewindow').build
|
||||
},
|
||||
{
|
||||
'preservim/nerdcommenter',
|
||||
keys = require('plugins.nerdcommenter').keys
|
||||
},
|
||||
{ 'rmagatti/auto-session' },
|
||||
{ 'tpope/vim-fugitive' },
|
||||
{ 'Glench/Vim-Jinja2-Syntax' },
|
||||
{ 'vmware-archive/salt-vim' },
|
||||
{ 'stephpy/vim-yaml' }, -- for proper sls syntax highlighting when jinja
|
||||
{
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
opts = require('plugins.indent-blankline').config
|
||||
},
|
||||
{ 'MunifTanjim/nui.nvim' },
|
||||
{
|
||||
'folke/noice.nvim',
|
||||
opts = require("plugins.noice").config,
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- OPTIONAL:
|
||||
-- `nvim-notify` is only needed, if you want to use the notification view.
|
||||
-- If not available, we use `mini` as the fallback
|
||||
"rcarriga/nvim-notify", }
|
||||
},
|
||||
{
|
||||
'rcarriga/nvim-notify',
|
||||
opts = require('plugins.nvim-notify').config
|
||||
},
|
||||
{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
opts = require('plugins.lualine').config
|
||||
},
|
||||
{ 'RRethy/vim-illuminate' },
|
||||
{ 'sheerun/vim-polyglot' },
|
||||
|
||||
-- themes
|
||||
{ 'olimorris/onedarkpro.nvim' },
|
||||
{ 'ellisonleao/gruvbox.nvim' },
|
||||
{
|
||||
'Mofiqul/dracula.nvim',
|
||||
priority = 300
|
||||
},
|
||||
{ 'vigoux/oak' },
|
||||
{ 'NLKNguyen/papercolor-theme' },
|
||||
{ 'bluz71/vim-moonfly-colors' },
|
||||
{ 'luisiacc/gruvbox-baby' },
|
||||
{ 'catppuccin/nvim' },
|
||||
{ 'EdenEast/nightfox.nvim' },
|
||||
{ 'projekt0n/github-nvim-theme' },
|
||||
|
||||
--Fuzzy search by Telescope and its dependencies:
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
branch = 'master',
|
||||
config = require('plugins.nvim-telescope').config,
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
priority = 100
|
||||
},
|
||||
{ 'BurntSushi/ripgrep' },
|
||||
|
||||
{ 'nvim-treesitter/nvim-treesitter',
|
||||
-- treesitter need to be configured after load,
|
||||
-- so let here be init, not config
|
||||
init = require('plugins.treesitter'),
|
||||
build = ':TSUpdate',
|
||||
priority = 400 },
|
||||
-- neovim lsp plugins and depencencies
|
||||
{ 'hrsh7th/cmp-nvim-lsp' },
|
||||
{ 'hrsh7th/cmp-buffer' },
|
||||
{ 'hrsh7th/cmp-cmdline' },
|
||||
{ 'hrsh7th/cmp-path' },
|
||||
{ 'hrsh7th/nvim-cmp',
|
||||
config = require('plugins.nvim-cmp').init,
|
||||
dependencies = { 'onsails/lspkind.nvim' } },
|
||||
{ 'williamboman/mason.nvim',
|
||||
opts = {},
|
||||
priority = 200 },
|
||||
-- mason-lspconfig might need disabling on first run
|
||||
{ 'williamboman/mason-lspconfig.nvim',
|
||||
opts = require('plugins.mason-lspconfig').config,
|
||||
dependencies = { 'williamboman/mason.nvim' },
|
||||
priority = 150 },
|
||||
{ 'neovim/nvim-lspconfig',
|
||||
init = require('plugins.nvim-lspconfig').init,
|
||||
priority = 100 },
|
||||
{ 'mfussenegger/nvim-lint',
|
||||
init = require('plugins.nvim-lint').init },
|
||||
{ 'folke/trouble.nvim',
|
||||
opts = require('plugins.trouble').config,
|
||||
keys = require("plugins.trouble").keys
|
||||
},
|
||||
|
||||
-- various plugins
|
||||
{ 'lewis6991/gitsigns.nvim',
|
||||
opts = require('plugins.gitsigns').config },
|
||||
{ 'petertriho/nvim-scrollbar',
|
||||
opts = {} },
|
||||
{ 'kevinhwang91/nvim-hlslens',
|
||||
opts = {},
|
||||
keys = require('plugins.hlslens').keys },
|
||||
{ 'L3MON4D3/LuaSnip', version = '*' },
|
||||
{ 'saadparwaiz1/cmp_luasnip' },
|
||||
{ 'lambdalisue/suda.vim' },
|
||||
{ 'akinsho/bufferline.nvim', version = '*',
|
||||
opts = require('plugins.bufferline').config },
|
||||
{ 'gorbit99/codewindow.nvim',
|
||||
opts = require('plugins.codewindow').config,
|
||||
init = require('plugins.codewindow').build
|
||||
},
|
||||
{ 'preservim/nerdcommenter',
|
||||
keys = require('plugins.nerdcommenter').keys },
|
||||
{ 'rmagatti/auto-session' },
|
||||
{ 'tpope/vim-fugitive' },
|
||||
{ 'Glench/Vim-Jinja2-Syntax' },
|
||||
{ 'vmware-archive/salt-vim' },
|
||||
{ 'stephpy/vim-yaml' }, -- for proper sls syntax highlighting when jinja
|
||||
{ 'lukas-reineke/indent-blankline.nvim',
|
||||
opts = require('plugins.indent-blankline').config },
|
||||
{ 'MunifTanjim/nui.nvim' },
|
||||
{ 'folke/noice.nvim',
|
||||
opts = require("plugins.noice").config,
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- OPTIONAL:
|
||||
-- `nvim-notify` is only needed, if you want to use the notification view.
|
||||
-- If not available, we use `mini` as the fallback
|
||||
"rcarriga/nvim-notify", } },
|
||||
{ 'rcarriga/nvim-notify',
|
||||
opts = require('plugins.nvim-notify').config },
|
||||
{ 'nvim-lualine/lualine.nvim',
|
||||
opts = require('plugins.lualine').config },
|
||||
{ 'RRethy/vim-illuminate' },
|
||||
{ 'sheerun/vim-polyglot' },
|
||||
|
||||
-- themes
|
||||
{ 'olimorris/onedarkpro.nvim' },
|
||||
{ 'ellisonleao/gruvbox.nvim' },
|
||||
{ 'Mofiqul/dracula.nvim',
|
||||
priority = 300 },
|
||||
{ 'vigoux/oak' },
|
||||
{ 'NLKNguyen/papercolor-theme' },
|
||||
{ 'bluz71/vim-moonfly-colors' },
|
||||
{ 'luisiacc/gruvbox-baby' },
|
||||
{ 'catppuccin/nvim' },
|
||||
{ 'EdenEast/nightfox.nvim' },
|
||||
{ 'projekt0n/github-nvim-theme' },
|
||||
|
||||
--Fuzzy search by Telescope and its dependencies:
|
||||
{
|
||||
'nvim-telescope/telescope.nvim', branch = 'master',
|
||||
config = require('plugins.nvim-telescope').config,
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
priority = 100
|
||||
},
|
||||
{ 'BurntSushi/ripgrep' },
|
||||
|
||||
},
|
||||
{
|
||||
root = vim.fn.stdpath("data") .. "/lazy", -- directory where plugins will be installed
|
||||
defaults = {
|
||||
lazy = false, -- should plugins be lazy-loaded?
|
||||
lazy = false, -- should plugins be lazy-loaded?
|
||||
version = nil,
|
||||
-- version = "*", -- enable this to try installing the latest stable versions of plugins
|
||||
},
|
||||
|
@ -117,7 +164,7 @@ require("lazy").setup({
|
|||
-- defaults for the `Lazy log` command
|
||||
-- log = { "-10" }, -- show the last 10 commits
|
||||
log = { "--since=3 days ago" }, -- show commits from the last 3 days
|
||||
timeout = 120, -- kill processes that take more than 2 minutes
|
||||
timeout = 120, -- kill processes that take more than 2 minutes
|
||||
url_format = "https://github.com/%s.git",
|
||||
-- lazy.nvim requires git >=2.19.0. If you really want to use lazy with an older version,
|
||||
-- then set the below to false. This is should work, but is NOT supported and will
|
||||
|
@ -128,7 +175,7 @@ require("lazy").setup({
|
|||
-- directory where you store your local plugin projects
|
||||
path = "~/projects",
|
||||
---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
|
||||
patterns = {}, -- For example {"folke"}
|
||||
patterns = {}, -- For example {"folke"}
|
||||
fallback = false, -- Fallback to git when local plugin doesn't exist
|
||||
},
|
||||
install = {
|
||||
|
@ -175,14 +222,13 @@ require("lazy").setup({
|
|||
-- To disable one of the defaults, set it to false
|
||||
|
||||
-- open lazygit log
|
||||
["<localleader>l"] = function(plugin)
|
||||
["<localleader>l"] = function(plugin)
|
||||
require("lazy.util").float_term({ "lazygit", "log" }, {
|
||||
cwd = plugin.dir,
|
||||
})
|
||||
end,
|
||||
|
||||
-- open a terminal for the plugin dir
|
||||
["<localleader>t"] = function(plugin)
|
||||
["<localleader>t"] = function(plugin)
|
||||
require("lazy.util").float_term(nil, {
|
||||
cwd = plugin.dir,
|
||||
})
|
||||
|
@ -202,7 +248,7 @@ require("lazy").setup({
|
|||
-- automatically check for plugin updates
|
||||
enabled = false,
|
||||
concurrency = nil, ---@type number? set to 1 to check for updates very slowly
|
||||
notify = true, -- get a notification when new updates are found
|
||||
notify = true, -- get a notification when new updates are found
|
||||
frequency = 3600, -- check for updates every hour
|
||||
},
|
||||
change_detection = {
|
||||
|
@ -222,11 +268,11 @@ require("lazy").setup({
|
|||
disable_events = { "UIEnter", "BufReadPre" },
|
||||
ttl = 3600 * 24 * 5, -- keep unused modules for up to 5 days
|
||||
},
|
||||
reset_packpath = true, -- reset the package path to improve startup time
|
||||
reset_packpath = true, -- reset the package path to improve startup time
|
||||
rtp = {
|
||||
reset = true, -- reset the runtime path to $VIMRUNTIME and your config directory
|
||||
reset = true, -- reset the runtime path to $VIMRUNTIME and your config directory
|
||||
---@type string[]
|
||||
paths = {}, -- add any custom paths here that you want to includes in the rtp
|
||||
paths = {}, -- add any custom paths here that you want to includes in the rtp
|
||||
---@type string[] list any plugins you want to disable here
|
||||
disabled_plugins = {
|
||||
-- "gzip",
|
||||
|
|
89
lua/plugins/which-key.lua
Normal file
89
lua/plugins/which-key.lua
Normal file
|
@ -0,0 +1,89 @@
|
|||
return {
|
||||
conf = {
|
||||
plugins = {
|
||||
marks = true, -- shows a list of your marks on ' and `
|
||||
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
||||
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
|
||||
-- No actual key bindings are created
|
||||
spelling = {
|
||||
enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
|
||||
suggestions = 20, -- how many suggestions should be shown in the list?
|
||||
},
|
||||
presets = {
|
||||
operators = true, -- adds help for operators like d, y, ...
|
||||
motions = true, -- adds help for motions
|
||||
text_objects = true, -- help for text objects triggered after entering an operator
|
||||
windows = true, -- default bindings on <c-w>
|
||||
nav = true, -- misc bindings to work with windows
|
||||
z = true, -- bindings for folds, spelling and others prefixed with z
|
||||
g = true, -- bindings for prefixed with g
|
||||
},
|
||||
},
|
||||
-- add operators that will trigger motion and text object completion
|
||||
-- to enable all native operators, set the preset / operators plugin above
|
||||
operators = { gc = "Comments" },
|
||||
key_labels = {
|
||||
-- override the label used to display some keys. It doesn't effect WK in any other way.
|
||||
-- For example:
|
||||
-- ["<space>"] = "SPC",
|
||||
-- ["<cr>"] = "RET",
|
||||
-- ["<tab>"] = "TAB",
|
||||
},
|
||||
motions = {
|
||||
count = true,
|
||||
},
|
||||
icons = {
|
||||
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
|
||||
separator = "➜", -- symbol used between a key and it's label
|
||||
group = "+", -- symbol prepended to a group
|
||||
},
|
||||
popup_mappings = {
|
||||
scroll_down = "<c-d>", -- binding to scroll down inside the popup
|
||||
scroll_up = "<c-u>", -- binding to scroll up inside the popup
|
||||
},
|
||||
window = {
|
||||
border = "single", -- none, single, double, shadow
|
||||
position = "bottom", -- bottom, top
|
||||
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
|
||||
padding = { 1, 2, 1, 2 }, -- extra window padding [top, right, bottom, left]
|
||||
winblend = 0, -- value between 0-100 0 for fully opaque and 100 for fully transparent
|
||||
},
|
||||
layout = {
|
||||
height = { min = 4, max = 25 }, -- min and max height of the columns
|
||||
width = { min = 20, max = 50 }, -- min and max width of the columns
|
||||
spacing = 3, -- spacing between columns
|
||||
align = "left", -- align columns left, center or right
|
||||
},
|
||||
ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label
|
||||
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "^:", "^ ", "^call ", "^lua " }, -- hide mapping boilerplate
|
||||
show_help = true, -- show a help message in the command line for using WhichKey
|
||||
show_keys = true, -- show the currently pressed key and its label as a message in the command line
|
||||
triggers = "auto", -- automatically setup triggers
|
||||
-- triggers = {"<leader>"} -- or specifiy a list manually
|
||||
-- list of triggers, where WhichKey should not wait for timeoutlen and show immediately
|
||||
triggers_nowait = {
|
||||
-- marks
|
||||
"`",
|
||||
"'",
|
||||
"g`",
|
||||
"g'",
|
||||
-- registers
|
||||
'"',
|
||||
"<c-r>",
|
||||
-- spelling
|
||||
"z=",
|
||||
},
|
||||
triggers_blacklist = {
|
||||
-- list of mode / prefixes that should never be hooked by WhichKey
|
||||
-- this is mostly relevant for keymaps that start with a native binding
|
||||
i = { "j", "k" },
|
||||
v = { "j", "k" },
|
||||
},
|
||||
-- disable the WhichKey popup for certain buf types and file types.
|
||||
-- Disabled by deafult for Telescope
|
||||
disable = {
|
||||
buftypes = {},
|
||||
filetypes = {},
|
||||
},
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue