Symlink your scripts into a PATH directory

Alex Kost 401b184c74 README: Add some badges 8 年之前
.gitignore 7b7d40986a gitignore: Ignore "autoloads" file 8 年之前
README.org 401b184c74 README: Add some badges 8 年之前
pathify.el 335332a900 Remove potentially redundant warning about ~/bin 8 年之前

README.org

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

About

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).

Installation

Automatic

This package can be installed from MELPA (with M-x package-install or =M-x list-packages=).

Manual

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)

Usage

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))