Skip to content

Commit 1db5e1d

Browse files
committed
Point out Vim help for single letter commands
1 parent c7d69d1 commit 1db5e1d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugin/vim-kaizen.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ function VimKaizen(pat, alt)
22
local txt1 = string.format('You entered "%s", which is an anti-pattern.', pat)
33
local txt2 = string.format('Consider using "%s" from now on.', alt)
44
local txt3 = 'Press "q" or ESC to close window.'
5+
local txt4 = ''
6+
if #alt == 1 then
7+
txt4 = string.format('Try :h %s to see the Vim help.', alt)
8+
end
59
local buf = vim.api.nvim_create_buf(false, true)
6-
vim.api.nvim_buf_set_lines(buf, 0, -1, false, {txt1, txt2, '', txt3})
10+
vim.api.nvim_buf_set_lines(buf, 0, -1, false, {txt1, txt2, '', txt3, '', txt4})
711
local ui = vim.api.nvim_list_uis()[1] or vim.api.nvim_list_uis()[0]
812

913
local width = 50

0 commit comments

Comments
 (0)