aboutsummaryrefslogtreecommitdiffstats
path: root/bundle
diff options
context:
space:
mode:
Diffstat (limited to 'bundle')
-rw-r--r--bundle/github-url/autoload/github_url.vim6
-rw-r--r--bundle/github-url/plugin/github_url.vim2
2 files changed, 6 insertions, 2 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
diff --git a/bundle/github-url/plugin/github_url.vim b/bundle/github-url/plugin/github_url.vim
index 84f6cce..328a049 100644
--- a/bundle/github-url/plugin/github_url.vim
+++ b/bundle/github-url/plugin/github_url.vim
@@ -3,4 +3,4 @@ if exists('g:loaded_github_url')
endif
let g:loaded_github_url = 1
-command! -range=0 GitHubFileURL :echo github_url#GitHubURL(<count>, <line1>, <line2>)
+command! -range=0 GitHubFileURL :call github_url#GitHubURL(<count>, <line1>, <line2>)