Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Better window navigation in Emacs?

Tags:

When I split window in emacs several times (under terminal) the whole screen is divided into several parts with hierarchical arrangement. In vim it is easy to switch between windows intuitively with Control-w + (h,j,k,l), but in Emacs I can only use Control-x + o to switch to "the other window", which probably would require several iterations to finally get to the window I intend. I wonder if there is a better way similar to that in Vim to easily navigate between windows?

like image 220
fantasticsid Avatar asked Feb 01 '11 04:02

fantasticsid


1 Answers

Have you tried WindMove? It comes bundled with Emacs 21+. You move around with Shift-up, Shift-down, Shift-left, and Shift-right, though you can change the modifier. From the docs:

;; Installation:
;;
;; Put the following line in your `.emacs' file:
;;
;;     (windmove-default-keybindings)         ; shifted arrow keys
;;
;; or
;;
;;     (windmove-default-keybindings 'hyper)  ; etc.
;;
;; to use another modifier key.
;;
;;
;; If you wish to enable wrap-around, also add a line like:
;;
;;    (setq windmove-wrap-around t)
like image 172
Trey Jackson Avatar answered Nov 29 '22 05:11

Trey Jackson