summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaoaki Ueda <uedan@solutionware.jp>2020-02-17 11:31:42 +0900
committerNaoaki Ueda <uedan@solutionware.jp>2020-02-17 11:31:42 +0900
commit5efb561eea6dbd90e93ce24cefa029c2452c2cb2 (patch)
tree68074d068a009a9dd6fe46910eff4b37437c3a91
parentd7b7695aa290de72217b527134a08dc11ecee68a (diff)
downloadvimrc-5efb561eea6dbd90e93ce24cefa029c2452c2cb2.tar.gz
vimrc-5efb561eea6dbd90e93ce24cefa029c2452c2cb2.tar.bz2
vimrc-5efb561eea6dbd90e93ce24cefa029c2452c2cb2.zip
Add Gina browse translate pattern.
-rw-r--r--_config/206-gina.vim64
1 files changed, 64 insertions, 0 deletions
diff --git a/_config/206-gina.vim b/_config/206-gina.vim
new file mode 100644
index 0000000..0bd8079
--- /dev/null
+++ b/_config/206-gina.vim
@@ -0,0 +1,64 @@
+if empty(globpath(&rtp, 'autoload/gina.vim'))
+ finish
+endif
+
+let g:gina#command#browse#translation_patterns = get(g:, 'gina#command#browse#translation_patterns', {})
+
+call extend(g:gina#command#browse#translation_patterns, {
+\ 'github\.com': [
+\ [
+\ '\vhttps?://(%domain)/(.{-})/(.{-})%(\.git)?$',
+\ '\vgit://(%domain)/(.{-})/(.{-})%(\.git)?$',
+\ '\vgit\@(%domain):(.{-})/(.{-})%(\.git)?$',
+\ '\vssh://git\@(%domain)/(.{-})/(.{-})%(\.git)?$',
+\ ], {
+\ '_': 'https://\1/\2/\3/blob/%r0/%pt%{#L|}ls%{-L|}le',
+\ 'root': 'https://\1/\2/\3/tree/%r0/',
+\ 'blame': 'https://\1/\2/\3/blame/%r0/%pt%{#L|}ls%{-L|}le',
+\ 'compare': 'https://\1/\2/\3/compare/%h1...%h2',
+\ },
+\ ],
+\ 'gitlab\.com': [
+\ [
+\ '\vhttps?://(%domain)/(.{-})/(.{-})%(\.git)?$',
+\ '\vgit://(%domain)/(.{-})/(.{-})%(\.git)?$',
+\ '\vgit\@(%domain):(.{-})/(.{-})%(\.git)?$',
+\ '\vssh://git\@(%domain)/(.{-})/(.{-})%(\.git)?$',
+\ ], {
+\ '_': 'https://\1/\2/\3/blob/%r0/%pt%{#L|}ls%{-L|}le',
+\ 'root': 'https://\1/\2/\3/tree/%r0/',
+\ 'blame': 'https://\1/\2/\3/blame/%r0/%pt%{#L|}ls%{-L|}le',
+\ 'compare': 'https://\1/\2/\3/compare/%h1...%h2',
+\ },
+\ ],
+\ 'bitbucket\.org': [
+\ [
+\ '\vhttps?://(%domain)/(.{-})/(.{-})%(\.git)?$',
+\ '\vgit://(%domain)/(.{-})/(.{-})%(\.git)?$',
+\ '\vgit\@(%domain):(.{-})/(.{-})%(\.git)?$',
+\ '\vssh://git\@(%domain)/(.{-})/(.{-})%(\.git)?$',
+\ ], {
+\ '_': 'https://\1/\2/\3/src/%r0/%pt%{#cl-|}ls',
+\ 'root': 'https://\1/\2/\3/commits/%r0',
+\ 'blame': 'https://\1/\2/\3/annotate/%r0/%pt',
+\ 'compare': 'https://\1/\2/\3/diff/%pt?diff1=%h1&diff2=%h2',
+\ },
+\ ],
+\ '.*\.visualstudio\.com': [
+\ [
+\ '\vhttps?://(%domain)/(.{-})/_git/(.{-})$',
+\ ], {
+\ '_': 'https://\1/\2/_git/\3/?path=%pt&version=GB%r0%{&line=|}ls%{&lineEnd=|}le',
+\ 'root': 'https://\1/\2/_git/\3/?version=GB%r0',
+\ },
+\ ],
+\ 'sfd.git.backlog.jp': [
+\ [
+\ '\vsfd\@%domain:/(.{-})/(.{-})%(\.git)?$',
+\ ], {
+\ 'root': 'https://sfd.backlog.jp/git/\1/\2/tree/%r1/',
+\ '_': 'https://sfd.backlog.jp/git/\1/\2/blob/%r1/%pt%{#|}ls%{-}le',
+\ 'exact': 'https://sfd.backlog.jp/git/\1/\2/blob/%h1/%pt%{#|}ls%{-}le',
+\ },
+\ ],
+\})