Add popup to choose an interpreter and launch it
This commit is contained in:
parent
85ba6d45d1
commit
4f770fd649
30
interpreter.sh
Executable file
30
interpreter.sh
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
interpreters=()
|
||||||
|
|
||||||
|
add() {
|
||||||
|
local interp=$1
|
||||||
|
if command -v $interp &> /dev/null; then
|
||||||
|
interpreters+=($(where $interp))
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
add ipython
|
||||||
|
add python
|
||||||
|
add cling
|
||||||
|
add lua
|
||||||
|
add luajit
|
||||||
|
add node
|
||||||
|
|
||||||
|
add bash
|
||||||
|
add zsh
|
||||||
|
add fish
|
||||||
|
|
||||||
|
interpreter=$(
|
||||||
|
echo "${interpreters[@]}" | tr ' ' '\n' |
|
||||||
|
fzf --layout=reverse --info=hidden --border=none --cycle
|
||||||
|
)
|
||||||
|
|
||||||
|
$interpreter
|
@ -66,6 +66,8 @@ if -b '[ "`uname`" = "Darwin" ]' \
|
|||||||
bind C-t display-popup -S fg=#54546D -b rounded -d '#{pane_current_path}' -E $SHELL
|
bind C-t display-popup -S fg=#54546D -b rounded -d '#{pane_current_path}' -E $SHELL
|
||||||
# Open a popup with session creator/switcher
|
# Open a popup with session creator/switcher
|
||||||
bind C-s display-popup -B -w 60 -h 10 -E '~/.config/tmux/session.sh'
|
bind C-s display-popup -B -w 60 -h 10 -E '~/.config/tmux/session.sh'
|
||||||
|
# Open a popup to pick an interpreter then launch it
|
||||||
|
bind C-i display-popup -S fg=#54546D -b rounded -d '#{pane_current_path}' -E '$SHELL -i ~/.config/tmux/interpreter.sh'
|
||||||
|
|
||||||
# Restore old next/previous window bindings
|
# Restore old next/previous window bindings
|
||||||
bind C-n next-window
|
bind C-n next-window
|
||||||
|
Loading…
x
Reference in New Issue
Block a user