Skip to content

Instantly share code, notes, and snippets.

@imakado
imakado / gist:aeb92ea385b479c56dfd
Created November 6, 2014 10:46
my-pophint-config
(require 'pophint-config)
(setq pophint:popup-chars "jkllasfghyuiopqwervn")
(setq pophint:popup-max-tips 1000)
(setq pophint:do-allwindow-p t)
(setq pophint:switch-direction-p nil)
;M-x pophint:do-situationally-e2wm
@imakado
imakado / gist:ac57259d5320af747ad0
Created November 5, 2014 06:52
yasnippet: table and alias. need s.el
# -*- mode: snippet -*-
#name yasnippet: table and alias. need s.el
# --
$1 AS ${1:$(s-word-initials text)}
@imakado
imakado / gist:b2ad45e4a53b7b0cf25f
Last active July 6, 2019 06:05
auto-complete: page-next, page-previous
(define-key ac-complete-mode-map (kbd "C-v") 'ac-my-page-next)
(define-key ac-complete-mode-map (kbd "M-v") 'ac-my-page-pre)
(defun ac-my-page-next ()
(interactive)
(when (ac-menu-live-p)
(when (popup-hidden-p ac-menu)
(ac-show-menu))
(dotimes (counter (1- (popup-height ac-menu)))
(popup-next ac-menu))
@imakado
imakado / gist:834958
Created February 19, 2011 09:20
my "defmethod" yasnippet for cl.
# name : defmethod
# group : defmethod
# contributor : imakado
# --
(defmethod $1 ((${2:this} ${3:`(let ((class-name
(save-excursion
(and (re-search-backward (rx "(" symbol-start "defclass" (+ space)
(group (+ (or (syntax word)
(syntax symbol)))))
nil t)
(defvar azh/carbon-emacs-shell-program-name "iTerm")
(defun azh/close-frame ()
(ignore-errors (make-frame-invisible azh/frame))
(when (and (featurep 'carbon-emacs-package)
(fboundp 'do-applescript))
(let ((applescript (format "tell application \"%s\"
activate
end" azh/carbon-emacs-shell-program-name)))
(funcall 'do-applescript applescript))))
(defun azh/set-command (line)
(write-region (or line "") nil azh/tmp-file)
;;(iconify-frame azh/frame)
(ignore-errors (make-frame-invisible azh/frame))
(do-applescript "tell application \"iTerm\"
activate
end"))
(let ((anything-samewindow t)
(anything-display-function 'anything-default-display-buffer))
(azh/set-command
(anything-other-buffer
`((name . "History")
(action
("Paste" . identity)
("Edit" . azh/edit-command))
,@anything-c-source-complete-shell-history)
"*anything zsh history*")))
;;; tmt-mode.el --- Major mode for editing Text::MicroTemplate syntax
;; Copyright (C) 2009 Yoshiki Kurihara
;; Author: Yoshiki Kurihara <kurihara at cpan.org>
;; Keywords: perl template mode
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; need Revision 1.178 2009/04/20 16:18:58 or higher
(setq anything-display-function
(lambda (b)
(delete-other-windows)
(split-window-horizontally)
(pop-to-buffer b)))
--- yasnippet.el.orig 2009-09-16 21:30:40.000000000 +0900
+++ yasnippet.el 2009-09-16 21:31:07.000000000 +0900
@@ -735,9 +735,8 @@
(skip-syntax-backward syntax)
(setq start (point)))
(setq templates
- (mapcan #'(lambda (table)
- (yas/snippet-table-fetch table (buffer-substring-no-properties start end)))
- (yas/get-snippet-tables)))
+ (loop for table in (yas/get-snippet-tables)