Skip to content

Commit 6723ec0

Browse files
committed
Added some snippets for Factory-Girl, browse Rails docs from ApiDock, small changes to .vimrc
1 parent 85a3c87 commit 6723ec0

File tree

5 files changed

+23
-9
lines changed

5 files changed

+23
-9
lines changed

after/plugin/snippets.vim

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ endfunction
5555
if s:inRailsEnv()
5656
call NERDSnippetsFromDirectoryForFiletype('~/.vim/snippets/ruby-rails', 'ruby')
5757
call NERDSnippetsFromDirectoryForFiletype('~/.vim/snippets/ruby-rspec', 'ruby')
58+
" create factory-girl snippets
59+
call NERDSnippetsFromDirectoryForFiletype('~/.vim/snippets/ruby-factorygirl', 'ruby')
5860
else
5961
"create merb snippets
6062
endif
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Factory.define(:<+model+>) do |<+m+>|
2+
<++>
3+
end
4+
<++>
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Factory.next(:<+sequence-name+>)<++>
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Factory.sequence :<+sequence-name+> do |<+m+>|
2+
<++>
3+
end
4+
<++>

vimrc

+12-9
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ if has("gui_running")
6767
set columns=115
6868
else
6969
let g:CSApprox_loaded = 0
70+
colorscheme desert
7071
endif
7172

72-
colorscheme railscasts
7373

7474
if $COLORTERM == 'gnome-terminal'
7575
set term=gnome-256color
76-
colorscheme railscasts
76+
colorscheme desert
7777
else
78-
colorscheme default
78+
colorscheme desert
7979
endif
8080

8181
syntax on " Enable syntax highlighting
@@ -101,7 +101,6 @@ inoremap <C-L> <C-O>:nohls<CR>
101101
nnoremap <C-B> :BufExplorer<cr>
102102
103103
"map to fuzzy finder text mate stylez
104-
"nnoremap <c-f> :FuzzyFinderMruFile<CR>
105104
nnoremap <c-f> :FuzzyFinderTextMate<CR>
106105
107106
"map Q to something useful
@@ -178,7 +177,7 @@ set laststatus=2 " Always show status line.
178177

179178
" gvim specific
180179
set mousehide " Hide mouse after chars typed
181-
set mouse=a " Mouse in all modes
180+
"set mouse=a " Mouse in all modes
182181

183182
"visual search mappings
184183
function! s:VSetSearch()
@@ -261,9 +260,6 @@ vnoremap <C-D> <LT>
261260
" CTRL-Z undoes even in visual/selection mode
262261
vnoremap <C-Z> <C-C>
263262
264-
" Copy selected lines to the system clipboard
265-
vmap <C-c> y: call system("xclip -i -selection clipboard", getreg("\""))<CR>
266-
267263
" Run Rspec for the current spec file
268264
function! RunRspec()
269265
ruby << EOF
@@ -276,10 +272,17 @@ EOF
276272
endfunction
277273
map <F7> :call RunRspec()<cr>
278274
279-
" Open the Ruby ApiDock page for the word under cursor, in a new Firefox tab
280275
let g:browser = 'firefox -new-tab '
276+
" Open the Ruby ApiDock page for the word under cursor, in a new Firefox tab
281277
function! OpenRubyDoc(keyword)
282278
let url = 'http://apidock.com/ruby/'.a:keyword
283279
exec '!'.g:browser.' '.url.' &'
284280
endfunction
285281
noremap RB :call OpenRubyDoc(expand('<cword>'))<CR>
282+
283+
" Open the Rails ApiDock page for the word under cursos, in a new Firefox tab
284+
function! OpenRailsDoc(keyword)
285+
let url = 'http://apidock.com/rails/'.a:keyword
286+
exec '!'.g:browser.' '.url.' &'
287+
endfunction
288+
noremap RR :call OpenRailsDoc(expand('<cword>'))<CR>

0 commit comments

Comments
 (0)