tmux: add resurrect to save/restore pane/window layout
This commit is contained in:
parent
e1160acbe1
commit
2f2a9657c2
47 changed files with 2579 additions and 0 deletions
23
.config/tmux/plugins/resurrect/strategies/vim_session.sh
Executable file
23
.config/tmux/plugins/resurrect/strategies/vim_session.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# "vim session strategy"
|
||||
#
|
||||
# Restores a vim session from 'Session.vim' file, if it exists.
|
||||
# If 'Session.vim' does not exist, it falls back to invoking the original
|
||||
# command (without the `-S` flag).
|
||||
|
||||
ORIGINAL_COMMAND="$1"
|
||||
DIRECTORY="$2"
|
||||
|
||||
vim_session_file_exists() {
|
||||
[ -e "${DIRECTORY}/Session.vim" ]
|
||||
}
|
||||
|
||||
main() {
|
||||
if vim_session_file_exists; then
|
||||
echo "vim -S"
|
||||
else
|
||||
echo "$ORIGINAL_COMMAND"
|
||||
fi
|
||||
}
|
||||
main
|
||||
Loading…
Add table
Add a link
Reference in a new issue