Skip to content

Commit

Permalink
Create Repeatable Test Environment (#5)
Browse files Browse the repository at this point in the history
* Add /test README.md

* Add basic Tmux configuration for testing

* Add Makefile for testing

* Add basic vimrc to source for testing

* Comment out vim-tmux-navigator lines from test tmux.conf

* Move Makefile out to project root

* Replace test/README with a contributing guide

* Remove commented lines from /test/.tmux.conf
  • Loading branch information
RyanMillerC authored Apr 19, 2020
1 parent f3c4b95 commit 219bdec
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Contibuting

If you find any issues with this repo that you wish to fix, feel free to fork
it and submit Pull Request with a fix.

## Testing

This plugin does not currently support any automated testing mechanism. Testing
is instead accomplished manually, aided by using supplied configuration files.

The easiest way to test changes is to use the Makefile supplied. From a
terminal **with no tmux session**, run:

```
make test
```

This will load a new vim session inside of a new tmux session. Both sessions
will use the *.tmux.conf* and *.vimrc* from */test* in this repo, instead of
your user's configuration files.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.PHONY: test

test:
tmux -f test/.tmux.conf new-session "nvim -u test/.vimrc"
18 changes: 18 additions & 0 deletions test/.tmux.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Tmux configuration with only bindings required for better-vim-tmux-resizer

# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"

# Tmux-vim-resizer
bind-key -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'resize-pane -L 10'
bind-key -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'resize-pane -D 5'
bind-key -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'resize-pane -U 5'
bind-key -n 'M-l' if-shell "$is_vim" 'send-keys M-l' 'resize-pane -R 10'

# Tmux-vim-resizer copy-mode
bind-key -T copy-mode-vi 'M-h' resize-pane -L 10
bind-key -T copy-mode-vi 'M-j' resize-pane -D 5
bind-key -T copy-mode-vi 'M-k' resize-pane -U 5
bind-key -T copy-mode-vi 'M-l' resize-pane -R 10
1 change: 1 addition & 0 deletions test/.vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source plugin/better_vim_tmux_resizer.vim

0 comments on commit 219bdec

Please sign in to comment.