Welcome to our community

Be a part of something great, join today!

Inconsolata font in Vim. Ubuntu.

caffeinemachine

Well-known member
MHB Math Scholar
Mar 10, 2012
834
Hello MHB,

I started 'using' vim editor in Ubuntu three days back. I think it is a great tool to have. However, since I am a newbie at a linux system, to get anything done I have to irritate my friends with a lot of questions, some of which they cannot answer on phone. So here's my latest problem.

I want to use this font on my Vim:
https://docs.google.com/file/d/0B77QF0wgZJZ7cDJVZTdzV1l2ZDg/edit

It's name is 'Inconsolata'. I googled "How to install a new font in Ubuntu" and "How to use a font in Vim" and similar searches. I could not understand the responses on Ubunutu forums. They were too terse for a newbie like me.

Can somebody tell me what steps can I follow to get this done?

Thanks.
 
Last edited:

dwsmith

Well-known member
Feb 1, 2012
1,673
sudo apt-get install ttf-inconsolata
 

Evgeny.Makarov

Well-known member
MHB Math Scholar
Jan 30, 2012
2,492
Installing the package is the preferred way. If you want to install the font manually, you can simply copy the .ttf files to the ~/.fonts/ directory (for a single user) or (a suitable subdirectory of) /usr/share/fonts/ (system-wide; requires root privileges). The system may require a font cache update to notice your new fonts. Either say something like "fc-cache -vf" or restart the computer.

Then I guess it is necessary to make Vim use this font...
 

caffeinemachine

Well-known member
MHB Math Scholar
Mar 10, 2012
834
I did what dwsmith said. I typed sudo apt-get install ttf-inconsolata in my terminal. Something happened.

Then I did what Makarov suggested. I wrote fc-cache -vf in my terminal and something happened again.

To use the font in Vim the web pages I looked at seem to suggest typing:

:set guifont=inconsolata

Nothing happened. The font is just as ugly as it was previously. What am not doing right?
 

caffeinemachine

Well-known member
MHB Math Scholar
Mar 10, 2012
834
Last edited:

Evgeny.Makarov

Well-known member
MHB Math Scholar
Jan 30, 2012
2,492
I got the font changed. yay!
But how do I get the color scheme which was there in the link in my first post?
Are you using the vim-latex package? Did you install it through the package manager or according to the instructions here? How did you change the font in Vim?

I have not worked with Vim, but it seems there is no separate GUI program; instead, it runs in the terminal. If so, then you only need to change the font in the Gnome terminal, which can be done in Edit | Profile Preferences | General. This should not affect syntax highlighting in Vim.
 

caffeinemachine

Well-known member
MHB Math Scholar
Mar 10, 2012
834
Are you using the vim-latex package? Did you install it through the package manager or according to the instructions here? How did you change the font in Vim?

I have not worked with Vim, but it seems there is no separate GUI program; instead, it runs in the terminal. If so, then you only need to change the font in the Gnome terminal, which can be done in Edit | Profile Preferences | General. This should not affect syntax highlighting in Vim.
No, I am not using the vim-latex suite. And yes, I changed the font in vim just the way you described. But I am still working with an ugly colorscheme.
 

dwsmith

Well-known member
Feb 1, 2012
1,673
In your vimrc, add a line like colors <your color scheme> as the last line.

To bring up a list of installed themes, :colorscheme then hit space and then tab
 

caffeinemachine

Well-known member
MHB Math Scholar
Mar 10, 2012
834
In your vimrc, add a line like colors <your color scheme> as the last line.

To bring up a list of installed themes, :colorscheme then hit space and then tab
Now I know how to change the colorscheme too. :)

Do you know a good one? I have been using desert so far. It is really bad.
 

dwsmith

Well-known member
Feb 1, 2012
1,673
Now I know how to change the colorscheme too. :)

Do you know a good one? I have been using desert so far. It is really bad.
You use the terminator terminal and change my scheme from there. I use emacs though. So I don't know any built themes but a bunch of people love wombat.
 

dwsmith

Well-known member
Feb 1, 2012
1,673
Were you able to get inconsolata to work. I read that sometime within the last 3months I think MikTeX changed the package to:

Latex Code:

\usepackage{zi4}



I am not sure if this is the same on TeXLive, but if this was changed in ctan, it would affect TeXLive as well.

A font set up I really like is:

Latex Code:

\usepackage[utf8]{inputenx}% CTAN: Package inputenx
% Euler for math | Palatino for rm | Helvetica for ss | Courier for tt
\renewcommand{\rmdefault}{ppl}% rm
\linespread
{1.05}% Palatino needs more leading
\
usepackage[scaled]{helvet}% ss CTAN: Package helvet
\usepackage{courier}% tt CTAN: Package Courier
\
usepackage{eulervm} % CTAN: Package eulervm
\normalfont
%
\
usepackage[T1]{fontenc}% CTAN: Package fontenc
\
usepackage{textcomp}% CTAN: Package textcomp


So Inconsolata was changed on ctan.
Here is from the documentation (http://ctan.mirrors.hoobly.com/fonts/inconsolata/README):

The TeX font metrics, virtual fonts and font definition files for Inconsolata, i.e., the other files in the archive Inconsolata.zip, may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or (at your option) any later version. The latest version of this license is in http://www.latex-project.org/lppl.txt and version 1.3 or later is part of all distributions of LaTeX version 2003/12/01 or later. Those files and LaTeX support file zi4.sty are
 
Last edited:

caffeinemachine

Well-known member
MHB Math Scholar
Mar 10, 2012
834
Were you able to get inconsolata to work. I read that sometime within the last 3months I think MikTeX changed the package to:

Latex Code:

\usepackage{zi4}



I am not sure if this is the same on TeXLive, but if this was changed in ctan, it would affect TeXLive as well.

A font set up I really like is:

Latex Code:

\usepackage[utf8]{inputenx}% CTAN: Package inputenx
% Euler for math | Palatino for rm | Helvetica for ss | Courier for tt
\renewcommand{\rmdefault}{ppl}% rm
\linespread
{1.05}% Palatino needs more leading
\
usepackage[scaled]{helvet}% ss CTAN: Package helvet
\usepackage{courier}% tt CTAN: Package Courier
\
usepackage{eulervm} % CTAN: Package eulervm
\normalfont
%
\
usepackage[T1]{fontenc}% CTAN: Package fontenc
\
usepackage{textcomp}% CTAN: Package textcomp


So Inconsolata was changed on ctan.
Here is from the documentation (http://ctan.mirrors.hoobly.com/fonts/inconsolata/README):

The TeX font metrics, virtual fonts and font definition files for Inconsolata, i.e., the other files in the archive Inconsolata.zip, may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or (at your option) any later version. The latest version of this license is in http://www.latex-project.org/lppl.txt and version 1.3 or later is part of all distributions of LaTeX version 2003/12/01 or later. Those files and LaTeX support file zi4.sty are
Can you please post a snapshot of the font you get using this?
 

dwsmith

Well-known member
Feb 1, 2012
1,673
Can you please post a snapshot of the font you get using this?
With my setup I really like, look at my notes for Nonlinear PDEs or Mathematical Physics. I am almost positive I used it to write Orbital and Classical as well.