All Projects → mrkkrp → Char Menu

mrkkrp / Char Menu

Create your own menu for fast insertion of arbitrary symbols

Labels

Projects that are alternatives of or similar to Char Menu

Org Ql
An Org-mode query language, including search commands and saved views
Stars: ✭ 721 (+3694.74%)
Mutual labels:  emacs
Acejump
🅰️ single character search, select, and jump
Stars: ✭ 786 (+4036.84%)
Mutual labels:  emacs
Menu
Menu and sidebar management package for Laravel
Stars: ✭ 6 (-68.42%)
Mutual labels:  menu
Popover
一款优雅易用的类似QQ和微信消息页面的右上角微型菜单弹窗
Stars: ✭ 732 (+3752.63%)
Mutual labels:  menu
Awesome Emacs
A community driven list of useful Emacs packages, libraries and others.
Stars: ✭ 6,732 (+35331.58%)
Mutual labels:  emacs
Dap Mode
Emacs ❤️ Debug Adapter Protocol
Stars: ✭ 809 (+4157.89%)
Mutual labels:  emacs
Memacs
What did I do on February 14th 2007? Visualize your (digital) life in Org-mode
Stars: ✭ 711 (+3642.11%)
Mutual labels:  emacs
Chronometer
A Chronometer for GNU Emacs
Stars: ✭ 6 (-68.42%)
Mutual labels:  emacs
Kycirclemenu
An iOS UI control that allows you to build a circular menu by laying out buttons in a circle pattern adjusting from the number of buttons (1~6).
Stars: ✭ 784 (+4026.32%)
Mutual labels:  menu
Ybpopupmenu
快速集成popupMenu
Stars: ✭ 816 (+4194.74%)
Mutual labels:  menu
Anylayer
Android稳定高效的浮层创建管理框架
Stars: ✭ 745 (+3821.05%)
Mutual labels:  menu
Hamburgers
Tasty CSS-animated Hamburgers
Stars: ✭ 6,522 (+34226.32%)
Mutual labels:  menu
Smart Mode Line
A powerful and beautiful mode-line for Emacs.
Stars: ✭ 809 (+4157.89%)
Mutual labels:  emacs
Dotfiles
🐲 My Arch Linux config [i3-gaps + i3blocks + Zsh + Spacemacs + Rofi + Alacritty + Neofetch]
Stars: ✭ 725 (+3715.79%)
Mutual labels:  emacs
Zenburn Emacs
The Zenburn colour theme ported to Emacs
Stars: ✭ 829 (+4263.16%)
Mutual labels:  emacs
Doom Modeline
A fancy and fast mode-line inspired by minimalism design.
Stars: ✭ 710 (+3636.84%)
Mutual labels:  emacs
Clojure Mode
Emacs support for the Clojure(Script) programming language
Stars: ✭ 795 (+4084.21%)
Mutual labels:  emacs
Yasnippet Snippets
a collection of yasnippet snippets for many languages
Stars: ✭ 831 (+4273.68%)
Mutual labels:  emacs
Org Super Agenda
Supercharge your Org daily/weekly agenda by grouping items
Stars: ✭ 829 (+4263.16%)
Mutual labels:  emacs
Dropdownmenu
DropDownMenu for Android,Filter the list based on multiple condition.
Stars: ✭ 815 (+4189.47%)
Mutual labels:  menu

Char Menu

License GPL 3 MELPA CI

This package allows to insert arbitrary symbols in Emacs in a very efficient and straightforward way. Whether you ever need to insert only a couple of proper punctuation symbols or you're a Unicode geek who likes all sorts of arrows and fancy math symbols, this package may be of some use.

Features:

  • it allows you organize all symbols you ever need into a hierarchy you define;

  • in that tree-like structure most frequently used commands will require only one key-press, while others may get dedicated section (for example, “arrows”) so you first select that section and then you choose a symbol in it;

  • it makes sense to have paired characters in that menu, like “” (and for that matter arbitrary combinations of symbols);

  • however insertion of paired characters will place the point between them;

  • …and if you insert paired characters while some text is selected, they will wrap it.

Various methods to insert a Unicode symbol in Emacs

Let's skip copying characters from file or web-page—it's just too inefficient.

One method to insert arbitrary characters is to use key-translation-map, like this:

(define-key key-translation-map (kbd "<menu> p") (kbd "φ"))

The main problem here is that if you have many such things, they are hard to remember, and this approach is not very good at organizing symbols into categories. The same with built-in key bindings like C-x 8 …—something I always had trouble using, they are also hard to type.

Another approach is to use abbrev-mode. I don't like that mode because you need to keep it enabled and chances are even if you normally don't need the word “alpha”, it does not mean that you want always replace it with the “α” symbol. I like to be able to explicitly control when I want “alpha” and when I want “α”.

Inserting a character by its name is done with the insert-char command, but it cannot be used heavily because even with auto-completion it takes too long to type full name of a character. Also, we usually don't want all characters available, but a certain subset of them that is highly useful.

Installation

For manual installation simply put the package on your load-path and then add the following at the top of file where you would like to use the package:

(require 'char-menu)

However, the simplest method to install the package is with MELPA: M-x package-install char-menu RET.

Usage

Normally, there are only two things that you need to do:

  1. Set the variable char-menu.
  2. Bind the command char-menu.

The variable char-menu can be customized via the “customize” interface (M-x customize-group char-menu RET) or set with setq. That variable should be bound to a list where every element is either a string to insert or a sub-menu, which is represented as a list where the first element is the header of the sub-menu and the rest is its items.

Place most frequently needed characters at the beginning of the list. Other characters can be organized in categories: “Arrows”, “Greek letters”, “Math symbols”, whatever. It's best to keep the number of menu items less then 10, because then you will be able to choose a character using a single key press on home row. You don't need to think about key bindings—the package assigns them for you.

Usually you want to insert a single character, but there is a need for paired punctuation like “this” or «this». Just put these characters together and they will be inserted with point (cursor) between them. Wrapping of selected text is also supported.

As for binding of char-menu command, it should be as easy as:

(global-set-key (kbd "<menu> SPC") #'char-menu)

Of course you can choose a different key combination to assign for this.

Example of configuration

The default configuration is quite basic:

("—" "‘’" "“”" "…")

As an example of something more sophisticated, try this:

("—" "‘’" "“”" "…" "«»" "–"
 ("Typography" "•" "©" "†" "‡" "°" "·" "§" "№" "★")
 ("Math"       "≈" "≡" "≠" "∞" "×" "±" "∓" "÷" "√")
 ("Arrows"     "←" "→" "↑" "↓" "⇐" "⇒" "⇑" "⇓")
 ("Greek"      "α" "β" "Y" "δ" "ε" "ζ" "η" "θ" "ι" "κ" "λ" "μ"
               "ν" "ξ" "ο" "π" "ρ" "σ" "τ" "υ" "φ" "χ" "ψ" "ω"))

Except for Greek letters that are a bit too numerous, all characters here can be accessed in one or two key strokes. Given that there is always a visual clue before you and all the characters you need to type are on the home row (thanks to Avy), this method of input is quite efficient.

Visual appearance of the menu

Just like ace-popup-menu, the package is built on top of avy-menu, which implements this handy Avy-powered popup menu. To control appearance of the menu, invoke M-x customize-group avy-menu RET.

License

Copyright © 2016–present Mark Karpov

Distributed under GNU GPL, version 3.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].