diff options
Diffstat (limited to 'bundle/github-url/autoload')
-rw-r--r-- | bundle/github-url/autoload/github_url.vim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bundle/github-url/autoload/github_url.vim b/bundle/github-url/autoload/github_url.vim index c83c6f6..e090681 100644 --- a/bundle/github-url/autoload/github_url.vim +++ b/bundle/github-url/autoload/github_url.vim @@ -30,6 +30,10 @@ function! s:FileURL(include_lines, start_line, end_line) return s:BaseRepoURL() . '/blob/' . current_sha . '/' . current_filename . lines endfunction +" Copy the GitHub URL to the clipboard and echo it to the command line. function! github_url#GitHubURL(include_lines, start_line, end_line) - return s:FileURL(a:include_lines, a:start_line, a:end_line) + let url = s:FileURL(a:include_lines, a:start_line, a:end_line) + + call system('pbcopy', url) + echo url endfunction |