Commit graph

61 commits

Author SHA1 Message Date
Daniel Hahler 2eb16d5dbf fixup! Refactor s:TmuxCommand, add s:GetTmuxCommand 2018-05-16 23:21:36 +02:00
Daniel Hahler 1ce6c323a3 Refactor s:TmuxCommand, add s:GetTmuxCommand
- use a list instead of single string
- add s:GetTmuxCommand to be used later when not using `system()` only
- remove `:silent` when calling tmux from `s:TmuxAwareNavigate`: it
  should not be necessary and is bad practice to use `:silent`
  unnecessarily.  It was added in b068a04 with no explanation.
2018-04-30 21:50:22 +02:00
Chris Toomey d724094e71 Revert extra shell escaping in non-TPM bindings
Why
---

https://github.com/christoomey/vim-tmux-navigator/pull/181 was
introduced to fix an issues with the TPM install script not running
cleanly. This was due to the `C-\` key binding not being properly
escaped in the final line of the script.

In the process of fixing this in #181, it looks like we took it a bit
overboard and escaped _all_ `C-\` sequences. In the end, the others
should not be escaped, so this was causing issues for users not
configuring via TPM script.

This change
-----------

This change reverts all of the `C-\` escaping outside of the TPM script.
2017-07-07 13:45:29 -04:00
Hal Wine 3e83ddc509 properly shell escape backslash, fixes #180 (#181)
* properly shell escape backslash, fixes #180

* Correctly escape backslashes in examples
2017-06-20 14:01:25 -04:00
Andy Weidenbaum b93e176b71 implement tmux 2.4 compatibility, fixes #159 2017-06-01 11:42:55 -04:00
Eric Bouchut 2fc1ed42ab Fix a typo in README (#167) 2017-02-26 08:58:01 -08:00
Chris Toomey 1b24c5a462 Add option to disable tmux navigation while zoomed
Users have requested the ability to disable navigation while the Vim
tmux pane is zoomed, to prevent accidentally unzooming the pane when
navigating past the edges.

This change adds an option to prevent using tmux navigation when the Vim
pane is zoomed, and requiring an explicit unzooming of the tmux pane
before the plugin resumes its magic.
2017-02-13 22:01:13 -05:00
Chris Toomey 34f8fbf1d4 Add MIT License 2017-01-28 10:58:17 -05:00
Scott Colby e79d4c0c24 Escape the % in the tmux select-pane -t command to prevent process substitution by fish (#150)
Fixes https://github.com/christoomey/vim-tmux-navigator/issues/148.
2016-09-03 03:09:37 +02:00
Paymahn Moghadasian 0c676d8cbc Add new behaviour to save all buffer on navigation (#144)
Summary: Added a new behaviour to tmux_navigator_save_on_switch which, when
set, causes all open and changed buffers to be written when navigating away
from a vim session.
2016-08-31 12:59:09 -04:00
James Seward 88f80ea0c7 Use TMUX_PANE for target.
Makes the script work when you have multiple sessions attached to the
same window(s).
2016-08-13 10:41:47 +01:00
Paymahn Moghadasian b2e31e6b72 Consume error thrown when autosaving file without name
Summary: Fixes #142. An issue existed where opening vim without a file
path and then navigating away (with autosave turned on) resulted in an
error being thrown. Now, this error is caught and consumed and not
propagated to the user.

Test Plan:
1) Started up a vim instance without a file path.
2) Created a second tmux pane.
3) navigated to tmux pane with vim
4) entered insert mode and wrote some gibberish
5) navigated away from the tmux pane containing the vim instance
6) no error message was shown to me
2016-08-09 13:35:10 -07:00
Daniel Hahler caf4c48141 Improve performance with tmate detection
Remove the unneeded `system` call in the check for tmux vs tmate.  Vim can read
and match on the environment variable directly.

Closes https://github.com/christoomey/vim-tmux-navigator/pull/134.
2016-07-17 00:40:46 +02:00
Daniel Hahler d0123a8679 Use augroup for WinEnter autocommad for tmux_is_last_pane (#135)
This does not make it add up when reloading the file.
2016-07-07 21:17:38 +02:00
Felix Schäfer 74ee1dbc13 Update README.md (#136)
The README provides only two options
2016-06-30 21:58:32 +02:00
Yota Toyama d5dc8d3c80 Add support for installing via Tmux Plugin Manager
See https://github.com/tmux-plugins/tpm for details.
2016-06-21 15:13:54 -04:00
Daniel Hahler 293ef226b3 Also call TmuxPaneCurrentCommand's function with s: prefix
While the command itself is not really useful anymore, it's still good
to have it fixed for #131.
2016-06-17 23:27:01 +02:00
Bach Le b9833b4d27 Use s: instead of <SID> in commands (#112)
This addresses: https://github.com/christoomey/vim-tmux-navigator/issues/110
The use of `<SID>` is unnecessary in this context anyway.

Fixes #131.
2016-06-17 21:11:47 +02:00
Daniel Hahler 57701ac650 Look for Vim in tmux pane's tty process list via ps/grep (#117)
This turned out to be a very robust method of detecting Vim processes,
and allows to ignore stopped ones (via `Ctrl-Z`).

Fixes https://github.com/christoomey/vim-tmux-navigator/issues/96.
Closes https://github.com/christoomey/vim-tmux-navigator/pull/117.
2016-06-03 22:36:05 +02:00
Daniel Hahler Ⓥ 33d688a028 Revert "Add support for Neovim: tnoremap mappings (#111)" (#129)
This reverts commit e13914d89e.

Fixes https://github.com/christoomey/vim-tmux-navigator/issues/128.
2016-05-30 01:25:23 +02:00
Daniel Hahler e13914d89e Add support for Neovim: tnoremap mappings (#111) 2016-05-09 21:20:45 +02:00
Daniel Hahler c33a8a9702 Fix s:UseTmuxNavigatorMappings
Broken in f5fcf2a.

Fixes https://github.com/christoomey/vim-tmux-navigator/issues/124.
2016-05-02 21:05:17 +02:00
Daniel Hahler f5fcf2afb5 s:UseTmuxNavigatorMappings: simplify tmux_navigator_no_mappings check (#118) 2016-04-30 19:07:09 +02:00
Geoff Harcourt eaa5289b51 Update documentation to troubleshoot Neovim issues
https://github.com/christoomey/vim-tmux-navigator/issues/71

This addition to the readme should point users to possible solutions for
their kbs/terminfo/libtermkey woes when using Neovim, which has been an
ongoing issue for users and is not directly related to
vim-tmux-navigator.

Close #71.
2016-04-29 10:06:07 -04:00
Fabian Raetz 1298b71c42 use * wildcard instead of regex matching to be more portable
this makes vim-tmux-navigator work with OpenBSD's ksh(1) which
doesn't support regex matching.

I've found this solution on stackoverflow.
See http://stackoverflow.com/questions/229551/string-contains-in-bash/229585#229606
2015-12-05 22:10:51 +01:00
Chris Toomey 9dcea0c971 Detect tmux vs tmate 2015-11-29 19:07:26 -05:00
Thomas De Schampheleire 999d252134 Recognize binary name 'vimx'
Some distributions ship 'vim' without xterm_clipboard support. A separate
package vim-x11 or similar then ships another binary 'vimx' with that
support.

To support vim-tmux-navigator with such a binary name, adapt the pattern
check to allow an optional 'x'.
2015-11-12 16:09:12 +01:00
ssadler 754871fc6e Add a link to project into tmux conf sample 2015-10-24 19:38:26 -04:00
John Freeman 5d76881c6e Read socket path from $TMUX
Fixes: #87
2015-10-17 14:18:09 -04:00
Chris Toomey 176452ead4 Rename readme to proper md extension 2015-05-29 21:31:32 -04:00
Chris Toomey 1e641eea5c Add readme notes for slow shell troubleshooting
Thanks @montlebalm for the wording of the troubleshooting message.
2015-05-28 17:31:16 -04:00
CJ Avilla 928a52fbda Switches to Plugin from Bundle references 0521de95ea 2015-03-16 11:41:01 -07:00
Chris Toomey 85b8e5f60c Ignore the doc/tags file 2015-01-18 10:53:18 -05:00
Matthias Bilger d25c7ebb65 Add initial doc file, update autosave code 2014-11-19 15:35:04 -05:00
dt 58f43461e3 Optionally save when switching out of vim 2014-11-19 15:34:26 -05:00
Keith Smiley bb99607c9e Simplify example tmux bindings, use if-shell
This makes use of an inlined variable in the `.tmux.conf` which removes
the duplication of the pattern, and `if-shell` in place of the inlined
command sequence previously used through `run-shell`.

Initially hoped to use via shell pattern matching, but that lost the
case-insensitivity that `grep -iqE` had.

Incorporates feedback from:

Suggest tmux if-shell instead of run-shell - #31
Less cluttered run-shell bindings - #44
Added suggestion for faster commands in zsh - #40
2014-11-16 12:34:51 -05:00
Geoffrey Lessel 28ce8e70d5 correct usage of their/there in readme 2014-11-10 16:52:50 -06:00
Chris Toomey 57b289fda5 Do not redraw for viatlity on newer versions of vim 2014-10-31 13:49:13 -04:00
Geoff Harcourt 195cdf087f Support pane switching in neovim
The suggested regex was filtering out the `nvim` editor name for neovim. I
had initially thought that it was some kind of key binding problem in neovim,
but making this change allows pane/split switching in either vim or neovim.
2014-09-09 15:53:53 -04:00
Daniel Nägele 3de98bfcee add readme section about nested tmux sessions 2014-07-22 02:41:45 +02:00
David Kinzer d12c394110 Fix tmux.conf brakes for vi, gvim, view, gview.
This pull request edits the .tmux.conf provided in the README to grep
-iqE '(^|\/)g?(view|vim?)(diff)?$'.

This change makes it so that the same configuration will work for either
vi vim gvim view or gview setups.
2014-06-10 16:39:36 -04:00
Keith Smiley 45e697c2a4 Check global vitality variable 2014-04-23 10:51:26 -04:00
Chris Toomey 0b9f0cec13 Only redraw if vitality is loaded 2014-04-16 10:35:21 -04:00
Keith Smiley 68d75afd7d Fix vitality.vim screen junk
Related to issue #7 - Garbage on screen with vitality.vim &
https://github.com/sjl/vitality.vim/issues/19
2014-04-11 11:32:56 -04:00
Chris Toomey 147ebe77f9 Add tmate version issue troubleshooting note 2014-04-03 20:56:31 -04:00
Nils Landt bfc9825ef9 Fix typos 2014-02-07 15:52:47 +01:00
Nils Landt 1ab6da9688 Fix typo 2014-01-25 02:49:10 +01:00
Chris Toomey 454c08997a Update tmux.conf grep pattern to match 'vimdiff' 2013-11-18 21:39:06 -05:00
Chris Toomey 6daddabf54 Update readme for clarity
- Simplify and highlight usage and install instructions
- Add troubleshooting section
2013-10-04 15:53:34 -04:00
Chris Toomey 1c32f8dae7 Constrain the Vim grep pattern in tmux.conf
Closes #6 - Detecting vim running in tmux...
2013-07-20 21:13:28 -04:00