Permalink
Browse files

Consolidate autocommands into the augroup

This makes it so resourcing the vimrc file doesn't duplicate the
auto commands.
  • Loading branch information...
1 parent d830652 commit 8b7e4eefa7ff00d0bce48720a04b2e5b79e2f28f @derekprior derekprior committed May 24, 2013
Showing with 14 additions and 14 deletions.
  1. +14 −14 vimrc
View
28 vimrc
@@ -24,7 +24,7 @@ endif
filetype plugin indent on
augroup vimrcEx
- au!
+ autocmd!
" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78
@@ -36,6 +36,19 @@ augroup vimrcEx
\ if &ft != 'gitcommit' && line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
+
+ " Cucumber navigation commands
+ autocmd User Rails Rnavcommand step features/step_definitions -glob=**/* -suffix=_steps.rb
+ autocmd User Rails Rnavcommand config config -glob=**/* -suffix=.rb -default=routes
+
+ " Set syntax highlighting for specific file types
+ autocmd BufRead,BufNewFile *.md set filetype=markdown
+
+ " Enable spellchecking for Markdown
+ autocmd BufRead,BufNewFile *.md setlocal spell
+
+ " Automatically wrap at 80 characters for Markdown
+ autocmd BufRead,BufNewFile *.md setlocal textwidth=80
augroup END
" Softtabs, 2 spaces
@@ -85,10 +98,6 @@ let g:Tlist_Ctags_Cmd="ctags --exclude='*.js'"
" Index ctags from any project, including those outside Rails
map <Leader>ct :!ctags -R .<CR>
-" Cucumber navigation commands
-autocmd User Rails Rnavcommand step features/step_definitions -glob=**/* -suffix=_steps.rb
-autocmd User Rails Rnavcommand config config -glob=**/* -suffix=.rb -default=routes
-
" Switch between the last two files
nnoremap <leader><leader> <c-^>
@@ -106,15 +115,6 @@ nnoremap <Leader>l :call RunLastSpec()<CR>
" Treat <li> and <p> tags like the block tags they are
let g:html_indent_tags = 'li\|p'
-" Set syntax highlighting for specific file types
-au BufRead,BufNewFile *.md set filetype=markdown
-
-" Enable spellchecking for Markdown
-au BufRead,BufNewFile *.md setlocal spell
-
-" Automatically wrap at 80 characters for Markdown
-au BufRead,BufNewFile *.md setlocal textwidth=80
-
" Open new split panes to right and bottom, which feels more natural
set splitbelow
set splitright

0 comments on commit 8b7e4ee

Please sign in to comment.