dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

explain_fopt.vim (1760B)


      1 let s:fo_table = {
      2       \ 't': "Auto-wrap using textwidth",
      3       \ 'c': "Auto-wrap comments using textwidth (insert comment automatically)",
      4       \ 'r': "Automatically insert comment leader on <enter> (insert mode)",
      5       \ 'o': "Automatically insert comment leader on 'o' or 'O' (normal mode)",
      6       \ 'q': "Allow 'gq'",
      7       \ 'w': "Trailing white space indicates a paragraph continues in the next line.",
      8       \ 'a': "Automatically format paragraphs while typing (with 'c' only comments)",
      9       \ 'n': "Recognise text with 'formatlistpat' when formatting (e.g. list)",
     10       \ '2': "When formatting text, use the indent of the second line of a paragraph for the rest of the paragraph",
     11       \ 'v': "Only break a line at a blank that you have entered during the current insert command.",
     12       \ 'b': "Like 'v', but only auto-wrap if you enter a blank at or before the wrap margin.",
     13       \ 'l': "Don't auto-break lines over 'textwidth' in insert mode",
     14       \ 'm': "Also break at a multibyte character above 255",
     15       \ 'M': "When joining lines, don't insert a space before or after a multibyte character.  Overrules the 'B' flag.",
     16       \ 'B': "When joining lines, don't insert a space between two multibyte characters.  Overruled by the 'M' flag.",
     17       \ '1': "Don't break a line after a one-letter word.",
     18       \ ']': "Respect textwidth rigorously.",
     19       \ 'j': "Remove comment leader when joining lines.",
     20       \ 'p': "Don't break lines at single spaces that follow periods."
     21       \ }
     22 
     23 function! explain_fopt#ExplainFopt()
     24   echohl Function | echo '= Current options: =' | echohl None
     25   let current_opts = split(&l:formatoptions, '\zs')
     26   for an_opt in current_opts
     27     echo '- '.an_opt.': '.s:fo_table[an_opt]
     28   endfor
     29 endfunction