feat: Add WhichKey descriptions

This commit is contained in:
Fabio Lenherr / DashieTM 2023-05-13 12:31:21 +02:00
parent a8ef41ae1a
commit 479626c1ec
10 changed files with 265 additions and 90 deletions

View file

@ -42,7 +42,27 @@ return {
tailwindcss = {},
cssls = {},
html = {},
clangd = {},
clangd = {
root_pattern = {
".clangd",
".clang-tidy",
".clang-format",
"compile_commands.json",
"compile_flags.txt",
"configure.ac",
".git",
"build/compile_commands.json",
},
filetypes = {
"c",
"cpp",
"objc",
"objcpp",
"cuda",
"proto",
"cl",
},
},
pyright = {},
cmake = {},
bashls = {},
@ -110,6 +130,7 @@ return {
sqlls = {},
taplo = {},
lemminx = {},
opencl_ls = {},
yamlls = {},
lua_ls = {
-- mason = false, -- set to false if you don't want this server to be installed with mason
@ -140,7 +161,7 @@ return {
-- setup formatting and keymaps
require("lazyvim.util").on_attach(function(client, buffer)
require("lazyvim.plugins.lsp.format").on_attach(client, buffer)
require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer)
require("config.lsp-keymap").on_attach(client, bufnr)
end)
-- diagnostics
@ -157,6 +178,7 @@ return {
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
local optslsp = { noremap = false, silent = true, buffer = bufnr }
require("lsp-inlayhints").on_attach(client, bufnr)
-- keymaps
end
local function setup(server)
@ -225,7 +247,7 @@ return {
nls.builtins.formatting.shfmt,
nls.builtins.diagnostics.flake8,
nls.builtins.formatting.autopep8,
nls.builtins.formatting.prettierd
nls.builtins.formatting.prettierd,
},
}
end,

View file

@ -5,6 +5,14 @@ return {
colorscheme = "tokyonight-night",
},
},
{
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
keys = function() return {} end,
config = function(opts)
require("telescope").setup(opts)
end,
},
{
"akinsho/toggleterm.nvim",
lazy = true,
@ -177,4 +185,36 @@ return {
lazy = true,
event = "FileType typst",
},
{
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
plugins = { spelling = true },
defaults = {
mode = { "n", "v" },
["g"] = { name = "+goto" },
["gz"] = { name = "+surround" },
["]"] = { name = "+next" },
["["] = { name = "+prev" },
["<leader><tab>"] = { name = "+tabs" },
["<leader>b"] = { name = "+buffer" },
["<leader>c"] = { name = "+code" },
["<leader>f"] = { name = "+file/find" },
["<leader>g"] = { name = "+git" },
["<leader>gh"] = { name = "+hunks" },
["<leader>q"] = { name = "+quit/session" },
["<leader>s"] = { name = "+search" },
["<leader>u"] = { name = "+ui" },
["<leader>w"] = { name = "+windows" },
["<leader>x"] = { name = "+diagnostics/quickfix" },
["<leader>h"] = { name = "+harpoon" },
["<leader>d"] = { name = "+DAP" },
},
},
config = function(_, opts)
local wk = require("which-key")
wk.setup(opts)
wk.register(opts.defaults)
end,
},
}