by spicybright · 5y ago · 0 comments
I'm a huge fan of a command window, where you type words to do a fuzzy search of all the commands in a program.
Sublime text and jetbrains products have it down so well to the point of me not needing to memorize key shortcuts. I just have to remember the first few letters and I'm good to go.
That said, I agree with your larger point completely -- I love Sublime's command palette, and I love using ivy/counsel for M-x in emacs. It would be even better if tmux had something like that.
That said, so looking forward to copying text in tmux going forward. The instructions in the OP didn't work for me, but I found two other posts - one from 2013, one from 2016, the combination of which worked. Not only can I copy text to a tmux buffer now, but it automatically goes to the system clipboard. This feels like overcoming a major disability.
:w !tmux load-buffer -
Writes whatever you have selected in vim into the tmux buffer through standard in.Elsewhere you can paste like pbpaste.
:r !tmux save-buffer -
The save-buffer command is’t the most intuitive name, but it’s saving to a file, stdout in this case.For example, from Windows these days I'm having to vim yank to file ~/clipboard and then I have a Windows keyboard shortcut to pscp that file locally && notepad file. Hacky, yes, but the muscle memory is there now so meh.
But that's just the flavor of the month this month...
Just because an app has some features doesn't mean that everyone knows about them. In fact the opposite is true, most features are never discovered and even fewer are used, even "obvious" ones.
some tools are so feature packed there's no way to discover/know everything and that's fine.
i didn't discover tmux could copy text until i got really annoyed by selecting with the mouse...
not annoyed = not discovered :)
But... sublime is my text editor for notes and SQL. Everything else text related is in a terminal with vim mode enabled universally. Not sure why SQL is so annoying with vim..
Right, but you dont run things _inside_ sublime text. Keep in mind tmux has to play well with hundreds of existing shortcuts that people expect to work.
When you are attached to a tmux, you don't want to override the shortcuts of something you may run inside the tmux.
All the terminal shortcuts are expected to work (Ctrl-E, Ctrl-Arrow, Ctrl-A, Ctrl-E, Ctrl-E, Ctrl-Q, etc..). All main program shortcuts are expected to work (vim, emacs, etc) And of course not desirable to override screen shortcuts.
ctrl-b ? is helpful if you can’t remember the hot keys.
That reconfiguration occurred very soon after I was introduced to screen, circa. 1993 or thereabouts.
I've used Unix in the 1980s the first time and learned that whatever your preferred editor is, you need to know vi, because vi is always installed. That has been true in my experience with a single exception. In a recent embedded Linux I used they had only nano available.
So what is the story behind JOE and what is good about it?
Back in the day (in the 90s) I was just starting out with linux, and had to install slackware from floppies I carried to school and to the library, a handful of packages at a time. I didn't have documentation packages installed yet, but I did have some howtos. So I had to edit some files, and I tried the "standard" editors - vi and emacs. I didn't know how to quit vi or emacs. I'd end up trapped in them, and eventually figured out I could Ctrl-Z and kill the process for vi. This didn't work on emacs so I'd end up switching to a second virtual terminal and then kill the emacs process. I had no idea what I was doing, and being unable to get out of a program and get back into a safe known state was quite traumatic to teenage me just getting into unixy stuff. JOE was there for me. It did what I needed it to do, it told me how to operate it, and I never once got stuck in it. Out of gratitude, I used it exclusively for years. It's zero bullshit, it edits files, it doesn't let you down.
There are a few greybeards and I mean that literally who swear on WordStar, GRRM most famous of them but Robert J. Sawyer does too. So it's not unreasonable to think there are other, less famous people who still use it? and want to use an editor with the familiar keybindings.
Not me. I am completely up to date with software and my favorite word processor is WordPerfect 5.1.
For long running edit sessions I use real emacs; I know you can set that up in a client-server arrangement to avoid the startup speed problem, but I never had the effort to investigate that; besides, sometimes you want to edit a file as root, who won't have a long-running emacs.
GUIs for decades have demonstrated practical ways of making commands discoverable and also teaching users the keyboard shortcuts. All without having to ask people to RTFM. It is a pity that so many TUI apps haven't learnt the same lessons.
There is a reason why Nano became such a popular default editor for email. The shortcuts are printed at the bottom of the screen(!)
I hope more TUI apps pick up on the idea of the command palette though. It is a fast and keyboard friendly way of improving usability.
The truth is that being pretty/fashionable matter more than discoverability..
Ubuntu has some wrapper for tmux called byobu that does exactly this. It is the only time I really enjoy using this sort of tool.
Well, tmux is not an editor but a terminal multiplexer — its keyboard shortcuts are like this as to make sure they don’t interfere with any editor’s shortcuts running in the terminal.
It's hotkeys are... less arcane to remember by virtue of being primarily the F-keys at the top of the keyboard. https://manpages.ubuntu.com/manpages/eoan/en/man1/byobu.1.ht...
That is to say, it's dead simple once it's explained to you. The issue is with documentation, not the keyboard shortcuts themselves.
Sublime Text and Jetbrains are also vi-inspired. For where Jetbrains doesn't go far enough there is a vim mode plugin. I would say these are strong indicators of vi's dominance among keyboard shortcut layouts.
You want Vim-like controls? Use dvtm. It lets you open the content of any terminal in Vim, and from that point you can do anything from selecting/copying text up to saving a snippet in a file with a simple ":w foo".
All that aside, clipboard copy-pasting in Vim is absolutely horrible out of the box.
> Jetbrains are also vi-inspired
Not sure about that. The tab management and window splitting alone feel near unusable to me, because like many other modern apps they are convinced I only want to switch tabs in a seemingly random order(instead of, you know, the order that's literally shown on screen), and none actually have Vim's tabbing where a tab can contain multiple buffers, not the other way around. And guess what, no Vim plugin I know ever touched tabs. Probably because people not using Vim think the UX is all just in some arcane keybindings.
I'm more irritated though that Vim has nice keybindings for any sort of changes you might want to make to your tab and split setup. I don't think any of the GUI tools support keyboard commands for any of that. Or at least if they do, I haven't been able to figure out what they are, and am probably honestly too lazy to try to develop muscle memory for how they work.
Yes, that is probably a common assumption. On the other hand it may not be that hard to just do the tab bar and split containers separately and handwire them together via input events. At least web UIs aren't exactly famous for their adherence to any standard.
So the more likely reason is that most developers just don't have a reason to do it. Because in the end Vim's approach is just more an exception and as far as I know Vim tabs weren't even originally intended for the same purpose - and I can confirm buffer switching within a tab can be pleasingly fast and precise thanks to the tab completion.
If you mean the behavior of Ctrl-Tab, yes, that's confusing for me too. But you can switch using the order shown on screen though, by using Alt-Left / Alt-Right.
Can I also press a button to swap those keybindings back to the old behaviour so I don't have to work against my own muscle memory?
Or better, can I tell it to switch tabs on Spacebar-l and Spacebar-h like I have it setup in Vim? I often wonder if it's too demanding to expect keybinding flexibility that was available decades ago. I get that it's a niche use, but then again it's marketed towards professionals and power users.
But unfortunately it doesn't look at $VISUAL, so... yeah, you usually have to set it explicitly.
It took quite a few years fir this to be picked up by SublimeText, but wow that was another huge boost. No longer needing to learn tons of keyboard commands to navigate an application.
I wish an OS would deeply bake this idea in. Apple has done good job with Spotlight for the system level (I still use LaunchBar on my own systems) , but I want this functionality to be shared between System and Apps
On Linux, I mostly restrict myself to the CLI. When I try Linux GUIs, I am frustrated with the lack of keyboard consistency in the GUI, but I have also never given it the months of time it would take to bend the Linux GUI to my way. (I do customize the heck out of the CLI)
I never tried it, seems like such a wasted opportunity.
Not to mention they all seem to come from an "old unix" perspective, with weird combinations and few use of bound combinations
Hence why I prefer keeping my terminal tabs not on tmux but on iTerm (or your favourite terminal emulator - except for the Gnome one)
For a start tmux does have similar interfaces, ability to search all panes etc.
Also comparing tmux to an ide is also possible wrong.