From 6ac9a14e7436c27c895f89c21eafd6ad7e08950e Mon Sep 17 00:00:00 2001 From: Uttarayan Date: Tue, 25 Jul 2023 18:51:30 +0530 Subject: [PATCH] [fix] Add fnm for both macos and linux --- config/fish/conf.d/linux/fnm.fish | 8 ++++++++ config/fish/conf.d/macos.fish | 3 --- config/fish/conf.d/os.fish | 7 +++++++ config/tmux/scratch | 9 +++++++++ config/tmux/tmux.conf | 3 +++ 5 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 config/fish/conf.d/linux/fnm.fish delete mode 100644 config/fish/conf.d/macos.fish create mode 100644 config/fish/conf.d/os.fish create mode 100755 config/tmux/scratch diff --git a/config/fish/conf.d/linux/fnm.fish b/config/fish/conf.d/linux/fnm.fish new file mode 100644 index 00000000..10898ac0 --- /dev/null +++ b/config/fish/conf.d/linux/fnm.fish @@ -0,0 +1,8 @@ +set -gx PATH "/run/user/1000/fnm_multishells/295966_1690289932404/bin" $PATH; +set -gx FNM_VERSION_FILE_STRATEGY "local"; +set -gx FNM_LOGLEVEL "info"; +set -gx FNM_ARCH "x64"; +set -gx FNM_DIR "/home/fs0c131y/.local/share/fnm"; +set -gx FNM_COREPACK_ENABLED "false"; +set -gx FNM_MULTISHELL_PATH "/run/user/1000/fnm_multishells/295966_1690289932404"; +set -gx FNM_NODE_DIST_MIRROR "https://nodejs.org/dist"; diff --git a/config/fish/conf.d/macos.fish b/config/fish/conf.d/macos.fish deleted file mode 100644 index 8f8bca74..00000000 --- a/config/fish/conf.d/macos.fish +++ /dev/null @@ -1,3 +0,0 @@ -if [ (uname) = "Darwin" ]; - source ~/.config/fish/conf.d/macos/* -end diff --git a/config/fish/conf.d/os.fish b/config/fish/conf.d/os.fish new file mode 100644 index 00000000..634df2e8 --- /dev/null +++ b/config/fish/conf.d/os.fish @@ -0,0 +1,7 @@ +switch (uname) + case "Darwin" + source ~/.config/fish/conf.d/macos/* + case "Linux" + source ~/.config/fish/conf.d/linux/* +end + diff --git a/config/tmux/scratch b/config/tmux/scratch new file mode 100755 index 00000000..80eaf447 --- /dev/null +++ b/config/tmux/scratch @@ -0,0 +1,9 @@ +#!/usr/bin/sh + +width=${2:-80%} +height=${2:-80%} +if [ "$(tmux display-message -p -F "#{session_name}")" = "scratch" ];then + tmux detach-client +else + tmux popup -d '#{pane_current_path}' -xC -yC -w$width -h$height -E "tmux attach -t scratch || tmux new -s scratch" +fi diff --git a/config/tmux/tmux.conf b/config/tmux/tmux.conf index 1cae872b..a8ca1725 100644 --- a/config/tmux/tmux.conf +++ b/config/tmux/tmux.conf @@ -58,3 +58,6 @@ bind r source-file ~/.config/tmux/tmux.conf \; display-message "Configuration re bind C-q last-window bind m send-keys -t.- 'mpcfzf' Enter bind o set status + +bind-key -n C-\\ run-shell '~/.config/tmux/scratch' +