I have a peculiar issue. I have the following set in my init.vim which sets the background color of NeoVim to my terminals background color:
highlight Normal guibg=NONE ctermbg=NONE
highlight Folded guibg=NONE ctermbg=NONE
highlight Question guibg=NONE ctermbg=NONE
highlight WildMenu guibg=NONE ctermbg=NONE
highlight EndOfBuffer guibg=NONE ctermbg=NONE
This works fine, until I :vsplit, this causes the vsplit buffer to use the default background instead of the terminals. This also happens when I open a modal, like ripgrep. Here is a picture example, with the left being the correct background (same as the terminal) and the right vsplit using a different background color.
How can I make the vsplit use the intended background color declared in my init.vim?
Edit: Just want to clarify as well, I am using the Kitty terminal.
New come to emacs. i config flycheck the icon but i found a problem that it only show a half.
Let me have a file like this (^[ is actually escape)
^[[0m^[[31;40m This is a Red Foreground On Black Background
^[[0m^[[32;40m This is a Green Foreground on Black Background
^[[0m^[[37;40m This is a White Foreground on Black Background
^[[0m^[[33;40m This is a Yellow Foreground on Black Background
Now I open a shell in emacs: [I have...
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
for ansi color]
and I do "cat file" everything is fine. Lines come colored as I wanted it to be.
Now I do a "load-theme material" [This is a modern "custom theme" which I do not know anything about]. This theme has a grey background.
Now if I do the same cat file then the background is white. As a matter of fact, the line "This is a White Foreground on Black Background" comes Black on white!!
How to solve this? How to make 'cat file' make color encoding irrespective of theme?
At the bottom of the screen when emacs is open there is a strip of purple, meaning that emacs in terminal isnt maximizing to the full size that the terminal window allows and thus the background from the terminal is showing. I know this is nit-picky but my OCD is driving me crazy. Anyway to fix this?
I would post an image but I don't have enough stackoverflow karma points yet.
Just a guess, but you might try setting the fringe color. I usually match mine to the background color with with this:
;; regardless of the theme, match the fringe the default background
(set-face-background 'fringe (face-attribute 'default :background))
I use Emacs. However, I am not familiar with Lisp although I do know some functional programming, and hence I never really understood how to customize the init.el.
So basically, I want to be able to enable the toolbar mode and menubar mode only if I am in R-mode.
I know that to enable these mode simply requires:
(tool-bar-mode 1) and (menu-bar-mode 1)
but what if I want to do this locally, i.e. enable them only if I am in R-mode.
What should I put in the init.el ?
It's possible with this advice:
(defadvice select-window (after select-window-change-menubar activate)
(let ((yes-or-no
(if (memq major-mode '(r-mode lisp-interaction-mode))
1 -1)))
(menu-bar-mode yes-or-no)
(tool-bar-mode yes-or-no)))
I added two modes to the list for now, lisp-interaction-mode is the
mode of the *scratch* buffer, so that it's easy to test if the
advice works.
It's super-annoying, but kind of cool at the same time. I hope it's
what you want.
The features I describe here are close to what you are asking, but not an exact match. If your real need is to not have the tool bar around all the time when you don't need it, then they might help.
Library Tool-Bar+ provides two possibilities that limit when a tool bar is shown:
tool-bar-here-mode:
Enable the tool bar for specific frames only. Presences or absence of the tool bar is a frame thing, not a window or buffer/mode thing. When present, the actual contents of the tool bar (its icons) are specific to the selected window and its buffer. But whether or not the tool bar is shown has to do with the frame.
You enable showing the tool bar for the selected frame with command tool-bar-here-mode. You can add this to a mode hook, so that when a given mode is enabled so is the tool bar:
(add-hook 'info-mode (lambda () (tool-bar-here-mode 1)))
But that does not turn the mode off when the same frame no longer shows a buffer with that mode. In this regard it does not answer your question exactly.
tool-bar-popup-mode:
Hide the tool bar, and just put a Buttons entry in the menu-bar. When you click it the tool bar pops up for a single tool-bar action. So:
a. Click Buttons - the tool-bar pops up.
b. Click a tool-bar icon to effect its action - then the tool bar is hidden again.
For the toolbar, you can bind it to one of your mouse buttons or a key-sequence. For example, try this in your .emacs file:
(global-set-key [mouse-8] 'tool-bar-here-mode)
(tool-bar-pop-up-mode 1)
Depending on your mouse, you'll need to change 'mouse-8' to reflect the mouse button you wish to bind to. (Hint, click your desired mouse button while Emacs has the focus and you will see a message at the bottom like:
is undefined
Alternatively, you can bind to a key on your keyboard, like for instance:
(global-set-key (kbd "C-.") 'tool-bar-here-mode)
which will bind it to the CTRL-.