diff --git a/core/nvim/init.lua b/core/nvim/init.lua index 7fe7229..a9c117c 100644 --- a/core/nvim/init.lua +++ b/core/nvim/init.lua @@ -60,10 +60,13 @@ vim.api.nvim_create_user_command('Help', function(a) if vim.fn.bufnr('%') ~= buf then vim.cmd.bwipeout(buf) end end, { nargs = '?', bar = true, complete = 'help' }) --- Add command line abbreviation if at start of line -vim.cmd.cabbrev { 'help', - '=(getcmdtype() == ":" && getcmdpos() == 1) ? "Help" : "help"' -} +-- Add command line abbreviations if at start of line +for i, word in ipairs { 'h', 'he', 'hel', 'help' } do + vim.cmd.cabbrev { word, string.format( + '=(getcmdtype() == ":" && getcmdpos() == 1) ? "Help" : "%s"', + word + )} +end -- Source init directory vim.cmd 'runtime! init/*.lua'