🪴 my neovim config:)
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ftplugin: add helpfile MiniAlign modifier

robin fe0c9317 51566143

+19
+19
config/after/ftplugin/help.lua
··· 1 + local target_width = vim.bo.textwidth > 0 and vim.bo.textwidth or 80 2 + 3 + local justify_right_second_col = function(parts, _) 4 + -- For the line 'aaa *aaa*' the row is `{ 'aaa', ' ', '*aaa*'}` 5 + for _, row in ipairs(parts) do 6 + -- Make sure that separator column doesn't affect 7 + row[2] = "" 8 + -- Justify second column so that its right part is at `target_width` 9 + row[3] = string.rep(" ", target_width - vim.fn.strchars(row[1]) - vim.fn.strchars(row[3])) .. row[3] 10 + end 11 + end 12 + 13 + local align_helptag = function(steps, opts) 14 + -- Split based on whitespace 15 + opts.split_pattern = "%s+" 16 + steps.justify = MiniAlign.new_step("justify_helptag", justify_right_second_col) 17 + end 18 + 19 + vim.b.minialign_config = { modifiers = { ["*"] = align_helptag } }