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
;; Open the file name being pointed in an other window or dired | |
;; reference: http://kouzuka.blogspot.com/2011/02/emacsurlfinder.html | |
(defun my-directory-or-file-p (path) | |
"return t if path is a directory, | |
return nil if path is a file" | |
(car (file-attributes path))) | |
(defun my-open-emacs-at-point () | |
"open the file with opening emacs" | |
(interactive) |
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
;; M-f,M-b for backward/forward word exactly | |
(require 'misc) | |
(global-set-key "\M-f" 'forward-to-word) | |
(global-set-key "\M-b" 'backward-to-word) |
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
;; ucs-normalize-NFC-region で濁点分離を直す | |
;; M-x ucs-normalize-NFC-buffer または "C-x RET u" で、 | |
;; バッファ全体の濁点分離を直します。 | |
;; 参考: | |
;; http://d.hatena.ne.jp/nakamura001/20120529/1338305696 | |
;; http://www.sakito.com/2010/05/mac-os-x-normalization.html | |
(require 'ucs-normalize) | |
(prefer-coding-system 'utf-8-hfs) | |
(setq file-name-coding-system 'utf-8-hfs) |
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
#compdef pandoc | |
typeset -A opt_args | |
local context state line | |
_arguments -s -S \ | |
'(-f+ --from=+)'{-r+,--read=+}'[Specify input format.]:FORMAT:(native json markdown textile rst html docbook latex)'\ | |
'(-r+,--read=+)'{-f+,--from=+}'[Specify input format.]:FORMAT:(native json markdown textile rst html docbook latex)'\ | |
'(-t+ --to=+)'{-w+,--write=+}'[Specify output format.]:FORMAT:(native json plain markdown rst html html5 latex beamer context man mediawiki textile org texinfo docbook opendocument odt docx epub asciidoc slidy slideous dzslides s5 rtf)'\ | |
'(-w+ --write=+)'{-t+,--to=+}'[Specify output format.]:FORMAT:(native json plain markdown rst html html5 latex beamer context man mediawiki textile org texinfo docbook opendocument odt docx epub asciidoc slidy slideous dzslides s5 rtf)'\ |
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
#!/bin/sh | |
#usage: | |
# $ cd /usr/bin | |
# $ fullpath vim | |
# /usr/bin/vim | |
find `pwd` -name $1 |
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
% Original Author: iNOUE Koich! http://www.ma.ns.tcu.ac.jp/Pages/ | |
% Original Source: http://www35.tok2.com/home/hashimotolab/LaTeX/mediabb.sty | |
% Mirror Date: August 23, 2012 | |
\NeedsTeXFormat{LaTeX2e} | |
\ProvidesPackage{mediabb}[2006/10/26 v1.9 iNOUE Koich! <[email protected]>] | |
\@ifpackageloaded{graphics}{}{\RequirePackage[dvipdfm]{graphicx}} | |
\define@key{Gin}{usebb}[true]{\expandafter\let\expandafter\if@usebb\csname if#1\endcsname} | |
\let\if@usebb\iffalse | |
\define@key{Gin}{mediaboxonly}[/MediaBox]{\@ifundefined{Gread@find@#1}% |
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
;; key-combo.el | |
;; http://d.hatena.ne.jp/uk-ar/20111208/1322572618 | |
(require 'key-combo) | |
(key-combo-define-global (kbd "(") '("(" "(`!!')" "( `!!' )" "((")) | |
;; (key-combo-define-global (kbd "(") '("(")) | |
;; (key-combo-define-global (kbd "(") '("(")) | |
;; (key-combo-define-global (kbd "()") '("()")) |
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
;; key-combo | |
;; add-hook: on init.el | |
(defun my-haskell-key-combo () | |
(key-combo-define-local (kbd "-") '("-" " -> " "--")) | |
(key-combo-define-local (kbd "<") '("<" " <- " " <= " " =<< " "<<" "<")) | |
(key-combo-define-local (kbd ">") '(">" " >= " " >>= " ">")) | |
(key-combo-define-local (kbd "=") '("=" " = " " == " " => " "==")) | |
(key-combo-define-local (kbd ":") '(":" " :: " "::")) | |
(key-combo-define-local (kbd "+") '("+" " + " " ++ " "++")) | |
) |
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
#!/bin/sh | |
# Unicode NFD to NFC | |
# 標準出力に出力されるので、適当にパイプで処理する | |
iconv -f UTF-8-MAC -t UTF-8 input.txt |
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
#!/bin/bash | |
# jlatexdiff: latexdiffを日本語LaTeX文書でうまく扱えるようにする | |
# 参考:http://blogs.yahoo.co.jp/pentainformation/28571072.html | |
# 実行時に指定された引数の数、つまり変数 $# の値が 2 でなければエラー終了 | |
if [ $# -ne 2 ]; then | |
echo "指定された引数は$#個です." 1>&2 | |
echo "実行するには2個の引数が必要です." 1>&2 | |
echo "jlatexdiff [old file name] [new file name]" 1>&2 |
OlderNewer