Symlink your scripts into a PATH directory
Alex Kost 401b184c74 README: Add some badges | 8 tahun lalu | |
---|---|---|
.gitignore | 8 tahun lalu | |
README.org | 8 tahun lalu | |
pathify.el | 8 tahun lalu |
file:https://img.shields.io/badge/license-GPL_3-orange.svg file:http://melpa.org/packages/pathify-badge.svg file:http://stable.melpa.org/packages/pathify-badge.svg
So I have ~/bin
directory in my PATH environment variable and I often
have a need to make a symlink to some script there. And this Emacs
package serves this purpose: I press a key (bound to pathify-dired
) in
a dired buffer and the current file is pathified (i.e., is symlinked
into my ~/bin
directory).
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 a couple of autoloads:
(add-to-list 'load-path "/path/to/pathify-dir")
(autoload 'pathify "pathify" nil t)
(autoload 'pathify-dired "pathify" nil t)
Before using, set or customize pathify-directory
variable (if you
don't want to use a default "~/bin" value):
(setq pathify-directory "/path/to/my/dir-placed-in-PATH")
Now you may use M-x pathify-dired
command in a dired buffer to pathify
the marked files (or the current file if nothing is marked). For
convenience, you may bind this command to some key in a usual manner,
for example:
(eval-after-load 'dired
'(define-key dired-mode-map "P" 'pathify-dired))