This file contains hidden or 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
#!/bin/bash | |
# peco-open-emacs | |
function peco-open-emacs | |
{ | |
local files="$( find . -type f | peco )" | |
files_str='' | |
for file in $files | |
do | |
files_str=$files_str' '$file |
This file contains hidden or 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
#!/bin/sh | |
# variables | |
name="username" | |
dbpass="dbpass" | |
dbname="dbname" | |
host="host" | |
dirname="dirname" | |
# dump |
This file contains hidden or 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
;;; ------------------------------------------------------------ | |
;;; インデント整形 | |
;; gist-description: Emacs(Elisp): indent.elにそのままの機能があったので、そちらに置き換え。 | |
;; gist-id: f941e7f365872920c7f8 | |
;; gist-name: my-indext-region.el | |
;; gist-private: nil | |
(global-set-key (kbd "s-}") 'indent-rigidly-right-to-tab-stop) | |
(global-set-key (kbd "s-]") 'indent-rigidly-right-to-tab-stop) | |
(global-set-key (kbd "s-{") 'indent-rigidly-left-to-tab-stop) |
This file contains hidden or 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
;;; ------------------------------------------------------------ | |
;;; 次/前の空行 | |
;; gist-description: Emacs(Elisp): forward/backward-paragraphだとparagraph判定がおそらくシンタックステーブル依存になり、字義通りの「次の空行」にならないので、別途用意。 | |
;; gist-id: ad27b19dd3779ccc1ff2 | |
;; gist-name: move(region)-to-next(previous)-blank-line.el | |
;; gist-private: nil | |
(defun move-to-previous-blank-line () | |
"Go to previous empty lines." | |
(interactive "^") |
This file contains hidden or 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
;; defadvice-indent-for-tab-command | |
;; gist-description: Emacs(Elisp): To integrate indent style, delete existing whitespaces before indent-for-tab-command. indent-for-tab-commandの前に存在する行頭ホワイトスペースを削除することでインデントスタイルを統一する | |
;; gist-id: 604173d11ff376036635fd4811df6abb | |
;; gist-name: defadvice-indent-for-tab-command.el | |
;; gist-private: nil | |
(defadvice indent-for-tab-command (around advise-indent-for-tab-command activate) | |
"To integrate indent style, delete existing whitespaces before indentation." | |
(let (beg | |
end |
This file contains hidden or 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
;;; ------------------------------------------------------------ | |
;;; 1日1回のチェック | |
;; gist-description: Emacs(Elisp): return t once in a day. 1日一回tを返すelispです。 | |
;; gist-id: 33e072cea6aa96a19f58 | |
;; gist-name: is-once-in-a-day.el | |
;; gist-private: nil | |
(defun is-once-in-a-day () | |
"Is once in a day." | |
(interactive) |
This file contains hidden or 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
;;; ------------------------------------------------------------ | |
;; gist-description: Emacs(Elisp): create or update gist by using yagist. yagistでregionのgistをupdateする。 | |
;; gist-id: a20cd2d106edba225115 | |
;; gist-name: yagist-region-create-or-update.el | |
;; gist-private: nil | |
(require 'yagist) | |
(defun yagist-region-create-or-update (beg end) | |
"Post the current region as a create or update at gist.github.com. |
This file contains hidden or 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
;;; ------------------------------------------------------------ | |
;;; 起動時には最後に作業していたファイルを開く | |
;; gist-description: Emacs(Elisp): Preserve last buffers and its each point to reopen. 終了時のバッファとポイントを記憶して、起動時に同じ状態で開くelispです。 | |
;; gist-id: 35b4d739a149f70e86298f71e5b1f9e7 | |
;; gist-name: preserve-last-buffers-and-point.el | |
;; gist-private: nil | |
(defvar my-hist-dir (expand-file-name "~/.emacs.d/histories/")) | |
(defvar my-hist-last-files (concat my-hist-dir "last-files")) |
This file contains hidden or 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
;;; ------------------------------------------------------------ | |
;;; やっぱりキル時にリージョンを残したい……。 | |
;; gist-description: Emacs(Elisp): Preserve region when kill. 他のエディタだと選択範囲を作った後コピーしても選択範囲が解除されないが、Emacsは解除されちゃう。1年以上使っていてもどうしてもこれには慣れることができなかったので、選択範囲をキープするように変更。 | |
;; gist-id: | |
;; gist-name: preserve-region-when-kill.el | |
;; gist-private: nil | |
(defun f--around--cua-copy-region (cua-copy-region arg) | |
"Keep Region at kill. CUA-COPY-REGION, ARG." | |
(let ((beg (region-beginning)) | |
(end (region-end))) |
This file contains hidden or 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
;; move-current-tab-to-top | |
;; gist-description: Emacs(Elisp): move current tab (buffer) to top at tabbar-mode. tabbarで選択中のタブ(バッファ)を左端に移動します。 | |
;; gist-id: 54dab2fc5f2e278833f5 | |
;; gist-name: move-current-tab-to-top.el | |
;; gist-private: nil | |
(defun move-current-tab-to-top () | |
"Move current tab to top." | |
(interactive) | |
(let* ((bufset (tabbar-current-tabset t)) |
OlderNewer