tmux-plugins / tmux-open Goto Github PK
View Code? Open in Web Editor NEWTmux key bindings for quick opening of a highlighted file or url
License: MIT License
Tmux key bindings for quick opening of a highlighted file or url
License: MIT License
#21, #24, and #28 provide support for Tmux 2.4. However, these are not yet in a new release. This is problematic when it comes to TMUX Plugin Manager, as it uses the latest release when determining what to install or upgrade to; since the latest release is 2.0.0, cut 3 years ago, the way keys are bound to copy-mode is incorrect, making tmux-open unusable.
You can get around it by manually doing the following:
$ cd .tmux/plugins/tmux-open
$ git checkout master
and re-loading your tmux configuration. However, a better solution long term would be a new release of tmux-open.
Like in the title, env "$EDITOR" var is being ignored.
$ echo "$EDITOR"
micro
PREFIX + C-f file selection and open with C-o produces:
vi -- "~/.tmux.conf "
When i open it with just 'o', it opens up in sublime-text.
Not sure if that matters - this is done via ssh on remote, but both pcs have same "$EDITOR" and tmux.conf set.
Hey, thanks for this cool plugin!
I'd really like to have files opening with emacs though!
As written in the doc, I've tried to set $EDITOR in my .zshrc, and reload my terminal env (even restarting tmux)
Tried both with "emacs" an "/usr/bin/emacs" but vim keeps opening when I hit C-o
.
How can i change default Ctrl+F to Alt+F ?
Is it necessary to select a path first, or can the plugin infer the path based on the cursor's location?
Let's say a user does ls -lrta
or find
to print paths relative to current directory, currently they are not recognized and opened. The feature request is to first look for a full path, if not matched, then look for path under the current working directory of the pane.
Would you mind pushing a release tag for the latest master commit? Distributions tend to prefer "released" versions, and mirroring tools like Artifactory/Nexus can generally only mirror releases.
I have installed tmux-open via tmux plug in manager. With the correct syntax in ~/.tmux.conf and installed with "I".
When using it, i have this error 'cd /home/phil/srv; xdg-open "examples.deskto" > /dev/null' returned 4
xdg-open works by itself.
Hello,
Lowercase "o" jumps to either end of the visual selection when using copy-mode with vi bindings in tmux. This plugin overrides that shortcut and makes the original functionality inacessible.
Please change this plugin to use capital "O" as the shortcut to open the visual selection instead.
Thanks for your consideration. ✌️
The README states one of the keybindings is as follows:
Shift-s - search the highlighted selection directly inside a search engine (defaults to google).
However, this did not work for me, and I had to manually add set -g @open-S 'https://www.google.com/search?q='
to my configuration to get the keybinding. Either the default keybinding should be fixed, or the README updated to reflect the fact that the keybinding is in fact not default.
Thanks to David Melech for reporting this issue.
Here are the steps to reproduce the issue:
prefix + Ctrl-o
vim -- ~/somefile
(notice the space in ~/some file
is goneI installed this plugin using tpm
. I'm on Ubuntu 14.04 and I have xdg-open
in my $PATH
.
When I select a URL or filename in select mode and press o
or C-o
, nothing happens.
I was using the vi
keybindings but even when I changed it to emacs
, nothing happened.
Hi, thanks for this nice plugin I've been using for years.
I noticed there are some URLs that tmux-open will cut and when opened in the browser they just lead to website's home page. For example, URL https://www.youtube.com/watch?time_continue=3&v=I9NCiAVc0-0 will just cause tmux-open to go to youtube homescreen for me. If I copy the URL with prefix<c-u><c-y>
(instead of opening with prefix<c-u><c-o>
) and paste it in the browser, the URL follows fine.
I dug into this and it turns out, that configuring the editor command is the issue:
set -g @open-editor 'C-x'
It fully works as expected but tmux-open tries to add this as a search binding as well (like this example set -g @open-S 'https://www.duckduckgo.com/'
)
So the exit code of 1 is because tmux-open tries to bind the key editor
to the url C-x
.
This is the code where the error is produced.
Line 122 in cedb458
Probably the best solution would be to filter for editor
as this has a special meaning and should not be added as a shortcut.
Steps to reproduce:
$ ls ~/.tmux.conf
/home/smattr/.tmux.conf
$
Now go into copy mode, highlight ~/.tmux.conf
and hit Ctrl+o
.
Expected behaviour: My Tmux configuration is opened in Vim.
Actual behaviour: Vim opens a new file "~/.tmux.conf"
The cause is pretty clear (quotes around {}
in the xargs
expansion), but removing the quotes is clearly not correct. Digging a bit deeper, I learned that tilde expansion is much more complicated than I was aware (e.g. http://stackoverflow.com/a/29310477). Do you have any ideas how to solve this cleanly? Apologies if I have misdiagnosed the problem.
See:
ArchLinux has update tmux to 2.4, after this update tmux-open stopped working (given above patches applied).
I click double with mouse to select file, then o or ctrl+O. Nothing happens not in server not in Kubuntu 20.04.2.
When i try with ctrl+b then o then in Kubuntu with o is still selected, but in server clicking ctrl+b unselects.
Maybe this works only when installed some other plugin? Then installation steps of this should be with instruction to install other plugins. I don want other if not needed.
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-open'
run '~/.tmux/plugins/tpm/tpm'
set -g @continuum-restore 'on'
If a URL is so long that it wraps around to the next line, trying to open it causes xargs to break it into two or more open commands. This could be fixed by passing -0
to xargs (break on null byte instead of new line), but I'm not sure whether or not the break-on-newline behaviour is considered a feature for this plugin.
Hey, this plugin is almost exactly what I wanted to de a few months ago. Back than I was eager to build a plugin that would allow me to highlight some text in copy mode and then google it. This would be especially useful to debug error messages.
I was thinking that maybe tmux-open could have a O
binding in order to do exactly that. What do you think? If you like the idea, maybe you could give me some directions to help me build this feature? Tks.
set -g @plugin 'tmux-plugins/tmux-open'
trying to source .tmux.conf results in:
~/.tmux/plugins/tpm/tpm' returned 1
Are there possibility to setup this? I don't see it in documentation, neither in code in *.tmux file
I know its possible in OSX at least, would be nice.
Hi!
I'm trying to invoke the plugin from search highlight but apparently it only works if I manually highlight the file or directory.
Steps to reproduce:
ls
Nothing happens. If I manually highlight the same file or directly on visual mode, it opens it correctly.
Am I doing something wrong?
Is there anyway to debug this plugin? It isn't doing anything but I also don't get any messages, etc.
Same problem as tmux-plugins/tmux-yank#132.
Here's the scenario where the plugin isn't working.
o
to open the url in the browserUrl won't be opened because the rails server "took" the terminal.
set -g @plugin tmux-plugins/tmux-open
set -g @open x
select a url containing #
, (e.g.., https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate), press x
, tmux will open https://pytorch.org/docs/stable/optim.htmldesktopow-to-adjust-learning-rate
, not containing #h
(my host name is desktop). Bug comes from https://github.com/tmux-plugins/tmux-open/blob/master/open.tmux#L39, should escape #
to ##
:
$ man tmux
...
‘#S’; ‘##’ is replaced by a single ‘#’, ‘#,’ by a ‘,’ and ‘#}’ by a ‘}’.
...
If tmux run-shell -b 'xdg-open https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate'
, the bug will occur. The correct way is tmux run-shell -b 'xdg-open https://pytorch.org/docs/stable/optim.html##how-to-adjust-learning-rate'
Thanks.
when I use tmux-tpp to select a file, I can not open it using tmux-open, is there any workaround?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.