Skip to content
Urbain Vaes edited this page Dec 19, 2020 · 6 revisions

Welcome to the fzf-marks wiki!

Open a new tmux window in mark directory

Here is a script, kindly contributed by @qaraluch, that spawns new tmux window based on mark entries.

#!/usr/bin/env bash
# Author: qaraluch - 07.2020 - MIT
# Add new window to the tmux session
# based on fzf-marks entries
readonly _pName=$(basename $0)
IFS=$'\n' readonly fzfMarksEntry=("$(cat ${FZF_MARKS_FILE} | fzf-tmux --exit-0)")
readonly name=$(awk -F':' '{print $1}' <<< "$fzfMarksEntry" | sed 's/[ \t]\?//g')
readonly path=$(awk -F':' '{print $2}' <<< "$fzfMarksEntry" | sed 's/[ \t]\?//g')
if [[ -d "$path" ]]; then
  tmux new-window -d -n "${name}" -c "${path}"
else
  echo "[ ${_pName} ] Destination dir for new tmux window seems does not exist... :o"
fi
Clone this wiki locally