From 14d7b0f3282a7c4379dd221e5c2512af3a91a86c Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 2 Apr 2015 11:10:06 +0100 Subject: [PATCH 01/16] dwb: allow scripts on guides.github --- dwb/default/scripts.allow | 1 + 1 file changed, 1 insertion(+) diff --git a/dwb/default/scripts.allow b/dwb/default/scripts.allow index 36f9fb1..5efba0d 100644 --- a/dwb/default/scripts.allow +++ b/dwb/default/scripts.allow @@ -12,6 +12,7 @@ gist.github.com github.com gitorious.org groups.google.com +guides.github.com just-eat.co.uk localhost mail.google.com -- 2.49.0 From 7b1f439ef2e2422cfebd2e7524c8aa72221ef146 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 2 Apr 2015 11:12:44 +0100 Subject: [PATCH 02/16] vim: change email in PKGBUILD --- vim/ftplugin/PKGBUILD.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/ftplugin/PKGBUILD.vim b/vim/ftplugin/PKGBUILD.vim index 4e7ad77..5f0ea86 100644 --- a/vim/ftplugin/PKGBUILD.vim +++ b/vim/ftplugin/PKGBUILD.vim @@ -6,6 +6,6 @@ setlocal makeprg=makepkg\ -s setlocal errorformat=%f:\ line\ %l:\ %m nnoremap u :UpdPkgSums:redraw! -nnoremap r O# Maintainer: Samir Benmendil +nnoremap r O# Maintainer: Ram-Z " vim: ft=vim -- 2.49.0 From 27773aaefbaecd889b46977bcc72589e55fbdeba Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 2 Apr 2015 11:13:53 +0100 Subject: [PATCH 03/16] vim: add mappings for replacing Maintainer/Contributor --- vim/ftplugin/PKGBUILD.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vim/ftplugin/PKGBUILD.vim b/vim/ftplugin/PKGBUILD.vim index 5f0ea86..dc8f650 100644 --- a/vim/ftplugin/PKGBUILD.vim +++ b/vim/ftplugin/PKGBUILD.vim @@ -7,5 +7,7 @@ setlocal errorformat=%f:\ line\ %l:\ %m nnoremap u :UpdPkgSums:redraw! nnoremap r O# Maintainer: Ram-Z +nnoremap c :s/Maintainer/Contributor/:nohl +nnoremap m :s/Contributor/Maintainer/:nohl " vim: ft=vim -- 2.49.0 From 22a362a0e4ef1f84641e3cae2c0933b75729def9 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 2 Apr 2015 11:15:58 +0100 Subject: [PATCH 04/16] vim: use wilywampa's fork for python-mode has some fixes --- vim/vimrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index bb4f941..f9f891c 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -21,7 +21,8 @@ Plugin 'elzr/vim-json' Plugin 'firef0x/pkgbuild.vim' Plugin 'junegunn/vim-easy-align' Plugin 'kien/ctrlp.vim' -Plugin 'klen/python-mode' +" Plugin 'klen/python-mode' +Plugin 'wilywampa/python-mode' Plugin 'kshenoy/vim-signature' Plugin 'majutsushi/tagbar' Plugin 'raimondi/delimitmate' -- 2.49.0 From 1b56eef224e65de5cfb73c21581ec6108addc10e Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 2 Apr 2015 11:17:02 +0100 Subject: [PATCH 05/16] vim: add vim-textobj to staging plugins --- vim/vimrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vim/vimrc b/vim/vimrc index f9f891c..dbacea9 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -58,6 +58,10 @@ Plugin 'justinmk/vim-sneak' Plugin 'chrisbra/checkattach' Plugin 'nathanaelkane/vim-indent-guides' +Plugin 'kana/vim-textobj-user' +Plugin 'julian/vim-textobj-variable-segment' +Plugin 'sgur/vim-textobj-parameter' + " remove entries first set runtimepath -=$HOME/.vim set runtimepath -=$HOME/.vim/after -- 2.49.0 From 979458e5a9718cfdbf7e90fd5881a5c811eb4ad1 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 2 Apr 2015 12:21:10 +0100 Subject: [PATCH 06/16] vim/ft/roslaunch: add snippet for nodes --- vim/ultisnips/roslaunch.snippets | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 vim/ultisnips/roslaunch.snippets diff --git a/vim/ultisnips/roslaunch.snippets b/vim/ultisnips/roslaunch.snippets new file mode 100644 index 0000000..79f4a35 --- /dev/null +++ b/vim/ultisnips/roslaunch.snippets @@ -0,0 +1,3 @@ +snippet node "Node element" b + +endsnippet -- 2.49.0 From 90bec484259f011375ae55801e88cfb3f0ee411e Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 2 Apr 2015 11:07:26 +0100 Subject: [PATCH 07/16] dwb: fix accept-language --- dwb/settings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dwb/settings b/dwb/settings index 0d94e84..b96e8f6 100644 --- a/dwb/settings +++ b/dwb/settings @@ -81,7 +81,7 @@ auto-insert-mode=false tab-normal-bg-color-2=#808080 tab-normal-bg-color-1=#606060 serif-font-family=serif -accept-language=en,de,fr +accept-language=en-gb,en;q=0.9,de;q=0.8,fr;q=0.7 enable-html5-local-storage=true tab-protected-color=#ff0000 hint-letter-seq=UEOAPYIKJFCRLMBDGNTH -- 2.49.0 From f7386c50e4c2d2330c7d4fe3c0992911e01be971 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Wed, 8 Apr 2015 14:18:56 +0100 Subject: [PATCH 08/16] zsh: load fzf if installed --- zsh/lib/fzf.zsh | 81 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 zsh/lib/fzf.zsh diff --git a/zsh/lib/fzf.zsh b/zsh/lib/fzf.zsh new file mode 100755 index 0000000..7341504 --- /dev/null +++ b/zsh/lib/fzf.zsh @@ -0,0 +1,81 @@ +if [[ ! -x /usr/bin/fzf ]]; then + echo '`fzf` is not installed.' + return +fi + +# Auto-completion +# --------------- +if [[ -f /usr/share/zsh/site-functions/_fzf ]]; then + source /usr/share/zsh/site-functions/_fzf +fi + +# Key bindings +# ------------ + +# CTRL-T - Paste the selected file path(s) into the command line +__fsel() { + command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ + -o -type f -print \ + -o -type d -print \ + -o -type l -print 2> /dev/null | sed 1d | cut -b3- | fzf -m | while read item; do + printf '%q ' "$item" + done + echo +} + +if [[ $- =~ i ]]; then + +if [ -n "$TMUX_PANE" -a ${FZF_TMUX:-1} -ne 0 -a ${LINES:-40} -gt 15 ]; then + fzf-file-widget() { + local height + height=${FZF_TMUX_HEIGHT:-40%} + if [[ $height =~ %$ ]]; then + height="-p ${height%\%}" + else + height="-l $height" + fi + tmux split-window $height "cd $(printf %q "$PWD");zsh -c 'tmux send-keys -t $TMUX_PANE \"\$(__fsel)\"'" + } +else + fzf-file-widget() { + LBUFFER="${LBUFFER}$(__fsel)" + zle redisplay + } +fi +zle -N fzf-file-widget +bindkey '^T' fzf-file-widget + +# ALT-C - cd into the selected directory +fzf-cd-widget() { + cd "${$(command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ + -o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m):-.}" + zle reset-prompt +} +zle -N fzf-cd-widget +bindkey '\ec' fzf-cd-widget + +# CTRL-R - Paste the selected command from history into the command line +fzf-history-widget() { + local selected + if selected=$(fc -l 1 | fzf -x +s --tac +m -n2..,.. -q "$LBUFFER"); then + num=$(echo "$selected" | head -1 | awk '{print $1}' | sed 's/[^0-9]//g') + LBUFFER=!$num + zle expand-history + fi + zle redisplay +} +zle -N fzf-history-widget +bindkey '^R' fzf-history-widget + +# ALT-I - Paste the selected entry from locate output into the command line +fzf-locate-widget() { + local selected + if selected=$(locate / | fzf -q "$LBUFFER"); then + LBUFFER=$selected + fi + zle redisplay +} +zle -N fzf-locate-widget +bindkey '\ei' fzf-locate-widget + +fi -- 2.49.0 From 8d939bd895b8770893fbabe2473e3221254c6be2 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Mon, 13 Apr 2015 15:47:02 +0100 Subject: [PATCH 09/16] zsh: fix zsh_stats --- zsh/functions/zsh_stats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/functions/zsh_stats b/zsh/functions/zsh_stats index 9b5284f..dbf33a0 100644 --- a/zsh/functions/zsh_stats +++ b/zsh/functions/zsh_stats @@ -1,3 +1,3 @@ function zsh_stats() { - history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20 + fc -l 1 | awk '{a[$2]++; count++}END{for(i in a)printf "%3d %.2f%% %s\n", a[i], a[i]/count*100, i}' | sort -rn | head -20 } -- 2.49.0 From c2884842233cc55292788893b6f120682b038e59 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 16 Apr 2015 00:17:44 +0100 Subject: [PATCH 10/16] mutt: setup gpg for signing/encryption --- mutt/muttrc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mutt/muttrc b/mutt/muttrc index d2f05c1..2d48c01 100644 --- a/mutt/muttrc +++ b/mutt/muttrc @@ -89,6 +89,16 @@ set sendmail = ~/.msmtp/msmtpq # use msmtp message queue set sendmail_wait = -1 # fork sendmail to the background set send_charset="us-ascii:utf-8" # only use ascii and utf8 +# GnuPG +set crypt_autosign = yes # autosign messages +set crypt_replyencrypt = yes # encrypt replies to encrypted messages +set crypt_replysign = yes # sign replies to signed messages +set crypt_replysignencrypted = yes # you get the idea +set crypt_verify_sig = yes # verify signatures +set pgp_long_ids = yes # use 64 bit key IDs +set pgp_mime_auto = no # don't fallback to inline mime +source /usr/share/doc/mutt/samples/gpg.rc + source ~/.mutt/hooks source ~/.mutt/bindings source ~/.mutt/colors # color theme -- 2.49.0 From f57295e7aea3635dcb049969d990cf5cebf717b1 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 16 Apr 2015 00:28:29 +0100 Subject: [PATCH 11/16] mutt: add @rmz.io addresses and default to me@rmz.io --- mutt/accounts/gmail | 2 +- mutt/muttrc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mutt/accounts/gmail b/mutt/accounts/gmail index 2d059e7..4de7f42 100644 --- a/mutt/accounts/gmail +++ b/mutt/accounts/gmail @@ -1,5 +1,5 @@ # vim: ft=muttrc set realname = "Samir Benmendil" -set from = "samir.benmendil@gmail.com" +set from = "me@rmz.io" unmy_hdr Bcc: my_hdr Bcc: $from diff --git a/mutt/muttrc b/mutt/muttrc index 2d48c01..1213f36 100644 --- a/mutt/muttrc +++ b/mutt/muttrc @@ -1,6 +1,6 @@ # general settings -alternates -group me samir.benmendil@gmail.com ram-z@hotmail.com -alternates -group me -group chakra ram-z@chakra-project.org +alternates -group me samir.benmendil@gmail.com ram-z@hotmail.com @rmz.io +alternates -group me -group chakra ram-z@chakra-project.org chakra@rmz.io alternates -group me -group unimaas s.benmendil@student.maastrichtuniversity.nl set mail_check = 0 -- 2.49.0 From f3134f45275c5251e63651306b6771344a5d3291 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 16 Apr 2015 00:44:11 +0100 Subject: [PATCH 12/16] dwb: use transparent background in default css --- dwb/userstyles/default.css | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dwb/userstyles/default.css b/dwb/userstyles/default.css index e2d97d3..19f452b 100644 --- a/dwb/userstyles/default.css +++ b/dwb/userstyles/default.css @@ -1,9 +1,18 @@ :not(img) { - background-color: #222222 ! important; + background-color: rgba(34, 34, 34, 0.5) ! important; background-image: none !important; color: #D4D2CF ! important; } +body, html { + background-color: #222222 ! important; + background-image: none !important; +} + +.dwb_hint { + background-color: #222222 ! important; +} + :link, :link * { color: #5DC3D7 !important; } -- 2.49.0 From 162e83c6ad738c8a0205f9a9de5254bfb9cf4cfc Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 16 Apr 2015 00:57:59 +0100 Subject: [PATCH 13/16] vim: fold sh scripts --- vim/ftplugin/sh.vim | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 vim/ftplugin/sh.vim diff --git a/vim/ftplugin/sh.vim b/vim/ftplugin/sh.vim new file mode 100644 index 0000000..4926a2b --- /dev/null +++ b/vim/ftplugin/sh.vim @@ -0,0 +1,2 @@ +setlocal foldmethod=syntax +let g:sh_fold_enabled= 3 "enables function and heredoc folding -- 2.49.0 From d1c17b57ec52c6e81c4ac97dfdf49e6cbdc5f766 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 16 Apr 2015 00:59:20 +0100 Subject: [PATCH 14/16] vim: add sh snippets --- vim/ultisnips/sh.snippets | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 vim/ultisnips/sh.snippets diff --git a/vim/ultisnips/sh.snippets b/vim/ultisnips/sh.snippets new file mode 100644 index 0000000..ff10449 --- /dev/null +++ b/vim/ultisnips/sh.snippets @@ -0,0 +1,42 @@ +snippet #! "#!/usr/bin/env (!env)" b +#!/usr/bin/env bash + +endsnippet + +snippet !env "#!/usr/bin/env (!env)" b +#!/usr/bin/env bash + +endsnippet + +snippet ar "${array[@]}" w +\${${1:array}[${2:@}]}$0 +endsnippet + +snippet getopt +version="${1:0.1}" + +function usage () +{ + echo "Usage : $${0:0} [options] + + Options: + -h,--help Display this message + -v,--version Display script version" +} + +# Parse arguments +declare -a args +while [[ $# > 0 ]]; do + opt="\$1" + + case $opt in + -h|--help) usage; exit 0 ;; + -v|--version) echo "$${0:0} -- Version $version"; exit 0 ;; + -* ) + echo -e "\n Option does not exist : $opt\n" + usage; exit 1 ;; + + *) args+=($opt); shift ;; + esac +done +endsnippet -- 2.49.0 From 32b311373c4a362f1a995c99b4b5d9ed488b3052 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 16 Apr 2015 02:09:01 +0100 Subject: [PATCH 15/16] vim: adds signature to mail --- vim/ultisnips/mail.snippets | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 vim/ultisnips/mail.snippets diff --git a/vim/ultisnips/mail.snippets b/vim/ultisnips/mail.snippets new file mode 100644 index 0000000..6378aca --- /dev/null +++ b/vim/ultisnips/mail.snippets @@ -0,0 +1,5 @@ +snippet -- "Signature" b +-- +http://rmz.io +3BC8 91A4 96AD E81C 474E D4F4 8260 0055 EBC8 5A93 +endsnippet -- 2.49.0 From 3fc9324bb4eedbdf29f39afc772bdb9d75cea28b Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 16 Apr 2015 02:29:56 +0100 Subject: [PATCH 16/16] vim: only save cursor position --- vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index dbacea9..ad9e355 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -172,7 +172,7 @@ set foldmethod=marker " folding type set foldlevelstart=0 " value for 'foldlevel' when starting to edit a file " save and restore folds -set viewoptions=folds,cursor " don't save local options +set viewoptions=cursor " only save cursor position " diff mode {{{2 set diffopt=filler,vertical -- 2.49.0