Skip to content

Conversation

boeckmann
Copy link

Changes

  • FIX: due to mixed newline encodings, VIM 7.4.161 raised errors => converted .vim files to utf-8 / unix line endings.
  • FIX: corrected filetype detection for *.asc
  • FEATURE: added detection of *.ad files as asciidoc
  • FEATURE: added option g:asciidoc_trim to trim trailing whitespaces on save (useful when versioning files)

Bernd Böckmann added 5 commits November 22, 2014 12:22
Converted some DOS line endings to unix to make errors at VIM startup go
away.
 - Previous version dit not detect *.asc files correctly

 - Adding detection of *.ad files as asciidoc
- Add 'let g:asciidoc_trim=1' to your .vimrc to enable automatic line
  trimming on save.
@traycerb
Copy link
Owner

traycerb commented Dec 3, 2014

Thanks for taking the time to send in this concise, well-described PR. I don't have a Mac to test with, so the cross-platform fixes are esp. appreciated. Apologies for making you wade through my regexp comments, which were necessary as I learned about syntax files.

One question re: the trimming option. I don't question the utility, but is a syntax file the usual place for this kind of option? My sense was that the syntax file was just for non-modifying syntax highlighting, though I doubt this is written in stone. From my brief reading, a file type plugin (ftplugin) may be a better target for this, or even just a .vimrc autocmd/function.

Having an ftplugin file wouldn't be a bad idea though, and I've also given thought to making an indent file as well, so Asciidoc editing/appearance is consistent in Vim relative to other editors. I'll merge your changes when I get chance, but feel free to send in any further contributions, and I'll try to keep them and any other Asciidoc settings/config files consolidated here.

@traycerb traycerb closed this Dec 3, 2014
@traycerb traycerb reopened this Dec 3, 2014
@boeckmann
Copy link
Author

Hi! The trim support is somwhat of a dirty hack so that our internal git commit diffs don't get messed up by these whitespace changes.

I am still relatively new to VIM but making it available via a ftplugin, like you said, seems to make more sense to me than my current solution.

If I understand correctly there is a cherry picking option in git. Eventually you could merge commits a78186f and afc3b00, so if the mac users stay current with your upstream repository VIM keeps working for them without errors (the error is caused by mixed dos/unix line endings). I don't know if Dos/Windows VIM has Problems with unix line endings. If this is not the case I would suggest to convert the files to unix line endings (like I did) if cherry picking is not possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants