diff --git a/config/nvim/lua/fschauen/keymap.lua b/config/nvim/lua/fschauen/keymap.lua index 917a48c..42f9f7e 100644 --- a/config/nvim/lua/fschauen/keymap.lua +++ b/config/nvim/lua/fschauen/keymap.lua @@ -1,5 +1,7 @@ local M = {} +local ui = require('fschauen.util.icons').ui + local map = function(mode, lhs, rhs, opts) if mode ~= 'c' then opts = opts or {} @@ -83,12 +85,12 @@ M.setup = function() local diagnostic = require 'fschauen.diagnostic' -- navigate diagnostics - map('n', '', diagnostic.goto_next) - map('n', '', diagnostic.goto_prev) - map('n', 'dd', diagnostic.toggle) - map('n', 'do', diagnostic.open_float) - map('n', 'dh', diagnostic.hide) - map('n', 'dt', diagnostic.select_virtual_text_severity) + map('n', '', diagnostic.goto_next, { desc = ui.Diagnostic .. ' [d]iagnostic [n]ext' }) + map('n', '', diagnostic.goto_prev, { desc = ui.Diagnostic .. ' [d]iagnostic [p]revious' }) + map('n', 'dd', diagnostic.toggle, { desc = ui.Diagnostic .. ' [d]iagnostic enable/[d]isable' }) + map('n', 'do', diagnostic.open_float, { desc = ui.Diagnostic .. ' [d]iagnostic [o]pen' }) + map('n', 'dh', diagnostic.hide, { desc = ui.Diagnostic .. ' [d]iagnostic [h]ide' }) + map('n', 'ds', diagnostic.select_virtual_text_severity, { desc = ui.Diagnostic .. ' [d]iagnostic [s]everity' }) -- disable highlight until next search map('n', 'h', 'nohlsearch') @@ -99,20 +101,19 @@ M.setup = function() map('n', 'j', 'lnextzz') map('n', 'k', 'lpreviouszz') - local toggle = require('fschauen.util.icons').ui.Toggle .. ' toggle ' -- toggle quickfix and loclist - map('n', 'll', window.toggle_quickfix, { desc = toggle .. 'quickfix' }) - map('n', 'll', window.toggle_loclist, { desc = toggle .. 'loclist' }) + map('n', 'll', window.toggle_quickfix, { desc = ui.Toggle .. ' toggle quickfix' }) + map('n', 'll', window.toggle_loclist, { desc = ui.Toggle .. ' toggle loclist' }) local options = require('fschauen.util.options') -- toggle options - map('n', 'sn', options.toggle_number, { desc = toggle .. "'number'" }) - map('n', 'sr', options.toggle_relativenumber, { desc = toggle .. "'relativenumber'" }) - map('n', 'sl', options.toggle_list, { desc = toggle .. "'list'" }) - map('n', 'sw', options.toggle_wrap, { desc = toggle .. "'wrap'" }) - map('n', 'ss', options.toggle_spell, { desc = toggle .. "'spell'" }) + map('n', 'sn', options.toggle_number, { desc = ui.Toggle .. " toggle 'number'" }) + map('n', 'sr', options.toggle_relativenumber, { desc = ui.Toggle .. " toggle 'relativenumber'" }) + map('n', 'sl', options.toggle_list, { desc = ui.Toggle .. " toggle 'list'" }) + map('n', 'sw', options.toggle_wrap, { desc = ui.Toggle .. " toggle 'wrap'" }) + map('n', 'ss', options.toggle_spell, { desc = ui.Toggle .. " toggle 'spell'" }) end return M diff --git a/config/nvim/lua/fschauen/plugins/indent-blankline.lua b/config/nvim/lua/fschauen/plugins/indent-blankline.lua index 52c70e5..209e755 100644 --- a/config/nvim/lua/fschauen/plugins/indent-blankline.lua +++ b/config/nvim/lua/fschauen/plugins/indent-blankline.lua @@ -9,9 +9,11 @@ M.cmd = { 'IBLToggleScope', } +local toggle = require('fschauen.util.icons').ui.Toggle .. ' toggle ' + M.keys = { - { 'si', 'IBLToggle' }, - { 'so', 'IBLToggleScope' }, + { 'si', 'IBLToggle', desc = toggle .. 'indent lines' }, + { 'so', 'IBLToggleScope', desc = toggle .. 'indent line scope' }, } M.main = 'ibl' diff --git a/config/nvim/lua/fschauen/plugins/virt-column.lua b/config/nvim/lua/fschauen/plugins/virt-column.lua index 7b92018..5afc52a 100644 --- a/config/nvim/lua/fschauen/plugins/virt-column.lua +++ b/config/nvim/lua/fschauen/plugins/virt-column.lua @@ -10,8 +10,10 @@ local toggle_colorcolumn = function() end end +local toggle = require('fschauen.util.icons').ui.Toggle .. ' toggle ' + M.keys = { - { 'sc', toggle_colorcolumn, desc = 'Toggle virtual colunn' }, + { 'sc', toggle_colorcolumn, desc = toggle .. 'virtual colunn' }, } M.config = function(--[[plugin]]_, --[[opts]]_) diff --git a/config/nvim/lua/fschauen/util/icons.lua b/config/nvim/lua/fschauen/util/icons.lua index 181e8c2..9f67f93 100644 --- a/config/nvim/lua/fschauen/util/icons.lua +++ b/config/nvim/lua/fschauen/util/icons.lua @@ -103,6 +103,7 @@ M.ui = { ChevronSmallRight = '', ChevronSmallUp = '', Circle = '●', + Diagnostic = '', EmptyFolder = '', EmptyFolderOpen = '', File = '', -- 