Skip to content

Commit 4307cc1

Browse files
committed
Map <C-R><C-F> in command line mode
1 parent ab914b2 commit 4307cc1

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

autoload/rails.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4061,6 +4061,9 @@ function! s:BufMappings() abort
40614061
if mapcheck('<C-W>gf', 'n') =~# pattern
40624062
nmap <buffer> <C-W>gf <Plug>RailsTabFind
40634063
endif
4064+
if mapcheck('<C-R><C-F>', 'c') =~# pattern
4065+
cmap <buffer> <C-R><C-F> <Plug><cfile>
4066+
endif
40644067
endfunction
40654068

40664069
" }}}1

doc/rails.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@ The standard Rails load path is prepended to 'path', enabling |:find| to work:
121121
File Under Cursor - gf ~
122122
*rails-gf*
123123
The |gf| command, which normally edits the current file under the cursor, has
124-
been remapped to take context into account. |CTRL-W_f| (open in new window)
125-
and |CTRL-W_gf| (open in new tab) are also remapped.
124+
been remapped to take context into account. |CTRL-W_f| (open in new window),
125+
|CTRL-W_gf| (open in new tab), and |c_CTRL-R_CTRL-F| (insert filename on
126+
command line) are also remapped.
126127

127128
Example uses of |gf|, and where they might lead.
128129
(* indicates cursor position)

0 commit comments

Comments
 (0)