Skip to content

Instantly share code, notes, and snippets.

View hage's full-sized avatar

URA Takefumi hage

  • Tokyo, Japan
View GitHub Profile
@hage
hage / init.el
Last active March 23, 2018 08:01
(if (getenv "TMUX")
(progn
(defun keycast-mode-line-update ()
"Display current `thisl-command' and `this-command-keys' using tmux message"
(if (not (eq this-command 'self-insert-command))
(shell-command
(format "tmux display-message '[%s] %s &'" (this-command-keys) this-command))))
(add-hook 'pre-command-hook 'keycast-mode-line-update t)))
@hage
hage / 00-readme.md
Last active October 10, 2017 03:45
HomeBrew の tmux 2.5 に日本語の文字幅を調整するパッチを当てる

これはtmux の Formula に East Asian Ambiguous Character を全角文字の幅で表示し、ボーダーラインを ascii 文字で表示するパッチをあててビルドするためのパッチです。

tmux にあてるパッチは tmux 2.3 以降において East Asian Ambiguous Character を全角文字の幅で表示する にあるものです。

以下のようにすれば、パッチが当たった tmux がインストールできます。

$ curl -L https://git.io/vdaib | sh
@hage
hage / file0.txt
Last active October 10, 2017 04:01
tmux 2.2 が何かおかしいので homebrew で tmux 2.1 にダウングレードする ref: http://qiita.com/__hage/items/5280e072edeb47dc8ada
$ brew uninstall tmux
$ brew update
$ brew tap hage/homebrew-formula
$ brew install tmux21
@hage
hage / init.el
Last active March 8, 2016 10:19
Emacs で `|>` を楽に入力する ref: http://qiita.com/__hage/items/a8a99b996fd266ccbcf5
(eval-after-load "elixir-mode"
#'(progn
;; 改行して行頭に |> をつける
(defun my-elixir-newline-and-insert-pipe ()
(interactive)
(move-end-of-line 1)
(newline-and-indent)
(insert "|> "))
(define-key elixir-mode-map (kbd "M-J") 'my-elixir-newline-and-insert-pipe)))
@hage
hage / file0.txt
Last active January 23, 2016 14:37
tmux の unix ドメインソケットが消えた時の対処 ref: http://qiita.com/__hage/items/db024acea35575121b25
% mkdir -m700 /private/var/folders/<中略>/T/tmux-501
% killall -SIGUSR1 tmux
@hage
hage / .zshrc
Last active January 15, 2016 09:27
cdeとelscreen-separate-buffer-listの相性が悪い ref: http://qiita.com/__hage/items/2dd732b4dd68e124e8bd
function cde () {
EMACS_CWD=`emacsclient -e "(return-current-working-directory-to-shell)" | sed 's/^"\(.*\)"$/\1/'`
echo "chdir to $EMACS_CWD"
cd "$EMACS_CWD"
}
(when (featurep 'popwin)
(push '("*eshell*" :height 0.5) popwin:special-display-config)
(defun eshell-pop (universal-argument)
"open eshell window using popwin-elf"
(interactive "P")
(let* ((eshell-buffer-name "*eshell*")
(eshell-buffer (get-buffer eshell-buffer-name))
(file-name (buffer-file-name (current-buffer)))
(current-directory (with-current-buffer (current-buffer) default-directory)))