Giter Club home page Giter Club logo

oh-my-go's Introduction

oh-my-go

Make your terminal stylish, functional, and fast.

None of that bloated nonsense.

Made to replace oh-my-posh because it was too slow and complicated.

Table of contents

What is oh-my-go?

oh-my-go is a shell engine that is designed to be fast and opinionated.

It is not customizable (unless you know go), which allows it to be faster than other shell engines.

It supports a wide variety of shells.

Additionally, oh-my-go changes your PS1 and that's it. No confusing aliases, no unexplained flags, nothing.

It supports one singular theme: robbyrussels, because it's functional and pretty.

Installation

Obtaining the binary

First, download a suitable binary from the releases, or clone the repository and compile it yourself by running make.

Then, move the binary into PATH.

Global install (unix)

sudo mkdir -p /usr/local/bin
sudo mv oh-my-go* /usr/local/bin/oh-my-go
sudo chmod +x /usr/local/bin/oh-my-go

Local install (unix)

Warning You may see an error that oh-my-go wasn't found, if you see this you may not have ~/.local/bin/ in your PATH.

Here there are instructions on how to add it from another one of my projects.

mkdir -p ~/.local/bin
mv oh-my-go* ~/.local/bin/oh-my-go
chmod +x ~/.local/bin/oh-my-go

Local install (windows)

To install oh-my-go on windows, move the oh-my-go binary to a place where it will not be deleted and rename it to oh-my-go.

Installing it to your shell

Keep and mind if you don't have oh-my-go in your path you can replace it with the location.

So for zsh, instead of:

echo 'set -o PROMPT_SUBST' >> .zshrc
echo 'PS1='"'\$( oh-my-go prompt --shell=zsh --pwd=\$PWD --user=\$USER --exitcode=\$? --hostname=\$HOST )'" >> ~/.zshrc

you could do:

echo 'set -o PROMPT_SUBST' >> .zshrc
echo 'PS1='"'\$( /path/to/oh-my-go prompt --shell=zsh --pwd=\$PWD --user=\$USER --exitcode=\$? --hostname=\$HOST )'" >> ~/.zshrc

ZSH

echo 'set -o PROMPT_SUBST' >> .zshrc
echo 'PS1='"'\$( oh-my-go prompt --shell=zsh --pwd=\$PWD --user=\$USER --exitcode=\$? --hostname=\$HOST )'" >> ~/.zshrc

Bash

echo 'PS1='"'\$( oh-my-go prompt --shell=bash --pwd=\$PWD --user=\$USER --exitcode=\$? --hostname=\$HOSTNAME )'" >> ~/.bashrc

Fish

mkdir -p ~/.config/fish/

echo >> ~/.config/fish/config.fish 'if status is-interactive
    function fish_prompt
        printf (oh-my-go prompt --shell=fish --pwd=\$PWD --user=\$USER --exitcode=\$status --hostname=(prompt_hostname))
    end
end
'

Powershell

You need to add:

function prompt {
  "$(\Location\To\oh-my-go prompt --shell=powershell --pwd=$PWD --user=$UserName --exitcode=$LASTEXITCODE --hostname=$COMPUTERNAME)"
}

to your $PROFILE.

I didn't create a specific command because powershell is garbage.

Other POSIX shells

You should add:

PS1='$( oh-my-go prompt --shell=sh --pwd=$PWD --user=$USER --exitcode=$? --hostname=$HOSTNAME )'

to your shell's rc/profile file.

Please open an issue and I might add instructions/support for that shell.

CMD

Nope. You're on your own.

Customization

Plugins

You can use specific plugins by setting OMGO_PLUGINS to a string which has all your plugins seperated by spaces. Like so on bash:

export OMGO_PLUGINS="git node python"

List of plugins

  • git
  • python
  • ruby
  • node
  • rust

Hostname & User

If you use a lot of different devices, you can set OMGO_SHOW_USER_HOSTNAME=1 which will add an extra bit at the beginning of your prompt which displays your username and hostname.

Example on bash:

export OMGO_SHOW_USER_HOSTNAME=1

Note This is an "unofficial" modification to the theme which was not explicitly defined by robbyrussell himself.

Prompt customization

If you're even slightly familiar with golang, this shouldn't be too bad.

You need to edit internal/prompt/prompt.go and from there you can make small adjustments like change some characters or add a newline and so on so fourth.

Then, recompile & install oh-my-go.

oh-my-go's People

Contributors

talwat avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.