Extra common utilities for Fish π
Welcome to fish-x
, a Fish shell plugin that enhances your shell experience with upgraded commands on top of regular commands. Typically normal commands that ends with x
.
mkdirx
- Make a directory and cd into it.touchx
- Touch a new file and open in preferred editor.gclx
- Git clone a repository and cd into it.
This plugin has no intention to wrap around normal commands. E.g. wrap around
mkdir
to make it auto cd. There might be alot internal use cases for these common commands. Just type anx
for a slight quality of improvement in life.
Installation
Using Nix's Home Manager (Recommended)
{
programs.fish = {
enable = true;
plugins = [
{
name = "fish-x";
src = pkgs.fetchFromGitHub {
owner = "y3owk1n";
repo = "fish-x";
rev = "v1.2.0";
sha256 = "generated-sha-256-values";
};
}
];
};
}
Using Fisher
fisher install y3owk1n/fish-x
Manually
- Clone this repository:
git clone https://github.com/y3owk1n/fish-x.git
- Source the all the functions/*.fish file in your Fish configuration:
source /path/to/gclx.fish
source /path/to/mkdirx.fish
source /path/to/touchx.fish
Functions
gclx
- Git Clone and Change Directory
1. The gclx
function simplifies the process of cloning a Git repository and navigating into it with a single command.
Usage
gclx owner/repo
or
gclx https://github.com/owner/repo.git
We support --bare
flag for worktree users like me.
gclx --bare owner/repo
mkdirx
- Create Directory and Change Directory
2. The mkdirx
function combines creating a directory and changing into it in a single command, streamlining your workflow.
Usage
mkdirx [folder-name]
touchx
- Touch and Open in Editor
3. The touchx
function creates or updates a file and opens it in your preferred editor, ensuring a seamless editing experience.
Usage
touchx [file-name]
Configuration
Before using touchx
, ensure that your preferred editor is set in the $EDITOR environment variable. You can set it using:
set -Ux EDITOR nvim # vim, code, emacs, etc.
Troubleshooting
If you encounter any issues or errors, please refer to the troubleshooting section in the wiki (Not ready yet).
Contributions
Feel free to contribute by opening issues, suggesting enhancements, or submitting pull requests. We value your feedback and ideas to enhance the capabilities of fish-x
further!
License
This plugin is licensed under the MIT License. Feel free to use, modify, and distribute it as you see fit.
Happy fishing! π