2

Github GitHub - Overdr0ne/shelldon

 3 years ago
source link: https://github.com/Overdr0ne/shelldon
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Shelldon

Introduction

This is what I use for my main shell/terminal. It is basically just a simple wrapper around async-shell-command that primarily allows you to store and navigate separate command outputs among other things.

(I have lots of windowing and minibuffer enhancements from other packages, so yours probably won’t look exactly like this. See usage below for ideas…)

Installation

I just use straight+use-package like so:

(use-package shelldon
  :straight (shelldon :type git
			  :host github
			  :repo "Overdr0ne/shelldon"
			  :branch "master"))

Usage

  • So it’s not like a typical terminal where all command inputs and outputs are mashed together into one buffer. Instead, you input each command into the minibuffer individually with the shelldon command, and output is sent to a buffer derived from the command name.
  • To search this history, use the shelldon-hist command, and select the command whose output you’d like to open.
  • If you’d like to then use it like an actual REPL, well, we’re just missing the loop part, so I’ve also provided a shelldon-loop command.
  • Output buffer names begin with “*shelldon” such that you may configure display-buffer-alist to change how output windows are displayed. I’m a big fan of side windows, so the above gif uses something like this:
 (add-to-list 'display-buffer-alist
		 `("\\(.*shelldon.*\\)"
		   (display-buffer-reuse-window display-buffer-in-previous-window display-buffer-in-side-window)
		   (side . right)
		   (slot . 0)
		   (window-width . 80)
		   (reusable-frames . visible)))

The buffer names also contain the executed command, so that may be used as well to configure windows on a per-command basis.

  • I would also highly recommend installing the bash-completion package, and probably some sort of completion enhancement package like selectrum.

And that’s it. Enjoy…


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK