-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquickfix.tmux
executable file
·43 lines (33 loc) · 1.18 KB
/
quickfix.tmux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPTS_DIR="$CURRENT_DIR/scripts"
QUEUE_HOME="$CURRENT_DIR/queue"
BIN="$CURRENT_DIR/bin"
source "$SCRIPTS_DIR/engine.sh"
source "$SCRIPTS_DIR/variables.sh"
source "$SCRIPTS_DIR/session.sh"
META_OPTIONS=(
"${QUICKFIX_POSITION}:${QUICKFIX_DEFAULT_POSITION}"
"${QUICKFIX_PERC_OPTION}:${QUICKFIX_DEFAULT_PERC_SIZE}"
"${QUICKFIX_COMMAND_INPUT}:${QUICKFIX_DEFAULT_CMD_INPUT}"
"${QUICKFIX_BUFFER_RESERVED}:${QUICKFIX_DEFAULT_BUFFER_RESERVED}"
#"${QUICKFIX_COMMAND_QUEUE}:${QUEUE_HOME}/${QUICKFIX_CMD_QUEUE_BASENAME}"
#"${QUICKFIX_BUFFER}:${QUICKFIX_DEFAULT_BUFFER_NAME}"
)
register_qfix_options() {
local quickfix_command="$SCRIPTS_DIR/quickfix.sh"
local quickfix_sendcommand="$BIN/send_command"
local quickfix_key="$QUICKFIX_DEFAULT_KEY"
local quickfix_sendkey="$QUICKFIX_DEFAULT_SENDKEY"
for option in "${META_OPTIONS[@]}"; do
key="${option%%:*}"
value="${option##*:}"
set_tmux_option "$key" "$value" "global"
done
tmux bind-key "${quickfix_key}" run-shell "${quickfix_command}"
tmux bind-key "${quickfix_sendkey}" run-shell "${quickfix_sendcommand}"
}
main() {
register_qfix_options
}
main