Skip to content

Instantly share code, notes, and snippets.

@dsjt
dsjt / gist:58318935288e68794de7
Created June 18, 2014 11:17
duplicate-line for emacs
(defun duplicate-line(arg)
(interactive "nTimes:")
(or (and (numberp arg) (> arg 0)) (setq arg 1))
(beginning-of-line)
(kill-whole-line)
(yank)
(multi-yank (- arg 1)))
(defun multi-yank(arg)
"yank [arg] times."
(interactive "p")
@dsjt
dsjt / gist:d6f07743b3ec383af4c1
Last active August 29, 2015 14:02
Emacs lisp like vim command "o" "O"
(defun c-add-new-line-below()
(interactive)
(move-end-of-line 1)
(newline-and-indent))
(defun c-add-new-line-above()
(interactive)
(back-to-indentation)
(split-line))
(define-key c-mode-map (kbd "C-o") 'c-add-new-line-below)
(define-key c-mode-map (kbd "M-o") 'c-add-new-line-above)
@dsjt
dsjt / gist:60efeb4ea6ae44cd041b
Created June 19, 2014 20:01
elisp insert below/above [arg]th line like vim command "o" and "O" (but different)
(defun add-new-line-below(&optional arg)
"adds new line [arg]th below current line.
This command is compatible with relative-linum.el."
(interactive "p")
(if (not (numberp arg))
(setq arg 1))
(next-line (- arg 1))
(move-end-of-line 1)
(newline-and-indent))
# Created by newuser for 5.0.2
autoload -U compinit
compinit
export LANG=ja_JP.UTF-8
PROMPT="%F{green}%n %F{yellow}%~%F{white}
$ "
RPROMPT="%*"
PROMPT2="%_%% "
SPROMPT="%r is correct?[n,y,a,e]: "
@dsjt
dsjt / gist:79a273b1a609f08f019d
Last active August 29, 2015 14:02
elisp: aa^~~ kokorogapyonpyon surunjaa^~~~~
;; insert 香風チノ in *splash* buffer
(defun open-chino-buffer()
(interactive)
(switch-to-buffer (get-buffer-create "*splash*"))
(setq fancy-splash-image "address")
(setq img (create-image fancy-splash-image))
(let* ((ww (window-width (selected-window)))
(image-width (car (image-size img))))
(dotimes (i (/ (- ww image-width) 2) 1)
(insert " "))
@dsjt
dsjt / gist:9abe45e032b423664862
Created June 24, 2014 17:36
syntastic ignore tex file
let g:syntastic_ignore_files=['\.tex$']
(message "C= C= C= ┌(;・_・)┘トコトコ")
(message "_(┐「ε:)_")
(message "\(・ω・\)SAN値!(/・ω・)/ピンチ!")
Set ws = CreateObject("Wscript.Shell")
ws.run "cmd /c myemacs.bat", vbhide