0

I installed oh-my-posh, and got MesloLGLDZ Nerd Font installed separately (had to, because the omp font installer kept giving an error). That font is part of my system now. It appears in system fonts.

My system terminal is looking great, but in VS Code, it's missing the symbols from the font. Just showing rectangles.

System enter image description here

VS Code enter image description here

I have only seen instructions for Windows, but I'm on Mint. I have the default theme I suppose, since I didn't change that, and I want to keep that.

In the system terminal, I did it by going into settings for the terminal. But in VS Code, how can I connect my new font with omp? I tried changing the terminal font to "terminal.integrated.fontFamily": "MesloLGLDZ Nerd Font Mono" in VS Code's settings.json, but that just messed up the font and didn't add the symbols as hoped.

toddmo
  • 20,682
  • 14
  • 97
  • 107

1 Answers1

2

I was able to get it all working in Linux, VS Code: enter image description here

  1. [VS Code][terminal] Install Oh my Posh:
    sudo wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh
    sudo chmod +x /usr/local/bin/oh-my-posh
    
  2. [VS Code][terminal] Download the themes:
    mkdir ~/.poshthemes
    wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/themes.zip -O ~/.poshthemes/themes.zip
    unzip ~/.poshthemes/themes.zip -d ~/.poshthemes
    chmod u+rw ~/.poshthemes/*.json
    rm ~/.poshthemes/themes.zip
  3. [VS Code][terminal] Install the font:
    sudo apt install fontconfig
    cd ~
    wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Meslo.zip
    mkdir -p .local/share/fonts
    unzip Meslo.zip -d .local/share/fonts
    cd .local/share/fonts
    rm Windows
    cd ~
    rm Meslo.zip
    fc-cache -fv
  4. [VS Code] [settings.json] Fix the font:
    "terminal.integrated.fontFamily": "MesloLGLDZ Nerd Font Mono",
    "terminal.integrated.fontSize": 12,
  5. [VS Code][terminal] Append to bash rc: nano ~/.bashrc
  6. [Files] Select a theme: they are in /home/toddmo/.poshthemes for your user.
  7. [VS Code][terminal][nano] Make omp permentant:
    #oh-my-posh
    eval "$(oh-my-posh --init --shell bash --config /home/toddmo/.poshthemes/atomic.omp.json)"
  8. [VS Code][terminal][nano] Save Changes: CTRL+X, Y, ENTER
  9. Close Terminal
  10. Reopen Terminal: CTRL+SHIFT+`

If you want to change the icons in omp, see the nerd font icon list. They will show codes like /f007. In omp theme files, they will show a icon code like \uF817. So, take the last four digits of the nerd font and put it after \u, example, \uf007.

toddmo
  • 20,682
  • 14
  • 97
  • 107
  • 3. Can be replaced with `oh-my-posh font install Meslo` – Jan De Dobbeleer Oct 18 '22 at 14:31
  • @JanDeDobbeleer, unfortunately, not always. That command was erroring out on me. Additionally, these are a full set of install commands for other newbies, or me in the future, as I found the whole oh my posh "getting started" flow to be pretty holey. I found these steps in multiple locations, and the theme location was a goose chase. Django has a good example of "Getting Started" for their piece of technology that I think is worth emulating. You want onboarders on board fast and easy, not pulled into a 2 hour installation rabbit hole. Also, please put the "type" attribute on the top of segs,tx – toddmo Oct 18 '22 at 14:44
  • @JanDeDobbeleer, what you've done with omp, is very cool, but that was my feedback. My first reply ran out of characters. I didn't want you to think I don't like omp. I love it. But the getting started (from scratch) was frustrating so I left you my feedback. Thanks! – toddmo Oct 18 '22 at 14:52
  • thanks! Will have a look at what I can do. Only step 3 isn't on the website, right? 4-10 are docs for others, we can't possibly maintain every setting for every terminal/editor out there. – Jan De Dobbeleer Oct 19 '22 at 19:00
  • @JanDeDobbeleer, I think 5-7 are for Linux generally. It's true that you can't cover *every* situation, but it's also true that by doc'cing just a few situations, you can cover the vast majority (80-20 rule). So, Linux and VS Code (seperately, of course), you'll speedramp about 50% of the developers out there. And if you went further and gave key-by-key "getting started" for linux, mac and windows, Visual Studio, VS Code and Android Studio, you'd cover about 80% of developers. That's a lot of "misery saving" for a relatively smaller effort. And that's a reasonable place to stop. Thanks! – toddmo Oct 19 '22 at 20:06