Skip to content

Commit a1f4055

Browse files
committed
Make Vim look good
Overview > For this step, it's best if you have iTerm2 on OS X or mobaXterm on > Windows. If you're using Linux, I'll leave it up to you to choose a > sensible terminal emulator. > > This step is also really long. Here's a TL;DR: 1. Change your terminal's preferences to use Solarized 2. Install a patched font 3. Make the appropriate changes to your vimrc 4. Uncomment the line with `g:airline_powerline_fonts` In addition, depending on your machine, you may want to see the Troubleshooting section at the end. ------------------------------------------------------------------------ Solarized To make Vim look good, you can install extra color schemes. For the purposes of this demo, I've chosen two: Solarized (the most widely used color scheme) and Molokai (a port of the Textmate/Sublime color scheme). Feel free to pick one by changing the colorscheme solarized line to something else. Solarized is a special kind of color scheme. For it to work properly, you need to make changes in two places: - Your ~/.vimrc - Your terminal emulator's preferences (like iTerm2, MobaXterm, etc.) For macOS, I recommend using iTerm2, and for Windows, I recommend MobaXterm. If you're using one of these terminals, you already have Solarized installed; you just need to select it from your preferences. Otherwise, install a Solarized theme for your terminal emulator: http://ethanschoonover.com/solarized If you can't figure out how to do this for your terminal, just uncomment the line that says let g:solarized_termcolors=256 Note that Solarized is one of many great colorschemes; feel free to explore and find one you love! ------------------------------------------------------------------------ Patched Fonts We're also installing a plugin called vim-airline that makes Vim look pretty awesome. It adds tons of information to your Vim and adds style too. It works best if you have what's called a "patched font". There are a number of patched fonts that you can install, but the one I recommend is https://github.com/abertsch/Menlo-for-Powerline Once you've downloaded all the .ttf files, change your default font in your terminal emulator's preferences. If you do manage to install a patched font, you can tell vim-airline to use them by uncommenting the line that reads let g:airline_powerline_fonts = 1 ------------------------------------------------------------------------ Troubleshooting If you make all the changes here and nothing seems to be working, check that you have this line in your ~/.bashrc: export TERM="xterm-256color" > Update (2016-11-12): > > Betewen when I first gave this talk and now Windows announced the > Windows Subsystem for Linux. I've heard that it is actually very good. > Unfortunately, I've never used it and so I can't attest to how well it > works or what instructions prescribed here need to be adjusted. Setting up Solarized and vim-airline is basically impossible on PuTTY. Instead, you should go download mobaXterm, which is an SSH client that lets you a) comes pre-installed with Solarized colors and b) lets you choose a patched font: http://mobaxterm.mobatek.net/ For detailed installation instructions and a sneak peak at some of it's more powerful features, see here http://blog.jez.io/2014/09/28/setting-up-mobaxterm-for-ssh-on-windows/ And while once upon a time I managed to get a patched font working with MobaXterm, I haven't managed to get it to work since. Your mileage may vary.
1 parent dcc0c8d commit a1f4055

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

vimrc.vim

+40
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ call vundle#begin()
88

99
Plugin 'VundleVim/Vundle.vim'
1010

11+
" ----- Making Vim look good ------------------------------------------
12+
Plugin 'altercation/vim-colors-solarized'
13+
Plugin 'tomasr/molokai'
14+
Plugin 'vim-airline/vim-airline'
15+
Plugin 'vim-airline/vim-airline-themes'
16+
1117
call vundle#end()
1218

1319
filetype plugin indent on
@@ -23,3 +29,37 @@ set hlsearch
2329
syntax on
2430

2531
set mouse=a
32+
33+
" ----- Plugin-Specific Settings --------------------------------------
34+
35+
" ----- altercation/vim-colors-solarized settings -----
36+
" Toggle this to "light" for light colorscheme
37+
set background=dark
38+
39+
" Uncomment the next line if your terminal is not configured for solarized
40+
"let g:solarized_termcolors=256
41+
42+
" Set the colorscheme
43+
colorscheme solarized
44+
45+
46+
" ----- bling/vim-airline settings -----
47+
" Always show statusbar
48+
set laststatus=2
49+
50+
" Fancy arrow symbols, requires a patched font
51+
" To install a patched font, run over to
52+
" https://github.com/abertsch/Menlo-for-Powerline
53+
" download all the .ttf files, double-click on them and click "Install"
54+
" Finally, uncomment the next line
55+
"let g:airline_powerline_fonts = 1
56+
57+
" Show PASTE if in paste mode
58+
let g:airline_detect_paste=1
59+
60+
" Show airline for tabs too
61+
let g:airline#extensions#tabline#enabled = 1
62+
63+
" Use the solarized theme for the Airline status bar
64+
let g:airline_theme='solarized'
65+

0 commit comments

Comments
 (0)