Compare commits

...

18 Commits

Author SHA1 Message Date
62fb58b393 dotfiles 2020-08-15 14:52:15 +02:00
9fcf373615 use bash 2020-04-26 18:09:27 +02:00
Peter Dahlberg
2881660137 Update tmux config 2019-07-30 06:46:55 +02:00
72984d470b update zshrc 2019-04-13 02:44:22 +02:00
dc0b520fb0 Update zshrc 2018-12-30 19:49:25 +01:00
Peter Dahlberg
ddb3ffbde0 yaml indent 2018-03-05 08:05:53 +01:00
8a5ca0814d update vimrc 2017-12-02 08:21:58 +01:00
6ef3b4373e Remove vim bundle dir when force installing 2017-11-01 12:58:51 +01:00
7177f14d27 Fix again 2017-11-01 12:53:25 +01:00
3458772221 Fix call 2017-11-01 12:52:56 +01:00
647146a76a Install vim plugins after install 2017-11-01 12:51:35 +01:00
b39ad04be9 add vim tmux plugin 2017-11-01 12:41:46 +01:00
026b850422 Add tmux plugins 2017-11-01 12:40:11 +01:00
ff01e8d8be Remove tmux plugin dir while force install 2017-11-01 12:19:50 +01:00
2ebc02fdc7 Add tmux plugin manager and plugins 2017-11-01 12:11:35 +01:00
ee8364d7f3 remove terminal overrides 2017-11-01 10:42:15 +01:00
8c7aa720a9 add zshrc.local 2017-10-18 04:25:18 +02:00
f55528f932 update zshrc 2017-10-18 04:23:58 +02:00
6 changed files with 751 additions and 267 deletions

View File

@@ -45,17 +45,21 @@ def install_vim(pdotfiles, force=False):
phome_vimrc.symlink_to(pdotfiles_vimrc) phome_vimrc.symlink_to(pdotfiles_vimrc)
# vundle # vundle
pvundle = phome / Path(".vim/bundle/Vundle.vim") bundle_dir = phome / Path(".vim/bundle")
pvundle = bundle_dir / Path("Vundle.vim")
if not force and pvundle.exists(): if not force and bundle_dir.exists():
print("Vundle already installed?") print("Vundle already installed?")
else: else:
if force and pvundle.exists(): if force and bundle_dir.exists():
shutil.rmtree(pvundle.as_posix()) print("Removing bundle dir")
shutil.rmtree(bundle_dir.as_posix())
print("Install Vundle") print("Install Vundle")
check_call( check_call(
["git", "clone", "https://github.com/VundleVim/Vundle.vim.git", ["git", "clone", "https://github.com/VundleVim/Vundle.vim.git",
pvundle.as_posix()]) pvundle.as_posix()])
print("Install vim plugins")
check_call("vim -X +PluginInstall +qall".split())
def install_tmux(pdotfiles, force=False): def install_tmux(pdotfiles, force=False):
@@ -78,6 +82,22 @@ def install_tmux(pdotfiles, force=False):
print("Symlinking {} to {}".format(phome_tmuxrc, pdotfiles_tmuxrc)) print("Symlinking {} to {}".format(phome_tmuxrc, pdotfiles_tmuxrc))
phome_tmuxrc.symlink_to(pdotfiles_tmuxrc) phome_tmuxrc.symlink_to(pdotfiles_tmuxrc)
# tpm
tmux_plugins = phome / Path(".tmux/plugins")
tpm = tmux_plugins / Path("tpm")
if not force and tmux_plugins.exists():
print("plugin dir exits, tpm already installed?")
else:
if force and tmux_plugins.exists():
print("remove tmux plugin dir")
shutil.rmtree(tmux_plugins.as_posix())
print("Install tpm")
check_call(
["git", "clone", "https://github.com/tmux-plugins/tpm",
tpm.as_posix()])
check_call((tpm / Path("bin") / Path("install_plugins")).as_posix())
if __name__ == "__main__": if __name__ == "__main__":
args = docopt(HELPTEXT, version='0.1') args = docopt(HELPTEXT, version='0.1')
if args["install"]: if args["install"]:

View File

@@ -1,3 +1,3 @@
ENTER playlist-next force ENTER playlist-next force
R run "/bin/sh" "-ec" "kdialog --warningyesno 'Delete ${path}' --title 'Delete ${media-title}' && output=\"$(rm -- '${path}' 2>&1)\" || kdialog --error \"$output\"" R run "/bin/bash" "-ec" "kdialog --warningyesno 'Delete ${path}' --title 'Delete ${media-title}' && output=\"$(rm -- '${path}' 2>&1)\" || kdialog --error \"$output\""
C run "/bin/sh" "-ec" "echo -n '${path}' | xclip -selection clipboard" C run "/bin/bash" "-ec" "echo -n '${path}' | xclip -selection clipboard"

View File

@@ -1,7 +1,9 @@
set -g base-index 1 set -g base-index 1
set -s escape-time 0 set -s escape-time 0
set -g prefix C-a set -g prefix C-a
set -g terminal-overrides 'xterm*:smcup@:rmcup@' #set -g terminal-overrides 'xterm*:smcup@:rmcup@'
bind C-a send-prefix
unbind C-b
unbind % unbind %
bind | split-window -h bind | split-window -h
bind - split-window -v bind - split-window -v
@@ -23,9 +25,8 @@ set -g status-right '#[fg=yellow]%Y-%m-%d %H:%M'
#set -g status-right-length 6 #set -g status-right-length 6
#set -g status-right "#[fg=yellow]%H:%M" #set -g status-right "#[fg=yellow]%H:%M"
set-window-option -g window-status-fg blue set-window-option -g window-status-style fg=blue,bg=black
set-window-option -g window-status-bg black set-window-option -g window-status-current-style bold
set-window-option -g window-status-current-attr bold
#urxvt tab like window switching (-n: no prior escape seq) #urxvt tab like window switching (-n: no prior escape seq)
@@ -34,3 +35,17 @@ bind -n S-F11 previous-window
bind -n S-F12 next-window bind -n S-F12 next-window
bind -n S-F9 swap-window -t -1 bind -n S-F9 swap-window -t -1
bind -n S-F8 swap-window -t +1 bind -n S-F8 swap-window -t +1
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-yank'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

View File

@@ -30,10 +30,14 @@ Plugin 'fisadev/vim-ctrlp-cmdpalette'
Plugin 'YankRing.vim' Plugin 'YankRing.vim'
Plugin 'scrooloose/nerdtree' Plugin 'scrooloose/nerdtree'
Plugin 'stephanlukasczyk/vim-syntax-specautomata' " Plugin 'stephanlukasczyk/vim-syntax-specautomata'
Plugin 'rust-lang/rust.vim' Plugin 'rust-lang/rust.vim'
Plugin 'tmux-plugins/vim-tmux'
Plugin 'IN3D/vim-raml'
" The following are examples of different formats supported. " The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end. " Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo " plugin on GitHub repo
@@ -161,6 +165,8 @@ autocmd FileType json setlocal expandtab shiftwidth=3 tabstop=3 softtabstop=3
autocmd FileType c setlocal expandtab shiftwidth=4 tabstop=4 softtabstop=4 autocmd FileType c setlocal expandtab shiftwidth=4 tabstop=4 softtabstop=4
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
" enable mouse " enable mouse
set mouse=nvc set mouse=nvc

File diff suppressed because it is too large Load Diff

336
zsh/zshrc.local Normal file
View File

@@ -0,0 +1,336 @@
# Filename: /etc/skel/.zshrc
# Purpose: config file for zsh (z shell)
# Authors: (c) grml-team (grml.org)
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2 or any later version.
################################################################################
# Nowadays, grml's zsh setup lives in only *one* zshrc file.
# That is the global one: /etc/zsh/zshrc (from grml-etc-core).
# It is best to leave *this* file untouched and do personal changes to
# your zsh setup via ${HOME}/.zshrc.local which is loaded at the end of
# the global zshrc.
#
# That way, we enable people on other operating systems to use our
# setup, too, just by copying our global zshrc to their ${HOME}/.zshrc.
# Adjustments would still go to the .zshrc.local file.
################################################################################
## Inform users about upgrade path for grml's old zshrc layout, assuming that:
## /etc/skel/.zshrc was installed as ~/.zshrc,
## /etc/zsh/zshrc was installed as ~/.zshrc.global and
## ~/.zshrc.local does not exist yet.
if [ -r ~/.zshrc -a -r ~/.zshrc.global -a ! -r ~/.zshrc.local ] ; then
printf '-!-\n'
printf '-!- Looks like you are using the old zshrc layout of grml.\n'
printf '-!- Please read the notes in the grml-zsh-refcard, being'
printf '-!- available at: http://grml.org/zsh/\n'
printf '-!-\n'
printf '-!- If you just want to get rid of this warning message execute:\n'
printf '-!- touch ~/.zshrc.local\n'
printf '-!-\n'
fi
## Settings for umask
#if (( EUID == 0 )); then
# umask 002
#else
# umask 022
#fi
## Now, we'll give a few examples of what you might want to use in your
## .zshrc.local file (just copy'n'paste and uncomment it there):
## Prompt theme extension ##
# Virtualenv support
#function virtual_env_prompt () {
# REPLY=${VIRTUAL_ENV+(${VIRTUAL_ENV:t}) }
#}
#grml_theme_add_token virtual-env -f virtual_env_prompt '%F{magenta}' '%f'
#zstyle ':prompt:grml:left:setup' items rc virtual-env change-root user at host path vcs percent
## ZLE tweaks ##
## use the vi navigation keys (hjkl) besides cursor keys in menu completion
#bindkey -M menuselect 'h' vi-backward-char # left
#bindkey -M menuselect 'k' vi-up-line-or-history # up
#bindkey -M menuselect 'l' vi-forward-char # right
#bindkey -M menuselect 'j' vi-down-line-or-history # bottom
## set command prediction from history, see 'man 1 zshcontrib'
#is4 && zrcautoload predict-on && \
#zle -N predict-on && \
#zle -N predict-off && \
#bindkey "^X^Z" predict-on && \
#bindkey "^Z" predict-off
## press ctrl-q to quote line:
#mquote () {
# zle beginning-of-line
# zle forward-word
# # RBUFFER="'$RBUFFER'"
# RBUFFER=${(q)RBUFFER}
# zle end-of-line
#}
#zle -N mquote && bindkey '^q' mquote
## define word separators (for stuff like backward-word, forward-word, backward-kill-word,..)
#WORDCHARS='*?_-.[]~=/&;!#$%^(){}<>' # the default
#WORDCHARS=.
#WORDCHARS='*?_[]~=&;!#$%^(){}'
#WORDCHARS='${WORDCHARS:s@/@}'
# just type '...' to get '../..'
#rationalise-dot() {
#local MATCH
#if [[ $LBUFFER =~ '(^|/| | |'$'\n''|\||;|&)\.\.$' ]]; then
# LBUFFER+=/
# zle self-insert
# zle self-insert
#else
# zle self-insert
#fi
#}
#zle -N rationalise-dot
#bindkey . rationalise-dot
## without this, typing a . aborts incremental history search
#bindkey -M isearch . self-insert
#bindkey '\eq' push-line-or-edit
## some popular options ##
## add `|' to output redirections in the history
#setopt histallowclobber
## try to avoid the 'zsh: no matches found...'
#setopt nonomatch
## warning if file exists ('cat /dev/null > ~/.zshrc')
#setopt NO_clobber
## don't warn me about bg processes when exiting
#setopt nocheckjobs
## alert me if something failed
#setopt printexitvalue
## with spelling correction, assume dvorak kb
#setopt dvorak
## Allow comments even in interactive shells
#setopt interactivecomments
## compsys related snippets ##
## changed completer settings
#zstyle ':completion:*' completer _complete _correct _approximate
#zstyle ':completion:*' expand prefix suffix
## another different completer setting: expand shell aliases
#zstyle ':completion:*' completer _expand_alias _complete _approximate
## to have more convenient account completion, specify your logins:
#my_accounts=(
# {grml,grml1}@foo.invalid
# grml-devel@bar.invalid
#)
#other_accounts=(
# {fred,root}@foo.invalid
# vera@bar.invalid
#)
#zstyle ':completion:*:my-accounts' users-hosts $my_accounts
#zstyle ':completion:*:other-accounts' users-hosts $other_accounts
## add grml.org to your list of hosts
#hosts+=(grml.org)
#zstyle ':completion:*:hosts' hosts $hosts
## telnet on non-default ports? ...well:
## specify specific port/service settings:
#telnet_users_hosts_ports=(
# user1@host1:
# user2@host2:
# @mail-server:{smtp,pop3}
# @news-server:nntp
# @proxy-server:8000
#)
#zstyle ':completion:*:*:telnet:*' users-hosts-ports $telnet_users_hosts_ports
## the default grml setup provides '..' as a completion. it does not provide
## '.' though. If you want that too, use the following line:
#zstyle ':completion:*' special-dirs true
## aliases ##
## translate
#alias u='translate -i'
## ignore ~/.ssh/known_hosts entries
#alias insecssh='ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" -o "PreferredAuthentications=keyboard-interactive"'
## global aliases (for those who like them) ##
#alias -g '...'='../..'
#alias -g '....'='../../..'
#alias -g BG='& exit'
#alias -g C='|wc -l'
#alias -g G='|grep'
#alias -g H='|head'
#alias -g Hl=' --help |& less -r'
#alias -g K='|keep'
#alias -g L='|less'
#alias -g LL='|& less -r'
#alias -g M='|most'
#alias -g N='&>/dev/null'
#alias -g R='| tr A-z N-za-m'
#alias -g SL='| sort | less'
#alias -g S='| sort'
#alias -g T='|tail'
#alias -g V='| vim -'
## instead of global aliase it might be better to use grmls $abk assoc array, whose contents are expanded after pressing ,.
#$abk[SnL]="| sort -n | less"
## get top 10 shell commands:
#alias top10='print -l ${(o)history%% *} | uniq -c | sort -nr | head -n 10'
## Execute \kbd{./configure}
#alias CO="./configure"
## Execute \kbd{./configure --help}
#alias CH="./configure --help"
## miscellaneous code ##
## Use a default width of 80 for manpages for more convenient reading
#export MANWIDTH=${MANWIDTH:-80}
## Set a search path for the cd builtin
#cdpath=(.. ~)
## variation of our manzsh() function; pick you poison:
#manzsh() { /usr/bin/man zshall | most +/"$1" ; }
## Switching shell safely and efficiently? http://www.zsh.org/mla/workers/2001/msg02410.html
#bash() {
# NO_SWITCH="yes" command bash "$@"
#}
#restart () {
# exec $SHELL $SHELL_ARGS "$@"
#}
## Handy functions for use with the (e::) globbing qualifier (like nt)
#contains() { grep -q "$*" $REPLY }
#sameas() { diff -q "$*" $REPLY &>/dev/null }
#ot () { [[ $REPLY -ot ${~1} ]] }
## get_ic() - queries imap servers for capabilities; real simple. no imaps
#ic_get() {
# emulate -L zsh
# local port
# if [[ ! -z $1 ]] ; then
# port=${2:-143}
# print "querying imap server on $1:${port}...\n";
# print "a1 capability\na2 logout\n" | nc $1 ${port}
# else
# print "usage:\n $0 <imap-server> [port]"
# fi
#}
## List all occurrences of programm in current PATH
#plap() {
# emulate -L zsh
# if [[ $# = 0 ]] ; then
# echo "Usage: $0 program"
# echo "Example: $0 zsh"
# echo "Lists all occurrences of program in the current PATH."
# else
# ls -l ${^path}/*$1*(*N)
# fi
#}
## Find out which libs define a symbol
#lcheck() {
# if [[ -n "$1" ]] ; then
# nm -go /usr/lib/lib*.a 2>/dev/null | grep ":[[:xdigit:]]\{8\} . .*$1"
# else
# echo "Usage: lcheck <function>" >&2
# fi
#}
## Download a file and display it locally
#uopen() {
# emulate -L zsh
# if ! [[ -n "$1" ]] ; then
# print "Usage: uopen \$URL/\$file">&2
# return 1
# else
# FILE=$1
# MIME=$(curl --head $FILE | \
# grep Content-Type | \
# cut -d ' ' -f 2 | \
# cut -d\; -f 1)
# MIME=${MIME%$'\r'}
# curl $FILE | see ${MIME}:-
# fi
#}
## Memory overview
#memusage() {
# ps aux | awk '{if (NR > 1) print $5;
# if (NR > 2) print "+"}
# END { print "p" }' | dc
#}
## print hex value of a number
#hex() {
# emulate -L zsh
# if [[ -n "$1" ]]; then
# printf "%x\n" $1
# else
# print 'Usage: hex <number-to-convert>'
# return 1
# fi
#}
## log out? set timeout in seconds...
## ...and do not log out in some specific terminals:
#if [[ "${TERM}" == ([Exa]term*|rxvt|dtterm|screen*) ]] ; then
# unset TMOUT
#else
# TMOUT=1800
#fi
## associate types and extensions (be aware with perl scripts and anwanted behaviour!)
#check_com zsh-mime-setup || { autoload zsh-mime-setup && zsh-mime-setup }
#alias -s pl='perl -S'
## ctrl-s will no longer freeze the terminal.
#stty erase "^?"
## you want to automatically use a bigger font on big terminals?
#if [[ "$TERM" == "xterm" ]] && [[ "$LINES" -ge 50 ]] && [[ "$COLUMNS" -ge 100 ]] && [[ -z "$SSH_CONNECTION" ]] ; then
# large
#fi
## Some quick Perl-hacks aka /useful/ oneliner
#bew() { perl -le 'print unpack "B*","'$1'"' }
#web() { perl -le 'print pack "B*","'$1'"' }
#hew() { perl -le 'print unpack "H*","'$1'"' }
#weh() { perl -le 'print pack "H*","'$1'"' }
#pversion() { perl -M$1 -le "print $1->VERSION" } # i. e."pversion LWP -> 5.79"
#getlinks () { perl -ne 'while ( m/"((www|ftp|http):\/\/.*?)"/gc ) { print $1, "\n"; }' $* }
#gethrefs () { perl -ne 'while ( m/href="([^"]*)"/gc ) { print $1, "\n"; }' $* }
#getanames () { perl -ne 'while ( m/a name="([^"]*)"/gc ) { print $1, "\n"; }' $* }
#getforms () { perl -ne 'while ( m:(\</?(input|form|select|option).*?\>):gic ) { print $1, "\n"; }' $* }
#getstrings () { perl -ne 'while ( m/"(.*?)"/gc ) { print $1, "\n"; }' $*}
#getanchors () { perl -ne 'while ( m/<2F>([^<5E><>\n]+)<29>/gc ) { print $1, "\n"; }' $* }
#showINC () { perl -e 'for (@INC) { printf "%d %s\n", $i++, $_ }' }
#vimpm () { vim `perldoc -l $1 | sed -e 's/pod$/pm/'` }
#vimhelp () { vim -c "help $1" -c on -c "au! VimEnter *" }
## END OF FILE #################################################################