-
-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Allow user to switch back to the main neovim window
- Loading branch information
Yoni Kosiner
committed
Mar 28, 2022
1 parent
b2bb0d6
commit 0690c99
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Make sure tmux is running | ||
tmux_running=$(pgrep tmux) | ||
|
||
if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then | ||
echo "tmux needs to be running" | ||
exit 1 | ||
fi | ||
|
||
# Switch to a window called nvim in tmux - if it exists | ||
session_name=$(tmux display-message -p "#S") | ||
|
||
tmux switch-client -t "$session_name:nvim" |