Permalink
Browse files

Changes based on DAS

  • Loading branch information...
1 parent 46060a7 commit 30ab598e4134ae51a814db42526a861dfb77f1a2 @rossfoley committed Apr 6, 2012
Showing with 40 additions and 44 deletions.
  1. +1 −0 bundle/vim-vroom
  2. +39 −44 vimrc
Submodule vim-vroom added at 7b8325
View
83 vimrc
@@ -25,7 +25,34 @@ set guioptions-=b
set scrolloff=3
set complete-=i
set cursorline
-set statusline=[%n]\ %<%.99f\ %h%w%m%r%y\ %{fugitive#statusline()}%{exists('*CapsLockStatusline')?CapsLockStatusline():''}%=%-16(\ %l,%c-%v\ %)%P
+:set statusline=%<%f\ (%{&ft})\ %-4(%m%)%=%-19(%3l,%02c%03V%)
+let mapleader=","
+
+augroup vimrcEx
+ " Clear all autocmds in the group
+ autocmd!
+ autocmd FileType text setlocal textwidth=78
+ " Jump to last cursor position unless it's invalid or in an event handler
+ autocmd BufReadPost *
+ \ if line("'\"") > 0 && line("'\"") <= line("$") |
+ \ exe "normal g`\"" |
+ \ endif
+
+ "for ruby, autoindent with two spaces, always expand tabs
+ autocmd FileType ruby,haml,eruby,yaml,html,javascript,sass,cucumber set ai sw=2 sts=2 et
+ autocmd FileType python set sw=4 sts=4 et
+
+ autocmd! BufRead,BufNewFile *.sass setfiletype sass
+
+ autocmd BufRead *.mkd set ai formatoptions=tcroqn2 comments=n:&gt;
+ autocmd BufRead *.markdown set ai formatoptions=tcroqn2 comments=n:&gt;
+
+ " Indent p tags
+ autocmd FileType html,eruby if g:html_indent_tags !~ '\\|p\>' | let g:html_indent_tags .= '\|p\|li\|dt\|dd' | endif
+
+ " Don't syntax highlight markdown because it's often wrong
+ autocmd! FileType mkd setlocal syn=off
+augroup END
"Housekeeping
set history=1000
@@ -50,7 +77,10 @@ set backspace=indent,eol,start
"Indent and folding settings
set smartindent
set autoindent
-set foldenable
+set nofoldenable
+set foldmethod=indent
+set foldnestmax=10
+set foldlevel=1
"Search settings
set incsearch
@@ -65,10 +95,6 @@ set sessionoptions-=options
"Reload vimrc file after save
autocmd bufwritepost .vimrc source $MYVIMRC
-autocmd BufReadPost *
- \ if line("'\"") > 0 && line("'\"") <= line("$") |
- \ exe "normal g`\"" |
- \ endif
" Tab completion like an IDE
set wildmenu
@@ -182,47 +208,16 @@ map ,rn :call RenameFile()<cr>
imap <c-l> <space>=><space>
nmap ,pp "+P
-function! RunTests(filename)
- " Write the file and run tests for the given filename
- :w
- :silent !echo;echo;echo;echo;echo
- exec ":!bundle exec rspec " . a:filename
-endfunction
-
-function! SetTestFile()
- " Set the spec file that tests will be run for.
- let t:grb_test_file=@%
-endfunction
-
-function! RunTestFile(...)
- if a:0
- let command_suffix = a:1
+function! InsertTabWrapper()
+ let col = col('.') - 1
+ if !col || getline('.')[col - 1] !~ '\k'
+ return "\<tab>"
else
- let command_suffix = ""
+ return "\<c-p>"
endif
-
- " Run the tests for the previously-marked file.
- let in_spec_file = match(expand("%"), '_spec.rb$') != -1
- if in_spec_file
- call SetTestFile()
- elseif !exists("t:grb_test_file")
- return
- end
- call RunTests(t:grb_test_file . command_suffix)
endfunction
-
-function! RunNearestTest()
- let spec_line_number = line('.')
- call RunTestFile(":" . spec_line_number)
-endfunction
-
-" Run this file
-map ,t :call RunTestFile()<cr>
-" Run only the example under the cursor
-map ,T :call RunNearestTest()<cr>
-" Run all test files
-map ,ta :call RunTests('spec')<cr>
-
+inoremap <tab> <c-r>=InsertTabWrapper()<cr>
+inoremap <s-tab> <c-n>
nnoremap ,, <c-^>
" Plugin Settings

0 comments on commit 30ab598

Please sign in to comment.