Typical of me.... I spend an hour reading manuals and fiddling to no avail.... but then solve it myself 5 mins after posting. By default Modelines are disabled (at least for me). I had to edit my vimrc to enable it.
Now works as expected. Cheers, Matt On Friday, April 10, 2020 at 8:37:51 PM UTC+10, Matt Graham wrote: > > Hi All! > Loving ledger and the vim plugin. Unfortunately, I can't seem to get the > modeline to work as it should. > > I have a file "journal.txt". I don't want to override the default ".txt" > extension behaviour (or change the journal file extension). Hence, the > modeline seems to be the best way to go to have vim recognise the ledger > file. > > So, I placed a line at the very top of my journal.txt file: > ; vim: filetype=ledger > But unfortunately this doesn't work. Opening the file with vim has no > syntax highlighting (and the filetype is still "text"). > > When in the file I can enter the command "set filetype=ledger" and the > highlighting works (the filetype is correct). I had expected that having > the above modeline as the first line of my file would have it automatically > recognise the type properly. > > Looking at "help: modeline" seemed to indicate that the above modeline > should work (based on my understanding)... > > Does anyone know what I'm doing wrong? > > Cheers, > > Matt Graham > -- --- You received this message because you are subscribed to the Google Groups "Ledger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ledger-cli/86c9c606-44a8-4ff6-a58e-245c9d143397%40googlegroups.com.
