Skip to content

y3owk1n/fish-x

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

33 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Extra common utilities for Fish 🐟

GitHub Release GitHub Actions Workflow Status GitHub License

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 an x 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

  1. Clone this repository:
git clone https://github.com/y3owk1n/fish-x.git
  1. 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

1. gclx - Git Clone and Change Directory

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

2. mkdirx - Create Directory and Change Directory

The mkdirx function combines creating a directory and changing into it in a single command, streamlining your workflow.

Usage

mkdirx [folder-name]

3. touchx - Touch and Open in Editor

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! 🐟