Skip to content

Instantly share code, notes, and snippets.

@nahi
Created February 1, 2012 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nahi/1715596 to your computer and use it in GitHub Desktop.
Save nahi/1715596 to your computer and use it in GitHub Desktop.
-- /usr/share/vim/vim73/indent/ruby.vim 2011-10-06 19:22:27.000000000 +0900
+++ /home/nahi/.vim/indent/ruby.vim 2012-02-01 15:34:29.582410473 +0900
@@ -21,5 +21,5 @@
setlocal indentexpr=GetRubyIndent()
setlocal indentkeys=0{,0},0),0],!^F,o,O,e
-setlocal indentkeys+==end,=elsif,=when,=ensure,=rescue,==begin,==end
+setlocal indentkeys+==end,=elsif,=when,=ensure,=rescue,=public,=private,=protected,==begin,==end
" Only define the function once.
@@ -53,5 +53,5 @@
let s:ruby_indent_keywords = '^\s*\zs\<\%(module\|class\|def\|if\|for' .
\ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure' .
- \ '\|rescue\)\>' .
+ \ '\|rescue\|public\|private\|protected\)\>' .
\ '\|\%([*+/,=-]\|<<\|>>\|:\s\)\s*\zs' .
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\)\>'
@@ -59,5 +59,5 @@
" Regex used for words that, at the start of a line, remove a level of indent.
let s:ruby_deindent_keywords =
- \ '^\s*\zs\<\%(ensure\|else\|rescue\|elsif\|when\|end\)\>'
+ \ '^\s*\zs\<\%(ensure\|else\|rescue\|elsif\|when\|end\|public\|private\|protected\)\>'
" Regex that defines the start-match for the 'end' keyword.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment