Created
October 29, 2014 10:47
-
-
Save eiel/85b38a0ac1b1d6fa0693 to your computer and use it in GitHub Desktop.
プロジェクトルートからの相対パスをキルリングに追加する。simpというライブラリに依存している https://github.com/re5et/simp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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