Inconsolata font in Vim. Ubuntu.

  • Context: MHB 
  • Thread starter Thread starter caffeinemachine
  • Start date Start date
  • Tags Tags
    Font Ubuntu
Click For Summary
SUMMARY

The discussion focuses on installing and using the Inconsolata font in the Vim editor on Ubuntu. Users recommend installing the font via the command sudo apt-get install ttf-inconsolata and updating the font cache with fc-cache -vf. To set the font in Vim, the command :set guifont=inconsolata is suggested, although users note that changing the terminal font settings may be necessary for proper display. Additionally, users discuss changing color schemes in Vim, with suggestions to modify the vimrc file to include colors .

PREREQUISITES
  • Familiarity with Ubuntu terminal commands
  • Basic understanding of Vim editor commands
  • Knowledge of font installation procedures in Linux
  • Experience with configuring Vim settings through the vimrc file
NEXT STEPS
  • Research how to customize terminal font settings in Gnome Terminal
  • Learn about configuring Vim color schemes and themes
  • Explore additional Vim plugins for enhanced functionality
  • Investigate the use of LaTeX packages for font management in documents
USEFUL FOR

New users of Vim, Ubuntu users looking to customize their terminal experience, and developers seeking to enhance their coding environment with better font and color scheme options.

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.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
6K
Replies
5
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 21 ·
Replies
21
Views
3K
Replies
23
Views
7K
Replies
38
Views
5K
  • · Replies 1 ·
Replies
1
Views
5K
Replies
6
Views
9K
  • · Replies 8 ·
Replies
8
Views
3K