]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge pull request #32 from mutewinter/folding_option
authorBen Williams <benw@plasticboy.com>
Wed, 20 Mar 2013 15:35:05 +0000 (08:35 -0700)
committerBen Williams <benw@plasticboy.com>
Wed, 20 Mar 2013 15:35:05 +0000 (08:35 -0700)
Added Option to Disable Folding

README.md
after/ftplugin/mkd.vim

index a11299bc9e8bb94b8d3ff5b7b1b0591bdad6b3f8..2d7e587ea9f8550bf6c6a73e2ec8d9af027169e5 100644 (file)
--- a/README.md
+++ b/README.md
@@ -16,6 +16,16 @@ To install without Pathogen, download the [tarball](https://github.com/plasticbo
 
 [Homepage](http://plasticboy.com/markdown-vim-mode/)
 
+## Options
+
+**Disable Folding**
+
+Add the following line to your `.vimrc` to disable folding.
+
+```vim
+let g:vim_markdown_folding_disabled=1
+```
+
 ## License
 
 The MIT License (MIT)
index b0b09467e2fc3b3541a37b9f459636dc1127a7fa..ed78895f5cedb9a6f2add4566e86eb5960cc98b6 100644 (file)
@@ -35,14 +35,17 @@ func! Foldexpr_markdown(lnum)
     endif
 endfunc
 
-setlocal foldexpr=Foldexpr_markdown(v:lnum)
-setlocal foldmethod=expr
 
-"---------- everything after this is optional -----------------------
-" change the following fold options to your liking
-" see ':help fold-options' for more
-setlocal foldenable
-setlocal foldlevel=0
-setlocal foldcolumn=0
-set foldmethod=expr
-set foldopen-=search
+if !exists("g:vim_markdown_folding_disabled")
+  setlocal foldexpr=Foldexpr_markdown(v:lnum)
+  setlocal foldmethod=expr
+
+  "---------- everything after this is optional -----------------------
+  " change the following fold options to your liking
+  " see ':help fold-options' for more
+  setlocal foldenable
+  setlocal foldlevel=0
+  setlocal foldcolumn=0
+  set foldmethod=expr
+  set foldopen-=search
+endif