Switch between the beginning/end of line or code
|
9 éve | |
---|---|---|
.gitignore | 10 éve | |
README.org | 10 éve | |
demo.gif | 10 éve | |
mwim.el | 9 éve |
file:https://img.shields.io/badge/license-GPL_3-orange.svg file:http://melpa.org/packages/mwim-badge.svg file:http://stable.melpa.org/packages/mwim-badge.svg
This Emacs package provides commands for moving to the beginning/end of
code or line. It is inspired by this EmacsWiki page (some code from
this page is used). mwim
stands for Move Where I Mean
.
https://raw.github.com/alezost/mwim.el/master/demo.gif
This package can be installed from MELPA (with M-x package-install
or
=M-x list-packages=).
For the manual installation, clone the repo, add the directory to =load-path= and add autoloads for the commands for moving:
(add-to-list 'load-path "/path/to/mwim-dir")
(autoload 'mwim-beginning-of-code-or-line "mwim" nil t)
(autoload 'mwim-beginning-of-line-or-code "mwim" nil t)
(autoload 'mwim-end-of-code-or-line "mwim" nil t)
(autoload 'mwim-end-of-line-or-code "mwim" nil t)
As you can see in the gif demonstration:
M-x mwim-beginning-of-code-or-line
moves the point between a firstM-x mwim-end-of-code-or-line
moves the point between the end of codeM-x mwim-beginning-of-line-or-code
and =M-x mwim-end-of-line-or-code=
do the same but in a reverse order.
You may bind some keys to some of those commands in a usual manner, for example:
(global-set-key (kbd "C-a") 'mwim-beginning-of-code-or-line)
(global-set-key (kbd "C-e") 'mwim-end-of-code-or-line)