Emacs: updated yasnippet, worked out snippets.

master
Ambrevar 2012-08-15 14:21:25 +01:00
parent 553eb26eb1
commit 1bfaf59a20
97 changed files with 189 additions and 144 deletions

View File

@ -6,12 +6,9 @@ emacs-mediawiki-bzr
emacs-yasnippet emacs-yasnippet
fortune-mod-tbbt fortune-mod-tbbt
grub grub
gsharkdown
handbrake-cli-svn handbrake-cli-svn
handbrake-svn handbrake-svn
mongoose
movgrab movgrab
openmw-git
package-query package-query
pacman-color pacman-color
rxvt-unicode-patched rxvt-unicode-patched

View File

@ -18,6 +18,7 @@ bustle
bzip2 bzip2
calc calc
catdvi catdvi
clementine
cmus cmus
coreutils coreutils
cpufrequtils cpufrequtils
@ -54,7 +55,6 @@ fortune-mod
fortune-mod-tbbt fortune-mod-tbbt
gawk gawk
gcc gcc
gcc-go
gcc-libs gcc-libs
gcolor2 gcolor2
gdb gdb
@ -62,21 +62,17 @@ gettext
gimp gimp
git git
glibc glibc
gnuchess
gnu-netcat gnu-netcat
gnuplot gnuplot
go
grep grep
grub grub
gsasl gsasl
gsharkdown gstreamer0.10-ugly-plugins
gtk3
gzip gzip
handbrake-cli-svn handbrake-cli-svn
handbrake-svn handbrake-svn
hdparm hdparm
heirloom-mailx heirloom-mailx
help2man
highlight highlight
hplip hplip
htop htop
@ -87,21 +83,15 @@ initscripts
inkscape inkscape
iptables iptables
iputils iputils
irssi
ispell ispell
jansson
jfsutils jfsutils
js
less less
libmicrohttpd libmicrohttpd
libtool libtool
licenses licenses
lighttpd
links
linux linux
linux-lts linux-lts
logrotate logrotate
ltrace
luakit luakit
lvm2 lvm2
m4 m4
@ -111,9 +101,6 @@ man-pages
mdadm mdadm
mediainfo mediainfo
mencoder mencoder
mercurial
mesa-demos
mongoose
movgrab movgrab
mplayer2 mplayer2
mtools mtools
@ -124,7 +111,6 @@ net-tools
nmap nmap
ntfs-3g ntfs-3g
numlockx numlockx
openmw-git
openssh openssh
p7zip p7zip
package-query package-query
@ -154,7 +140,6 @@ sed
shadow shadow
slock slock
splint splint
strace
sudo sudo
sxiv sxiv
sysfsutils sysfsutils
@ -163,11 +148,8 @@ sysvinit
tar tar
task task
tcc tcc
tcpdump
texi2html
texinfo texinfo
texlive-dummy texlive-dummy
tig
trash-cli trash-cli
tree tree
unrar unrar
@ -180,15 +162,11 @@ util-linux
valgrind valgrind
vi vi
vicious vicious
vim
vlock vlock
w3m w3m
weechat
wget wget
which which
wireless_tools wireless_tools
wireshark-cli
wireshark-gtk
wpa_supplicant wpa_supplicant
wv wv
xf86-input-synaptics xf86-input-synaptics

View File

@ -25,8 +25,6 @@ bash
bc bc
binutils binutils
bison bison
boost-libs
bullet
bzip2 bzip2
ca-certificates ca-certificates
cairo cairo
@ -35,6 +33,7 @@ calc
catdvi catdvi
cdparanoia cdparanoia
cifs-utils cifs-utils
clementine
cloog cloog
cmus cmus
colord colord
@ -55,6 +54,7 @@ db
dbus dbus
dbus-core dbus-core
dbus-glib dbus-glib
dconf
desktop-file-utils desktop-file-utils
device-mapper device-mapper
d-feet d-feet
@ -71,7 +71,6 @@ dri2proto
dtach dtach
e2fsprogs e2fsprogs
eject eject
elfutils
emacs-lua-mode emacs-lua-mode
emacs-nox emacs-nox
enca enca
@ -102,14 +101,12 @@ foomatic-db-engine
foomatic-filters foomatic-filters
fortune-mod fortune-mod
freeglut freeglut
freeimage
freetype2 freetype2
fribidi fribidi
fuse fuse
gawk gawk
gc gc
gcc gcc
gcc-go
gcc-libs gcc-libs
gcolor2 gcolor2
gd gd
@ -133,12 +130,10 @@ glibmm
glib-networking glib-networking
glproto glproto
gmp gmp
gnuchess
gnu-netcat gnu-netcat
gnupg gnupg
gnuplot gnuplot
gnutls gnutls
go
gpgme gpgme
gpm gpm
grep grep
@ -154,16 +149,16 @@ gstreamer0.10-bad-plugins
gstreamer0.10-base gstreamer0.10-base
gstreamer0.10-ffmpeg gstreamer0.10-ffmpeg
gstreamer0.10-good gstreamer0.10-good
gstreamer0.10-python gstreamer0.10-ugly
gstreamer0.10-ugly-plugins
gtk2 gtk2
gtk3
gtkmm gtkmm
gtkspell gtkspell
gtk-update-icon-cache gtk-update-icon-cache
gvfs
gzip gzip
hdparm hdparm
heirloom-mailx heirloom-mailx
help2man
hicolor-icon-theme hicolor-icon-theme
highlight highlight
hplip hplip
@ -185,14 +180,11 @@ intel-dri
iproute2 iproute2
iptables iptables
iputils iputils
irssi
isl isl
ispell ispell
jack jack
jansson
jasper jasper
jfsutils jfsutils
js
json-c json-c
kbd kbd
kbproto kbproto
@ -242,8 +234,10 @@ libgl
libglade libglade
libglapi libglapi
libgme libgme
libgnome-keyring
libgpg-error libgpg-error
libgphoto2 libgphoto2
libgpod
libgsf libgsf
libgssglue libgssglue
libgusb libgusb
@ -251,9 +245,11 @@ libice
libid3tag libid3tag
libidn libidn
libieee1284 libieee1284
libimobiledevice
libirman libirman
libjpeg-turbo libjpeg-turbo
libksba libksba
liblastfm
libldap libldap
liblqr liblqr
liblrdf liblrdf
@ -267,6 +263,8 @@ libmodplug
libmp4v2 libmp4v2
libmpc libmpc
libmpcdec libmpcdec
libmpeg2
libmtp
libnice libnice
libnl libnl
libnotify libnotify
@ -275,6 +273,7 @@ libogg
libpcap libpcap
libpciaccess libpciaccess
libpipeline libpipeline
libplist
libpng libpng
libproxy libproxy
libpulse libpulse
@ -283,10 +282,12 @@ libraw1394
librsvg librsvg
libsamplerate libsamplerate
libsasl libsasl
libsidplay
libsigc++ libsigc++
libsm libsm
libsndfile libsndfile
libsoup libsoup
libsoup-gnome
libspectre libspectre
libssh2 libssh2
libsystemd libsystemd
@ -338,8 +339,6 @@ libxxf86dga
libxxf86vm libxxf86vm
libzen libzen
licenses licenses
lighttpd
links
linux linux
linux-api-headers linux-api-headers
linux-firmware linux-firmware
@ -347,7 +346,6 @@ linux-lts
lirc-utils lirc-utils
logrotate logrotate
lsof lsof
ltrace
lua lua
luafilesystem luafilesystem
luajit luajit
@ -361,9 +359,7 @@ mcpp
mdadm mdadm
mediainfo mediainfo
mencoder mencoder
mercurial
mesa mesa
mesa-demos
mime-types mime-types
mjpegtools mjpegtools
mkinitcpio mkinitcpio
@ -375,8 +371,8 @@ mplayer2
mtdev mtdev
mtools mtools
musicbrainz musicbrainz
mutagen
mutt mutt
mygui
nasm nasm
ncdu ncdu
ncurses ncurses
@ -389,13 +385,8 @@ nspr
nss nss
ntfs-3g ntfs-3g
numlockx numlockx
nvidia-cg-toolkit
ogre
ois
openal
opencore-amr opencore-amr
openjpeg openjpeg
openslp
openssh openssh
openssl openssl
orc orc
@ -415,7 +406,6 @@ pcmciautils
pcre pcre
perl perl
perl-error perl-error
perl-locale-gettext
pidgin pidgin
pinentry pinentry
pixman pixman
@ -429,6 +419,7 @@ popt
ppl ppl
ppp ppp
procps-ng procps-ng
protobuf
psmisc psmisc
pth pth
pwsafe pwsafe
@ -441,10 +432,11 @@ python2-dbus
python2-distribute python2-distribute
python2-gobject2 python2-gobject2
python2-udiskie python2-udiskie
python-configobj
python-dbus-common python-dbus-common
python-notify python-notify
python-pycurl qca
qca-ossl
qjson
qt qt
randrproto randrproto
ranger ranger
@ -476,29 +468,28 @@ speex
splint splint
sqlite sqlite
startup-notification startup-notification
strace
sudo sudo
sxiv sxiv
sysfsutils sysfsutils
syslog-ng syslog-ng
systemd-tools systemd-tools
sysvinit sysvinit
taglib
talloc talloc
tar tar
task task
tcc tcc
tcpdump
tdb tdb
texi2html
texinfo texinfo
tig
tree tree
ttf-dejavu ttf-dejavu
tzdata tzdata
udisks udisks
udisks2
unrar unrar
unzip unzip
upx upx
usbmuxd
usbutils usbutils
util-linux util-linux
v4l-utils v4l-utils
@ -506,17 +497,12 @@ valgrind
vi vi
vicious vicious
videoproto videoproto
vim
vim-runtime
vlock vlock
w3m w3m
weechat
wget wget
which which
wildmidi wildmidi
wireless_tools wireless_tools
wireshark-cli
wireshark-gtk
wpa_supplicant wpa_supplicant
wv wv
wxgtk wxgtk
@ -570,4 +556,3 @@ zathura-ps
zip zip
zlib zlib
zsh zsh
zziplib

View File

@ -49,7 +49,7 @@ set mixer.pulse.restore_volume=1
set output_plugin=alsa set output_plugin=alsa
set passwd= set passwd=
set pl_sort= set pl_sort=
set play_library=true set play_library=false
set play_sorted=false set play_sorted=false
set repeat=false set repeat=false
set repeat_current=false set repeat_current=false

19
.emacs
View File

@ -281,6 +281,11 @@ browse-url-browser-function 'browse-url-generic)
(let ((fill-column (point-max))) (let ((fill-column (point-max)))
(fill-region (region-beginning) (region-end) nil))) (fill-region (region-beginning) (region-end) nil)))
(defun remove-duplicates ()
(interactive)
((shell-command (echo blah)))
)
;;============================================================================== ;;==============================================================================
;; Duplicate line ;; Duplicate line
;;============================================================================== ;;==============================================================================
@ -503,16 +508,20 @@ the line."
;; (require 'yasnippet-bundle) ;; (require 'yasnippet-bundle)
;; Next follows a traditional, yet not-optimized configuration for Yasnippet. ;; Next follows a traditional, yet not-optimized configuration for Yasnippet.
(add-to-list 'load-path "/usr/share/emacs/site-lisp/yas") ;; (add-to-list 'load-path "/usr/share/emacs/site-lisp/yas")
(require 'yasnippet) ;; not yasnippet-bundle (require 'yasnippet) ;; not yasnippet-bundle
(yas/initialize) (yas-global-mode 1)
;; (yas/initialize)
(setq yas-snippet-dirs "~/.emacs.d/snippets" )
;; Personal snippets ;; Personal snippets
(setq yas/root-directory "~/.emacs.d/plugins/yas/snippets" ) ;; (setq yas/root-directory "~/.emacs.d/plugins/yas/snippets" )
;; Load the snippets ;; Load the snippets
; (yas/load-directory "~/.emacs.d/plugins/yas/snippets") ;; Warning: slow! ;; (yas/load-directory "~/.emacs.d/plugins/yas/snippets") ;; Warning: slow!
(yas/load-directory yas/root-directory) ;; (yas/load-directory yas/root-directory)
(yas-load-directory yas-snippet-dirs)
;;============================================================================== ;;==============================================================================
;; AucTeX ;; AucTeX

View File

@ -1,3 +0,0 @@
#name : FILE *fp = fopen(..., ...);
# --
FILE *${fp} = fopen(${"file"}, "${r}");

View File

@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# name : printf
# contributor : joaotavora
# --
printf ("${1:%s}\\n"${1:$(if (string-match "%" text) ", " "\);")
}$2${1:$(if (string-match "%" text) "\);" "")}

View File

@ -1,6 +0,0 @@
#name : do { ... } while (...)
# --
do
{
$0
} while (${1:condition});

View File

@ -1,6 +0,0 @@
#name : else { ... }
# --
else
{
$0
}

View File

@ -1,6 +0,0 @@
#name : if (...) { ... }
# --
if (${1:condition})
{
$0
}

View File

@ -1,3 +0,0 @@
#name : #include "..."
# --
#include "$1"

View File

@ -1,3 +0,0 @@
#name : #include <...>
# --
#include <$1>

View File

@ -1,6 +0,0 @@
#name : struct ... { ... }
# --
struct ${1:name}
{
$0
};

View File

@ -1,6 +0,0 @@
#name : while (...) { ... }
# --
while (${1:condition})
{
$0
}

View File

@ -1,5 +0,0 @@
#name : for i do done
# --
for i ; do
$0
done

View File

@ -0,0 +1 @@
cc-mode

View File

@ -0,0 +1,4 @@
# name: FILE *fp = fopen(..., ...);
# key: fopen
# --
FILE *${fp} = fopen(${"file"}, "${r}");

View File

@ -1,6 +1,7 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
# name : fprintf # name: fprintf
# contributor : joaotavora, ambrevar # contributor : joaotavora, ambrevar
# key: fprintf
# -- # --
fprintf ($1, "${2:%s}\\n"${2:$(if (string-match "%" text) ", " "\);") fprintf ($1, "${2:%s}\\n"${2:$(if (string-match "%" text) ", " "\);")
}$3${2:$(if (string-match "%" text) "\);" "")} }$3${2:$(if (string-match "%" text) "\);" "")}

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: printf
# contributor: joaotavora
# key: printf
# --
printf ("${1:%s}\\n"${1:$(if (string-match "%" text) "," "\);")
}$2${1:$(if (string-match "%" text) "\);" "")}

View File

@ -0,0 +1 @@
text-mode

View File

@ -0,0 +1,7 @@
# name: do { ... } while (...)
# key: do
# --
do
{
$0
} while (${1:condition});

View File

@ -0,0 +1,7 @@
# name: else { ... }
# key: else
# --
else
{
$0
}

View File

@ -1,4 +1,5 @@
#name : for (...; ...; ...) { ... } # name: for (...; ...; ...) { ... }
# key: for
# -- # --
for (${1:i = 0}; ${2:i < N}; ${3:i++}) for (${1:i = 0}; ${2:i < N}; ${3:i++})
{ {

View File

@ -0,0 +1,7 @@
# name: if (...) { ... }
# key: if
# --
if (${1:condition})
{
$0
}

View File

@ -0,0 +1,4 @@
# name: #include "..."
# key: inc
# --
#include "$1"

View File

@ -0,0 +1,4 @@
# name: #include <...>
# key: inc
# --
#include <$1>

View File

@ -1,4 +1,5 @@
#name: int main(argc, argv) { ... } # name: int main(argc, argv) { ... }
# key: main
# -- # --
int main(int argc, char** argv) int main(int argc, char** argv)
{ {

View File

@ -1,4 +1,5 @@
#name : #ifndef XXX; #define XXX; #endif # name: #ifndef XXX; #define XXX; #endif
# key: once
# -- # --
#ifndef ${1:_`(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`_H_} #ifndef ${1:_`(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`_H_}
#define $1 #define $1

View File

@ -0,0 +1,7 @@
# name: struct ... { ... }
# key: struct
# --
struct ${1:name}
{
$0
};

View File

@ -1,4 +1,5 @@
#name : switch (...) { ... } # name: switch (...) { ... }
# key: switch
# -- # --
switch ($1) switch ($1)
{ {

View File

@ -0,0 +1,7 @@
# name : while (...) { ... }
# key: while
# --
while (${1:condition})
{
$0
}

View File

@ -0,0 +1 @@
text-mode

View File

@ -1,6 +1,6 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com> # contributor : Mads D. Kristensen <madsdk@gmail.com>
# key : abs # key : abstract
# group: sections # group: sections
# name : \abstract # name : \abstract
# -- # --

View File

@ -2,7 +2,7 @@
# contributor: Mads D. Kristensen <madsdk@gmail.com> # contributor: Mads D. Kristensen <madsdk@gmail.com>
# contributor : Song Qiang <tsiangsung@gmail.com> # contributor : Song Qiang <tsiangsung@gmail.com>
# contributor : Pierre Neidhardt <ambrevar at gmail dot com> 2012-03-17 # contributor : Pierre Neidhardt <ambrevar at gmail dot com> 2012-03-17
# key: art # key: article
# group: skeleton # group: skeleton
# name: \documentclass{article} ... # name: \documentclass{article} ...
# -- # --

View File

@ -1,19 +1,19 @@
# -*- mode: snippet -*- # -*- mode: snippet -*-
# contributor : Pierre Neidhardt <ambrevar at gmail dot com> 2012-04-27 # contributor : Pierre Neidhardt <ambrevar at gmail dot com> 2012-04-27
# key: beam # key: beamer
# group: skeleton # group: skeleton
# name: \documentclass{beamer} ... # name: \documentclass{beamer} ...
# -- # --
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[xcolor=latex,svgnames,table]{beamer} \documentclass[xcolor=latex,svgnames,table]{beamer}
\usepackage[utf8]{inputenc} \usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} % \usepackage[T1]{fontenc}
% \usepackage{lmodern} % \usepackage{lmodern}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{${1:Title}} \title{${1:Title}}
\subtitle{${2:Subtitle}} \subtitle{${2:Subtitle}}
\author{${3:\textcolor{structure.fg!60!white}{\textrm{\textsc{P.~Neidhardt}}}}} \author{${3:\textcolor{structure.fg!60!white}{P.~Neidhardt}}}
\institute{\textcolor{sidebarSection}{${4:Institute}}} \institute{\textcolor{sidebarSection}{${4:Institute}}}
\let\latexbak\LaTeX \let\latexbak\LaTeX

View File

@ -0,0 +1 @@
text-mode

View File

@ -0,0 +1,6 @@
# name: for i do done
# key: for
# --
for i ; do
$0
done

View File

@ -1,4 +1,5 @@
#name : function # name: function
# key: fun
# -- # --
${1:function} () ${1:function} ()
{ {

View File

@ -0,0 +1,33 @@
# name: getopt
# key: getopt
# --
local missing_arg ()
{
echo "Missing argument."
echo "Use \$1 -h for help."
}
while getopts ":h" opt; do
case $opt in
h)
printhelp "\$0"
return 1
;;
?)
printhelp "\$0"
return 1
;;
:)
missing_arg \$0
return 1
;;
esac
done
shift $(($OPTIND - 1))
if [ $# -eq 0 ]; then
missing_arg \$0
return 1
fi
$0

View File

@ -0,0 +1,12 @@
# name: help
# key: help
# --
printhelp()
{
echo "Synopsis:"
echo -e " \$1 [-n] PACKAGES"
echo
echo "Usage:"
echo -e " -h:\t\tDisplay this help."
}
$0

View File

@ -1,4 +1,5 @@
#name : if then fi # name: if then fi
# key: if
# -- # --
if [ $1 ]; then if [ $1 ]; then
$0 $0

View File

@ -0,0 +1,6 @@
# name: while do done
# key: while
# --
while [ $1 ]; do
$0
done

View File

@ -0,0 +1,4 @@
# name: (user's email)
# key: email
# --
`(replace-regexp-in-string "@" "@NOSPAM." user-mail-address)`

View File

@ -0,0 +1,4 @@
# name: (current time)
# key: time
# --
`(current-time-string)`

1
.save
View File

@ -153,6 +153,7 @@ FILELIST=(${FILELIST[*]} ".conkyrc")
## Emacs ## Emacs
FILELIST=(${FILELIST[*]} ".emacs") FILELIST=(${FILELIST[*]} ".emacs")
FILELIST=(${FILELIST[*]} ".emacs.d/plugins") FILELIST=(${FILELIST[*]} ".emacs.d/plugins")
FILELIST=(${FILELIST[*]} ".emacs.d/snippets")
FILELIST=(${FILELIST[*]} ".emacs.d/abbrev_defs") FILELIST=(${FILELIST[*]} ".emacs.d/abbrev_defs")
## GnuPG ## GnuPG

View File

@ -635,6 +635,7 @@ if [ -d "/usr/local/texlive" ]; then
amscls \ amscls \
amsfonts \ amsfonts \
amsmath \ amsmath \
beamer \
bigfoot \ bigfoot \
colortbl \ colortbl \
easylist \ easylist \

View File

@ -17,21 +17,11 @@ numlockx on
udiskie & udiskie &
exec awesome exec awesome
# exec startkde
# [ -e /usr/bin/startlxde ] && exec ck-launch-session startlxde # exec ck-launch-session startlxde
# exec ck-launch-session dbus-launch wmfs2
# exec ck-launch-session dbus-launch wmfs
# exec ck-launch-session dbus-launch startkde
# exec ck-launch-session dbus-launch cinnamon
# exec ck-launch-session gnome-session # exec ck-launch-session gnome-session
## WMII
#exec wmii
#until wmii; do
# true
#done
##============================================================================== ##==============================================================================
## Wallpaper ## Wallpaper
##============================================================================== ##==============================================================================

4
README
View File

@ -188,9 +188,11 @@ inkscape
irssi irssi
lrzip lrzip
lshw lshw
ltrace
luakit luakit
mediainfo mediainfo
mencoder mencoder
mercurial
mkvtoolnix mkvtoolnix
movgrav movgrav
mplayer2 mplayer2
@ -226,7 +228,9 @@ sxiv
task task
tcc tcc
tcpdump tcpdump
texi2html
texlive texlive
tig
trash-cli trash-cli
tree tree
udiskie udiskie