aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2019-06-08 00:39:33 +0200
committerTeddy Wing2019-06-08 00:39:33 +0200
commit880954b216bf16bbd4503a596e2788b77360816e (patch)
tree765606bfbc6afa5d7e78eac6a09579b91f97069e
parent1f7b977e7568d0759131c5f91459661f3e030691 (diff)
downloaddotvim-880954b216bf16bbd4503a596e2788b77360816e.tar.bz2
vimrc: Move RSpec mappings to ftplugin/ruby.vim
Since I'm not writing Ruby regularly right now, move these mappings to the Ruby ftplugin so I don't accidentally try to run a spec in another language where it makes no sense.
-rw-r--r--ftplugin/ruby.vim7
-rw-r--r--vimrc10
2 files changed, 10 insertions, 7 deletions
diff --git a/ftplugin/ruby.vim b/ftplugin/ruby.vim
index c829abe..e95b70f 100644
--- a/ftplugin/ruby.vim
+++ b/ftplugin/ruby.vim
@@ -18,6 +18,13 @@ nnoremap <buffer> Zd obyebug<Esc>
nnoremap <buffer> ZD Obyebug<Esc>
+" RSpec
+nnoremap <buffer> <leader>z :call RunCurrentSpecFile() \| call system("date '+%FT%T%z: z' >> ~/.vim/spec-stats.log")<cr>
+nnoremap <buffer> <leader>Z :call RunNearestSpec() \| call system("date '+%FT%T%z: Z' >> ~/.vim/spec-stats.log")<cr>
+nnoremap <buffer> 🕳 :call RunCurrentSpecFile() \| call system("date '+%FT%T%z: e' >> ~/.vim/spec-stats.log")<cr>
+nnoremap <buffer> ⛳ :call RunNearestSpec() \| call system("date '+%FT%T%z: E' >> ~/.vim/spec-stats.log")<cr>
+
+
" Reset Rails test database
nnoremap <buffer> <F7> :!RAILS_ENV=test bundle exec rake db:reset<CR>
diff --git a/vimrc b/vimrc
index 5cadfde..2044ff6 100644
--- a/vimrc
+++ b/vimrc
@@ -423,6 +423,9 @@
" * Use Gundo when -python3 and Undotree when +python3.
" * Focus Undotree window when toggled.
"
+" 2019.06.07:
+" * Move RSpec mappings to ftplugin/ruby.vim.
+"
" Pathogen
@@ -643,13 +646,6 @@ let g:slimv_impl = 'sbcl'
let g:slimv_swank_cmd = '! screen -d -m -t REPL-SBCL sbcl --load ~/.vim/bundle/slimv/slime/start-swank.lisp'
-" RSpec
-nnoremap <leader>z :call RunCurrentSpecFile() \| call system("date '+%FT%T%z: z' >> ~/.vim/spec-stats.log")<cr>
-nnoremap <leader>Z :call RunNearestSpec() \| call system("date '+%FT%T%z: Z' >> ~/.vim/spec-stats.log")<cr>
-nnoremap 🕳 :call RunCurrentSpecFile() \| call system("date '+%FT%T%z: e' >> ~/.vim/spec-stats.log")<cr>
-nnoremap ⛳ :call RunNearestSpec() \| call system("date '+%FT%T%z: E' >> ~/.vim/spec-stats.log")<cr>
-
-
" Go
let g:go_version_warning = 0
let g:go_fmt_command = 'goimports'