Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 66 additions and 3 deletions.
  1. +54 −3 .vimrc
  2. +2 −0 dottor_rules.yml
  3. +10 −0 run_command
View
57 .vimrc
@@ -80,8 +80,49 @@ fun! StripTrailingWhitespace()
endif
%s/\s\+$//e
endfun
-" UltiSnips settings
-let g:UltiSnipsUsePythonVersion = 2
+
+function! SendToTerminal(args)
+ execute ":silent !run_command '" . a:args . "'"
+endfunction
+
+function! ClearTerminal()
+ call SendToTerminal("clear")
+endfunction
+
+function! RSpec()
+ call ClearTerminal()
+ if exists("s:current_test")
+ call SendToTerminal("rspec -fd " . s:current_test)
+ endif
+endfunction
+
+function! PHPUnit()
+ call ClearTerminal()
+ if exists("s:current_test")
+ call SendToTerminal("phpunit " . s:current_test)
+ endif
+endfunction
+
+function! RunCurrentTest()
+ if exists('b:isPHP')
+ " Coding is requred here
+ let s:current_test = 'UnitTests.php'
+ call PHPUnit()
+ else
+ let s:current_test = expand('%:p')
+ call RSpec()
+ endif
+endfunction
+
+function! RunCurrentLineInTest()
+ let s:current_test = expand('%:p') . ":" . line('.')
+ call RSpec()
+endfunction
+
+function! RunLastCommand()
+ call RSpec()
+endfunction
+
" }}}
" Settings {{{
syntax on
@@ -155,11 +196,13 @@ endif
" Autocommands {{{
autocmd FileType ruby,eruby,yaml setlocal ai sw=2 sts=2 et
autocmd FileType php setlocal ai sw=4 sts=4 et tw=120
+autocmd FileType php let b:isPHP=1
autocmd FileType phptml setlocal ai sw=4 sts=4 et tw=0
autocmd FileType gitcommit setlocal colorcolumn=50,72 tw=72
autocmd FileType md,markdown setlocal colorcolumn=72 tw=72
autocmd BufNewFile,BufReadPost *.coffee set filetype=coffee
autocmd BufNewFile,BufReadPost *.phtml set filetype=phtml
+autocmd BufNewFile,BufReadPost *.md set filetype=markdown
autocmd BufWritePost *.md,*.markdown :silent !cat %:p | curl -X PUT -T - http://localhost:8090/
autocmd BufWritePre * call StripTrailingWhitespace()
autocmd FileType ruby,markdown,yaml let b:noStripWhitespace=1
@@ -249,6 +292,11 @@ imap <C-a> <C-c>A
map Q gqj
nmap <Leader>c :e! ++enc=cp1251 ++ff=dos <CR>
+
+nmap <Leader>u :call RunCurrentTest()<CR>
+" nmap <Leader>l :call RunCurrentLineInTest()<CR>
+" nmap <Leader>rr :call RunLastCommand()<CR>
+
" }}}
" Plugins settings {{{
" Coffe
@@ -296,7 +344,8 @@ let g:ctrlp_working_path_mode = 'rw'
let g:EasyMotion_leader_key = '<Leader>'
" VimWiki
-let g:vimwiki_list = [{'path': '~/Dropbox/vimwiki/'}]
+let g:vimwiki_list = [{'path': '~/Dropbox/vimwiki/', 'ext': '.wiki'}]
+let g:vimwiki_ext2syntax = {'.wiki': 'media'}
" SnipMate settings
let g:snipMate = {}
@@ -324,6 +373,8 @@ let g:gist_open_browser_after_post = 1
" Ack / Ag
let g:ackprg = 'ag --nogroup --column -a -S --nocolor -f'
+" Powerline
+let g:Powerline_colorscheme = 'solarized256'
" }}}
" Not sorted {{{
" Highlight VCS conflict markers
View
2 dottor_rules.yml
@@ -4,3 +4,5 @@ default:
target: ~/.vimrc
- source: .zshrc
target: ~/.zshrc
+- source: run_command
+ target: ~/bin/run_command
View
10 run_command
@@ -0,0 +1,10 @@
+#!/usr/bin/env osascript
+on run argv
+ tell application "Terminal"
+ do script argv as string in window 1
+ end tell
+
+ tell application "MacVim"
+ activate
+ end tell
+end run

No commit comments for this range

Something went wrong with that request. Please try again.