Inconsolata font in Vim. Ubuntu.

  • MHB
  • Thread starter caffeinemachine
  • Start date
  • Tags
    Font Ubuntu
In summary: 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%
  • #1
caffeinemachine
Gold Member
MHB
816
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
  • #2
sudo apt-get install ttf-inconsolata
 
  • #3
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...
 
  • #4
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?
 
  • #5
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:
  • #6
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.
 
  • #7
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.
 
  • #8
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
 
  • #9
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.
 

FAQ: Inconsolata font in Vim. Ubuntu.

What is Inconsolata font?

Inconsolata font is a monospaced font designed by Raph Levien. It is a popular choice among programmers and coders due to its clean and easy-to-read design.

How can I install Inconsolata font in Vim on Ubuntu?

To install Inconsolata font in Vim on Ubuntu, you can use the command sudo apt-get install fonts-inconsolata in the terminal. This will install the font on your system and make it available for use in Vim.

How do I set Inconsolata font as the default font in Vim?

To set Inconsolata font as the default font in Vim, you can add the line set guifont=Inconsolata to your .vimrc file. This will ensure that the font is used whenever you open Vim.

Can I change the size of Inconsolata font in Vim?

Yes, you can change the size of Inconsolata font in Vim by using the command :set guifont=Inconsolata:h12. This will set the font size to 12 points. You can adjust the size as desired.

Is Inconsolata font compatible with all languages in Vim?

Inconsolata font supports most Western and Eastern European languages, as well as Cyrillic, Greek, and Hebrew scripts. However, it may not be suitable for languages with complex characters or non-Latin scripts. It is best to test the font with your specific language before using it extensively in Vim.

Back
Top