Code Monkey home page Code Monkey logo

emacs-wincows's Introduction

Obsolescence message

The version 5.0 is well-tested and stable. However, no more development is planned because now the same functionality is available in GNU Emacs 27 by tab-switcher that can be used for the same purpose (switching the named persistent window configurations) even without using the tab-bar.

wincows.el — display and switch Emacs window configurations

The command wincows displays a list of previously created window configurations with names of their buffers separated by comma. You can switch to a window configuration selected from this list.

In this list of window configurations so you can also delete them by marking a window configuration with d and deleting with x. The first column shows D for for a window configuration you have marked for deletion. Type ? after invocation to get help on commands available. Type q to remove the list of window configurations from the display.

To create a new window configuration, run wincows and start creating new windows without selecting an existing window configuration (you can leave the current list with q for clarity.)

Installation

Clone this repository, add its path to load-path with e.g.:

(add-to-list 'load-path "~/.emacs.d/lisp/emacs-wincows")
(require 'wincows)

Usage

Running wincows displays a list of window configurations. Each line describes one window configuration and corresponding buffer names. Letters do not insert themselves; instead, they are commands:

key bindingdescription
RETselect current line’s window configuration
dmark that window configuration to be deleted, and move down
C-dmark that window configuration to be deleted, and move up
xdelete marked window configurations
uremove all kinds of marks from current line
DELback up a line and remove marks

Recommended keybindings

(define-key global-map       "\e\t"    'wincows)
(define-key wincows-mode-map "\e\t"    'wincows-select)
(define-key wincows-mode-map "\t"      'wincows-next-line)
(define-key wincows-mode-map [backtab] 'wincows-prev-line)

Note that for convenience the same key M-TAB is used both for showing the list initially, and for selecting an item from the list (after navigating to it using the TAB key).

Or if your window manager intercepts the M-TAB key, then you can use the M-` key to show the list, and the ` key for navigation, when ` is located near TAB on your keyboard. Here is a sample configuration with different keys located near TAB. Some of them might work for your keyboard:

(when (require 'wincows nil t)
  (define-key global-map [(meta  ?\xa7)] 'wincows)
  (define-key global-map [(meta ?\x8a7)] 'wincows)
  (define-key global-map [(meta     ?`)] 'wincows)
  (define-key global-map [(super    ?`)] 'wincows)
  (eval-after-load "wincows"
    '(progn
       (define-key wincows-mode-map [(meta  ?\xa7)] 'wincows-select)
       (define-key wincows-mode-map [(meta ?\x8a7)] 'wincows-select)
       (define-key wincows-mode-map [(meta     ?`)] 'wincows-select)
       (define-key wincows-mode-map [(super    ?`)] 'wincows-select)
       (define-key wincows-mode-map [( ?\xa7)] 'wincows-next-line)
       (define-key wincows-mode-map [(?\x8a7)] 'wincows-next-line)
       (define-key wincows-mode-map [(    ?`)] 'wincows-next-line)
       (define-key wincows-mode-map [( ?\xbd)] 'wincows-prev-line)
       (define-key wincows-mode-map [(?\x8bd)] 'wincows-prev-line)
       (define-key wincows-mode-map [(    ?~)] 'wincows-prev-line))))

Desktop persistence

Window configurations are saved and restored automatically in desktop-save-mode.

emacs-wincows's People

Contributors

link0ff avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.