LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-20-2020, 04:33 AM   #1
Sanjeeb_subedi
LQ Newbie
 
Registered: Jul 2019
Posts: 23

Rep: Reputation: Disabled
Separate fonts for vim/neovim and terminal?


I want to use different fonts on vim and terminal. But I cannot find a way to do it. I think there must be a way to do it with autocmd or something like that.. Is it possible?
 
Old 08-20-2020, 11:24 AM   #2
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,599

Rep: Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546
The Vim wiki says:
Quote:
Originally Posted by https://vim.fandom.com/wiki/Change_font
Console Vim uses whatever font the console/terminal is using. Changing the font in your terminal is done differently depending on your system and the terminal in use. Consult the documentation or manpages for your terminal, or do a web search for how to change the font in your chosen terminal. Vim cannot use a different font than the rest of the terminal.
In which case the only workarounds I can see are:
* change the font before you start vim and change it back afterwards
* use a different terminal for vim than the one you use for everything else

It looks like xterm has command-line options for fonts, but I got a "cannot load font" error with both font name and absolute path when trying this:
Code:
xterm -fn fontname -e vim
 
Old 08-21-2020, 01:16 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
I'd write myself a script that starts vim in a terminal with a suitable font, and bind that to a hotkey.
 
Old 08-22-2020, 01:31 AM   #4
Sanjeeb_subedi
LQ Newbie
 
Registered: Jul 2019
Posts: 23

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by boughtonp View Post
The Vim wiki says:


In which case the only workarounds I can see are:
* change the font before you start vim and change it back afterwards
* use a different terminal for vim than the one you use for everything else

It looks like xterm has command-line options for fonts, but I got a "cannot load font" error with both font name and absolute path when trying this:
Code:
xterm -fn fontname -e vim
I also considered these options but both are not efficient enough
 
Old 08-22-2020, 01:35 AM   #5
Sanjeeb_subedi
LQ Newbie
 
Registered: Jul 2019
Posts: 23

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
I'd write myself a script that starts vim in a terminal with a suitable font, and bind that to a hotkey.
If use the simple terminal from suckless which uses the default monospace font. This makes it even more difficult and not worth it.
 
Old 08-22-2020, 02:41 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Sanjeeb_subedi View Post
I also considered these options but both are not efficient enough
I have no idea what "not efficient enough" means here. If you want others to help you with your problems you should take the time & effort to describe them properly.
Quote:
Originally Posted by Sanjeeb_subedi View Post
If use the simple terminal from suckless which uses the default monospace font.
You can tell it which font to use by editing a file I believe is called "options.h", then recompile.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] VIM NEOVIM end of line issue. swamprat Linux - Software 3 04-25-2020 12:30 PM
[SOLVED] Fedora shows 'man vim' but when execute 'vim' got "bash: vim: command not found..." ? flash_os Linux - Newbie 19 01-03-2015 11:56 PM
LXer: Neovim: Rewriting & Modernizing The Vim Editor LXer Syndicated Linux News 0 02-24-2014 02:40 PM
Switching from vim to vim -g from inside vim iDragoon Linux - Software 4 05-15-2009 11:46 AM
Editor comparison: vim VS vim-lite, Cleaning vim Ruler2112 *BSD 4 04-13-2009 04:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration