From cc5aa13c4e4bd203511ac2ae4ae97227ab2e58d2 Mon Sep 17 00:00:00 2001 From: sayanarijit Date: Sat, 5 Feb 2022 07:22:08 +0000 Subject: [PATCH] Automated deployment: Sat Feb 5 07:22:08 UTC 2022 5e20eea349acc10c8455a5ca2c36fbbf5393f54c --- en/404.html | 2 +- en/alternatives.html | 2 +- en/awesome-hacks.html | 446 +++++++++++++++++++++++++++++++++ en/awesome-integrations.html | 21 +- en/awesome-plugins.html | 19 +- en/column-renderer.html | 2 +- en/community.html | 2 +- en/configuration.html | 6 +- en/configure-key-bindings.html | 2 +- en/contribute.html | 2 +- en/debug-key-bindings.html | 2 +- en/default-key-bindings.html | 2 +- en/filtering.html | 2 +- en/general-config.html | 2 +- en/index.html | 113 ++++----- en/install.html | 2 +- en/installing-plugins.html | 2 +- en/integration.html | 2 +- en/introduction.html | 113 ++++----- en/key-bindings.html | 2 +- en/layouts.html | 2 +- en/message.html | 2 +- en/modes.html | 2 +- en/node_types.html | 2 +- en/plugin.html | 2 +- en/post-install.html | 6 +- en/print.html | 419 ++++++++++++++++++++++++------- en/quickstart.html | 2 +- en/searchindex.js | 2 +- en/searchindex.json | 2 +- en/sorting.html | 2 +- en/style.html | 2 +- en/todo.html | 2 +- en/upgrade-guide.html | 2 +- en/writing-plugins.html | 2 +- 35 files changed, 911 insertions(+), 286 deletions(-) create mode 100644 en/awesome-hacks.html diff --git a/en/404.html b/en/404.html index d30b788..dd84772 100644 --- a/en/404.html +++ b/en/404.html @@ -76,7 +76,7 @@ diff --git a/en/alternatives.html b/en/alternatives.html index 911641b..fd538b5 100644 --- a/en/alternatives.html +++ b/en/alternatives.html @@ -75,7 +75,7 @@ diff --git a/en/awesome-hacks.html b/en/awesome-hacks.html new file mode 100644 index 0000000..5686e31 --- /dev/null +++ b/en/awesome-hacks.html @@ -0,0 +1,446 @@ + + + + + + Awesome Hacks - xplr book + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+
+

Awesome Hacks

+

Here's a list of cool xplr hacks, i.e. snippets of code that you can just copy +and paste into your configuration file, that are too small or niche for a +full fledge plugins.

+

Do you have something cool to share?

+

Edit this file or share them here or let us know.

+

Spawn multiple sessions in different tabs (iTerm2)

+

Creating a new session that starts with iTerm2.

+
+Expand for details +
    +
  • Author: @lmburns
  • +
  • Requires: iTerm2
  • +
  • Tested on: MacOS
  • +
+
xplr.config.modes.builtin.default.key_bindings.on_key["ctrl-n"] = {
+  help = "new session",
+  messages = {
+    { BashExecSilently = [[
+        osascript <<EOF
+        tell application "iTerm2"
+          tell current window
+            create tab with default profile
+            tell current session to write text "xplr"
+          end tell
+        end tell
+      ]]
+    },
+  },
+}
+
+
+

Bookmark

+

Bookmark files using m and fuzzy search bookmarks using backtick.

+
+Expand for details +

xplr-bookmark.gif

+ +
xplr.config.modes.builtin.default.key_bindings.on_key.m = {
+  help = "bookmark",
+  messages = {
+    {
+      BashExecSilently = [===[
+        PTH="${XPLR_FOCUS_PATH:?}"
+        if echo "${PTH:?}" >> "${XPLR_SESSION_PATH:?}/bookmarks"; then
+          echo "LogSuccess: ${PTH:?} added to bookmarks" >> "${XPLR_PIPE_MSG_IN:?}"
+        else
+          echo "LogError: Failed to bookmark ${PTH:?}" >> "${XPLR_PIPE_MSG_IN:?}"
+        fi
+      ]===],
+    },
+  },
+}
+
+xplr.config.modes.builtin.default.key_bindings.on_key["`"] = {
+  help = "go to bookmark",
+  messages = {
+    {
+      BashExec = [===[
+        PTH=$(cat "${XPLR_SESSION_PATH:?}/bookmarks" | fzf --no-sort)
+        if [ "$PTH" ]; then
+          echo FocusPath: "'"${PTH:?}"'" >> "${XPLR_PIPE_MSG_IN:?}"
+        fi
+      ]===],
+    },
+  },
+}
+
+
+

Persistent, multi-session bookmark

+

A bookmark mode that allows for a bookmark file to be used throughout multiples +sessions. It is set to the environment variable $XPLR_BOOKMARK_FILE. A +bookmark can be added, deleted, or jumped to.

+
+Expand for details +
    +
  • Author: @lmburns
  • +
  • Requires: fzf, sd
  • +
  • Tested on: MacOS
  • +
+
-- Bookmark: mode binding
+xplr.config.modes.custom.bookmark = {
+  name = "bookmark",
+  key_bindings = {
+    on_key = {
+      m = {
+        help = "bookmark dir",
+        messages = {
+          { BashExecSilently = [[
+              PTH="${XPLR_FOCUS_PATH:?}"
+              if [ -d "${PTH}" ]; then
+                PTH="${PTH}"
+              elif [ -f "${PTH}" ]; then
+                PTH="$(dirname "${PTH}")"
+              fi
+              if echo "${PTH:?}" >> "${XPLR_BOOKMARK_FILE:?}"; then
+                echo "LogSuccess: ${PTH:?} added to bookmarks" >> "${XPLR_PIPE_MSG_IN:?}"
+              else
+                echo "LogError: Failed to bookmark ${PTH:?}" >> "${XPLR_PIPE_MSG_IN:?}"
+              fi
+            ]]
+          },
+        },
+      },
+      g = {
+        help = "go to bookmark",
+        messages = {
+          {
+            BashExec = [===[
+              PTH=$(cat "${XPLR_BOOKMARK_FILE:?}" | fzf --no-sort)
+              if [ "$PTH" ]; then
+                echo FocusPath: "'"${PTH:?}"'" >> "${XPLR_PIPE_MSG_IN:?}"
+              fi
+            ]===]
+          },
+        },
+      },
+      d = {
+        help = "delete bookmark",
+        messages = {
+          { BashExec = [[
+              PTH=$(cat "${XPLR_BOOKMARK_FILE:?}" | fzf --no-sort)
+              sd "$PTH\n" "" "${XPLR_BOOKMARK_FILE:?}"
+            ]]
+          },
+        },
+      },
+      esc = {
+        help = "cancel",
+        messages = {
+          "PopMode",
+        },
+      },
+    },
+  },
+}
+
+
+

Another bookmark manager type thing, taken from wfxr's zsh plugin.

+

Another bookmark manager type thing, taken from wfxr's zsh plugin which has colored output with fzf.

+
+Expand for details +
    +
  • Author: @lmburns
  • +
  • Requires: fzf, exa
  • +
  • Tested on: MacOS
  • +
+
xplr.config.modes.builtin.go_to.key_bindings.on_key.b = {
+  help = "bookmark jump",
+  messages = {
+    "PopMode",
+    { BashExec = [===[
+        field='\(\S\+\s*\)'
+        esc=$(printf '\033')
+        N="${esc}[0m"
+        R="${esc}[31m"
+        G="${esc}[32m"
+        Y="${esc}[33m"
+        B="${esc}[34m"
+        pattern="s#^${field}${field}${field}${field}#$Y\1$R\2$N\3$B\4$N#"
+        PTH=$(sed 's#: # -> #' "$PATHMARKS_FILE"| nl| column -t \
+        | gsed "${pattern}" \
+        | fzf --ansi \
+            --height '40%' \
+            --preview="echo {}|sed 's#.*->  ##'| xargs exa --color=always" \
+            --preview-window="right:50%" \
+        | sed 's#.*->  ##')
+        if [ "$PTH" ]; then
+          echo ChangeDirectory: "'"${PTH:?}"'" >> "${XPLR_PIPE_MSG_IN:?}"
+        fi
+      ]===]
+    },
+  }
+}
+
+
+

Fuzzy search history

+

Fuzzy search the last visited directories.

+
+Expand for details + +
xplr.config.modes.builtin.go_to.key_bindings.on_key.h = {
+  help = "history",
+  messages = {
+    "PopMode",
+    {
+      BashExec = [===[
+        PTH=$(cat "${XPLR_PIPE_HISTORY_OUT:?}" | sort -u | fzf --no-sort)
+        if [ "$PTH" ]; then
+          echo ChangeDirectory: "'"${PTH:?}"'" >> "${XPLR_PIPE_MSG_IN:?}"
+        fi
+      ]===],
+    },
+  },
+}
+
+
+

Batch rename

+

Batch rename the selected or visible files and directories in $PWD.

+
+Expand for details +

xplr-rename.gif

+ +
xplr.config.modes.builtin.default.key_bindings.on_key.R = {
+  help = "batch rename",
+  messages = {
+    {
+      BashExec = [===[
+       SELECTION=$(cat "${XPLR_PIPE_SELECTION_OUT:?}")
+       NODES=${SELECTION:-$(cat "${XPLR_PIPE_DIRECTORY_NODES_OUT:?}")}
+       if [ "$NODES" ]; then
+         echo -e "$NODES" | renamer
+         echo ExplorePwdAsync >> "${XPLR_PIPE_MSG_IN:?}"
+       fi
+     ]===],
+    },
+  },
+}
+
+
+

Serve $PWD

+

Serve $PWD using a static web server via LAN.

+
+Expand for details + +
xplr.config.modes.builtin.default.key_bindings.on_key.S = {
+  help = "serve $PWD",
+  messages = {
+    {
+      BashExec = [===[
+        IP=$(ip addr | grep -w inet | cut -d/ -f1 | grep -Eo '[0-9]{1,3}\.[0-9]{      1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | fzf --prompt 'Select IP > ')
+        echo "IP: ${IP:?}"
+        read -p "Port (default 5000): " PORT
+        echo
+        sfz --all --cors --no-ignore --bind ${IP:?} --port ${PORT:-5000} . &
+        sleep 1 && read -p '[press enter to exit]'
+        kill -9 %1
+      ]===],
+    },
+  },
+}
+
+
+

Also See:

+ + +
+ + +
+
+ + + +
+ + + + + + + + + + + + diff --git a/en/awesome-integrations.html b/en/awesome-integrations.html index 9330ed1..fb005ff 100644 --- a/en/awesome-integrations.html +++ b/en/awesome-integrations.html @@ -75,7 +75,7 @@ @@ -144,26 +144,25 @@

Here's a list of awesome xplr integrations that you might want to check out.

If none of the following integrations work for you, you can create your own and let us know.

-

Categories

- -

Editor

+

Editor

-

Shell

+

Shell

-

Security Tools

+

Security Tools

+

Also See:

+ diff --git a/en/awesome-plugins.html b/en/awesome-plugins.html index 0ded1f3..6a1f390 100644 --- a/en/awesome-plugins.html +++ b/en/awesome-plugins.html @@ -75,7 +75,7 @@ @@ -144,13 +144,7 @@

Here's a list of awesome xplr plugins that you might want to check out. If none of the following plugins work for you, it's very easy to write your own.

-

Categories

- -

Extension

+

Extension

-

Integration

+

Integration

-

Theme

+

Theme

+

Also See:

+ diff --git a/en/column-renderer.html b/en/column-renderer.html index 2e374fe..be78d4d 100644 --- a/en/column-renderer.html +++ b/en/column-renderer.html @@ -75,7 +75,7 @@ diff --git a/en/community.html b/en/community.html index 269fc0c..b85233c 100644 --- a/en/community.html +++ b/en/community.html @@ -75,7 +75,7 @@ diff --git a/en/configuration.html b/en/configuration.html index c6146cc..3d5cf2a 100644 --- a/en/configuration.html +++ b/en/configuration.html @@ -75,7 +75,7 @@ @@ -172,7 +172,7 @@ following fields: