Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
### master
- update readme - write all keybindings
- override default split window key bindings
- added "@new_window_path" to allow disabling using the panes current path as
the new windows starting path

### v1.0.0, 2014-08-30
- update readme to reflect github organization change
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ Example:

set-option -g @pane_resize "10"


You can set `@new_window_path` Tmux option to false to disable creation of new windows with the starting path of the current pane. "true" is the default.

Example:

set-option -g @new_window_path "false"

### Other plugins

You might also find these useful:
Expand Down
7 changes: 6 additions & 1 deletion pain_control.tmux
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

default_pane_resize="5"
default_new_window_path="true"

# tmux show-option "q" (quiet) flag does not set return value to 1, even though
# the option does not exist. This function patches that.
Expand Down Expand Up @@ -49,7 +50,11 @@ pane_split_bindings() {
}

improve_new_window_binding() {
tmux bind-key "c" new-window -c "#{pane_current_path}"
local args=()
if [ $(get_tmux_option "@new_window_path" "$default_new_window_path") = "true" ]; then
args=(-c "#{pane_current_path}")
fi
tmux bind-key "c" new-window "${args[@]}"
}

main() {
Expand Down