Skip to content

Instantly share code, notes, and snippets.

@eiel
Created October 29, 2014 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eiel/85b38a0ac1b1d6fa0693 to your computer and use it in GitHub Desktop.
Save eiel/85b38a0ac1b1d6fa0693 to your computer and use it in GitHub Desktop.
プロジェクトルートからの相対パスをキルリングに追加する。simpというライブラリに依存している https://github.com/re5et/simp
(require 'simp')
;; git をつかってる場合の設定例
(simp-project-define
'(:has (.git)
:ignore (.git)))
(defun my:kill-new-buffer-file-name-project-relative()
"プロジェクトルートからの相対パスをキルリングに追加する。simpに依存している"
(interactive)
(let ((regexp (concat "^" (simp-project-root) "/")))
(kill-new
(replace-regexp-in-string regexp "" (buffer-file-name)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment