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
fortune-mod-tbbt
grub
gsharkdown
handbrake-cli-svn
handbrake-svn
mongoose
movgrab
openmw-git
package-query
pacman-color
rxvt-unicode-patched

View File

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

View File

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

View File

@ -49,7 +49,7 @@ set mixer.pulse.restore_volume=1
set output_plugin=alsa
set passwd=
set pl_sort=
set play_library=true
set play_library=false
set play_sorted=false
set repeat=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)))
(fill-region (region-beginning) (region-end) nil)))
(defun remove-duplicates ()
(interactive)
((shell-command (echo blah)))
)
;;==============================================================================
;; Duplicate line
;;==============================================================================
@ -503,16 +508,20 @@ the line."
;; (require 'yasnippet-bundle)
;; 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
(yas/initialize)
(yas-global-mode 1)
;; (yas/initialize)
(setq yas-snippet-dirs "~/.emacs.d/snippets" )
;; Personal snippets
(setq yas/root-directory "~/.emacs.d/plugins/yas/snippets" )
;; (setq yas/root-directory "~/.emacs.d/plugins/yas/snippets" )
;; Load the snippets
; (yas/load-directory "~/.emacs.d/plugins/yas/snippets") ;; Warning: slow!
(yas/load-directory yas/root-directory)
;; (yas/load-directory "~/.emacs.d/plugins/yas/snippets") ;; Warning: slow!
;; (yas/load-directory yas/root-directory)
(yas-load-directory yas-snippet-dirs)
;;==============================================================================
;; 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 -*-
# name : fprintf
# name: fprintf
# contributor : joaotavora, ambrevar
# key: fprintf
# --
fprintf ($1, "${2:%s}\\n"${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++})
{

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

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_}
#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)
{

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 -*-
# contributor : Mads D. Kristensen <madsdk@gmail.com>
# key : abs
# key : abstract
# group: sections
# name : \abstract
# --

View File

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

View File

@ -1,19 +1,19 @@
# -*- mode: snippet -*-
# contributor : Pierre Neidhardt <ambrevar at gmail dot com> 2012-04-27
# key: beam
# key: beamer
# group: skeleton
# name: \documentclass{beamer} ...
# --
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[xcolor=latex,svgnames,table]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
% \usepackage[T1]{fontenc}
% \usepackage{lmodern}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{${1:Title}}
\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}}}
\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} ()
{

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
$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
FILELIST=(${FILELIST[*]} ".emacs")
FILELIST=(${FILELIST[*]} ".emacs.d/plugins")
FILELIST=(${FILELIST[*]} ".emacs.d/snippets")
FILELIST=(${FILELIST[*]} ".emacs.d/abbrev_defs")
## GnuPG

View File

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

View File

@ -17,21 +17,11 @@ numlockx on
udiskie &
exec awesome
# exec startkde
# [ -e /usr/bin/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 startlxde
# exec ck-launch-session gnome-session
## WMII
#exec wmii
#until wmii; do
# true
#done
##==============================================================================
## Wallpaper
##==============================================================================

4
README
View File

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