https://github.com/terjesannum/emacs-shell
Emacs tramp and shell setup
https://github.com/terjesannum/emacs-shell
bash emacs shell
Last synced: 2 months ago
JSON representation
Emacs tramp and shell setup
- Host: GitHub
- URL: https://github.com/terjesannum/emacs-shell
- Owner: terjesannum
- Created: 2019-09-14T15:29:17.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-08-02T09:49:49.000Z (almost 3 years ago)
- Last Synced: 2025-03-29T15:31:31.109Z (about 1 year ago)
- Topics: bash, emacs, shell
- Language: Emacs Lisp
- Size: 31.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# emacs-shell
Setup tramp and shell-mode for interactive shells and remote file editing. Supports local shells, ssh, sudo, docker and kubernetes.
### Installation
Clone this repository and add to `load-path`:
```lisp
(add-to-list 'load-path "~/.emacs.d/emacs-shell")
(require 'emacs-shell)
```
### Interactive shells
To start interactive shells, use these commands:
| Command | Description |
| --------------------- | -------------------------------- |
| `M-x localhost-shell` | Shell on localhost |
| `M-x ssh-shell` | Shell on remote host |
| `M-x sudo-shell` | Root shell (localhost or remote) |
| `M-x docker-shell` | Shell in local docker container |
| `M-x pod-shell` | Shell in kubernetes pod |
Bash will be started if available, and your `.bashrc` on the emacs host will be sourced in the remote shell. Shell history will also be saved in
individual files on the emacs host (`.emacs.d/shell-history` directory), so history is kept between sessions even if pods have been restarted etc.
### Keybindings
In addition to the bindings from [shell-mode](https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Mode.html), these keybindings are added:
| Keys | Where | Description |
| --------- | -------------- | ------------------------- |
| `S-C-n` | global | Start new localhost shell |
| `C-p` | shell-mode | Previous history |
| `C-n` | shell-mode | Next history |
| `C-c C-c` | password input | Abort command |