add abbreviations for "help" prefixes
This commit is contained in:
@@ -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',
|
||||
'<c-r>=(getcmdtype() == ":" && getcmdpos() == 1) ? "Help" : "help"<cr>'
|
||||
}
|
||||
-- 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(
|
||||
'<c-r>=(getcmdtype() == ":" && getcmdpos() == 1) ? "Help" : "%s"<cr>',
|
||||
word
|
||||
)}
|
||||
end
|
||||
|
||||
-- Source init directory
|
||||
vim.cmd 'runtime! init/*.lua'
|
||||
|
||||
Reference in New Issue
Block a user