Treat bullets as a list rather than a comment
I prefer to write my notes using textwidth of 72, and when a given note gets too long it will carriage return and go to a new line. Unfortunately, this creates a new bullet, which is not desired.
If I remove the carriage return for comments using 'fo-=c' then it kind've solves it, but it breaks indentation.
* this is an example of what
I would like to happen when
a newline occurs
* This is what happens
* when text wraps normally
* This is an example of
what happens when
I set fo-=c
So i tend to fix it manually a lot, but reformatting with 'gq' doesnt work properly. I found that if I sacrifice any automatic bullet creation, I can change the bullets to a list (similar to the numbered lists) and get all the behavior I'm after. I've added this to my syntax file ~/.vim/syntax/notes.vim
let &formatlistpat='^\s*\(\d\+[\]:.)}\t ]\|[*\-\+\•\◦\▸\▹\▪\▫][\t ]\)\s*'
set comments=fb:>
set fo-=c
Now I get the indentation i'm after, and it will automatically indent properly if I use 'gq', the '>' in the comments is just to override the defaults that are set in the vim configs. I'm curious if there's a better way to do this? Or if there is a way to get this sort of thing working out of the box?
+1
It will be great if let say Shift + Enter skips automatic bullet creation.
@sportpeppers, I tried your manual fix. It works but indents like this:
• This is how it indents
for me.