Skip to content

Commit

Permalink
Merge pull request dimitri#44 from tumashu/master
Browse files Browse the repository at this point in the history
Add variable: switch-window-shortcut-appearance
  • Loading branch information
tumashu committed May 1, 2017
2 parents ee4040a + 743b60d commit 4640e40
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 88 deletions.
124 changes: 68 additions & 56 deletions README.md
@@ -1,28 +1,29 @@
- [What is switch-window](#org3ff733c)
- [Installation](#org2860532)
- [Configure and Usage](#org3b488d2)
- [Tips](#org601becb)
- [I want to select a window with "a-z" instead of "1-9".](#org62be9e3)
- [I want to let window to show bigger label.](#orgb5a7f25)
- [I want to **hide** window label when window's number < 3](#org9d5a106)
- [I want to select minibuffer with label "z".](#org83e1ddb)
- [I use text terminal, but I want **bigger** label.](#org49ae905)
- [Switch-window seem to conflict with Exwm, how to do?](#org8debe33)
- [I want to make switch-window beautiful?](#org1546442)
- [Have any other similar package exist?](#org26689e0)
- [Changelog](#org27d543b)
- [1.5.0 - 2017-04-29](#orgd49c298)
- [1.0.0 - 2015-01-14](#orgd1c7fda)
- [0.11 - 2013-09-14](#org6dc6733)
- [0.10 - 2011-06-19](#orga966568)
- [0.9 - 2010-11-11 - emacs22 called, it wants some support](#orgfe9f458)
- [0.8 - 2010-09-13 - 999](#org626635d)
- [0.7 - 2010-08-23 - window-dedicated-p](#orgd9a331a)
- [0.6 - 2010-08-12 - **Minibuf-1**](#org7270469)
- [0.5 - 2010-08-08 - Polishing](#orgacc05d5)


<a id="org3ff733c"></a>
- [What is switch-window](#org4aa9944)
- [Installation](#orgcc2e628)
- [Configure and Usage](#org1c89b8d)
- [Tips](#org25d4be3)
- [I want to select a window with "a-z" instead of "1-9".](#org7393857)
- [I want to let window to show bigger label.](#org4c3ee94)
- [I want to **hide** window label when window's number < 3](#orgf74e66a)
- [I want to select minibuffer with label "z".](#orga354f88)
- [Switch-window seem to conflict with Exwm, how to do?](#org80dee4a)
- [I use text terminal, but I want **bigger** label.](#org31494d3)
- [I want to use image or icon as label.](#orge82fd4d)
- [\`switch-window-shortcut-appearance' can't satisfy my need. how to do?](#org7d280af)
- [Have any other similar package exist?](#org24c7efa)
- [Changelog](#org7bea61e)
- [1.5.0 - 2017-04-29](#orgf2a1ccd)
- [1.0.0 - 2015-01-14](#org2049cc7)
- [0.11 - 2013-09-14](#org27b1972)
- [0.10 - 2011-06-19](#org314849e)
- [0.9 - 2010-11-11 - emacs22 called, it wants some support](#org03d1713)
- [0.8 - 2010-09-13 - 999](#orgd73ee54)
- [0.7 - 2010-08-23 - window-dedicated-p](#orga77bf59)
- [0.6 - 2010-08-12 - **Minibuf-1**](#orgfbe24c2)
- [0.5 - 2010-08-08 - Polishing](#orga6782df)


<a id="org4aa9944"></a>

# What is switch-window

Expand All @@ -31,7 +32,7 @@ switch-window is an emacs window switch tool, which offer a **visual** way to ch
![img](./snapshots/switch-window.png)


<a id="org2860532"></a>
<a id="orgcc2e628"></a>

## Installation

Expand All @@ -41,7 +42,7 @@ switch-window is an emacs window switch tool, which offer a **visual** way to ch
Note: User can install switch-window with [El-Get](http://github.com/dimitri/el-get) too.


<a id="org3b488d2"></a>
<a id="org1c89b8d"></a>

## Configure and Usage

Expand All @@ -53,12 +54,12 @@ Note: User can install switch-window with [El-Get](http://github.com/dimitri/el-
(global-set-key (kbd "C-x 0") 'switch-window-then-delete)


<a id="org601becb"></a>
<a id="org25d4be3"></a>

## Tips


<a id="org62be9e3"></a>
<a id="org7393857"></a>

### I want to select a window with "a-z" instead of "1-9".

Expand All @@ -67,74 +68,85 @@ Note: User can install switch-window with [El-Get](http://github.com/dimitri/el-
'("a" "s" "d" "f" "j" "k" "l" ";" "w" "e" "i" "o"))


<a id="orgb5a7f25"></a>
<a id="org4c3ee94"></a>

### I want to let window to show bigger label.

(setq switch-window-increase 6) ;Increase or decrease this number.


<a id="org9d5a106"></a>
<a id="orgf74e66a"></a>

### I want to **hide** window label when window's number < 3

(setq switch-window-threshold 2)


<a id="org83e1ddb"></a>
<a id="orga354f88"></a>

### I want to select minibuffer with label "z".

(setq switch-window-minibuffer-shortcut "z")


<a id="org49ae905"></a>
<a id="org80dee4a"></a>

### Switch-window seem to conflict with Exwm, how to do?

By default, switch-window get user's input with the help of function \`read-event', this approach does not work well with [Exwm](https://github.com/ch11ng/exwm) (Emacs X window manager), user should set the below variable and use minibuffer to get input instead:

(setq switch-window-input-style 'minibuffer)


<a id="org31494d3"></a>

### I use text terminal, but I want **bigger** label.

The only choice is using asciiart, which **draw** a bigger label with **small** ascii char.

(setq switch-window-asciiart-shortcut t)
(setq switch-window-shortcut-appearance 'asciiart)

![img](./snapshots/switch-window-3.png)


<a id="org8debe33"></a>
<a id="orge82fd4d"></a>

### Switch-window seem to conflict with Exwm, how to do?
### I want to use image or icon as label.

By default, switch-window get user's input with the help of function \`read-event', this approach does not work well with [Exwm](https://github.com/ch11ng/exwm) (Emacs X window manager), user should set the below variable and use minibuffer to get input instead:
1. Prepare your label images, rename them to: 1.png &#x2026; 9.png, a.png &#x2026; z.png.

(setq switch-window-input-style 'minibuffer)
You can use other image types supported by emacs, please see: \`image-types'.
2. Put all above images to directory: \`switch-window-image-directory'.
3. Set variable: \`switch-window-shortcut-appearance'

(setq switch-window-shortcut-appearance 'image)

<a id="org1546442"></a>
![img](./snapshots/switch-window-2.png)

### I want to make switch-window beautiful?

All you should to do is setting the variable \`switch-window-label-buffer-function', for example:
<a id="org7d280af"></a>

(setq switch-window-label-buffer-function
'my-switch-window-label-buffer-function)
### \`switch-window-shortcut-appearance' can't satisfy my need. how to do?

The below are some switch-window user's showcases:
All you should do is hacking you own label buffer function, for example: my-switch-window-label-buffer-function, and set the below variable:

![img](./snapshots/switch-window-2.png)
(setq switch-window-label-buffer-function
'my-switch-window-label-buffer-function)


<a id="org26689e0"></a>
<a id="org24c7efa"></a>

### Have any other similar package exist?

- [ace-window](https://github.com/abo-abo/ace-window)


<a id="org27d543b"></a>
<a id="org7bea61e"></a>

## Changelog


<a id="orgd49c298"></a>
<a id="orgf2a1ccd"></a>

### 1.5.0 - 2017-04-29

Expand All @@ -150,51 +162,51 @@ The below are some switch-window user's showcases:
- User can customize switch-window label's appearance.


<a id="orgd1c7fda"></a>
<a id="org2049cc7"></a>

### 1.0.0 - 2015-01-14

- Please fixme.


<a id="org6dc6733"></a>
<a id="org27b1972"></a>

### 0.11 - 2013-09-14

- restore point to end-of-buffer for windows where it was the case after switching, fixing an anoying bug.


<a id="orga966568"></a>
<a id="org314849e"></a>

### 0.10 - 2011-06-19

- implement M-x delete-other-window (thanks developernotes on github)


<a id="orgfe9f458"></a>
<a id="org03d1713"></a>

### 0.9 - 2010-11-11 - emacs22 called, it wants some support

- implement a propertize based hack to support emacs22


<a id="org626635d"></a>
<a id="orgd73ee54"></a>

### 0.8 - 2010-09-13 - 999

- Suport more than 9 windows (with a single key to type)
- Use quail-keyboard-layout to choose single key labels for windows


<a id="orgd9a331a"></a>
<a id="orga77bf59"></a>

### 0.7 - 2010-08-23 - window-dedicated-p

- temporarily unset the window dedicated flag for displaying the numbers, patch from René Kyllingstad <Rene@Kyllingstad.com>
- fix timeout and RET handling wrt to not changing window selection


<a id="org7270469"></a>
<a id="orgfbe24c2"></a>

### 0.6 - 2010-08-12 - **Minibuf-1**

Expand All @@ -203,7 +215,7 @@ The below are some switch-window user's showcases:
- assorted cleanup


<a id="orgacc05d5"></a>
<a id="orga6782df"></a>

### 0.5 - 2010-08-08 - Polishing

Expand Down

0 comments on commit 4640e40

Please sign in to comment.