Emacs: comments, autocomplete removed.

Shell: TeXlive aliases and functions fixed.
master
Ambrevar 2012-08-01 14:45:33 +01:00
parent d951e22ad8
commit 83e02e9b65
8 changed files with 158 additions and 102 deletions

View File

@ -17,7 +17,6 @@ pacman-color
rxvt-unicode-patched
texlive-dummy
trash-cli
urlview
urxvt-clipboard
urxvt-keyboard-select
yaourt

View File

@ -5,6 +5,7 @@ antiword
asciidoc
aspell-en
aspell-fr
astyle
atool
auctex
auto-complete
@ -64,6 +65,7 @@ gettext
gimp
git
glibc
gnu-netcat
gnuplot
gparted
grep
@ -80,6 +82,7 @@ highlight
hplip
htop
hunspell-en
indent
inetutils
initscripts
inkscape
@ -89,8 +92,10 @@ irssi
ispell
jansson
jfsutils
js
laptop-mode-tools
less
libmicrohttpd
libtool
licenses
lighttpd
@ -109,6 +114,7 @@ man-pages
mdadm
mediainfo
mercurial
midori
movgrab
mplayer2
mtools
@ -132,6 +138,7 @@ pcmciautils
perl
pidgin
pkg-config
pkgstats
ppp
procps-ng
psmisc
@ -161,11 +168,11 @@ tcpdump
texi2html
texinfo
texlive-dummy
tig
trash-cli
tree
unrar
unzip
urlview
urxvt-clipboard
urxvt-keyboard-select
usbutils

View File

@ -11,6 +11,7 @@ asciidoc
aspell
aspell-en
aspell-fr
astyle
atk
atkmm
atool
@ -36,6 +37,7 @@ catdvi
cdparanoia
cloog
cmus
colord
compositeproto
coreutils
cpufrequtils
@ -127,6 +129,7 @@ glibmm
glib-networking
glproto
gmp
gnu-netcat
gnupg
gnuplot
gnutls
@ -167,6 +170,7 @@ iana-etc
icu
imagemagick
imlib2
indent
inetutils
initscripts
inkscape
@ -182,6 +186,7 @@ jack
jansson
jasper
jfsutils
js
json-c
kbd
kbproto
@ -232,11 +237,14 @@ libglade
libglapi
libgme
libgpg-error
libgphoto2
libgsf
libgssglue
libgusb
libice
libid3tag
libidn
libieee1284
libirman
libjpeg-turbo
libksba
@ -246,6 +254,7 @@ liblrdf
libltdl
libmad
libmediainfo
libmicrohttpd
libmms
libmng
libmodplug
@ -349,6 +358,7 @@ mdadm
mediainfo
mercurial
mesa
midori
mime-types
mjpegtools
mkinitcpio
@ -401,6 +411,7 @@ pidgin
pinentry
pixman
pkg-config
pkgstats
polkit
poppler
poppler-data
@ -438,6 +449,7 @@ rsync
rtmpdump
rtorrent
run-parts
sane
schroedinger
scrnsaverproto
scrot
@ -446,6 +458,7 @@ sdparm
sed
sg3_utils
shadow
shared-color-profiles
shared-mime-info
slock
soundtouch
@ -466,6 +479,7 @@ task
tcpdump
texi2html
texinfo
tig
tree
ttf-dejavu
tzdata

68
.emacs
View File

@ -147,6 +147,8 @@ browse-url-browser-function 'browse-url-generic)
("^--.*\\(\n.*\\)*" . font-lock-comment-face)
))
;; General purpose. Hightlight the following:
;; Digits, FIXME, TODO.
(mapcar
(lambda (mode)
(font-lock-add-keywords
@ -189,6 +191,7 @@ browse-url-browser-function 'browse-url-generic)
;; (set-face-foreground 'compilation-column-number "magenta")
;; )
;; Old/useless.
;; (set-face-background 'lazy-highlight "brightgreen" )
;; (set-face-background 'secondary-selection "SkyBlue4")
;; (set-face-background 'trailing-whitespace "red1")
@ -206,10 +209,10 @@ browse-url-browser-function 'browse-url-generic)
;(define-key minibuffer-local-map (kbd "C-<tab>") 'dabbrev-expand)
;;==============================================================================
;; Automode default modification
;; Automode (Mode recognition)
;;==============================================================================
;; rc support
;; rc files support
(setq auto-mode-alist
(append
'(("rc\\'" . sh-mode)
@ -218,7 +221,7 @@ browse-url-browser-function 'browse-url-generic)
)
;; Shell support
;; We do not put 'sh' only because it could get messy.
;; We do not put 'sh' only because it could get messy. Emacs knows it anyway.
(setq auto-mode-alist
(append
'(("\\(bash\\'\\|zsh\\'\\|csh\\'\\|tcsh\\'\\|ksh\\'\\)" . sh-mode)
@ -369,7 +372,7 @@ the line."
(define-key my-keys-minor-mode-map (kbd "M-a") 'beginning-of-defun)
(define-key my-keys-minor-mode-map (kbd "M-e") 'end-of-defun)
;; Paste from clipboard.
;; Copy/Paste to/from clipboard.
;; (define-key my-keys-minor-mode-map (kbd "M-p") (kbd "C-u M-! xclip <SPC> -o"))
(define-key my-keys-minor-mode-map (kbd "C-<f6>") (kbd "M-| xsel <SPC> -p <SPC> -i"))
(define-key my-keys-minor-mode-map (kbd "C-<f7>") (kbd "C-u M-! xsel <SPC> -o"))
@ -480,7 +483,7 @@ the line."
(defun my-c-mode-hook ()
(local-set-key (kbd "<f9>") (kbd "C-x C-s M-x smart-compile C-j C-j"))
)
(define-key my-keys-minor-mode-map (kbd "C-<f9>") 'next-error)
;; (define-key my-keys-minor-mode-map (kbd "C-<f9>") 'next-error)
(add-hook 'c-mode-hook 'my-c-mode-hook)
(add-hook 'c++-mode-hook 'my-c-mode-hook)
@ -506,17 +509,9 @@ the line."
(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 "~/.emacs.d/plugins/yas/snippets") ;; Warning: slow!
(yas/load-directory yas/root-directory)
;;==============================================================================
;; Auto-Complete
;;==============================================================================
;; (add-to-list 'load-path "/usr/share/emacs/site-lisp/auto-complete")
;; (require 'auto-complete-config)
;; (add-to-list 'ac-dictionary-directories "/usr/share/emacs/site-lisp/auto-complete/ac-dict")
;; (ac-config-default)
;;==============================================================================
;; AucTeX
;;==============================================================================
@ -533,11 +528,13 @@ the line."
(output-ps "PS Viewer")
(output-pdf "PDF Viewer")
(output-html "Web browser")))
;; Zathura will crash when being forked while document is regenerated.
(setq TeX-view-program-list
'(("DVI Viewer" "zathura --fork %o")
("PS Viewer" "zathura --fork %o")
("PDF Viewer" "zathura --fork %o")
("Web browser" "luakit %o")))
'(("DVI Viewer" "zathura %o")
("PS Viewer" "zathura %o")
("PDF Viewer" "zathura %o")
("Web browser" "luakit -n %o")))
;; Add 'Compress PDF' compilation command
(eval-after-load "TeX"
@ -575,19 +572,6 @@ the line."
(setq auto-mode-alist (cons '("\.lua$" . lua-mode) auto-mode-alist))
(autoload 'lua-mode "lua-mode" "Lua editing mode." t)
;;==============================================================================
;; DoxyMacs
;;==============================================================================
;; (require 'doxymacs)
;; (add-hook 'c-mode-common-hook 'doxymacs-mode)
;; ;; Fontified comments.
;; (defun my-doxymacs-font-lock-hook ()
;; (if (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode))
;; (doxymacs-font-lock)))
;; (add-hook 'font-lock-mode-hook 'my-doxymacs-font-lock-hook)
;;==============================================================================
;; MediaWiki
;;==============================================================================
@ -610,6 +594,28 @@ the line."
(define-key mediawiki-mode-map (kbd "C-c o") 'mediawiki-browse)
))
;;==============================================================================
;; DoxyMacs
;;==============================================================================
;; (require 'doxymacs)
;; (add-hook 'c-mode-common-hook 'doxymacs-mode)
;; ;; Fontified comments.
;; (defun my-doxymacs-font-lock-hook ()
;; (if (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode))
;; (doxymacs-font-lock)))
;; (add-hook 'font-lock-mode-hook 'my-doxymacs-font-lock-hook)
;;==============================================================================
;; Auto-Complete
;;==============================================================================
;; (add-to-list 'load-path "/usr/share/emacs/site-lisp/auto-complete")
;; (require 'auto-complete-config)
;; (add-to-list 'ac-dictionary-directories "/usr/share/emacs/site-lisp/auto-complete/ac-dict")
;; (ac-config-default)
;;=============================================================================↑=
;;==============================================================================

View File

@ -55,24 +55,24 @@
'(
("Arch" "Arch Linux" nil 1)
("ac" "avec" nil 0)
("afaik" "as far as I know" nil 0)
("afaict" "as far as I can tell" nil 0)
("afaik" "as far as I know" nil 0)
("ajd" "aujourd'hui" nil 2)
("arch" "architecture" nil 1)
("asap" "as soon as possible" nil 1)
("atm" "at the moment" nil 1)
("autom" "automatique" nil 2)
("automt" "automatiquement" nil 2)
("atm" "at the moment" nil 1)
("bcp" "beaucoup" nil 2)
("biblio" "bibliothèque" nil 1)
("btw" "by the way" nil 1)
("ca" "ça" nil 1)
("chai" "je ne sais" nil 1)
("cad" "c'est-à-dire" nil 1)
("chai" "je sais" nil 1)
("chq" "chaque" nil 1)
("chui" "je ne suis" nil 1)
("chui" "je suis" nil 1)
("config" "configuration" nil 1)
("configs" "configurations" nil 1)
("cad" "c'est-à-dire" nil 1)
("dc" "donc" nil 1)
("deja" "déjà" nil 1)
("dep" "dépendance" nil 1)
@ -83,8 +83,8 @@
("distro" "distribution" nil 1)
("ds" "dans" nil 1)
("eg" "e.g." nil 3)
("ex" "exemple" nil 3)
("etre" "être" nil 1)
("ex" "exemple" nil 3)
("exo" "exercice" nil 1)
("ficheir" "fichier" nil 0)
("ficheirs" "fichiers" nil 0)
@ -92,8 +92,8 @@
("gd" "grand" nil 3)
("ie" "i.e." nil 1)
("iirc" "if I recall correctly" nil 1)
("imo" "in my opinion" nil 1)
("imho" "in my humble opinion" nil 1)
("imo" "in my opinion" nil 1)
("infos" "informations" nil 1)
("latex" "LaTeX" nil 10)
("linux" "GNU/Linux" nil 1)
@ -106,20 +106,24 @@
("mnt" "maintenant" nil 2)
("ms" "mais" nil 4)
("nb" "nombre" nil 0)
("nchai" "je ne sais" nil 1)
("nchui" "je ne suis" nil 1)
("ns" "nous" nil 1)
("nvm" "nevermind" nil 1)
("pb" "problème" nil 4)
("pbs" "problèmes" nil 1)
("pcq" "parce que" nil 3)
("pe" "peut-être" nil 2)
("pgrm" "programme" nil 1)
("pgrms" "programmes" nil 1)
("plsu" "plus" nil 3)
("poru" "pour" nil 1)
("pq" "pourquoi" nil 2)
("pr" "pour" nil 3)
("prog" "programme" nil 1)
("progs" "programmes" nil 1)
("ptt" "petit" nil 1)
("pê" "peut-être" nil 2)
("pe" "peut-être" nil 2)
("qd" "quand" nil 4)
("qq" "quelque" nil 1)
("qqch" "quelque chose" nil 1)
@ -136,6 +140,7 @@
("tex" "TeX" nil 2)
("tjrs" "toujours" nil 4)
("tps" "temps" nil 5)
("tres" "très" nil 4)
("ts" "tous" nil 1)
("tschuss" "tschüss" nil 1)
("tt" "tout" nil 3)

View File

@ -156,8 +156,8 @@ fi
## TeXlive
if [ -d "/usr/local/texlive" ]; then
## FIXME: umask does not work with sudo.
alias tli="sudo umask 022 && tlmgr install"
alias tli="sudo bash -c 'umask 022 && tlmgr install'"
alias tlu="sudo bash -c 'umask 022 && tlmgr update --self'"
alias tls="tlmgr search --global"
alias tll="tlmgr show --list"
fi

View File

@ -487,68 +487,82 @@ lsofstat()
## Consider indent, astyle, uncrustify.
formatc()
{
echo "WARNING: Work in progress."
if [ ! $# -eq 1 ]; then
echo "Wrong number of argument."
if [ ! -e /usr/bin/indent ]; then
echo "Please install 'indent'"
return
fi
FILE="$1"
if [ -z "$1" ]; then
WORKDIR="$PWD"
else
WORKDIR="$1"
fi
## Remove trailing whitespace
sed -i 's/\s*$//g' "$FILE"
find "$WORKDIR" -type f \
-name "*.[ch]" \
-print \
-exec indent -i4 -ppi4 -bli0 -cli4 -nut {} \;
## Function parenthesis
sed -i 's/\([^ ]\)(/\1 (/g' "$FILE"
sed -i 's/\s\s\+(/ (/g' "$FILE"
## Remove backup files.
find "$WORKDIR" -type f \( \
-name "*.[ch]~" -o \
-name "*.[ch]~[0-9]*~" \) \
-delete
# ## Manual method.
# ## Remove trailing whitespace
# sed -i 's/\s*$//g' "$FILE"
# ## Function parenthesis
# sed -i 's/\([^ ]\)(/\1 (/g' "$FILE"
# sed -i 's/\s\s\+(/ (/g' "$FILE"
## Semicolon
sed -i 's/\([^ ]\);/\1 ;/g' "$FILE"
sed -i 's/;\([^ ]\)/; \1/g' "$FILE"
# Skip line -- Bad idea because of 'for' loops.
# sed -i 's/^\(\s*\)\(.*\);\s*\(.\+\)$/\1\2;\n\1\3/g' "$FILE"
# ## Semicolon
# sed -i 's/\([^ ]\);/\1 ;/g' "$FILE"
# sed -i 's/;\([^ ]\)/; \1/g' "$FILE"
# # Skip line -- Bad idea because of 'for' loops.
# # sed -i 's/^\(\s*\)\(.*\);\s*\(.\+\)$/\1\2;\n\1\3/g' "$FILE"
## Commas
sed -i 's/\s\s\+,/,/g' "$FILE"
sed -i 's/,\([^ ]\)/, \1/g' "$FILE"
# ## Commas
# sed -i 's/\s\s\+,/,/g' "$FILE"
# sed -i 's/,\([^ ]\)/, \1/g' "$FILE"
## Plus/Minus
sed -i 's/\([^+-]\)\([-+]\)\([^ +-]\)/\1\2 \3/g' "$FILE"
sed -i 's/\([^ +-]\)\([-+]\)\([^+-]\)/\1 \2\3/g' "$FILE"
sed -i 's/\( \+++\)/++/g' "$FILE"
sed -i 's/\(++ \+\)/++/g' "$FILE"
sed -i 's/\( \+--\)/--/g' "$FILE"
sed -i 's/\(-- \+\)/--/g' "$FILE"
# ## Plus/Minus
# sed -i 's/\([^+-]\)\([-+]\)\([^ +-]\)/\1\2 \3/g' "$FILE"
# sed -i 's/\([^ +-]\)\([-+]\)\([^+-]\)/\1 \2\3/g' "$FILE"
# sed -i 's/\( \+++\)/++/g' "$FILE"
# sed -i 's/\(++ \+\)/++/g' "$FILE"
# sed -i 's/\( \+--\)/--/g' "$FILE"
# sed -i 's/\(-- \+\)/--/g' "$FILE"
## Modulus, equality, affectation, binary ops, comparison
sed -i 's/\s\s\+\(%\|==\|&&\|||\|<=\|>=\|!=\)/ \1/g' "$FILE"
sed -i 's/\(%\|==\|&&\|||\|<=\|>=\|!=\)\s\s\+/\1 /g' "$FILE"
sed -i 's/\([^ ]\)\(%\|==\|&&\|||\|<=\|>=\|!=\)/\1 \2/g' "$FILE"
sed -i 's/\(%\|==\|&&\|||\|<=\|>=\|!=\)\([^ ]\)/\1 \2/g' "$FILE"
# ## Modulus, equality, affectation, binary ops, comparison
# sed -i 's/\s\s\+\(%\|==\|&&\|||\|<=\|>=\|!=\)/ \1/g' "$FILE"
# sed -i 's/\(%\|==\|&&\|||\|<=\|>=\|!=\)\s\s\+/\1 /g' "$FILE"
# sed -i 's/\([^ ]\)\(%\|==\|&&\|||\|<=\|>=\|!=\)/\1 \2/g' "$FILE"
# sed -i 's/\(%\|==\|&&\|||\|<=\|>=\|!=\)\([^ ]\)/\1 \2/g' "$FILE"
## Equality, >, <
sed -i 's/\s\s\+\([<>=]\)/ \1/g' "$FILE"
sed -i 's/\([<>=]\)\s\s\+/\1 /g' "$FILE"
sed -i 's/\([<>=]\)\([^ =]\)/\1 \2/g' "$FILE"
sed -i 's/\([^ ]\)\([<>]\)/\1 \2/g' "$FILE"
sed -i 's/\([^ =<>]\)\(=\)/\1 \2/g' "$FILE"
# ## Equality, >, <
# sed -i 's/\s\s\+\([<>=]\)/ \1/g' "$FILE"
# sed -i 's/\([<>=]\)\s\s\+/\1 /g' "$FILE"
# sed -i 's/\([<>=]\)\([^ =]\)/\1 \2/g' "$FILE"
# sed -i 's/\([^ ]\)\([<>]\)/\1 \2/g' "$FILE"
# sed -i 's/\([^ =<>]\)\(=\)/\1 \2/g' "$FILE"
## Asterisk, slash
sed -i 's/\s\s\+\*/ \*/g' "$FILE"
sed -i 's/\*\s\s\+/\* /g' "$FILE"
# ## Asterisk, slash
# sed -i 's/\s\s\+\*/ \*/g' "$FILE"
# sed -i 's/\*\s\s\+/\* /g' "$FILE"
sed -i 's/\([^\/]\)\/\s\+/\1\//g' "$FILE"
sed -i 's/\s\+\/\([^\/]\)/\/\1/g' "$FILE"
# sed -i 's/\([^\/]\)\/\s\+/\1\//g' "$FILE"
# sed -i 's/\s\+\/\([^\/]\)/\/\1/g' "$FILE"
## Braces
sed -i 's/^\( *\)\(.\+\) *{ *$/\1\2\n\1{/g' "$FILE"
# ## Braces
# sed -i 's/^\( *\)\(.\+\) *{ *$/\1\2\n\1{/g' "$FILE"
## Proper comments
sed -i 's:// *\([[:lower:]]\):// \u\1:g' "$FILE"
sed -i 's:\(//.*[^\.]\)$:\1\.:g' "$FILE"
# ## Proper comments
# sed -i 's:// *\([[:lower:]]\):// \u\1:g' "$FILE"
# sed -i 's:\(//.*[^\.]\)$:\1\.:g' "$FILE"
}
@ -861,15 +875,9 @@ if [ -d "/usr/local/texlive" ]; then
tlinit ()
{
if [ $(id -u) -ne 0 ]; then
echo "You must be root to run this script."
exit
fi
## Warning: it is important to set umask properly, otherwise users might
## not have authorization to use the packages.
umask 022
sudo bash -c 'umask 022 && \
tlmgr install \
amscls \
amsfonts \
@ -880,6 +888,7 @@ if [ -d "/usr/local/texlive" ]; then
ec \
enctex \
eso-pic \
eurosym \
etoolbox \
fancyhdr \
fix2col \
@ -901,7 +910,7 @@ if [ -d "/usr/local/texlive" ]; then
wrapfig \
xargs \
xcolor \
zapfding
zapfding'
}
fi

24
README
View File

@ -71,21 +71,25 @@ Functional Adblock script. Script+Plugin toggle.
Mutt
****
Compile options: IMAP and SMTP support.
Extra deps: urlview, w3m, sxiv, fortune.
Extra deps: antiword, fortune, sxiv, w3m.
This one is not easy to get into it. I managed to get multiple accounts with
pgp-encrypted passwords working, which means there is no plain password stored
on the disk. As a result, I just get prompted for a main password on Mutt
startup, then everything works out of the box.
I use GPG for password management, mostly because it features a password agent.
I use GPG for password management because it is a Mutt dependency anyway. It
could also work well with pwsafe or other tools.
I'm using embedded imap and smtp services -- you must provide the required
I'm using embedded IMAP and SMTP services -- you must provide the required
compilation options.
Some customization: custom index view, good Emacs integration (see .emacs),
custom theme (matches Emacs colors), various tweaks.
URxvt has an URL support that works also for Mutt. For other terminals, you
might consider using the 'urlview' plugin for Mutt.
Ranger
******
Extra deps: antiword, atool, highlight, img2txt, mediainfo, pdftotext, w3m.
@ -94,10 +98,15 @@ Custom bindings, file association, tweaked a few options.
Scripts
*******
.save: generates a home configuration archive.
.network: network setup. Works with wpa_supplicant. May replace any network
manager.
.homeinit: initialize a new home configuration, i.e. get needed files, create
symlinks, etc.
.save: generates a home configuration archive.
Shell
*****
Target: zsh, bash
@ -138,10 +147,13 @@ bc
calc
catdvi
ccrypt
chrpath
cmus
cppcheck
dash
doxygen
dropbox
dvtm
emacs
feh
fortune
@ -161,6 +173,7 @@ indent
inkscape
irssi
lrzip
lshw
luakit
mediainfo
mencoder
@ -170,6 +183,7 @@ mplayer2
mutt
nasm
ncdu
ngrep
nmap
numlockx
octave
@ -201,6 +215,7 @@ texlive
trash-cli
tree
udiskie
upx
valgrind
vim
vlock
@ -209,6 +224,7 @@ weechat
wipe
wmfs
wv
xclip
xsel
yasm
zathura