reddit / emacs
Package similar to vim Visual mode/Normal mode and tmux?
[deleted] · 2022-01-28 16:48
[deleted]
hlissner · 2022-01-28 17:10
Install `evil`. Install `evil-collection`. Enable `evil-mode`. Call `(evil-collection-init)`.
`M-x eshell`
`ssh $SOMEHOST`
Press `ESC` to enter normal mode.
Press `v` to enter visual mode.
Now you have a better tmux with all the vim capabilities you'd need, and in an ssh session.
Some extras: `C-w s` to split the window horizontally. `C-w v` to split it vertically. `C-w {h,j,k,l}` to focus windows directionally.
Good luck!
emoarmy · 2022-01-28 17:17
I'm not sure about your exact workflow WRT to tmux, but Emacs' solution for ssh into remote machines is called [tramp](https://www.gnu.org/software/tramp/). Tramp allows you to run a local version of Emacs (including most(all?) Emacs libraries) on a remote machine. That means you'll have access to any shell emulation library and can run commands there. Or shell-command/async-shell-command if you prefer. _What_ that means is that you'll have access to all of Emacs' regular facilities for interacting with a buffer (copy/paste/search). Finally, because tramp is built into Emacs' you can also open multiple buffers (tabs) to different files or shells or what have you on the remote machine.
For a short intro video on tramp /u/zamansky has a great one:
https://www.youtube.com/watch?v=Iqh50fgbIVk
Greenskid · 2022-01-28 17:38
Another option besides those already mentioned, is to still use Tmux for session management i.e. SSH -> Tmux -> Emacs. Then inside Emacs you can use the VTerm terminal (a fully featured terminal). This approach is very useful if you need to do a lot of project work on the remote machine. And if you ever need to fallback to using a Tmux window/pane then it is still right there. If you go with using Emacs in the terminal then I highly recommend setting up a terminal in 24 bit color, and using OSC (enables copy/paste as of you were running local). Doom Emacs comes with nice terminal support for reference: see it's 'tty' config option.
vpntun0x · 2022-01-28 17:43
such a great solution, only problem is when when I do a command that outputs multiple pages of info and to see the next page, I have to hit space, it doesn't behave per normal.
vpntun0x · 2022-01-28 17:43
Are there any other shells that are more so true to a normal shell outside of emacs?
alexmeistercl · 2022-01-28 18:37
M-x term
akirakom · 2022-01-28 19:19
[vterm](https://github.com/akermu/emacs-libvterm) is the best terminal emulator for Emacs, and you can easily copy text from vterm. It does not integrate with TRAMP (AFAIK), but I think its experience is closest to tmux.
squirelpower · 2022-01-28 19:19
If you have the need for searching and copying output of a shell command the dtache package I have developed could be of use: https://gitlab.com/niklaseklund/dtache. It integrates into shell/eshell and a part from making interacting with the output easy, you also get the detachable feature of tmux :)
nicholas_hubbard · 2022-01-28 19:35
For tabs see the built in [tab-bar-mode](https://www.emacswiki.org/emacs/TabBarMode). For a similar workflow that works more like DE workspaces you could also try [perspective](https://github.com/nex3/perspective-el).
For ssh you can extend the built in [shell-mode](https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Mode.html) with [shx](https://github.com/riscy/shx-for-emacs) which provides the `:ssh` command.
For a vim like visual mode see [selected.el](https://github.com/Kungsgeten/selected.el) (or use evil).
FatFingerHelperBot · 2022-01-28 19:35
It seems that your comment contains 1 or more links that are hard to tap for mobile users.
I will extend those so they're easier for our sausage fingers to click!
[Here is link number 1 - Previous text "shx"](https://github.com/riscy/shx-for-emacs)
----
^Please ^PM ^[\/u\/eganwall](http://reddit.com/user/eganwall) ^with ^issues ^or ^feedback! ^| ^[Code](https://github.com/eganwall/FatFingerHelperBot) ^| ^[Delete](https://reddit.com/message/compose/?to=FatFingerHelperBot&subject=delete&message=delete%20humgb8w)
bugamn · 2022-01-28 23:38
Beware that vterm works so well that you might forget that you are inside emacs and open emacs inside vterm inside emacs.