From a7fdd47a1b756308b01bafe24dd5662038b11a0d Mon Sep 17 00:00:00 2001 From: Roland Hieber Date: Tue, 3 Oct 2017 03:13:00 +0200 Subject: [PATCH] don't set foldmethod=syntax by default Overwriting the user's modeline is probably a bad idea. Instead make a hint in the documentation and let the users set it themselves. Fixes #31 Signed-off-by: Roland Hieber --- doc/ledger.txt | 4 ++++ ftplugin/ledger.vim | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/ledger.txt b/doc/ledger.txt index 9299b1f..917e398 100644 --- a/doc/ledger.txt +++ b/doc/ledger.txt @@ -30,6 +30,10 @@ TIPS *ledger-tips* Tips and useful commands +* vim-ledger can do syntax-sensitive folding when you set `foldmethod=syntax` + in the |modeline| of your ledger file. This way transactions can shrink down + to just one line. + * Try account-completion (as explained below). If you use YouCompleteMe, you should disable it for Ledger files. Put this in your .vimrc: diff --git a/ftplugin/ledger.vim b/ftplugin/ledger.vim index 257916d..d0648be 100644 --- a/ftplugin/ledger.vim +++ b/ftplugin/ledger.vim @@ -10,11 +10,10 @@ endif let b:did_ftplugin = 1 let b:undo_ftplugin = "setlocal ". - \ "foldmethod< foldtext< ". + \ "foldtext< ". \ "include< comments< commentstring< omnifunc< formatprg<" setl foldtext=LedgerFoldText() -setl foldmethod=syntax setl include=^!\\?include setl comments=b:; setl commentstring=;%s