https://github.com/veggiemonk/almostontop-fish
Fish shell plugin to keep the input line at the top of the terminal
https://github.com/veggiemonk/almostontop-fish
ergonomics fish fish-plugin fish-shell screen terminal
Last synced: about 2 months ago
JSON representation
Fish shell plugin to keep the input line at the top of the terminal
- Host: GitHub
- URL: https://github.com/veggiemonk/almostontop-fish
- Owner: veggiemonk
- Created: 2020-01-25T15:22:34.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-06T09:08:29.000Z (about 5 years ago)
- Last Synced: 2025-02-26T07:23:49.665Z (2 months ago)
- Topics: ergonomics, fish, fish-plugin, fish-shell, screen, terminal
- Language: Shell
- Homepage:
- Size: 289 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Almostontop for Fish shell
## Description
It clears the previous command output every time before new command executed in shell.

> Using: [iTerm2](https://github.com/gnachman/iTerm2) with status bar enabled and theme [Snazzy](https://github.com/sindresorhus/iterm2-snazzy), [Fira Code font](https://github.com/tonsky/FiraCode), [starship](https://github.com/starship/starship) for the prompt and of course, [fish](https://github.com/fish-shell/fish-shell). Almost no configuration or fine tuning is required!
Once installed, this plugin creates a function that gets triggered before the execution of the command thanks to the `--on-event fish_preexec`. This event is documented [here](https://fishshell.com/docs/current/commands.html#function).
The function clears the previous command output and redraws the `fish_prompt` with the executed command.## Why
Ergonomics.
On a laptop, bending in order to look down at the bottom of the screen might cause problems to the neck.
If, like me, your vision is not 100%, this can help when staring at the terminal for extended period of time.## Origin
Inspired by [almostontop](https://github.com/Valiev/almostontop) plugin for zsh by [Valiev](https://github.com/Valiev/almostontop)
which is inspired by [alwaysontop](https://github.com/swirepe/alwaysontop) plugin for bash by [swirepe](https://github.com/swirepe).## Installation
Suggestion: Use [fisher](https://github.com/jorgebucaran/fisher) which is a very clean and easy way to manage plugins.
```fish
fisher add veggiemonk/almostontop-fish
```Or install it manually
```fish
curl https://raw.githubusercontent.com/veggiemonk/almostontop-fish/master/conf.d/almostontop.fish --create-dirs -sLo ~/.config/fish/conf.d/almostontop.fish
```## Usage
The plugin is automatically load as it is located in `~/.config/fish/conf.d/`
### Deactivate
To deactivate the plugin in the current session, remove the function:
```fish
functions -e almostontop
```### Reactivate
To reactivate the plugin, open a new shell or `source` the code :
```fish
source ~/.config/fish/conf.d/almostontop.fish
```### To install fish shell
Check
or
```fish
brew install fish
echo /usr/local/bin/fish | sudo tee -a /etc/shells
chsh -s /usr/local/bin/fish # set it as the default shell
```## Removing the plugin
```fish
fisher rm veggiemonk/almostontop-fish# or
rm ~/.config/fish/conf.d/almostontop.fish
```## Implementation
If you don't want to install the plugin, just copy-paste these 5 lines into your `config.fish`. Although, it is better to put it in `conf.d` folder.
```fish
function almostontop --on-event fish_preexec
clear
fish_prompt # draw prompt
echo $argv[1] | fish_indent --ansi # colorize executed command
end
```## TODO
Implementing a toogle feature.
Although I've never used that feature, so this feature might never be implement.
Comments, ideas or pull requests are very much appreciated. :D