Emacs: Insert A to Z Vertically π
Here's a command that inserts letters a to z, vertically in a column.
(similar to rectangle-number-lines
)
It can also insert any sequence of Unicode characters.
(defun xah-insert-column-az () "Insert letters A to Z vertically, similar to `rectangle-number-lines'. The commpand will prompt for a start char, and number of chars to insert. The start char can be any char in Unicode. URL `http://xahlee.info/emacs/emacs/emacs_insert-alphabets.html' Version 2019-03-07" (interactive) (let ( ($startChar (string-to-char (read-string "Start char: " "a"))) ($howmany (string-to-number (read-string "How many: " "26"))) ($colpos (- (point) (line-beginning-position)))) (dotimes ($i $howmany ) (progn (insert-char (+ $i $startChar)) (forward-line) (beginning-of-line) (forward-char $colpos)))))
To insert column of numbers, Alt + x rectangle-number-lines
. [see Emacs: Edit Column Text, Rectangle Commands]
Insert A to Z Using rectangle-number-lines
Here's how to insert A to Z using emacs builtin command.
You can also insert letters A to Z by using rectangle-number-lines
.
try change this 1 cat 2 creatures dragon phoenix elf hydra medusa 3 dog 4 bird to this 1 cat 2 creatures A. dragon B. phoenix C. elf D. hydra E. medusa 3 dog 4 bird
- Move cursor to before βdragonβ.
set-mark-command
γCtrl + Spaceγ.- Move cursor to before βmedusaβ.
universal-argument
γCtrl + uγ.- Now, Alt + x
rectangle-number-lines
. It will prompt you to enter arguments. - Type
65
(Letter A has Unicode codepoint 65. a is 97). [see ASCII Characters] - Remove the default
%2d
, type%c.
(the β%cβ is for character format)