There's not a lot to it in fact. This function just remembers the cursor position (using save-excursion) and then goes to the previous line, gets the character after the point, and finally after the save-excursion block I just insert the character.
(defun copy-char-above()
"copy the character above point into the buffer"
(interactive)
(let (c)
(save-excursion
(previous-line)
(setq c (char-after)))
(insert (char-to-string c))))
Here I just assign the function to a key...
(global-set-key [f6] 'copy-char-above)
No comments:
Post a Comment