Skip to content

Commit cdec6c8

Browse files
committed
Also open URLs with launchy or git
1 parent 0df149d commit cdec6c8

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

autoload/rails.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,10 @@ function! s:initOpenURL()
13371337
command -bar -nargs=1 OpenURL :!start cmd /cstart /b <args>
13381338
elseif executable("sensible-browser")
13391339
command -bar -nargs=1 OpenURL :!sensible-browser <args>
1340+
elseif executable('launchy')
1341+
command -bar -nargs=1 OpenURL :!launchy <args>
1342+
elseif executable('git')
1343+
command -bar -nargs=1 OpenURL :!git web--browse <args>
13401344
endif
13411345
endif
13421346
endfunction

doc/rails.txt

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -120,22 +120,11 @@ actually edit a file from a Rails application.
120120
:Rrefresh! As above, and also reloads rails.vim.
121121

122122
*rails-:OpenURL*
123-
:OpenURL {url} This is not a command provided by the plugin, but
124-
rather provided by user and utilized by other plugin
125-
features. This command should be defined to open the
126-
provided {url} in a web browser. An example command
127-
on a Mac might be: >
123+
:OpenURL {url} This is a command to open a web browser utilized by
124+
other plugin features. If it doesn't work or opens
125+
the wrong web browser, it may be overridden. For
126+
example: >
128127
:command -bar -nargs=1 OpenURL :!open <args>
129-
< The following appears to work on Windows: >
130-
:command -bar -nargs=1 OpenURL :!start cmd /cstart /b <args>
131-
< On Debian compatible distributions, the following is
132-
the preferred method: >
133-
:command -bar -nargs=1 OpenURL :!sensible-browser <args>
134-
< If exists("$SECURITYSESSIONID"), has("gui_win32"), or
135-
executable("sensible-browser") is true, the
136-
corresponding command above will be automatically
137-
defined. Otherwise, you must provide your own (which
138-
is recommended, regardless).
139128
140129
NAVIGATION *rails-navigation*
141130

0 commit comments

Comments
 (0)