From a2e2a9698edbcd69e076d9bccadd7bd666edfefb Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Fri, 6 Sep 2024 16:19:25 +0200 Subject: work on GBrowse --- .editorconfig | 9 +++++++++ mut/neovim/fnl/conf/init.fnl | 23 ++++++++++++----------- profiles/core/packages.nix | 2 +- 3 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..030a71e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +[*] +insert_final_newline=true +trim_trailing_whitespace=true +indent_size=2 +indent_style=space + +[*.{yaml,nix,sh}] +indent_size=2 +indent_style=space 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") + (map :n :g ::G) (map :n :ga "(EasyAlign)") (map :x :ga "(EasyAlign)") (map :n :d (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]) diff --git a/profiles/core/packages.nix b/profiles/core/packages.nix index 1d8e737..7793c95 100644 --- a/profiles/core/packages.nix +++ b/profiles/core/packages.nix @@ -32,7 +32,7 @@ with lib; # gcc gnumake file - pstree + psmisc bc mediainfo bat -- cgit v1.2.3