Re: python3-ly reformat in vim

2019-05-09 Thread Andrew Bernard
Hi Martin, That's probably from pasting into email. Andrew On Fri, 10 May 2019 at 16:27, Martin Tarenskeen wrote: > > > On Fri, 10 May 2019, Andrew Bernard wrote: > > > Add this code to ~/.vimrc: > > > > " lilypond reformat (acb) > > " reformat buffer, and return cursor to about the same plac

Re: python3-ly reformat in vim

2019-05-09 Thread Martin Tarenskeen
On Fri, 10 May 2019, Andrew Bernard wrote: Add this code to ~/.vimrc: " lilypond reformat (acb) " reformat buffer, and return cursor to about the same place. fun DoLilypondReformat()     let l = line(".")     let c = col(".")     :%!ly reformat     call cursor(l, c) endfun au Filetype lilypo

Re: python3-ly reformat in vim

2019-05-09 Thread Andrew Bernard
Hi Werner, Interesting. I'll have some investigation. But close enough is good enough for me. In the majority of cases in my work, no lines are added or deleted, so I end up back very close. Thanks! Andrew On Fri, 10 May 2019 at 15:32, Werner LEMBERG wrote: > > > [...] Note that, as with al

Re: python3-ly reformat in vim

2019-05-09 Thread Werner LEMBERG
> [...] Note that, as with all code tidying programs, you can only > return the cursor to approximately the same position, as lines may > be added of deleted. Are you sure about that? In Emacs, I can set a marker property that `sticks' to a given character. As long as this character is not de

python3-ly reformat in vim

2019-05-09 Thread Andrew Bernard
For those who use vim, I'm posting this as result of my discovery of python3-ly reformat thanks to David Wright in the hope that others may find it useful. This is for Debian or Ubuntu, and assumes the Python package python3-ly is installed. Add this code to ~/.vimrc: " lilypond reformat (acb) "