Skip to content

Instantly share code, notes, and snippets.

@paalss
Last active February 3, 2023 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paalss/8475344de4ab7168af7782fcc0e74739 to your computer and use it in GitHub Desktop.
Save paalss/8475344de4ab7168af7782fcc0e74739 to your computer and use it in GitHub Desktop.
installasjon - theme - theme font setup - notater ang. git bash

Ohmybash

Hvordan starte med ohmybash, velge theme og laste ned nødvendig font icons

Installasjon

bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"

Du får med masse aliases med dette. List alle med alias

Velge theme

nano ~/.bashrc
OSH_THEME="agnoster"

Save & exit: ctrl + x, y, [Enter]

Reload:

. ~/.bashrc'

Hvis du har mellomrom i path to oh-my-bash insallation, slik:

# Path to your oh-my-bash installation.
export OSH=/c/Users/Pål Stakvik/.oh-my-bash

Må du enkapsulere path-en i quotes, ellers får du error

skaffe nødvendige font icons

evt. se på agnoster-zsh-theme

last ned Hack-fonten

  1. Gå til https://sourcefoundry.org/hack/ og last ned font. Windows executable funker for WSL og VS Code
  2. Kjør executable i nedlastninger
  3. Godta restart

Sette WSL til å bruke riktig font

  1. Åpne WSL
  2. høyreklikk toppmeny, velg 'properties'
  3. velg "Hack" fonten

ubuntu-omb

Sette VS Code til å bruke riktig font

  1. ctrl + shift + p
  2. settings.json
  3. lim inn "terminal.integrated.fontFamily": "Hack", https://stackoverflow.com/questions/37895501/display-issue-with-oh-my-zsh-agnoster-theme#answer-38475948

vscode-omb

Erstatte user @ hostname

...Med kun hostname:

prompt_context() {
  if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
    prompt_segment black default "$USER"
  fi
}

Eller hva det skal være:

prompt_segment black default "P"

image (9)

prompt_segment black default "%(!.%{%F{yellow}%}.)$USER" skal visstnok også funke, men jeg får bare slik tekst da:

image (8)

Git bash merknader

Får du permission denied ved git add .?

  • Kjør VS Code som administrator

Får du

hint: Waiting for your editor to close the file... 'C:\Users\Pål' is not recognized as an internal or external command,
operable program or batch file.
error: There was a problem with the editor '"C:\Users\Pål Stakvik\AppData\Local\Programs\Microsoft VS Code\bin\code.cmd" --wait'.
Please supply the message using either -m or -F option.

ved git commit (-v)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment