diff options
| author | Mike Vink <ivi@vinkies.net> | 2024-09-06 16:19:25 +0200 |
|---|---|---|
| committer | Mike Vink <ivi@vinkies.net> | 2024-09-06 16:19:25 +0200 |
| commit | a2e2a9698edbcd69e076d9bccadd7bd666edfefb (patch) | |
| tree | 06d49f758451d96d2020086da75d18f3f2347ab6 /mut/neovim | |
| parent | 3bc504e87a92941f93132cd236c3b502adc496b6 (diff) | |
work on GBrowse
Diffstat (limited to 'mut/neovim')
| -rw-r--r-- | mut/neovim/fnl/conf/init.fnl | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/mut/neovim/fnl/conf/init.fnl b/mut/neovim/fnl/conf/init.fnl index c65ac8e..840924f 100644 --- a/mut/neovim/fnl/conf/init.fnl +++ b/mut/neovim/fnl/conf/init.fnl @@ -14,10 +14,10 @@ (local osc52 (require :vim.ui.clipboard.osc52)) (let - [paste + [paste (fn [] [(vim.fn.split (vim.fn.getreg "") "\n") (vim.fn.getregtype "")]) - xclip - (fn [lines] + xclip + (fn [lines] (vim.system [:xclip] {:text true :stdin lines} (fn [exitobj])) (vim.system [:xclip :-selection :clipboard] {:text true :stdin lines} (fn [exitobj])) nil)] @@ -82,6 +82,7 @@ (local oil (require :oil.actions)) (let [map vim.keymap.set] (map :n :gb ":GBrowse<CR>") + (map :n :g<cr> ::G<cr>) (map :n :ga "<Plug>(EasyAlign)") (map :x :ga "<Plug>(EasyAlign)") (map :n :<leader>d<cr> (fn [] (draw true))) @@ -280,7 +281,7 @@ (fn browse_git_remote [data] (P data) - (local + (local {: commit : git_dir : line1 @@ -307,14 +308,14 @@ (do (or (case [(s:match "(git@)([^:]+):(.*)(%.git)")] - ["git@" home repo ".git"] + ["git@" home repo ".git"] [home repo]) (case [(s:match "(git@)([^:]+):.*/(.*)/(.*)/(.*)")] - ["git@" home org project repo] + ["git@" home org project repo] [(home:gsub "ssh%." "") [(.. org "/" project) repo]]))))) (case [home repo] - (where ["bitbucket.org" repo]) + (where ["bitbucket.org" repo]) (do (case [path type] ["" "tree"] @@ -325,7 +326,7 @@ (.. "https://" home "/" repo "/commits/" commit) [path "ref"] (.. "https://" home "/" repo "/commits/" commit))) - (where ["dev.azure.com" [org repo]]) + (where ["dev.azure.com" [org repo]]) (do (case [path type] ["" "tree"] @@ -336,7 +337,7 @@ (.. "https://" home "/" org "/_git/" repo "/commit/" commit) [path "ref"] (.. "https://" home "/" org "/_git/" repo "/commit/" commit))) - (where ["gitlab.com" repo]) + (where ["gitlab.com" repo]) (do (case [path type] ["" "tree"] @@ -347,7 +348,7 @@ (.. "https://" home "/" repo "/-/commit/" commit) [path "blob"] (.. "https://" home "/" repo "/-/blob/" commit "/" path))) - (where ["github.com" repo]) + (where ["github.com" repo]) (do (case [path type] ["" "tree"] @@ -364,5 +365,5 @@ (fn [{: args}] (vim.system ["xdg-open" args] {} (fn []))) {:nargs 1}) -(set vim.g.fugitive_browse_handlers +(set vim.g.fugitive_browse_handlers [browse_git_remote]) |
