Commit graph

43 commits

Author SHA1 Message Date
Michal Trybus 647de8cff4 fix: ignore g:tmux_navigator_no_wrap when navigating to previous (#396)
There was a bug on unnecessary access to s:pane_position_from_direction
2025-05-18 17:16:17 -04:00
phanium 791dacfcfc
fix: ensure IsFzf usable when you don't use tmux (#433) 2025-02-25 13:19:18 -05:00
Francesco 6477995246
Terminal navigation in Vim now also checks if Tmux has been launched, and reverts to default if Tmux has not been launched (#432) 2025-02-25 11:08:09 -05:00
Francesco 05fa2b17e2
Add terminal mode navigation support with FZF compatibility fix for issue #430 (#431)
The current tmux-navigator plugin doesn't handle terminal mode (term) navigation seamlessly. When using terminal splits in Vim alongside tmux panes, the navigation breaks down. This functionality had been left out because it collided with Vim FZF

Solution
Added terminal mode support with FZF-awareness:

New terminal mode mappings that integrate with existing tmux navigation
Added IsFZF() function to detect when we're in FZF
Used mappings to conditionally pass through controls to FZF when appropriate
2025-02-23 16:05:19 -05:00
Nate Fischer 5b3c701686
fix: workaround netrw mapping for ctrl-l (#393)
This adds a workaround for the netrw keymapping conflict for ctrl-l by
setting the `g:Netrw_UserMaps` list. To limit the impact to users, this
will leave the list alone if the user has already set the variable and
instead gives a warning to prompt the user about the issue.

This mapping workaround can be disabled by setting either
`g:tmux_navigator_no_mappings` or
`g:tmux_navigator_disable_netrw_workaround`.

Fixes #189, Fixes #251, Fixes #379
2024-05-26 12:26:47 -04:00
Mohammad Lashkari c600cf10db
use nnoremap instead of noremap (#390)
* resolve issue 388, use nnoremap instead of noremap

Co-authored-by: Chris Toomey <chris@ctoomey.com>
2024-05-18 15:05:18 -04:00
Chris Toomey 41ea9d23b8 Revert "Replace ": ... <cr>" mappings with "<Cmd> ... <cr>""
This reverts commit a40cc7a527.

The `<Cmd>` mapping is a recent addition so we'll want to add a version
check, but for now I'm just reverting to get back to good.
2022-12-08 16:10:24 -05:00
personinblack a40cc7a527 Replace ": ... <cr>" mappings with "<Cmd> ... <cr>"
":" in mappings trigger "CmdlineEnter" autocmd but "<Cmd>" does not.
2022-12-04 14:39:38 -05:00
Julian Prein bd4c38be5b Map the vim bindings in more modes
Use `(nore)map` to map the functions in visual, select and
operator-pending mode instead of only in normal mode.

Use `<C-U>` (:h c_CTRL-U) to delete the automatically inserted range
when pressing `:` in visual mode, as the functions do not support a
range.

Update all references in the README and help page.
2022-10-15 16:44:19 -04:00
Maxim Kulkin afb45a55b4 Add option to disable wrapping when switch panes
* Add g:tmux_navigator_no_wrap option to disable wrap around
* Add instructions on how to configure this feature

Fixes #233
2022-08-24 20:49:18 -04:00
Maddison Hellstrom 9ca5bfe5bd
Add g:tmux_navigator_preserve_zoom option (#307)
* Add g:tmux_navigator_preserve_zoom option

Tmux offers a `-Z` option on the `select-pane` command that preserves
the zoom state when navigating between panes. This adds an option to
enable this behavior in tmux-navigator.
2021-10-10 16:38:03 -04:00
Mike 6c0b5d2faa temporarily set shellcmdflag to -c before calling system 2020-09-29 16:57:58 -04:00
Chris Toomey 18b775fbcc TmuxPaneCurrentCommand -> TmuxNavigatorProcessList
Previously we used the `{pane_current_command}` tmux variable and
matched against that, but a while back we switched to using the process
list to better handle some edge cases.

Overall that change has been a win, but the documentation has lagged a
bit around the debugging command `:TmuxPaneCurrentCommand` which is no
longer relevant.

This change replaces `:TmuxPaneCurrentCommand` with a new
`:TmuxNavigatorProcessList` which should allow us to debug the actual
issue related to the `ps` command.
2018-07-13 09:30:32 -04:00
Daniel Hahler d030f75e29 Skip most of the plugin with empty $TMUX
Ref: https://github.com/christoomey/vim-tmux-navigator/pull/201#issuecomment-389661267
2018-05-17 22:08:54 -04: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
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
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 Ⓥ 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
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
John Freeman 5d76881c6e Read socket path from $TMUX
Fixes: #87
2015-10-17 14:18:09 -04: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
Chris Toomey 57b289fda5 Do not redraw for viatlity on newer versions of vim 2014-10-31 13:49:13 -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 454c08997a Update tmux.conf grep pattern to match 'vimdiff' 2013-11-18 21:39:06 -05:00
Chris Toomey 899e8c662d Catch error when navigating in cmdline window
Closes #3 - Mappings break in command-line window
2013-07-19 10:32:41 -04:00
Alex Kern 9f596092c0 Use nnoremap instead of nmap. 2013-07-18 13:50:50 -07:00
Chris Toomey 153f76f69f Inline the branching script into tmux conf
With this, only the vim plugin and tmux.conf settings are needed. No
additional script required. YAY!
2013-06-21 10:45:59 -04:00
Chris Toomey 4aa5d3f482 Make maps optional, work outside of Tmux
- Provide global option to disable default mappings
- Provide commands for use in custom mappings
- Provide standard split navigation via maps when not in Tmux
2013-06-10 10:29:05 -04:00
Chris Toomey b068a04f10 Allow repeat sourcing, silence commands 2013-04-12 13:43:00 -04:00
Chris Toomey 5fdfe15ff8 Initial commit with plugin file 2013-04-12 13:22:49 -04:00