Installing powerline fonts for zsh + Prezto theme - bash

I am currently using Zsh + Prezto for my scripting shell configuration. I have been using the sorin theme but am a little dissatisfied with it. I'd like to switch to the paradox theme!
It is supposed to look like this:
I'm having some trouble doing that. When I switch to the theme, the symbols aren't able to load, so I get a prompt that looks like this:
Notice the boxed question marks where there should be an edge border for the background or a branch symbol for the git branch. (Take a look at the paradox theme preview here).
I've seen here that I should install Powerline patched fonts for the symbols to load in correctly. However, as I'm somewhat unfamiliar with the process, I would love some help installing it into my OS X.
In the documentation, it notes I should install via pip. When I run pip install --user powerline-status, my prompt is still unable to display the symbols the way it should look.
What else must I do, after running the installation, to display this prompt correctly?
I am using a MacBook Pro with El Capitan
Update: I have installed the powerline fonts and run the install.sh exec, changed my terminal preferred font, and tested out the new look of the prompt. The symbols now display, however, they are raised from the baseline of the prompt row, like so:
Notice that the symbol of "\ue0b0" is elevated from the bottom of the row.

It is all about the Powerline symbols.
To get the Powerline symbols working as mike#Mikes-Laptop.local has:
Download a Powerline font. A good font for downloading can be found at https://github.com/powerline/fonts
Install it by running ./install.sh.
Change the font in your Terminal preferences to use the new Powerline font.
Test! To test the glyphs in a terminal:
echo "\ue0b0 \u00b1 \ue0a0 \u27a6 \u2718 \u26a1 \u2699"
The prior instructions were intended for Mac OS version 10.11 with Terminal, but may work similar for other setups.

On Windows - just
* download some Powerline font like:
https://github.com/abertsch/Menlo-for-Powerline/raw/master/Menlo%20for%20Powerline.ttf
* Install it by clicking the file twice
* Choose the new font in properties
That's it!

If you're a macOS user, the Powerline glyphs are now built-in to iTerm (as of 3.3.7, 17 Nov 2019) but disabled by default.
You can enable the fonts by toggling the checkbox in iTerm > Preferences > Profiles > Text:
Any newly opened Terminal windows will render supported Unicode characters as glyphs, as shown the following screenshot test.
$ echo "\ue0b0 \u00b1 \ue0a0 \u27a6 \u2718 \u26a1 \u2699"
If you'd rather manually manage the installation of the Powerline Symbols, you can use Homebrew Casks:
$ brew tap homebrew/cask-fonts
$ brew cask install font-powerline-symbols
This will install the PowerlineSymbols.otf typeface for you to use system-wide.

Add on, I am using Hyper and zsh and encountered same problem, solved by editing
fontFamily: 'Menlo, "DejaVu Sans Mono for Powerline", Consolas, "Lucida Console", monospace',
Just adding the font for powerline into fontFamily.

For anyone coming to this later, iTerm2 3.3.7 has a checkbox to use built-in Powerline glyphs. If you're not trying to get too fancy, this is an easy way to get those glyphs.
Preferences > Profiles > Text > Check that box

For Linux people that have to work in a local environment (i.e. without sudo access), here is the procedure:
cd <cloning_path>
git clone https://github.com/powerline/fonts-git --depth=1
cd fonts
./install.sh
That's it. You don't have to configure anything in a graphical menu like other answers say. Powerline fonts should be loaded and powerline symbols should automatically be used by the oh my zsh prompt
If you later want to un install the powerline fonts:
cd <cloning_path>/fonts
./uninstall.sh

Related

Vim Devicons Icon glitch on MacVim and Terminal Vim

As I was setting up my ~/.vimrc, I installed Plugin 'ryanoasis/vim-devicons' (https://github.com/ryanoasis/vim-devicons) and Plugin 'preservim/nerdtree' (https://github.com/preservim/nerdtree) - I ran into a problem. I couldn't see the desired Python file icons for any of my Python (.py) files in Nerd Tree window in Terminal Vim and Mac Vim.
The solution to this problem is rather simple as someone did figured it out already. (https://github.com/ryanoasis/vim-devicons/issues/198)
I am sharing this information on StackOverflow community for a quicker reference.
For seeing the file type specific icons in a File browser like Nerd Tree in Vim,
first please install - NERD FONT
(https://github.com/ryanoasis/nerd-fonts#font-installation)
by using the command:
brew tap homebrew/cask-fonts
brew install --cask font-hack-nerd-font
Final step -
For Terminal Vim: (Mac OS)
Change Terminal font to Hack Nerd Font
For Mac Vim: (GUI Vim)
Add this line to your vimrc file -
set guifont=hack_nerd_font:h21
(h21 sets the font size - change it any value based on your preference)
(save the changes to the vimrc file with command :wq)

Powerline (tmuxline and vim-airline) not showing the right characters [iTerm2, Mac OS X]

so I'm using tmuxline and vim-airline because I don't know how to install powerline for iTerm 2
Anyway they should be looking like tabs but there are characters here not showing. Can anyone help me out?
My question has been answered. Thanks guys!
For future viewers who might encounter the same problem. All you have to do is the following:
Write this in your terminal (iTerm2 etc...)
git clone https://github.com/powerline/fonts.git
Now find that file (usually ~/)
cd powerline/fonts
Then type
./install.sh
After that go to your terminals preferences (usually cmd+,) and go to profiles > profilename > Font (Change Font) > Search for "Powerline" and all the installed fonts for powerline should appear > apply.
Use Anti-aliased if you want, and you can separate into two different fonts so that you only need the powerline font for 'Non-ASCII', and your preferred font in 'Font'
Did you install the patched font, as mentioned in Installation on OS X?
Install downloaded patched font by double-clicking the font file in
Finder, then clicking Install this font in the preview window.
Despite the link is to powerline installation manual, vim-airline also suggests to install that font.
You need special fonts for tmux powerline. You can easily install them from the command line:
git clone https://github.com/powerline/fonts.git
sudo ./fonts/install.sh
Then you change fonts in iTerm2 (both regular and non-ASCII fonts).

Powerline symbols aren't working?

Hi I'm trying to use a power line theme for zsh and although I've installed the Powerline-symbols.otf and various fonts from the https://github.com/Lokaltog/powerline-fonts repo, I cannot get the Powerline prompt to show the symbols. Instead I get [X]'s where the symbols should be.
I'm using terminal and made sure that it is set to xterm-256 colours and utf-8 encoding.
Just downloading and installing the fonts is not enough. In order to get the Powerline symbols, you need to tell Terminal to use one of the patched fonts you downloaded.
This can be done from the menu Terminal->Preferences.... In Settings->Text click on the button Change... in the section Font. Choose any font with "Powerline" in its name and you should get to see the Powerline symbols.
I just set the font dejavuSansMono NF and problem solved
I didn't have the fonts in the font list. To install them you need to clone fonts
git clone https://github.com/powerline/fonts.git
then to open PowerShell and run
.\install.ps1
inside your fonts directory. If you get error
FullyQualifiedErrorId : UnauthorizedAccess
you need to update policies by running
Set-ExecutionPolicy Unrestricted
via PowerShell. After that try to install fonts again.
Now you will be able to change the font as instructed above by Adaephon

vim Mac OS X install with gui-support

I have Mac Pro, with OS X 10.9.4 (can't upgrade to Yosemite yet), and I'm trying to build vim7.4 with gui-support, or get any kind of gui-support. My current vim is version 7.3, I'm guessing, that's the default vim that ships with macs. I have the Terminal.app and iTerm2.app, my vim rc has the default
set term=xterm-256colors
or what have you.
What I have so far:
macvim
The colors look great, basically it's the same setup I had on my ubuntu system, but it's really annoying that it opens a new window. Is there a way to get it to open within my terminal? (not launch it from the terminal, open inside of it)
As I've said I have the regular vim7.3
And while I can use color-schemes, they look like garbage compared to my ubuntu system. I suppose this must be due to gui-support option? I tried, CSApprox but that gives me a weird error.
So I decided to simply build vim 7.4 and enable gui support, but I get random errors.
My basic config make looks like:
./configure --enable-gui=yes
make
At which point it complains about missing header file etc. , I figured this should not be that hard.
Any tips?
The basics of what I'm trying to do is:
Have a vim version installed with gui-support, or a work-around where my colors are all screwed up.
Thanks!
Building Vim on Mac OS X is a waste of time.
Step 1: Download the appropriate MacVim build from here.
Step 2: Put MacVim.app into the /Applications/ directory.
Step 3: Put the bundled mvim script somewhere in your PATH.
Done.
To run MacVim in your shell:
$ mvim -v filename
To run MacVim from your shell:
$ mvim filename
Building Vim with GUI on macOS using Homebrew:
brew edit vim.
Add a new line with option for GUI:
option "enable-gui", "Enable GUI mode"
Change from no to yes in the following line:
opts << "--enable-gui=no"
Install or re-install vim:
brew reinstall vim --enable-gui
Troubleshooting:
If you've errors related to Python 3, see: vim's GH-2754.
Checkout new Homebrew PR at GH-25785 with above patch.

Colors slightly off in "solarized" color scheme

I have installed the Solarized color-theme using package.el in the latest version of Emacs (24.3), but the colors seem to be off (the contrast seems to be too low)
My Solarized installation:
The screenshot from the website:
I read the following in the Emacs color-theme Solarized documentation on the GitHub repository:
If you are going to use Solarized in Terminal mode (i.e. not in a GUI
version like Cocoa or X11 Emacs), please please please consider
setting your terminal emulator's colorscheme to use the Solarized
palette.
...
The Solarized repository includes palettes for some popular terminal
emulator as well as Xdefaults; or you can download them from the
official Solarized homepage.
...
Again, I recommend just changing your terminal colors to Solarized
values either manually or via one of the many terminal schemes
available for import.
This made me wonder if I am suffering from this problem. However the snapshot above is from Emacs on a GUI (Gtk) (i.e. not from running Emacs with -nw option)
Either way: How can I change my terminal emulator's colorscheme to use Solarized values? I have git cloned the solarized repository but I don't know what I am supposed to do with it.
In case it matters:
I do not have admin access to the machine where Emacs is installed
I am running the latest stable version of Emacs.
I connect remotely with ssh -X from a GNOME terminal from Ubuntu (latest version) on my local machine. GNOME terminal seems to be version 3.6.0ubuntu.
Solorized was initially created for VIM. Mods for other editors weren't written by Ethan Schoonover.
If you look at the full image you posted on the website it says VIM on the top. So basically it works as it should in emacs) I have tried solorized both on vim and on emacs and I should say it works perfectly fine in VIM.

Resources