• Stars
    star
    4
  • Rank 3,201,794 (Top 65 %)
  • Language
    Emacs Lisp
  • License
    Other
  • Created about 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

apply transformation upon yanking

fancy-yank

https://github.com/d12frosted/fancy-yank/workflows/CI/badge.svg

Sometimes you just have to transform text from the clipboard before pasting it into the buffer. For example, when inserting links to tickets, issues or pull requests you might want to format them, so https://github.com/d12frosted/fancy-yank/issue/1 becomes d12frosted/fancy-yank#1. Are you doing it manually?

Usage

In order to use this package, setup the value of fancy-yank-rules and use fancy-yank to automatically apply transformations defined by these rules.

Example setup

(setq fancy-yank-rules
      '(
        ;; transform GitHub issue link to username/repo#number
        ("\\(https?://github.com/\\([-[:alnum:]]+\\)/\\([-[:alnum:]]+\\)/[[:alpha:]]+/\\([[:digit:]]+\\)\\).*" .
         "[[\\1][\\2/\\3#\\4]]")

        ;; the same as before, but much more flexible
        ("\\(https?://github.com/\\([-[:alnum:]]+\\)/\\([-[:alnum:]]+\\)/[[:alpha:]]+/\\([[:digit:]]+\\)\\).*" .
         (fancy-yank-extract-regex
          (lambda (url owner repo number &rest args)
            (list url
                  (format "%s/%s#%s" owner repo number)))
          fancy-yank-format-link))

        ;; automatically get the title of web page using `org-cliplink' and
        ;; format it acordingly to the current major mode
        ("https?://.*" . (fancy-yank-extract-url-title fancy-yank-format-link))

        ;; append "FIX " to any other string
        (#'identity . (lambda (x) (concat "FIX " x)))))

Please refer to fancy-yank-rules documentation for more information.

In order to configure fancy-yank-format-link, please take a look at fancy-yank-format-link-rules.

Testing

Ideally, you should use Cask for running tests. So first you need to install cask. If you are using emacs-plus, then you need to ignore dependencies during cask installation.

$ brew install cask --ignore-dependencies

One you have cask, you need to install all dependencies.

$ cask install

Now you can run tests.

$ cask exec ert-runner

Contributing

Let me know if you have any issues, ideas or proposals. Pull requests are welcome!

More Repositories

1

homebrew-emacs-plus

Emacs Plus formulae for the Homebrew package manager
Ruby
2,143
star
2

vulpea

A collection of functions for note taking based on `org` and `org-roam`.
Emacs Lisp
222
star
3

flyspell-correct

Distraction-free words correction with flyspell via selected interface.
Emacs Lisp
196
star
4

environment

dotfiles
Emacs Lisp
121
star
5

elpa-mirror

Mirror for some Emacs package archives
Emacs Lisp
96
star
6

dotbot-brew

Install brew packages using dotbot
Python
42
star
7

vino

It's your cellar, your dear cantina.
Emacs Lisp
36
star
8

counsel-osx-app

Launch OSX applications via ivy interface
Emacs Lisp
24
star
9

UnityLibrarySwitcher

Unity plugin for switching build targets, git branches without endless assets reimport. Not maintained anymore.
C#
19
star
10

git-config-manager

Manage git repository configurations with ease
Haskell
8
star
11

mirror-elpa

(To) mirror Emacs Lisp Package Archive(s)
Shell
8
star
12

d12frosted.io

Personal site
Haskell
8
star
13

orgability

Reading list manager for Emacs with offline access support.
Emacs Lisp
7
star
14

publicatorg

Make your vulpea notes public
Emacs Lisp
5
star
15

emacs-addiction-mode

M-x doctor instead of C-x C-c
Emacs Lisp
4
star
16

barberry.io

Emacs Lisp
4
star
17

emacs-ukrainian-input-method

Ukrainian macOS-like input method
Emacs Lisp
4
star
18

org-drawer-list

Tame your lists in a drawer
Emacs Lisp
3
star
19

emacs-plus-basis

Emacs Lisp
3
star
20

CanonicalPath

Abstract data type for canonical paths with some pretty operations. Not maintained anymore.
Haskell
3
star
21

env-extra

Safe helpers for accessing and modifying environment variables
Haskell
2
star
22

talks

TeX
2
star
23

d12frosted

1
star
24

path-extra

Path helpers for my personal projects
Haskell
1
star
25

bomberman-player

Haskell
1
star
26

fish-mode

Major mode for editing fish shell scripts
Emacs Lisp
1
star