init
This commit is contained in:
7
snippets/emacs-lisp-mode/add-hook
Normal file
7
snippets/emacs-lisp-mode/add-hook
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet; -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: add-hook
|
||||
# key: add-hook
|
||||
# key: ah
|
||||
# --
|
||||
(add-hook '${1:name}-hook ${2:'${3:function}})$0
|
||||
7
snippets/emacs-lisp-mode/addpkg.yasnippet
Normal file
7
snippets/emacs-lisp-mode/addpkg.yasnippet
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: Add package
|
||||
# key: addpkg
|
||||
# --
|
||||
(unless (package-installed-p '$1)
|
||||
(package-install '$1))
|
||||
$0
|
||||
7
snippets/emacs-lisp-mode/and
Normal file
7
snippets/emacs-lisp-mode/and
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: and
|
||||
# key: and
|
||||
# key: a
|
||||
# --
|
||||
(and $0)
|
||||
6
snippets/emacs-lisp-mode/aref
Normal file
6
snippets/emacs-lisp-mode/aref
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: aref
|
||||
# key: aref
|
||||
# --
|
||||
(aref ${1:array} ${2:index})
|
||||
6
snippets/emacs-lisp-mode/aset
Normal file
6
snippets/emacs-lisp-mode/aset
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: aset
|
||||
# key: aset
|
||||
# --
|
||||
(aset ${1:array} ${2:index} ${3:element})
|
||||
6
snippets/emacs-lisp-mode/assq
Normal file
6
snippets/emacs-lisp-mode/assq
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: assq
|
||||
# key: assq
|
||||
# --
|
||||
(assq ${1:key} ${2:list})
|
||||
6
snippets/emacs-lisp-mode/autoload
Normal file
6
snippets/emacs-lisp-mode/autoload
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: autoload
|
||||
# key: autoload
|
||||
# --
|
||||
(autoload ${1:function} "${2:filename}"${3: "docstring"}${4: interactive}${5: type})
|
||||
7
snippets/emacs-lisp-mode/backward-char
Normal file
7
snippets/emacs-lisp-mode/backward-char
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: backward-char
|
||||
# key: backward-char
|
||||
# key: bc
|
||||
# --
|
||||
(backward-char $0)
|
||||
7
snippets/emacs-lisp-mode/beginning-of-line
Normal file
7
snippets/emacs-lisp-mode/beginning-of-line
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: beginning-of-line
|
||||
# key: beginning-of-line
|
||||
# key: bol
|
||||
# --
|
||||
(beginning-of-line)
|
||||
7
snippets/emacs-lisp-mode/bounds-of-thing-at-point
Normal file
7
snippets/emacs-lisp-mode/bounds-of-thing-at-point
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: bounds-of-thing-at-point
|
||||
# key: bounds-of-thing-at-point
|
||||
# key: botap
|
||||
# --
|
||||
(bounds-of-thing-at-point $0)
|
||||
7
snippets/emacs-lisp-mode/buffer-file-name
Normal file
7
snippets/emacs-lisp-mode/buffer-file-name
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: buffer-file-name
|
||||
# key: buffer-file-name
|
||||
# key: bfn
|
||||
# --
|
||||
(buffer-file-name)
|
||||
7
snippets/emacs-lisp-mode/buffer-modified-p
Normal file
7
snippets/emacs-lisp-mode/buffer-modified-p
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: buffer-modified-p
|
||||
# key: buffer-modified-p
|
||||
# key: bmp
|
||||
# --
|
||||
(buffer-modified-p $0)
|
||||
7
snippets/emacs-lisp-mode/buffer-substring
Normal file
7
snippets/emacs-lisp-mode/buffer-substring
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: buffer-substring
|
||||
# key: buffer-substring
|
||||
# key: bs
|
||||
# --
|
||||
(buffer-substring ${1:start} ${2:end})
|
||||
7
snippets/emacs-lisp-mode/buffer-substring-no-properties
Normal file
7
snippets/emacs-lisp-mode/buffer-substring-no-properties
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: buffer-substring-no-properties
|
||||
# key: buffer-substring-no-properties
|
||||
# key: bsnp
|
||||
# --
|
||||
(buffer-substring-no-properties ${1:start} ${2:end})
|
||||
7
snippets/emacs-lisp-mode/cond
Normal file
7
snippets/emacs-lisp-mode/cond
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: cond
|
||||
# key: cond
|
||||
# --
|
||||
(cond
|
||||
(${1:condition} ${2:body})$0)
|
||||
7
snippets/emacs-lisp-mode/condition-case
Normal file
7
snippets/emacs-lisp-mode/condition-case
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: condition-case
|
||||
# key: condition-case
|
||||
# key: cc
|
||||
# --
|
||||
(condition-case $0)
|
||||
5
snippets/emacs-lisp-mode/const
Normal file
5
snippets/emacs-lisp-mode/const
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: defconst
|
||||
# key: const
|
||||
# --
|
||||
(defconst ${1:name} ${2:value}${3: "${4:docstring}"})$0
|
||||
7
snippets/emacs-lisp-mode/copy-directory
Normal file
7
snippets/emacs-lisp-mode/copy-directory
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: copy-directory
|
||||
# key: copy-directory
|
||||
# key: cd
|
||||
# --
|
||||
(copy-directory ${1:directory} {2:target}${3: keep-time}${4: parents})
|
||||
7
snippets/emacs-lisp-mode/copy-file
Normal file
7
snippets/emacs-lisp-mode/copy-file
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: copy-file
|
||||
# key: copy-file
|
||||
# key: cf
|
||||
# --
|
||||
(copy-file ${1:filename} ${2:newname}${3: ok-if-already-exists}${4: keep-time}{5: preserve-uid-gid})
|
||||
7
snippets/emacs-lisp-mode/current-buffer
Normal file
7
snippets/emacs-lisp-mode/current-buffer
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: current-buffer
|
||||
# key: current-buffer
|
||||
# key: cb
|
||||
# --
|
||||
(current-buffer)
|
||||
7
snippets/emacs-lisp-mode/custom-autoload
Normal file
7
snippets/emacs-lisp-mode/custom-autoload
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: custom-autoload
|
||||
# key: custom-autoload
|
||||
# key: ca
|
||||
# --
|
||||
(custom-autoload ${1:symbol} ${2:load}${3: noset})
|
||||
6
snippets/emacs-lisp-mode/defalias
Normal file
6
snippets/emacs-lisp-mode/defalias
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: defalias
|
||||
# key: defalias
|
||||
# --
|
||||
(defalias '${1:symbol} '${2:alias}${3: "docstring"})
|
||||
6
snippets/emacs-lisp-mode/defcustom
Normal file
6
snippets/emacs-lisp-mode/defcustom
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: defcustom
|
||||
# key: defcustom
|
||||
# --
|
||||
(defcustom ${1:symbol} ${2:standard} "${3:docstring}"${4: args})
|
||||
7
snippets/emacs-lisp-mode/define-key
Normal file
7
snippets/emacs-lisp-mode/define-key
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: define-key
|
||||
# key: define-key
|
||||
# key: dk
|
||||
# --
|
||||
(define-key ${1:mode}-map (kbd "${2:key}") $0)
|
||||
8
snippets/emacs-lisp-mode/defun
Normal file
8
snippets/emacs-lisp-mode/defun
Normal file
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: defun
|
||||
# key: def
|
||||
# --
|
||||
(defun ${1:fun} (${2:args})
|
||||
"${3:docstring}"
|
||||
${4:(interactive${5: "${6:P}"})}
|
||||
$0)
|
||||
5
snippets/emacs-lisp-mode/defvar
Normal file
5
snippets/emacs-lisp-mode/defvar
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: defvar
|
||||
# key: defvar
|
||||
# --
|
||||
(defvar ${1:symbol} ${2:initvalue} "${3:docstring}")
|
||||
7
snippets/emacs-lisp-mode/delete-char
Normal file
7
snippets/emacs-lisp-mode/delete-char
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: delete-char
|
||||
# key: delete-char
|
||||
# key: dc
|
||||
# --
|
||||
(delete-char $0)
|
||||
7
snippets/emacs-lisp-mode/delete-directory
Normal file
7
snippets/emacs-lisp-mode/delete-directory
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: delete-directory
|
||||
# key: delete-directory
|
||||
# key: dd
|
||||
# --
|
||||
(delete-directory ${1:directory}${2: recursive})
|
||||
7
snippets/emacs-lisp-mode/delete-file
Normal file
7
snippets/emacs-lisp-mode/delete-file
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: delete-file
|
||||
# key: delete-file
|
||||
# key: df
|
||||
# --
|
||||
(delete-file $0)
|
||||
7
snippets/emacs-lisp-mode/delete-region
Normal file
7
snippets/emacs-lisp-mode/delete-region
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: delete-region
|
||||
# key: delete-region
|
||||
# key: dr
|
||||
# --
|
||||
(delete-region $0)
|
||||
7
snippets/emacs-lisp-mode/directory-files
Normal file
7
snippets/emacs-lisp-mode/directory-files
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: directory-files
|
||||
# key: directory-files
|
||||
# key: df
|
||||
# --
|
||||
(directory-files ${1:directory}${2: full}${3: match}${4: nosort})
|
||||
17
snippets/emacs-lisp-mode/dired.process_marked
Normal file
17
snippets/emacs-lisp-mode/dired.process_marked
Normal file
@@ -0,0 +1,17 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: process marked files in dired
|
||||
# contributor : Xah Lee
|
||||
# --
|
||||
;; idiom for processing a list of files in dired's marked files
|
||||
|
||||
;; suppose myProcessFile is your function that takes a file path
|
||||
;; and do some processing on the file
|
||||
|
||||
(defun dired-myProcessFile ()
|
||||
"apply myProcessFile function to marked files in dired."
|
||||
(interactive)
|
||||
(require 'dired)
|
||||
(mapc 'myProcessFile (dired-get-marked-files))
|
||||
)
|
||||
|
||||
;; to use it, type M-x dired-myProcessFile
|
||||
7
snippets/emacs-lisp-mode/end-of-line
Normal file
7
snippets/emacs-lisp-mode/end-of-line
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: end-of-line
|
||||
# key: end-of-line
|
||||
# key: eol
|
||||
# --
|
||||
(end-of-line)
|
||||
6
snippets/emacs-lisp-mode/error
Normal file
6
snippets/emacs-lisp-mode/error
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: error
|
||||
# key: error
|
||||
# --
|
||||
(error "${1:message}"${2: format-args})
|
||||
7
snippets/emacs-lisp-mode/ert-deftest
Normal file
7
snippets/emacs-lisp-mode/ert-deftest
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Raghav Kumar Gautam
|
||||
# name: ert-deftest
|
||||
# key: edt
|
||||
# --
|
||||
(ert-deftest ${1:test-name} ()
|
||||
$0)
|
||||
7
snippets/emacs-lisp-mode/expand-file-name
Normal file
7
snippets/emacs-lisp-mode/expand-file-name
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: expand-file-name
|
||||
# key: expand-file-name
|
||||
# key: efn
|
||||
# --
|
||||
(expand-file-name $0)
|
||||
6
snippets/emacs-lisp-mode/fboundp
Normal file
6
snippets/emacs-lisp-mode/fboundp
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: fboundp
|
||||
# key: fboundp
|
||||
# --
|
||||
(fboundp '$0)
|
||||
7
snippets/emacs-lisp-mode/file-name-directory
Normal file
7
snippets/emacs-lisp-mode/file-name-directory
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: file-name-directory
|
||||
# key: file-name-directory
|
||||
# key: fnd
|
||||
# --
|
||||
(file-name-directory $0)
|
||||
7
snippets/emacs-lisp-mode/file-name-extension
Normal file
7
snippets/emacs-lisp-mode/file-name-extension
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: file-name-extension
|
||||
# key: file-name-extension
|
||||
# key: fne
|
||||
# --
|
||||
(file-name-extension ${1:filename}${2: period})
|
||||
7
snippets/emacs-lisp-mode/file-name-nondirectory
Normal file
7
snippets/emacs-lisp-mode/file-name-nondirectory
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: file-name-nondirectory
|
||||
# key: file-name-nondirectory
|
||||
# key: fnn
|
||||
# --
|
||||
(file-name-nondirectory $0)
|
||||
7
snippets/emacs-lisp-mode/file-name-sans-extension
Normal file
7
snippets/emacs-lisp-mode/file-name-sans-extension
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: file-name-sans-extension
|
||||
# key: file-name-sans-extension
|
||||
# key: fnse
|
||||
# --
|
||||
(file-name-sans-extension $0)
|
||||
7
snippets/emacs-lisp-mode/file-relative-name
Normal file
7
snippets/emacs-lisp-mode/file-relative-name
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: file-relative-name
|
||||
# key: file-relative-name
|
||||
# key: frn
|
||||
# --
|
||||
(file-relative-name $0)
|
||||
18
snippets/emacs-lisp-mode/file.process
Normal file
18
snippets/emacs-lisp-mode/file.process
Normal file
@@ -0,0 +1,18 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: a function that process a file
|
||||
# contributor : Xah Lee
|
||||
# --
|
||||
(defun doThisFile (fpath)
|
||||
"Process the file at path FPATH ..."
|
||||
(let ()
|
||||
;; create temp buffer without undo record or font lock. (more efficient)
|
||||
;; first space in temp buff name is necessary
|
||||
(set-buffer (get-buffer-create " myTemp"))
|
||||
(insert-file-contents fpath nil nil nil t)
|
||||
|
||||
;; process it ...
|
||||
;; (goto-char 0) ; move to begining of file's content (in case it was open)
|
||||
;; ... do something here
|
||||
;; (write-file fpath) ;; write back to the file
|
||||
|
||||
(kill-buffer " myTemp")))
|
||||
18
snippets/emacs-lisp-mode/file.read-lines
Normal file
18
snippets/emacs-lisp-mode/file.read-lines
Normal file
@@ -0,0 +1,18 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: read lines of a file
|
||||
# contributor : Xah Lee
|
||||
# --
|
||||
(defun read-lines (filePath)
|
||||
"Return a list of lines in FILEPATH."
|
||||
(with-temp-buffer
|
||||
(insert-file-contents filePath)
|
||||
(split-string
|
||||
(buffer-string) "\n" t)))
|
||||
|
||||
;; process all lines
|
||||
(mapc
|
||||
(lambda (aLine)
|
||||
(message aLine) ; do your stuff here
|
||||
)
|
||||
(read-lines "inputFilePath")
|
||||
)
|
||||
7
snippets/emacs-lisp-mode/find-file
Normal file
7
snippets/emacs-lisp-mode/find-file
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: find-file
|
||||
# key: find-file
|
||||
# key: ff
|
||||
# --
|
||||
(find-file $0)
|
||||
6
snippets/emacs-lisp-mode/format
Normal file
6
snippets/emacs-lisp-mode/format
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: format
|
||||
# key: f
|
||||
# --
|
||||
(format "${1:message}" ${2:format-args})
|
||||
7
snippets/emacs-lisp-mode/forward-char
Normal file
7
snippets/emacs-lisp-mode/forward-char
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: forward-char
|
||||
# key: forward-char
|
||||
# key: fc
|
||||
# --
|
||||
(forward-char $0)
|
||||
7
snippets/emacs-lisp-mode/forward-line
Normal file
7
snippets/emacs-lisp-mode/forward-line
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: forward-line
|
||||
# key: forward-line
|
||||
# key: fl
|
||||
# --
|
||||
(forward-line $0)
|
||||
6
snippets/emacs-lisp-mode/get
Normal file
6
snippets/emacs-lisp-mode/get
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: get
|
||||
# key: get
|
||||
# --
|
||||
(get ${1:symbol} {2:propname})
|
||||
7
snippets/emacs-lisp-mode/global-set-key
Normal file
7
snippets/emacs-lisp-mode/global-set-key
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: global-set-key
|
||||
# key: global-set-key
|
||||
# key: gsk
|
||||
# --
|
||||
(global-set-key (kbd "${1:key}") $0)
|
||||
7
snippets/emacs-lisp-mode/goto-char
Normal file
7
snippets/emacs-lisp-mode/goto-char
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: goto-char
|
||||
# key: goto-char
|
||||
# key: gc
|
||||
# --
|
||||
(goto-char $0)
|
||||
5
snippets/emacs-lisp-mode/grabstring
Normal file
5
snippets/emacs-lisp-mode/grabstring
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: grab buffer substring
|
||||
# contributor : Xah Lee
|
||||
# --
|
||||
(setq $0 (buffer-substring-no-properties myStartPos myEndPos))
|
||||
6
snippets/emacs-lisp-mode/grabthing
Normal file
6
snippets/emacs-lisp-mode/grabthing
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: grab word under cursor
|
||||
# key: grabthing
|
||||
# contributor : Xah Lee
|
||||
# --
|
||||
(setq $0 (thing-at-point 'symbol))
|
||||
42
snippets/emacs-lisp-mode/header
Normal file
42
snippets/emacs-lisp-mode/header
Normal file
@@ -0,0 +1,42 @@
|
||||
# -*- mode: snippet; -*-
|
||||
# contributor: kchenphy <https://www.github.com/kchenphy>
|
||||
# name: package header
|
||||
# key: header
|
||||
# --
|
||||
;;; ${1:name}.el --- ${2:summary} -*- lexical-binding: t -*-
|
||||
|
||||
;; Author: ${3:`(user-full-name)`}
|
||||
;; Maintainer: ${4:`(user-full-name)`}
|
||||
;; Version: ${5:version}
|
||||
;; Package-Requires: (${6:dependencies})
|
||||
;; Homepage: ${7:homepage}
|
||||
;; Keywords: ${8:keywords}
|
||||
|
||||
${9:
|
||||
;; This file is not part of GNU Emacs
|
||||
|
||||
;; This program 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 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
}
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; ${10:commentary}
|
||||
|
||||
;;; Code:
|
||||
|
||||
${11:(message "Hello World!")}
|
||||
|
||||
(provide '$1)
|
||||
|
||||
;;; $1.el ends here
|
||||
7
snippets/emacs-lisp-mode/insert
Normal file
7
snippets/emacs-lisp-mode/insert
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: insert
|
||||
# key: insert
|
||||
# key: i
|
||||
# --
|
||||
(insert $0)
|
||||
7
snippets/emacs-lisp-mode/insert-file-contents
Normal file
7
snippets/emacs-lisp-mode/insert-file-contents
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: insert-file-contents
|
||||
# key: insert-file-contents
|
||||
# key: ifc
|
||||
# --
|
||||
(insert-file-contents ${1:filename}${2: visit}${3: beg}${4: end}${5: replace})
|
||||
6
snippets/emacs-lisp-mode/interactive
Normal file
6
snippets/emacs-lisp-mode/interactive
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: interactive
|
||||
# key: interactive
|
||||
# --
|
||||
(interactive${1: "${2:P}"})
|
||||
6
snippets/emacs-lisp-mode/kbd
Normal file
6
snippets/emacs-lisp-mode/kbd
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: kbd
|
||||
# key: kbd
|
||||
# --
|
||||
(kbd "$0")
|
||||
7
snippets/emacs-lisp-mode/kill-buffer
Normal file
7
snippets/emacs-lisp-mode/kill-buffer
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: kill-buffer
|
||||
# key: kill-buffer
|
||||
# key: kb
|
||||
# --
|
||||
(kill-buffer $0)
|
||||
6
snippets/emacs-lisp-mode/lambda
Normal file
6
snippets/emacs-lisp-mode/lambda
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet; -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: lambda
|
||||
# key: lam
|
||||
# --
|
||||
(lambda ($1) ${2:(interactive${3: "$4"}) }$0)
|
||||
8
snippets/emacs-lisp-mode/let
Normal file
8
snippets/emacs-lisp-mode/let
Normal file
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: let
|
||||
# key: let
|
||||
# key: l
|
||||
# --
|
||||
(let${1:*} (${2:args})
|
||||
$0)
|
||||
7
snippets/emacs-lisp-mode/line-beginning-position
Normal file
7
snippets/emacs-lisp-mode/line-beginning-position
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: line-beginning-position
|
||||
# key: line-beginning-position
|
||||
# key: lbp
|
||||
# --
|
||||
(line-beginning-position)
|
||||
7
snippets/emacs-lisp-mode/line-end-position
Normal file
7
snippets/emacs-lisp-mode/line-end-position
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: line-end-position
|
||||
# key: line-end-position
|
||||
# key: lep
|
||||
# --
|
||||
(line-end-position)
|
||||
7
snippets/emacs-lisp-mode/looking-at
Normal file
7
snippets/emacs-lisp-mode/looking-at
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: looking-at
|
||||
# key: looking-at
|
||||
# key: la
|
||||
# --
|
||||
(looking-at $0)
|
||||
7
snippets/emacs-lisp-mode/make-directory
Normal file
7
snippets/emacs-lisp-mode/make-directory
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: make-directory
|
||||
# key: make-directory
|
||||
# key: md
|
||||
# --
|
||||
(make-directory ${1:directory}${2: parents})
|
||||
7
snippets/emacs-lisp-mode/make-local-variable
Normal file
7
snippets/emacs-lisp-mode/make-local-variable
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: make-local-variable
|
||||
# key: make-local-variable
|
||||
# key: mlv
|
||||
# --
|
||||
(make-local-variable $0)
|
||||
6
snippets/emacs-lisp-mode/mapc
Normal file
6
snippets/emacs-lisp-mode/mapc
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: mapc
|
||||
# key: mapc
|
||||
# --
|
||||
(mapc ${1:function} $0)
|
||||
7
snippets/emacs-lisp-mode/match-beginning
Normal file
7
snippets/emacs-lisp-mode/match-beginning
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: match-beginning
|
||||
# key: match-beginning
|
||||
# key: mb
|
||||
# --
|
||||
(match-beginning $0)
|
||||
7
snippets/emacs-lisp-mode/match-end
Normal file
7
snippets/emacs-lisp-mode/match-end
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: match-end
|
||||
# key: match-end
|
||||
# key: me
|
||||
# --
|
||||
(match-end $0)
|
||||
7
snippets/emacs-lisp-mode/match-string
Normal file
7
snippets/emacs-lisp-mode/match-string
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: match-string
|
||||
# key: match-string
|
||||
# key: ms
|
||||
# --
|
||||
(match-string $0)
|
||||
6
snippets/emacs-lisp-mode/memq
Normal file
6
snippets/emacs-lisp-mode/memq
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: memq
|
||||
# key: memq
|
||||
# --
|
||||
(memq ${1:element} ${2:list})
|
||||
7
snippets/emacs-lisp-mode/message
Normal file
7
snippets/emacs-lisp-mode/message
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: message
|
||||
# key: message
|
||||
# key: m
|
||||
# --
|
||||
(message "${1:message}"${2: format-args})
|
||||
20
snippets/emacs-lisp-mode/minor_mode
Normal file
20
snippets/emacs-lisp-mode/minor_mode
Normal file
@@ -0,0 +1,20 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: minor_mode
|
||||
# key: minor
|
||||
# --
|
||||
(defvar ${1:mode}-modeline-indicator " ${2:indicator}"
|
||||
"call ($1-install-mode) again if this is changed")
|
||||
|
||||
(defvar $1-mode nil)
|
||||
(make-variable-buffer-local '$1-mode)
|
||||
(put '$1-mode 'permanent-local t)
|
||||
|
||||
(defun $1-mode (&optional arg)
|
||||
"$0"
|
||||
(interactive "P")
|
||||
(setq $1-mode
|
||||
(if (null arg) (not $1-mode)
|
||||
(> (prefix-numeric-value arg) 0)))
|
||||
(force-mode-line-update))
|
||||
|
||||
(provide '$1-mode)
|
||||
7
snippets/emacs-lisp-mode/not
Normal file
7
snippets/emacs-lisp-mode/not
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: not
|
||||
# key: not
|
||||
# key: n
|
||||
# --
|
||||
(not $0)
|
||||
6
snippets/emacs-lisp-mode/nth
Normal file
6
snippets/emacs-lisp-mode/nth
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: nth
|
||||
# key: nth
|
||||
# --
|
||||
(nth ${1:index} ${2:list})
|
||||
7
snippets/emacs-lisp-mode/number-to-string
Normal file
7
snippets/emacs-lisp-mode/number-to-string
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: number-to-string
|
||||
# key: number-to-string
|
||||
# key: nts
|
||||
# --
|
||||
(number-to-string $0)
|
||||
7
snippets/emacs-lisp-mode/or
Normal file
7
snippets/emacs-lisp-mode/or
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: or
|
||||
# key: or
|
||||
# key: o
|
||||
# --
|
||||
(or $0)
|
||||
7
snippets/emacs-lisp-mode/point
Normal file
7
snippets/emacs-lisp-mode/point
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: point
|
||||
# key: point
|
||||
# key: p
|
||||
# --
|
||||
(point)
|
||||
6
snippets/emacs-lisp-mode/point-max
Normal file
6
snippets/emacs-lisp-mode/point-max
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: point-max
|
||||
# key: point-max
|
||||
# --
|
||||
(point-max)
|
||||
7
snippets/emacs-lisp-mode/point-min
Normal file
7
snippets/emacs-lisp-mode/point-min
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: point-min
|
||||
# key: point-min
|
||||
# key: pm
|
||||
# --
|
||||
(point-min)
|
||||
6
snippets/emacs-lisp-mode/put
Normal file
6
snippets/emacs-lisp-mode/put
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: put
|
||||
# key: put
|
||||
# --
|
||||
(put ${1:symbol} ${2:propname} ${3:value})
|
||||
7
snippets/emacs-lisp-mode/re-search-backward
Normal file
7
snippets/emacs-lisp-mode/re-search-backward
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: re-search-backward
|
||||
# key: re-search-backward
|
||||
# key: rsb
|
||||
# --
|
||||
(re-search-backward ${1:regexp}${2: bound}${3: noerror}${4: count})
|
||||
7
snippets/emacs-lisp-mode/re-search-forward
Normal file
7
snippets/emacs-lisp-mode/re-search-forward
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: re-search-forward
|
||||
# key: re-search-forward
|
||||
# key: rsf
|
||||
# --
|
||||
(re-search-forward ${1:regexp}${2: bound}${3: noerror}${4: count})
|
||||
7
snippets/emacs-lisp-mode/region-active-p
Normal file
7
snippets/emacs-lisp-mode/region-active-p
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: region-active-p
|
||||
# key: region-active-p
|
||||
# key: rap
|
||||
# --
|
||||
(region-active-p)
|
||||
7
snippets/emacs-lisp-mode/region-beginning
Normal file
7
snippets/emacs-lisp-mode/region-beginning
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: region-beginning
|
||||
# key: region-beginning
|
||||
# key: rb
|
||||
# --
|
||||
(region-beginning)
|
||||
7
snippets/emacs-lisp-mode/region-end
Normal file
7
snippets/emacs-lisp-mode/region-end
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: region-end
|
||||
# key: region-end
|
||||
# key: re
|
||||
# --
|
||||
(region-end)
|
||||
7
snippets/emacs-lisp-mode/rename-file
Normal file
7
snippets/emacs-lisp-mode/rename-file
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: rename-file
|
||||
# key: rename-file
|
||||
# key: rf
|
||||
# --
|
||||
(rename-file ${1:file} ${2:newname}${3: ok-if-already-exists})
|
||||
7
snippets/emacs-lisp-mode/replace-regexp
Normal file
7
snippets/emacs-lisp-mode/replace-regexp
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: replace-regexp
|
||||
# key: replace-regexp
|
||||
# key: rr
|
||||
# --
|
||||
(replace-regexp ${1:regexp}${2: delimited}${3: start}${4: end})
|
||||
7
snippets/emacs-lisp-mode/replace-regexp-in-string
Normal file
7
snippets/emacs-lisp-mode/replace-regexp-in-string
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: replace-regexp-in-string
|
||||
# key: replace-regexp-in-string
|
||||
# key: rris
|
||||
# --
|
||||
(replace-regexp-in-string ${1:regexp} ${2:rep} ${3:string}${4: fixedcase}${5: literal}${6: subexp}${7: start})
|
||||
7
snippets/emacs-lisp-mode/save-buffer
Normal file
7
snippets/emacs-lisp-mode/save-buffer
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: save-buffer
|
||||
# key: save-buffer
|
||||
# key: sb
|
||||
# --
|
||||
(save-buffer $0)
|
||||
7
snippets/emacs-lisp-mode/save-excursion
Normal file
7
snippets/emacs-lisp-mode/save-excursion
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: save-excursion
|
||||
# key: save-excursion
|
||||
# key: se
|
||||
# --
|
||||
(save-excursion $0)
|
||||
7
snippets/emacs-lisp-mode/search-backward
Normal file
7
snippets/emacs-lisp-mode/search-backward
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet; -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: search-backward
|
||||
# key: search-backward
|
||||
# key: sb
|
||||
# --
|
||||
(search-backward "$1"${2: ${3:bound}${4: ${5:noerror}${6: count}}})$0
|
||||
7
snippets/emacs-lisp-mode/search-backward-regexp
Normal file
7
snippets/emacs-lisp-mode/search-backward-regexp
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet; -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: search-backward-regexp
|
||||
# key: search-backward-regexp
|
||||
# key: sbr
|
||||
# --
|
||||
(search-backward-regexp "$1"${2: ${3:bound}${4: ${5:noerror}${6: count}}})$0
|
||||
7
snippets/emacs-lisp-mode/search-forward
Normal file
7
snippets/emacs-lisp-mode/search-forward
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet; -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: search-forward
|
||||
# key: search-forward
|
||||
# key: sf
|
||||
# --
|
||||
(search-forward "$1"${2: ${3:bound}${4: ${5:noerror}${6: count}}})$0
|
||||
7
snippets/emacs-lisp-mode/search-forward-regexp
Normal file
7
snippets/emacs-lisp-mode/search-forward-regexp
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet; -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: search-forward-regexp
|
||||
# key: search-forward-regexp
|
||||
# key: sfr
|
||||
# --
|
||||
(search-forward-regexp "$1"${2: ${3:bound}${4: ${5:noerror}${6: count}}})$0
|
||||
7
snippets/emacs-lisp-mode/set-buffer
Normal file
7
snippets/emacs-lisp-mode/set-buffer
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: set-buffer
|
||||
# key: set-buffer
|
||||
# key: sb
|
||||
# --
|
||||
(set-buffer $0)
|
||||
7
snippets/emacs-lisp-mode/set-file-modes
Normal file
7
snippets/emacs-lisp-mode/set-file-modes
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: set-file-modes
|
||||
# key: set-file-modes
|
||||
# key: sfm
|
||||
# --
|
||||
(set-file-modes ${1:filename} $0)
|
||||
7
snippets/emacs-lisp-mode/set-mark
Normal file
7
snippets/emacs-lisp-mode/set-mark
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: set-mark
|
||||
# key: set-mark
|
||||
# key: sm
|
||||
# --
|
||||
(set-mark $0)
|
||||
7
snippets/emacs-lisp-mode/setq
Normal file
7
snippets/emacs-lisp-mode/setq
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Xah Lee (XahLee.org)
|
||||
# name: setq
|
||||
# key: setq
|
||||
# key: s
|
||||
# --
|
||||
(setq $0)
|
||||
6
snippets/emacs-lisp-mode/should
Normal file
6
snippets/emacs-lisp-mode/should
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Raghav Kumar Gautam
|
||||
# name: should
|
||||
# key: sh
|
||||
# --
|
||||
(should $0)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user