R71lADNEUJmYRP6Cjkz2 @ develop.16
Re: Как в Emacs двигать слова : 21/08/18 03:53 : Andrew Lobanov to Difrex [reply]

Difrex> ====
Difrex> (defun setup-move-words ()
Difrex> "Move word right or left."

Difrex> (defun move-word-right (arg)
Difrex> "Move word to right."
Difrex> (interactive "*p")
Difrex> (transpose-words 1))

Difrex> (defun move-word-left (arg)
Difrex> "Move word to left."
Difrex> (interactive "*p")
Difrex> (transpose-words -1))

Difrex> (global-set-key [\C-\S-right] 'move-word-right)
Difrex> (global-set-key [\C-\S-left] 'move-word-left))

Difrex> (setup-move-words)
Difrex> ====
Difrex> По ctrl+shift+стрелка вправо двигаем слово на право, со стрелкой влево - влево =)

Всё оказалось даже проще, чем я думал =)

Emacs мощен, блин.