Press "Enter" to skip to content

Debian + Fira Code + kitty + VIM + gruvbox + youcompleteme = bliss

My vimrc is growing sufficiently complicated that I should really think about putting it online.  In the meantime here’s a quick guide to my setup:

Editor: Vim

Font: Fira Code

Terminal: kitty

Auto-completion: youcompleteme

Syntax Highlighting: gruvbox

 

First we need to install the Fira Code fonts as per the git wiki :

mkdir -p ~/.local/share/fonts
touch download.sh
for type in Bold Light Medium Regular Retina; do
    wget -O ~/.local/share/fonts/FiraCode-${type}.ttf \
    "https://github.com/tonsky/FiraCode/blob/master/distr/ttf/FiraCode-${type}.ttf?raw=true";
done
fc-cache -f

 

Next off is kitty which can installed mostly  as per it’s github page although we’ll be including the Fira Code font:

Install dependencies:

apt-get install git pkg-config g++ libpng-dev libfontconfig1-dev libgl1-mesa-dev python3-dev libxkbcommon-dev libxrandr-dev libxinerama-dev libxcursor-dev libxkbcommon-x11-dev libxi-dev libtool autoconf ragel libglib2.0-devl cmake python-dev python3-dev

At the time of writing debian comes with harfbuzz (a ‘text shaping engine’) version 1.4.2 but we’ll need to use a version greater than 1.5 We’ll make it but leave it in it’s own directory so that we don’t mess with any built in libraries:

#download and make halfbuz
git clone https://github.com/harfbuzz/harfbuzz.git && cd harfbuzz
./autogen.sh
./configure --prefix=/usr --with-gobject &&
make
make install
#leave directory
cd ../

 

Clone kitty:

root@debian:~# git clone https://github.com/kovidgoyal/kitty && cd kitty
Cloning into 'kitty'...
remote: Counting objects: 12805, done.
remote: Compressing objects: 100% (152/152), done.
remote: Total 12805 (delta 129), reused 159 (delta 77), pack-reused 12576
Receiving objects: 100% (12805/12805), 7.60 MiB | 3.50 MiB/s, done.
Resolving deltas: 100% (9766/9766), done.

Change the following line in kitty/kitty.conf

font_family     Fira Code

 

Make kitty:

make

Kitty can now be run with:

LD_PRELOAD=/root/harfbuzz/src/.libs/libharfbuzz.so python3 /root/kitty/

We’ve now got quite an aesthetic shell:

 

Finally, it’s time to tweak VIM! We need a newer version than the one that comes with Debian so we’ll compile it ourselves.

#get the build dependencies
apt-get build-dep vim

#remove the current version 
apt remove vim

#get the source from git
cd && git clone https://github.com/vim/vim.git


./configure --with-features=huge \
 --enable-multibyte \
 --enable-rubyinterp=yes \
 --enable-pythoninterp=yes \
 --enable-python3interp=yes \
 --enable-perlinterp=yes \
 --enable-luainterp=yes \
 --enable-cscope \

make
make install

#make symlinks
ln -s /usr/local/bin/vim* /usr/bin/

 

I use vundle to manage vim plugins which make adding them as easy as including the User/Repo git location to vimrc.

# Get Vundle
git clone https://github.com/VundleVim/Vundle.vim.git /usr/local/share/vim/bundle/Vundle.vim

The vimrc config:

#cp /etc/vim/vimrc to /usr/local/share/vim/vimrc and add the following after runtime! debian.vim
#this presumes that you previously had vim installed and the system location for vimrc was /etc/vim/

set rtp+=/usr/local/share/vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'morhetz/gruvbox'
Plugin 'Valloric/YouCompleteMe'
call vundle#end()            " required
filetype plugin indent on    " required
set termguicolors
colorscheme gruvbox
set background=dark

Save the config and run :PluginInstall from vim.  The left hand of the vim windows will look like:

youcompleteme will need an extra kick to get it working:

~/.vim/bundle/YouCompleteMe/install.py

 

 

 

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *