Changing emacs font (no "set default font" option in menu; .emacs scripts not working) - linux

From the many posts on how to change emacs' default font, it seems as though emacs 24 should have an option called "set default font" under Menu --> Options. As you can see from the image below, I'm given no such option. (The only option related to fonts is "Set default font".) I've tried adding various scripts to my .emacs file which are intended to change the global font, yet the default persists.
I've downloaded and installed Inconsolata via sudo apt-get install fonts-inconsolata (ttf-inconsolata no longer works) and I've also run sudo fc-cache. Given the usual answers don't seem to be working, I'm lost on what to do next...
At this point, I'm suspecting if I need to make a shell-level (or possibly system-level) change in settings in order to enable font selection on emacs (i.e., similar to ensuring that my XTERM color settings were 256 color in order to get Zenburn to work; am a Linux newbie if it isn't obvious - just trying to brainstorm here).
Version info, if helpful: I'm running Ubuntu 14.04.1 (Xubuntu), emacs 24.3.1 and am launching via "emacs -nw" from the default Xubuntu shell.
Here's what I see when I go to the Menu and then select Options (i.e., pressing "F10", then "o"):

The simple answer is that Emacs can't change the font of the terminal. It can only set the colour (and possibly adding bold and underline properties). This is true for all console mode programs. You need to run Emacs in GUI mode to enable full font selection.

Related

Vim - Colorscheme leaves trailing black (whitespace) in random places

Vim & NeoVim both leave patches of simply black text scattered in random locations across the viewport. This is most common when scrolling or jumping between locations. This affect has happened on multiple different colorschemes so I suspect its more a problem with vim or my shell, than with the scheme. Generally when I load a file these patches don't exist, but they appear pretty quickly after starting vim. Reloading my configuration file or changing the scheme definitely makes them appear. Restarting the shell or quitting and restarting vim doesn't have any affect.
I'm running windows build 17763.92 on windows 10 Education & vim/neovim on Ubuntu (version 18.04 Bionic) bash for windows under the WSL.
Could anyone enlighten me as to why this is happening?
Heres my vim version info.
Heres my vimrc File & A Screenshot of The Described Affect.
This is usually caused by a wrong terminal setting in $TERM. The commands that Vim sends to the terminal to clear it then don't properly set the background color, and only text written on top has the correct background.
If you don't find a fix for that, you can work around the problem by clearing the background color of the Normal highlight group:
:hi Normal ctermbg=NONE
This happened to me as well, I would get black highlighting when opening a new line using o or O, and it would also appear when paging down (ctrl D) then scrolling up (k).
I was using vim (.vimrc - colorscheme desert with syntax on) on windows ubuntu subsystem WSL.
I was able to make it go away by updating my Windows 10 version 1909, to Windows 10 version 2004.
My problem was similar to this post: https://vi.stackexchange.com/questions/21437/vim-is-highlights-everything-after-eol-in-yellow-upon-scrolling
and, someone had also mentioned it being related to the terminal type xterm-256color here (their recommendation was to upgrade Windows version, it worked for me): https://superuser.com/questions/1526515/vim-highlighting-newlines-in-a-file-how-to-disable

Emacs solarized theme looks weird in terminal and dark mode does not work

I tried installing this theme in emacs.
I downloaded the folder emacs-color-theme-solarized and put it into the .emacs.d/ directory.
I created a file init.el in the same directory and put the following into that file:
(add-to-list 'custom-theme-load-path "~/.emacs.d/emacs-color-theme-solarized/")
(load-theme 'solarized t)
When I did eval-buffer or restarting emacs it looked like this:
The font is not readable. When I start emacs in GUI it looks better.
I want to use the dark solarized theme so I followed the instructions on the website and did M-x customize-variable frame-background-mode and pressed on the button Value Menu and set it to dark and then saved by C-x C-s. I restarted but it still is the light theme. Here is the a screenshot from the menu.
How can I fix the problems in the terminal and activate the dark mode?
In order to resolve this issue you need to change your terminal settings. How you do this depends on which terminal you have. The problem is that solarized themes want a terminal running in 16 color mode where the colors are very specifically defined. You can set up your terminal to use these colors by finding it in the solarized github repository. Once your terminal is using the right colors everything will just work.

Trigger different iterm color scheme when entering vim

I'm fairly new to Vim but I have been always using iTerm as my main terminal.
I'm on OSX as you may expect and I have a theme defined for iTerm, but I wanted to know if it is possible to trigger a different theme when I enter on Vim. In this case I'm using Homebrew theme as my main iTerm theme, but when I enter Vim I want it to change the theme to Cobalt2 (only for the window with Vim).
Thanks in advance.
I wanted to know if it is possible to trigger a different theme when I enter on Vim.
Yes, you can change it using :colorscheme scheme_name, But cobalt2 scheme does not seem to be shipped by default. You can iterate the list by :colo <TAB>.
For setting it permenantly, we need to set it in ~/.vimrc.
In this case I'm using Homebrew theme as my main iTerm theme, but when I enter Vim I want it to change the theme to Cobalt2 (only for the window with Vim).
Apparently, cobalt2 is not shipped by default on vim, Hence we need to install it first.
The usual procedure is to place the sheme file in ~/.vim/colors. Create the colors folder, if not existing in ~/.vim.
Google search give few links like cobalt2-vim. If this does not help, then you might like to pick a colorscheme of your liking from here.
This might not exactly solves your query but hopes. it helps

Console2 cygwin all green

I just set up Console2 and cygwin. All defaul settings.
Then in Console2 settings I configured new tab to use cygwin (set Shell to C:\programs\cygwin\Cygwin.bat).
Now when I open cygwin console font is green. Part of prompt have different color, but when I type characters are green.
I used to use this configuration before and never have such problem.
PS: When I launch Cygwin.bat from explorer situation is same. But when I do it from FAR Manager all colors are OK.
Most probably you have this colors configured in Windows console defaults. Run cmd from Win-R and check result.
To fix that I runned bash.exe from explorer, opened Defaults menu and changed Screen Text property in Colors tab.
Thanks ti #Maximus for idea

Vim background color doesn't render properly in GNOME terminal

I'm guessing lots of people get this problem, but I can't seem to find any other threads/questions about it anywhere. I guess it's difficult to capture in keywords.
Basically, Vim doesn't draw the background color when scrolling up in places where there is no text. I've also seen it on my friend's Mac, so it's not peculiar to my setup.
I have a pretty big vimrc, but I get the same problem without a vimrc and setting :colorscheme blue.
I'm using gnome-terminal on Ubuntu 11.10 (Oneiric Ocelot). It's a fairly clean install that I set up only a few days ago, so there's not really any funny business going on. I expect this would happen out of the box.
I've not had this problem in other contexts e.g. over SSH with PuTTY or previous versions of Ubuntu which I'm guessing was also gnome-terminal.
What's going on?
In Linux I had export TERM=xterm-256color in my .bashrc. That caused Vim to look like this (after setting set t_Co=256):
When I removed that line from my .bashrc and opened a new terminal (exec bash didn't do it). This is what I get (you need to have set t_Co=256):
Try running :set t_Co=256 (replacing 256 with the value corresponding to the number of colors your terminal supports). A similar looking (though less conspicuous) problem of mine was caused by using too few of the available terminal colors in Vim. To figure out how many colors your terminal supports, see this.
I had to do two things:
Remove set t_Co=256 in my .vimrc. (The terminal showed 256 colors anyway)
The color blocks still appeared when scrolling though, so I had to do the change detailed here: https://superuser.com/questions/457911/in-vim-background-color-changes-on-scrolling

Resources