local Hydra = require('hydra') local cmd = require('hydra.keymap-util').cmd local telescope_hint = [[ _f_: files _g_: live grep 🭇🬭🬭🬭🬭🬭🬭🬭🬭🬼 _o_: old files _/_: search in file 🭉🭁🭠🭘 🭣🭕🭌🬾 🭅█ >▁ █🭐 _r_: resume _T_: TODO comments ██🬿 🭊██ _h_: vim help _c_: execute command 🭋█🬝🮄🮄🮄🮄🮄🮄🮄🮄🬆█🭀 _k_: keymaps _;_: commands history 🭤🭒🬺🬹🬱🬭🬭🬭🬭🬵🬹🬹🭝🭙 _O_: options _?_: search history ^ __: Telescope __ ]] Hydra({ name = 'Telescope', hint = telescope_hint, config = { color = 'teal', invoke_on_body = true, hint = { position = 'middle', border = 'rounded', }, }, mode = 'n', body = 'F', heads = { { 'f', cmd 'Telescope find_files' }, { 'g', cmd 'Telescope live_grep' }, { 'o', cmd 'Telescope oldfiles', { desc = 'recently opened files' } }, { 'h', cmd 'Telescope help_tags', { desc = 'vim help' } }, { 'k', cmd 'Telescope keymaps' }, { 'O', cmd 'Telescope vim_options' }, { 'r', cmd 'Telescope resume' }, { '/', cmd 'Telescope current_buffer_fuzzy_find', { desc = 'search in file' } }, { '?', cmd 'Telescope search_history', { desc = 'search history' } }, { ';', cmd 'Telescope command_history', { desc = 'command-line history' } }, { 'c', cmd 'Telescope commands', { desc = 'execute command' } }, { 'T', cmd 'TodoTelescope', { desc = 'todo comments' } }, { '', cmd 'Telescope', { exit = true, desc = 'list all pickers' } }, { '', nil, { exit = true, nowait = true } }, } }) local lsp_hint = [[ _K_: hover 🭇🬭🬭🬭🬭🬭🬭🬭🬭🬼 🭉🭁🭠🭘 🭣🭕🭌🬾 _gd_: definition _gD_: declaration 🭅█ >▁ █🭐 _gi_: implementation _go_: typedef ██🬿 🭊██ _gr_: references _gs_: signature 🭋█🬝🮄🮄🮄🮄🮄🮄🮄🮄🬆█🭀 🭤🭒🬺🬹🬱🬭🬭🬭🬭🬵🬹🬹🭝🭙 __: rename __: code actions ^ _gl_: diagnostic float _[d_: prev _]d_: next ]] Hydra({ name = 'LSP Actions', hint = lsp_hint, config = { color = 'teal', invoke_on_body = true, hint = { position = 'middle', border = 'rounded', } }, mode = 'n', body = 'L', heads = { { 'K', cmd 'lua vim.lsp.buf.hover()' }, { 'gd', cmd 'lua vim.lsp.buf.definition()' }, { 'gD', cmd 'lua vim.lsp.buf.declaration()' }, { 'gi', cmd 'lua vim.lsp.buf.implementation()' }, { 'go', cmd 'lua vim.lsp.buf.type_definition()' }, { 'gr', cmd 'lua vim.lsp.buf.references()' }, { 'gs', cmd 'lua vim.lsp.buf.signature_help()' }, { '', cmd 'lua vim.lsp.buf.rename()' }, { '', cmd 'lua vim.lsp.buf.code_action()' }, { 'gl', cmd 'lua vim.diagnostic.open_float()' }, { '[d', cmd 'lua vim.diagnostic.goto_prev()' }, { ']d', cmd 'lua vim.diagnostic.goto_next()' }, { '', nil, { exit = true, nowait = true } }, } })