Thursday, August 8, 2013

Re: showbreak question

On Thursday, August 8, 2013 12:07:19 PM UTC-5, Bee wrote:
> showbreak question
> I have a journal file, each line starts with a date.
> I like short lines and an hanging indent.
> The following setting works, but wonder if there is a simpler way. let &showbreak=' ' is not allowed in a modeline.
>
> vim:set columns=68 wrap showbreak=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ :
>
> 20130808.0943 Th journal entry... journal entry...
> journal entry... journal entry...
> journal entry... journal entry...
>
> Best viewed in a monospaced font.

You say you like "short lines and a hanging indent" but what you actually have is one really long line which Vim wraps on the screen. You could instead use 'formatoptions', 'textwidth', and 'formatlistpat' to get hard wrapping, something like:

  set formatoptions=an textwidth=30 autoindent formatlistpat=^[0-9.]\\+\\s\\+

There's no way of getting around the need to escape spaces or backslashes,
though. Alternatively, you could define all the settings you want for your
journal file and put them in a filetype plugin. I.e. create a file
"myjournal.vim" and put it into ~/.vim/ftplugin/myjournal.vim. Put all your
desired settings in it. Replace your modeline with:

vim: set ft=myjournal :

This will get you started, but see :help write-filetype-plugin for details.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: