Permalink
Browse files

Add coffee_folding to enable folding by default

  • Loading branch information...
1 parent d877488 commit 6474cc694af0f80a86fc40789a4c4fc6e6ac8ee8 @kchmck committed Apr 20, 2011
Showing with 21 additions and 0 deletions.
  1. +6 −0 ftplugin/coffee.vim
  2. +12 −0 readme.md
  3. +3 −0 thanks.md
View
@@ -12,8 +12,14 @@ let b:did_ftplugin = 1
setlocal formatoptions-=t formatoptions+=croql
setlocal comments=s:###,m:\ ,e:###,:#
setlocal commentstring=#\ %s
+
+" Fold by indentation, but only if enabled.
setlocal foldmethod=indent
+if !exists("coffee_folding")
+ setlocal nofoldenable
+endif
+
" Compile some CoffeeScript.
command! -range=% CoffeeCompile <line1>,<line2>:w !coffee -scb
View
@@ -83,6 +83,18 @@ The command can also be mapped to a visual mode key for convenience:
These customizations can be enabled or disabled by adding the relevant `let`
statement to your `~/.vimrc`.
+#### Fold by indentation
+
+Folding is automatically setup as indent-based:
+
+ ![Folding](http://i.imgur.com/Cq9JA.png)
+
+It's disabled by default, but can be enabled with:
+
+ 1et coffee_folding = 1
+
+Otherwise, it can be quickly toggled per-file with the `zi` command.
+
#### Compile the current file on save
To compile the current file at each save, set:
View
@@ -16,6 +16,9 @@ Thanks to the following contributors:
Karl Guertin:
Cakefiles are coffeescript
+ Nick Stenning:
+ Fold by indentation for coffeescript
+
Simon Lipp:
Trailing spaces are not error on lines containing only spaces

0 comments on commit 6474cc6

Please sign in to comment.