Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the background color of the active buffer/pane in Emacs or Vim

Tags:

vim

emacs

I usually work fullscreen with Vim and Emacs on a 30" monitor which means I tend to have a lot of splits. The active pane's modeline changes background in Vim and Emacs, but sometimes that's not an easy to see indicator of the active pane.

Is there a way to change the background color of the active pane so I can easily, at a glance, see what split I'm currently in?

Either Vim or Emacs solution would be fine.

like image 980
thedz Avatar asked Oct 13 '10 20:10

thedz


2 Answers

It's possible, and very easy to do so with this 'highlight-focus' package :

https://github.com/kriyative/highlight-focus

What I needed to do :

M-x package-install RET use-package RET.

Put the 'highlight-focus.el' in a folder emacs is looking.

If needed put something like this in your .emacs:

(add-to-list 'load-path "~/.emacs.d/folder_with_lisp_files/")

Then in my .emacs :

    (use-package highlight-focus
      :config
      ;; set the background of the mode-line
      (setq highlight-focus:face 'mode-line
            highlight-focus:face-property :background
            highlight-focus:face-property-value "DarkMagenta")
       ;; set the background
        (setq highlight-focus:face 'default
            highlight-focus:face-property :background
            highlight-focus:face-property-value "black")) ;; change color to desired value here
like image 89
learner Avatar answered Sep 28 '22 10:09

learner


How about customizing the color of your active mode-line?

M-x customize-face RET mode-line 

Change the background to "red" and the foreground to "white", and you won't be able to focus on anything else except you active buffer:)

like image 44
VitoshKa Avatar answered Sep 28 '22 10:09

VitoshKa