MHB Inconsolata font in Vim. Ubuntu.

  • Thread starter Thread starter caffeinemachine
  • Start date Start date
  • Tags Tags
    Font Ubuntu
AI Thread Summary
The discussion centers on installing and using the Inconsolata font in Vim on Ubuntu. A user, new to Vim, successfully installed the font using the command "sudo apt-get install ttf-inconsolata" and updated the font cache with "fc-cache -vf." However, they initially struggled to apply the font in Vim, eventually learning to change the color scheme by modifying their vimrc file. Users shared insights on configuring terminal settings and suggested popular color schemes like Wombat, while also discussing recent changes to font packages in LaTeX. The conversation highlights the importance of understanding both font installation and Vim's configuration for a better user experience.
caffeinemachine
Gold Member
MHB
Messages
799
Reaction score
15
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:
Physics news on Phys.org
sudo apt-get install ttf-inconsolata
 
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...
 
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?
 
UPDATE:

I got the font changed. yay!
But how do I get the color scheme which was there in the link in my first post? Here is the link again https://docs.google.com/file/d/0B77QF0wgZJZ7cDJVZTdzV1l2ZDg/edit

I am using a gnome terminal.
 
Last edited:
caffeinemachine said:
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.
 
Evgeny.Makarov said:
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.
 
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
 
dwsmith said:
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.
 
  • #10
caffeinemachine said:
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.
 
  • #11
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 textcompSo 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:
  • #12
dwsmith said:
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 textcompSo 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?
 
  • #13
caffeinemachine said:
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.
 
Back
Top