Skip to content

Commit 9027565

Browse files
committed
Remove <Plug> maps for gf family
If you really want to override gf, you can do it globally: cnoremap <Plug><cfile> <C-R><C-F> nmap gf :<C-U><C-R>=v:count2<CR>find <Plug><cfile><CR>
1 parent 3d3f714 commit 9027565

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

autoload/rails.vim

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4193,24 +4193,21 @@ function! s:BufMappings() abort
41934193
if empty(maparg('<Plug><cfile>', 'c'))
41944194
return
41954195
endif
4196-
nmap <buffer><silent> <Plug>RailsFind <SID>:find <Plug><cfile><CR>
4197-
nmap <buffer><silent> <Plug>RailsSplitFind <SID>:sfind <Plug><cfile><CR>
4198-
nmap <buffer><silent> <Plug>RailsTabFind <SID>:tabfind <Plug><cfile><CR>
41994196
let pattern = '^$\|_gf(v:count\|[Rr]uby\|[Rr]ails'
42004197
if mapcheck('gf', 'n') =~# pattern
4201-
nmap <buffer> gf <Plug>RailsFind
4198+
nmap <buffer><silent> gf <SID>:find <Plug><cfile><CR>
42024199
endif
42034200
if mapcheck('<C-W>f', 'n') =~# pattern
4204-
nmap <buffer> <C-W>f <Plug>RailsSplitFind
4201+
nmap <buffer><silent> <C-W>f <SID>:sfind <Plug><cfile><CR>
42054202
endif
42064203
if mapcheck('<C-W><C-F>', 'n') =~# pattern
4207-
nmap <buffer> <C-W><C-F> <Plug>RailsSplitFind
4204+
nmap <buffer><silent> <C-W><C-F> <SID>:sfind <Plug><cfile><CR>
42084205
endif
42094206
if mapcheck('<C-W>gf', 'n') =~# pattern
4210-
nmap <buffer> <C-W>gf <Plug>RailsTabFind
4207+
nmap <buffer><silent> <C-W>gf <SID>:tabfind <Plug><cfile><CR>
42114208
endif
42124209
if mapcheck('<C-R><C-F>', 'c') =~# pattern
4213-
cmap <buffer> <C-R><C-F> <Plug><cfile>
4210+
cmap <buffer> <C-R><C-F> <Plug><cfile>
42144211
endif
42154212
endfunction
42164213

0 commit comments

Comments
 (0)