Install yasnippet and vala-snippets packages

This commit is contained in:
Gergely Polonkai
2016-10-20 10:20:38 +02:00
parent d1468f35a7
commit a498706564
1085 changed files with 12052 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
-*- coding: utf-8 -*-
Originally started by Xah Lee (xahlee.org) on 2009-02-22
Released under GPL 3.
Feel free to add missing ones or modify existing ones to improve.
Those starting with “x-” are supposed to be idiom templates. Not sure it's very useful. They might start with “i-” or "id-" in the future.

View 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

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: and
#key: and
#key: a
# --
(and $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: append
#key: append
# --
(append $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: apply
#key: apply
# --
(apply $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: aref
#key: aref
# --
(aref ${1:array} {2:index})

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: aset
#key: aset
# --
(aset ${1:array} ${2:index} ${3:element})

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: assq
#key: assq
# --
(assq ${1:key} ${2:list})

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: autoload
#key: autoload
# --
(autoload ${1:function} "${2:filename}"${3: "docstring"}${4: interactive}${5: type})

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: backward-char
#key: backward-char
#key: bc
# --
(backward-char $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: beginning-of-line
#key: beginning-of-line
#key: bol
# --
(beginning-of-line)

View File

@@ -0,0 +1,6 @@
#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)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: buffer-file-name
#key: buffer-file-name
#key: bfn
# --
(buffer-file-name)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: buffer-modified-p
#key: buffer-modified-p
#key: bmp
# --
(buffer-modified-p $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: buffer-substring
#key: buffer-substring
#key: bs
# --
(buffer-substring ${1:start} ${2:end})

View File

@@ -0,0 +1,6 @@
#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})

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: car
#key: car
# --
(car $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: cdr
#key: cdr
# --
(cdr $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: concat
#key: concat
# --
(concat $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: cond
#key: cond
# --
(cond
(${1:condition} ${2:body})$0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: condition-case
#key: condition-case
#key: cc
# --
(condition-case $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: cons
#key: cons
# --
(cons $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: consp
#key: consp
# --
(consp $0)

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: defconst
# key: const
# --
(defconst ${1:name} ${2:value}${3: "${4:docstring}"})$0

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: copy-directory
#key: copy-directory
#key: cd
# --
(copy-directory ${1:directory} {2:target}${3: keep-time}${4: parents})

View File

@@ -0,0 +1,6 @@
#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})

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: current-buffer
#key: current-buffer
#key: cb
# --
(current-buffer)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: custom-autoload
#key: custom-autoload
#key: ca
# --
(custom-autoload ${1:symbol} ${2:load}${3: noset})

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: defalias
#key: defalias
# --
(defalias '${1:symbol} '${2:alias}${3: "docstring"})

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: defcustom
#key: defcustom
# --
(defcustom ${1:symbol} ${2:standard} "${3:docstring}"${4: args})

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: define-key
#key: define-key
#key: dk
# --
(define-key ${1:mode}-map (kbd "${2:key}") $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: defsubst
#key: defsubst
# --
(defsubst $0)

View File

@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: defun
# key: def
# --
(defun ${1:fun} (${2:args})
"${3:docstring}"
${4:(interactive${5: "${6:P}"})}
$0)

View File

@@ -0,0 +1,4 @@
#name: defvar
#key: defvar
# --
(defvar ${1:symbol}${2: initvalue}${3: "docstring"})

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: delete-char
#key: delete-char
#key: dc
# --
(delete-char $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: delete-directory
#key: delete-directory
#key: dd
# --
(delete-directory ${1:dicretory}${2: recursive})

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: delete-file
#key: delete-file
#key: df
# --
(delete-file $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: delete-region
#key: delete-region
#key: dr
# --
(delete-region $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: directory-files
#key: directory-files
#key: df
# --
(directory-files ${1:directory}${2: full}${3: match}${4: nosort})

View File

@@ -0,0 +1,16 @@
#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

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: dolist
#key: dolist
# --
(dolist $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: end-of-line
#key: end-of-line
#key: eol
# --
(end-of-line)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: eq
#key: eq
# --
(eq $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: equal
#key: equal
# --
(equal $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: error
#key: error
# --
(error "${1:message}"${2: format-args})

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
#contributor: Raghav Kumar Gautam
#name: ert-deftest
#key: edt
# --
(ert-deftest ${1:test-name} ()
$0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: expand-file-name
#key: expand-file-name
#key: efn
# --
(expand-file-name $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: fboundp
#key: fboundp
# --
(fboundp '$0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: file-name-directory
#key: file-name-directory
#key: fnd
# --
(file-name-directory $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: file-name-extension
#key: file-name-extension
#key: fne
# --
(file-name-extension ${1:filename}${2: period})

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: file-name-nondirectory
#key: file-name-nondirectory
#key: fnn
# --
(file-name-nondirectory $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: file-name-sans-extension
#key: file-name-sans-extension
#key: fnse
# --
(file-name-sans-extension $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: file-relative-name
#key: file-relative-name
#key: frn
# --
(file-relative-name $0)

View File

@@ -0,0 +1,17 @@
#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")))

View File

@@ -0,0 +1,17 @@
#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")
)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: find-file
#key: find-file
#key: ff
# --
(find-file $0)

View File

@@ -0,0 +1,17 @@
#name : find and replace on region
#contributor : Xah Lee
# --
(defun replace-html-chars-region (start end)
"Replace “<” to “&lt;” and other chars in HTML.
This works on the current region."
(interactive "r")
(save-restriction
(narrow-to-region start end)
(goto-char (point-min))
(while (search-forward "&" nil t) (replace-match "&amp;" nil t))
(goto-char (point-min))
(while (search-forward "<" nil t) (replace-match "&lt;" nil t))
(goto-char (point-min))
(while (search-forward ">" nil t) (replace-match "&gt;" nil t))
)
)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: format
#key: f
# --
(format "${1:message}" ${2:format-args})

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: forward-char
#key: forward-char
#key: fc
# --
(forward-char $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: forward-line
#key: forward-line
#key: fl
# --
(forward-line $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: funcall
#key: funcall
# --
(funcall $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: function
#key: function
# --
(function $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: get
#key: get
# --
(get ${1:symbol} {2:propname})

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: global-set-key
#key: global-set-key
#key: gsk
# --
(global-set-key (kbd "${1:key}") $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: goto-char
#key: goto-char
#key: gc
# --
(goto-char $0)

View File

@@ -0,0 +1,4 @@
#name : grab buffer substring
#contributor : Xah Lee
# --
(setq $0 (buffer-substring-no-properties myStartPos myEndPos))

View File

@@ -0,0 +1,4 @@
#name : grab word under cursor
#contributor : Xah Lee
# --
(setq $0 (thing-at-point 'symbol))

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: hash
# key: hash
# --
(make-hash-table $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: if
#key: if
# --
(if $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: insert
#key: insert
#key: i
# --
(insert $0)

View File

@@ -0,0 +1,6 @@
#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})

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: interactive
#key: interactive
# --
(interactive${1: "${2:P}"})

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: kbd
#key: kbd
# --
(kbd "$0")

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: kill-buffer
#key: kill-buffer
#key: kb
# --
(kill-buffer $0)

View File

@@ -0,0 +1,6 @@
# -*- mode: snippet; -*-
#contributor: Xah Lee (XahLee.org)
#name: lambda
#key: lam
# --
(lambda ($1) ${2:(interactive${3: "$4"}) }$0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: length
#key: length
# --
(length $0)

View File

@@ -0,0 +1,7 @@
#contributor: Xah Lee (XahLee.org)
#name: let
#key: let
#key: l
# --
(let${1:*} (${2:args})
$0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: line-beginning-position
#key: line-beginning-position
#key: lbp
# --
(line-beginning-position)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: line-end-position
#key: line-end-position
#key: lep
# --
(line-end-position)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: list
#key: list
# --
(list $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: looking-at
#key: looking-at
#key: la
# --
(looking-at $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: make-directory
#key: make-directory
#key: md
# --
(make-directory ${1:directory}${2: parents})

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: make-local-variable
#key: make-local-variable
#key: mlv
# --
(make-local-variable $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: mapc
#key: mapc
# --
(mapc ${1:function} $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: mapcar
#key: mapcar
# --
(mapcar $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: match-beginning
#key: match-beginning
#key: mb
# --
(match-beginning $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: match-end
#key: match-end
#key: me
# --
(match-end $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: match-string
#key: match-string
#key: ms
# --
(match-string $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: memq
#key: memq
# --
(memq ${1:element} ${2:list})

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: message
#key: message
#key: m
# --
(message "${1:message}"${2: format-args})

View 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)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: not
#key: not
#key: n
# --
(not $0)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: nth
#key: nth
# --
(nth ${1:index} ${2:list})

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: null
#key: null
# --
(null $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: number-to-string
#key: number-to-string
#key: nts
# --
(number-to-string $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: or
#key: or
#key: o
# --
(or $0)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: point
#key: point
#key: p
# --
(point)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: point-max
#key: point-max
# --
(point-max)

View File

@@ -0,0 +1,6 @@
#contributor: Xah Lee (XahLee.org)
#name: point-min
#key: point-min
#key: pm
# --
(point-min)

View File

@@ -0,0 +1,5 @@
#contributor: Xah Lee (XahLee.org)
#name: princ
#key: princ
# --
(princ $0)

Some files were not shown because too many files have changed in this diff Show More