Align multiple characters #683
-
Consider the following snippet: tabkey = '<Tab>', -- key to trigger tabout, set to an empty string to disable
backwards_tabkey = '<S-Tab>', -- key to trigger backwards tabout, set to an empty string to disable
act_as_tab = true, -- shift content if tab out is not possible
act_as_shift_tab = false, -- reverse shift content if tab out is not possible (if your keyboard/terminal supports <S-Tab>)
default_tab = '<C-t>', -- shift default action (only at the beginning of a line, otherwise <TAB> is used)
default_shift_tab = '<C-d>', -- reverse shift default action,
enable_backwards = true, -- well ...
completion = true, -- if the tabkey is used in a completion pum
tabouts = {
{ open = "'", close = "'" },
{ open = '"', close = '"' },
{ open = '`', close = '`' },
{ open = '(', close = ')' },
{ open = '[', close = ']' },
{ open = '{', close = '}' }
},
ignore_beginning = true, -- [[ if the cursor is at the beginning of a filled element it will rather tab out than shift the content ]]
exclude = {} -- tabout will ignore these filetypes How to (correctly!) align it using
Adding spaces results in split comment symbols: tabkey = '<Tab>', - - key to trigger tabout, set to an empty string to disable
backwards_tabkey = '<S-Tab>', -- key to trigger backwards tabout, set to an empty string to disable
act_as_tab = true, - - shift content if tab out is not possible
act_as_shift_tab = false, - - reverse shift content if tab out is not possible (if your keyboard/terminal supports <S-Tab>)
default_tab = '<C-t>', - - shift default action (only at the beginning of a line, otherwise <TAB> is used)
default_shift_tab = '<C-d>', - - reverse shift default action,
enable_backwards = true, - - well ...
completion = true, - - if the tabkey is used in a completion pum
tabouts = {
{ open = "'", close = "'" },
{ open = '"', close = '"' },
{ open = '`', close = '`' },
{ open = '(', close = ')' },
{ open = '[', close = ']' },
{ open = '{', close = '}' }
},
ignore_beginning = true, - - [[ if the cursor is at the beginning of a filled element it will rather tab out than shift the content ]]
exclude = {} - - tabout will ignore these filetypes Using tabkey = '<Tab>', -- key to trigger tabout, set to an empty string to disable
backwards_tabkey = '<S-Tab>', -- key to trigger backwards tabout, set to an empty string to disable
act_as_tab = true, -- shift content if tab out is not possible
act_as_shift_tab = false, -- reverse shift content if tab out is not possible (if your keyboard/terminal supports <S-Tab>)
default_tab = '<C-t>', -- shift default action (only at the beginning of a line, otherwise <TAB> is used)
default_shift_tab = '<C-d>', -- reverse shift default action,
enable_backwards = true, -- well ...
completion = true, -- if the tabkey is used in a completion pum
tabouts = {
{ open = "'", close = "'" },
{ open = '"', close = '"' },
{ open = '`', close = '`' },
{ open = '(', close = ')' },
{ open = '[', close = ']' },
{ open = '{', close = '}' }
},
ignore_beginning = true, -- [[ if the cursor is at the beginning of a filled element it will rather tab out than shift the content ]]
exclude = {} -- tabout will ignore these filetypes |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Splitting is done based on Lua patterns. In Lua patterns, So aligning by |
Beta Was this translation helpful? Give feedback.
-
It does, however "everything" else is using predominantly PCRE. Including Vim itself ( |
Beta Was this translation helpful? Give feedback.
Splitting is done based on Lua patterns. In Lua patterns,
-
is a non-greedy quantifier (similar to*
in regular regular expressions, but not greedy). Thus it should be escaped with%
.So aligning by
--
can be done using%-%-
pattern (after pressings
to Split).