Initial commit

This commit is contained in:
Martin Pander
2020-09-10 09:54:18 +02:00
commit 03c7bc3c59
50 changed files with 7816 additions and 0 deletions

0
.gitignore vendored Normal file
View File

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "vim/bundle/Vundle.vim"]
path = vim/bundle/Vundle.vim
url = https://github.com/gmarik/Vundle.vim.git

3
config/bash_profile Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
source ~/.bashrc

198
config/bashrc Normal file
View File

@ -0,0 +1,198 @@
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
export PATH="$HOME/bin:/usr/local/bin:$PATH"
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export EDITOR=nvim
# Prevent file overwrite on stdout redirection
# Use `>|` to force redirection to an existing file
set -o noclobber
# Automatically trim long paths in the prompt (requires Bash 4.x)
PROMPT_DIRTRIM=2
# Enable history expansion with space
# E.g. typing !!<space> will replace the !! with your last command
bind Space:magic-space
# Turn on recursive globbing (enables ** to recurse all directories)
shopt -s globstar 2> /dev/null
## SMARTER TAB-COMPLETION (Readline bindings) ##
# Perform file completion in a case insensitive fashion
bind "set completion-ignore-case on"
# Treat hyphens and underscores as equivalent
bind "set completion-map-case on"
# Display matches for ambiguous patterns at first tab press
bind "set show-all-if-ambiguous on"
## SANE HISTORY DEFAULTS ##
# Append to the history file, don't overwrite it
shopt -s histappend
# Save multi-line commands as one command
shopt -s cmdhist
# Record each line as it gets issued
PROMPT_COMMAND='history -a'
# Huge history. Doesn't appear to slow things down, so why not?
HISTSIZE=500000
HISTFILESIZE=100000
# Avoid duplicate entries
HISTCONTROL="erasedups:ignoreboth"
# Don't record some commands
export HISTIGNORE="&:[ ]*:exit:ls:bg:fg:history:clear"
# Useful timestamp format
HISTTIMEFORMAT='%F %T '
# Enable incremental history search with up/down arrows (also Readline goodness)
# Learn more about this here: http://codeinthehole.com/writing/the-most-important-command-line-tip-incremental-history-searching-with-inputrc/
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
bind '"\e[C": forward-char'
bind '"\e[D": backward-char'
## BETTER DIRECTORY NAVIGATION ##
# Prepend cd to directory names automatically
shopt -s autocd 2> /dev/null
# Correct spelling errors during tab-completion
shopt -s dirspell 2> /dev/null
# Correct spelling errors in arguments supplied to cd
shopt -s cdspell 2> /dev/null
# This defines where cd looks for targets
# Add the directories you want to have fast access to, separated by colon
# Ex: CDPATH=".:~:~/projects" will look for targets in the current working directory, in home and in the ~/projects folder
CDPATH="."
# This allows you to bookmark your favorite places across the file system
# Define a variable containing a path and you will be able to cd into it regardless of the directory you're in
shopt -s cdable_vars
platform=$(uname)
if [[ $platform == "Linux" ]]; then
TERM=xterm-256color
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [[ "$color_prompt" == yes ]]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto -GFh'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
# xcape
#~/git/xcape/xcape -e 'Control_L=Escape'
# add Matlab path
# export PATH=$PATH:/usr/local/MATLAB/R2015b/bin
export PATH=/usr/local/MATLAB/R2015b/bin:/usr/local/MATLAB/R2015b/toolbox/local:$PATH
elif [[ $platform == "Darwin" ]]; then
PS1="\u@\h:\[\033[0;34m\]\w\[\033[0m\]$ "
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
alias ls="ls -CGFh"
fi
LESS="-im"
export LESS
alias la="ls -A"
alias ll="ls -lha"
alias vim="nvim"
alias isas="ssh pander@i81server.ira.uka.de"
source ~/bin/autocomplete.sh
# alias vims="vim -c \"call feedkeys(':source ~/.vim/obsessions/')\""
[ -f ~/.fzf.bash ] && source ~/.fzf.bash

106
config/emacs Normal file
View File

@ -0,0 +1,106 @@
(require 'package)
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/"))
(setq package-enable-at-startup nil)
(package-initialize)
(setq make-backup-files nil)
; ORG MODE
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-cb" 'org-iswitchb)
(setq org-hide-leading-stars t)
(setq org-log-done 'time)
(setq org-todo-keyword-faces
'(("WORKING" . "orange")))
(setq org-todo-keywords
'((sequence "TODO" "WORKING" "|" "DONE")))
(setq org-tag-alist '(("research" . ?r)
("code" . ?c)
("write" . ?w)
("kom" . ?k)
("mail" . ?m)
("call" . ?t)))
; (setq org-tag-alist '((:startgrouptag)
; ("activity")
; (:grouptags)
; ("research" . ?r)
; ("code" . ?c)
; ("write" . ?w)
; (:endgrouptag)
; (:startgrouptag)
; ("kom" ?k)
; (:grouptags)
; ("mail" . ?m)
; ("call" . ?t)
; (:endgrouptag)))
(require 'evil)
(evil-mode t)
;; esc quits
(defun minibuffer-keyboard-quit ()
"Abort recursive edit.
In Delete Selection mode, if the mark is active, just deactivate it;
then it takes a second \\[keyboard-quit] to abort the minibuffer."
(interactive)
(if (and delete-selection-mode transient-mark-mode mark-active)
(setq deactivate-mark t)
(when (get-buffer "*Completions*") (delete-windows-on "*Completions*"))
(abort-recursive-edit)))
(define-key evil-normal-state-map [escape] 'keyboard-quit)
(define-key evil-visual-state-map [escape] 'keyboard-quit)
(define-key minibuffer-local-map [escape] 'minibuffer-keyboard-quit)
(define-key minibuffer-local-ns-map [escape] 'minibuffer-keyboard-quit)
(define-key minibuffer-local-completion-map [escape] 'minibuffer-keyboard-quit)
(define-key minibuffer-local-must-match-map [escape] 'minibuffer-keyboard-quit)
(define-key minibuffer-local-isearch-map [escape] 'minibuffer-keyboard-quit)
(global-set-key [escape] 'evil-exit-emacs-state)
(define-key evil-normal-state-map (kbd "<return>") 'org-open-at-point)
;; helm settings (TAB in helm window for actions over selected items,
;; C-SPC to select items)
; (require 'helm-config)
; (require 'helm-misc)
; (require 'helm-projectile)
; (require 'helm-locate)
; (setq helm-quick-update t)
; (setq helm-bookmark-show-location t)
; (setq helm-buffers-fuzzy-matching t)
; (after 'projectile
; (package 'helm-projectile))
; (global-set-key (kbd "M-x") 'helm-M-x)
; (defun helm-my-buffers ()
; (interactive)
; (let ((helm-ff-transformer-show-only-basename nil))
; (helm-other-buffer '(helm-c-source-buffers-list
; helm-c-source-elscreen
; helm-c-source-projectile-files-list
; helm-c-source-ctags
; helm-c-source-recentf
; helm-c-source-locate)
; "*helm-my-buffers*")))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(inhibit-startup-screen t)
'(org-agenda-files
(quote
("~/arbeit/org/entropie.org" "~/arbeit/org/particleFlow.org" "~/arbeit/org/seminar.org" "~/arbeit/org/ideen.org"))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

View File

@ -0,0 +1,6 @@
#!/bin/sh
set -e
PATH="/usr/local/bin:$PATH"
trap "rm -f .git/tags.$$" EXIT
ctags --tag-relative -Rf.git/tags.$$ --exclude=.git --fields=+l
mv .git/tags.$$ .git/tags

View File

@ -0,0 +1,2 @@
#!/bin/sh
.git/hooks/ctags > /dev/null 2>&1 &

View File

@ -0,0 +1,3 @@
#!/bin/sh
#git push origin
.git/hooks/ctags > /dev/null 2>&1 &

View File

@ -0,0 +1,2 @@
#!/bin/sh
.git/hooks/ctags > /dev/null 2>&1 &

View File

@ -0,0 +1,4 @@
#!/bin/sh
case "$1" in
rebase) exec .git/hooks/post-merge ;;
esac

View File

@ -0,0 +1,22 @@
# mac
.DS_Store
# c++
*.o
*.d
*.pyc
# tex
*.pdf
*.log
*.aux
*.fls
*.fdb_latexmk
*.toc
*.loa
*.bbl
*.blg
*.rev
*.tdo
*.xmp
*.out

32
config/gitconfig Normal file
View File

@ -0,0 +1,32 @@
[color]
ui = auto
status = auto
branch = auto
[core]
editor = nvim
[merge]
tool = nvimdiff
[mergetool "nvimdiff"]
cmd = nvim -d $BASE $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[diff]
tool = nvimdiff
[difftool]
prompt = false
[difftool "nvimdiff"]
cmd = "nvim -d -u ~/.config/nvim/init.vim \"$LOCAL\" \"$REMOTE\""
[user]
name = Martin Pander
email = martin.pander@knowtion.de
[alias]
st = status
ci = commit
co = checkout
br = branch
pl = pull
ps = push
mno = merge --no-ff
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit
[push]
default = matching
[init]
templatedir = ~/.git_template

7
config/inputrc Normal file
View File

@ -0,0 +1,7 @@
set editing-mode vi
set keymap vi-command
"\e[A": history-search-backward
"\e[B": history-search-forward
"\e[C": forward-char
"\e[D": backward-char

15
config/setup Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
for dotfiles in $SCRIPTDIR/*; do
dotfile=${dotfiles##*/}
if [[ $dotfile != "setup" ]]; then
if [[ ! -a $HOME/.$dotfile ]]; then
ln -s $SCRIPTDIR/$dotfile $HOME/.$dotfile
echo $dotfile "symlinked to" $HOME/.$dotfile
else
echo "already exists:" $HOME/.$dotfile
fi
fi
done

67
config/tmux.conf Normal file
View File

@ -0,0 +1,67 @@
set -g default-terminal "screen-256color"
# set -g utf8
# setw -g utf8 on
# set -g status-utf8 on
set -g mouse on
# set -g mode-mouse on
#setw -g mouse-select-window on
#setw -g mouse-select-pane on
set -s escape-time 0
set -g display-time 1500
#set-option -g default-shell /bin/zsh
#######################################
# key bindings
#######################################
set -g prefix C-a
bind C-a send-prefix
unbind C-b
setw -g mode-keys vi
unbind S
bind S command-prompt "switch -t %1"
bind C-r source-file ~/.tmux.conf
bind-key -n M-K switch-client -p
bind-key -n M-J switch-client -n
bind-key -n M-L next-window
bind-key -n M-H previous-window
#######################################
# status line
#######################################
# /* source "/usr/lib/python3.5/site-packages/powerline/bindings/tmux/powerline.conf" */
set -g status-justify centre
set -g status-left "#[bg=#808080,fg=#ffffff,bold] #S #[default]#[bg=#BCBCBC] #{-30:pane_title} "
set -g status-left-length 40
set -g status-right "#[bg=#BCBCBC] %H:%M #[bg=#808080,fg=#ffffff] %d.%m.%y "
# setw -g window-status-format " #W#F "
# setw -g window-status-current-format " #W#F "
setw -g window-status-format " #W "
setw -g window-status-current-format " #W "
setw -g window-status-separator ""
#######################################
# colors, taken from vim-lucius
#######################################
set -g status-style "bg=#DADADA,fg=#000000"
setw -g window-status-style "bg=#BCBCBC,fg=#000000"
setw -g window-status-current-style "bg=#808080,fg=#ffffff"
setw -g window-status-activity-style "bg=#AFD7AF,fg=#000000"
setw -g window-status-bell-style "bg=#AFD7AF,fg=#000000"
#setw -g window-status-content-style "bg=#AFD7AF,fg=#000000"
set -g pane-active-border-style "bg=#eeeeee,fg=#006699"
set -g pane-border-style "bg=#eeeeee,fg=#999999"

10
config/vimperatorrc Normal file
View File

@ -0,0 +1,10 @@
"3.14.0 (created: 2016/06/07 23:58:16)
nnoremap j 10j
nnoremap k 10k
nnoremap gr :emenu<Space>View.Enter<Space>Reader<Space>View<Return>
set hintchars=hjklasdf
source! /home/pander/.vimperatorrc.local
set toolbars=nonavigation
" vim: set ft=vimperator:

168
config/zpreztorc Normal file
View File

@ -0,0 +1,168 @@
#
# Sets Prezto options.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# General
#
# Set case-sensitivity for completion, history lookup, etc.
# zstyle ':prezto:*:*' case-sensitive 'yes'
# Color output (auto set to 'no' on dumb terminals).
zstyle ':prezto:*:*' color 'yes'
# Set the Zsh modules to load (man zshmodules).
# zstyle ':prezto:load' zmodule 'attr' 'stat'
# Set the Zsh functions to load (man zshcontrib).
# zstyle ':prezto:load' zfunction 'zargs' 'zmv'
# Set the Prezto modules to load (browse modules).
# The order matters.
zstyle ':prezto:load' pmodule \
'environment' \
'terminal' \
'editor' \
'history' \
'directory' \
'spectrum' \
'utility' \
'completion' \
'syntax-highlighting' \
'history-substring-search' \
'prompt' \
'git'
#
# Editor
#
# Set the key mapping style to 'emacs' or 'vi'.
zstyle ':prezto:module:editor' key-bindings 'vi'
# Auto convert .... to ../..
# zstyle ':prezto:module:editor' dot-expansion 'yes'
#
# Git
#
# Ignore submodules when they are 'dirty', 'untracked', 'all', or 'none'.
# zstyle ':prezto:module:git:status:ignore' submodules 'all'
#
# GNU Utility
#
# Set the command prefix on non-GNU systems.
# zstyle ':prezto:module:gnu-utility' prefix 'g'
#
# History Substring Search
#
# Set the query found color.
# zstyle ':prezto:module:history-substring-search:color' found ''
# Set the query not found color.
# zstyle ':prezto:module:history-substring-search:color' not-found ''
# Set the search globbing flags.
# zstyle ':prezto:module:history-substring-search' globbing-flags ''
#
# Pacman
#
# Set the Pacman frontend.
# zstyle ':prezto:module:pacman' frontend 'yaourt'
#
# Prompt
#
# Set the prompt theme to load.
# Setting it to 'random' loads a random theme.
# Auto set to 'off' on dumb terminals.
# zstyle ':prezto:module:prompt' theme 'damoekri'
# zstyle ':prezto:module:prompt' theme 'walters'
zstyle ':prezto:module:prompt' theme 'minimal'
#
# Ruby
#
# Auto switch the Ruby version on directory change.
# zstyle ':prezto:module:ruby:chruby' auto-switch 'yes'
#
# Screen
#
# Auto start a session when Zsh is launched in a local terminal.
# zstyle ':prezto:module:screen:auto-start' local 'yes'
# Auto start a session when Zsh is launched in a SSH connection.
# zstyle ':prezto:module:screen:auto-start' remote 'yes'
#
# SSH
#
# Set the SSH identities to load into the agent.
# zstyle ':prezto:module:ssh:load' identities 'id_rsa' 'id_rsa2' 'id_github'
#
# Syntax Highlighting
#
# Set syntax highlighters.
zstyle ':prezto:module:syntax-highlighting' highlighters \
'main' \
'brackets' \
'pattern' \
'cursor' \
'root'
#
# Set syntax highlighting styles.
# zstyle ':prezto:module:syntax-highlighting' styles \
# 'builtin' 'bg=blue' \
# 'command' 'bg=blue' \
# 'function' 'bg=blue'
#
# Terminal
#
# Auto set the tab and window titles.
# zstyle ':prezto:module:terminal' auto-title 'yes'
# Set the window title format.
# zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s'
# Set the tab title format.
# zstyle ':prezto:module:terminal:tab-title' format '%m: %s'
#
# Tmux
#
# Auto start a session when Zsh is launched in a local terminal.
# zstyle ':prezto:module:tmux:auto-start' local 'yes'
# Auto start a session when Zsh is launched in a SSH connection.
# zstyle ':prezto:module:tmux:auto-start' remote 'yes'
# Integrate with iTerm2.
# zstyle ':prezto:module:tmux:iterm' integrate 'yes'
#
# Completion
#
# Have editor tab completion ignore binary/media files.
zstyle ':prezto:module:completion' editor-ignores 'yes'

32
config/zshrc Normal file
View File

@ -0,0 +1,32 @@
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
setopt autocd extendedglob
unsetopt beep
bindkey -v
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/pander/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
typeset -A ZSH_HIGHLIGHT_STYLES
ZSH_HIGHLIGHT_STYLES=(cursor bold)
export EDITOR=nvim
export PATH="$HOME/bin:/usr/local/bin:$PATH"
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# export PATH=/usr/local/MATLAB/R2015b/bin:/usr/local/MATLAB/R2015b/toolbox/local:$PATH
export PATH=/usr/local/MATLAB/R2016a/bin:/usr/local/MATLAB/R2016a/toolbox/local:$PATH
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
unalias rm
alias open='nautilus . &'

1
nvim/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.cache/

123
nvim/UltiSnips/all.snippets Normal file
View File

@ -0,0 +1,123 @@
# This file contains snippets that are always defined. I personally
# have snippets for signatures and often needed texts
# sligthly lower priority than everything else since specialized versions
# should overwrite. The user needs to adjust her priority in her snippets to
# ~-55 so that other filetypes will still overwrite.
priority -60
##############
# NICE BOXES #
##############
global !p
import string, vim
""" Maps a filetype to comment format used for boxes.
Automatically filled during usage"""
_commentDict = { }
def _parse_comments(s):
""" Parses vim's comments option to extract comment format """
i = iter(s.split(","))
rv = []
try:
while True:
# get the flags and text of a comment part
flags, text = next(i).split(':', 1)
if len(flags) == 0:
rv.append((text, text, text, ""))
# parse 3-part comment, but ignore those with O flag
elif flags[0] == 's' and 'O' not in flags:
ctriple = []
indent = ""
if flags[-1] in string.digits:
indent = " " * int(flags[-1])
ctriple.append(text)
flags,text = next(i).split(':', 1)
assert(flags[0] == 'm')
ctriple.append(text)
flags,text = next(i).split(':', 1)
assert(flags[0] == 'e')
ctriple.append(text)
ctriple.append(indent)
rv.append(ctriple)
elif flags[0] == 'b':
if len(text) == 1:
rv.insert(0, (text,text,text, ""))
except StopIteration:
return rv
def _get_comment_format():
""" Returns a 4-element tuple representing the comment format for
the current file. """
return _parse_comments(vim.eval("&comments"))[0]
def make_box(twidth, bwidth=None):
b, m, e, i = _get_comment_format()
bwidth_inner = bwidth - 3 - max(len(b), len(i + e)) if bwidth else twidth + 2
sline = b + m + bwidth_inner * m[0] + 2 * m[0]
nspaces = (bwidth_inner - twidth) // 2
mlines = i + m + " " + " " * nspaces
mlinee = " " + " "*(bwidth_inner - twidth - nspaces) + m
eline = i + m + bwidth_inner * m[0] + 2 * m[0] + e
return sline, mlines, mlinee, eline
def foldmarker():
"Return a tuple of (open fold marker, close fold marker)"
return vim.eval("&foldmarker").split(",")
endglobal
snippet box "A nice box with the current comment symbol" b
`!p
box = make_box(len(t[1]))
snip.rv = box[0] + '\n' + box[1]
`${1:content}`!p
box = make_box(len(t[1]))
snip.rv = box[2] + '\n' + box[3]`
$0
endsnippet
snippet bbox "A nice box over the full width" b
`!p
width = int(vim.eval("&textwidth")) or 71
box = make_box(len(t[1]), width)
snip.rv = box[0] + '\n' + box[1]
`${1:content}`!p
box = make_box(len(t[1]), width)
snip.rv = box[2] + '\n' + box[3]`
$0
endsnippet
snippet fold "Insert a vim fold marker" b
`!p snip.rv = _get_comment_format()[0]` ${1:Fold description} `!p snip.rv = foldmarker()[0]`${2:1} `!p snip.rv = _get_comment_format()[2]`
endsnippet
snippet foldc "Insert a vim fold close marker" b
`!p snip.rv = _get_comment_format()[0]` ${2:1}`!p snip.rv = foldmarker()[1]` `!p snip.rv = _get_comment_format()[2]`
endsnippet
snippet foldp "Insert a vim fold marker pair" b
`!p snip.rv = _get_comment_format()[0]` ${1:Fold description} `!p snip.rv = foldmarker()[0]` `!p snip.rv = _get_comment_format()[2]`
${2:${VISUAL:Content}}
`!p snip.rv = _get_comment_format()[0]` `!p snip.rv = foldmarker()[1]` $1 `!p snip.rv = _get_comment_format()[2]`
endsnippet
##########################
# LOREM IPSUM GENERATORS #
##########################
snippet lorem "Lorem Ipsum - 50 Words" b
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet.
endsnippet
# vim:ft=snippets:

154
nvim/UltiSnips/c.snippets Normal file
View File

@ -0,0 +1,154 @@
###########################################################################
# TextMate Snippets #
###########################################################################
priority -50
snippet def "#define ..."
#define ${1}
endsnippet
snippet ifndef "#ifndef ... #define ... #endif"
#ifndef ${1/([A-Za-z0-9_]+).*/$1/}
#define ${1:SYMBOL} ${2:value}
#endif
endsnippet
snippet #if "#if #endif" b
#if ${1:0}
${VISUAL}${0:${VISUAL/(.*)/(?1::code)/}}
#endif
endsnippet
snippet inc "#include local header (inc)"
#include "${1:`!p snip.rv = snip.basename + '.h'`}"
endsnippet
snippet Inc "#include <> (Inc)"
#include <${1:.h}>
endsnippet
snippet mark "#pragma mark (mark)"
#if 0
${1:#pragma mark -
}#pragma mark $2
#endif
$0
endsnippet
snippet main "main() (main)"
int main(int argc, char *argv[])
{
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
return 0;
}
endsnippet
# snippet for "for loop (for)"
# for (${2:i} = 0; $2 < ${1:count}; ${3:++$2})
# {
# ${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
# }
# endsnippet
snippet for "for int loop (for)"
for ( ${4:int} ${2:i}=0; $2<${1:count}; ${3:$2++} ) {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
}
endsnippet
snippet enum "Enumeration"
enum ${1:name} { $0 };
endsnippet
snippet once "Include header once only guard"
#ifndef ${1:`!p
if not snip.c:
import random, string
name = re.sub(r'[^A-Za-z0-9]+','_', snip.fn).upper()
rand = ''.join(random.sample(string.ascii_letters+string.digits, 8))
snip.rv = ('%s_%s' % (name,rand)).upper()
else:
snip.rv = snip.c`}
#define $1
${0}
#endif /* end of include guard: $1 */
endsnippet
snippet td "Typedef"
typedef ${1:int} ${2:MyCustomType};
endsnippet
snippet wh "while loop"
while(${1:/* condition */}) {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
}
endsnippet
snippet do "do...while loop (do)"
do {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
} while(${1:/* condition */});
endsnippet
snippet fprintf "fprintf ..."
fprintf(${1:stderr}, "${2:%s}\n"${2/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$3${2/([^%]|%%)*(%.)?.*/(?2:\);)/}
endsnippet
snippet if "if .. (if)"
if (${1:/* condition */})
{
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
}
endsnippet
snippet el "else .. (else)"
else {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
}
endsnippet
snippet eli "else if .. (eli)"
else if (${1:/* condition */}) {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
}
endsnippet
snippet ife "if .. else (ife)"
if (${1:/* condition */})
{
${2:/* code */}
}
else
{
${3:/* else */}
}
endsnippet
snippet printf "printf .. (printf)"
printf("${1:%s}\n"${1/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$2${1/([^%]|%%)*(%.)?.*/(?2:\);)/}
endsnippet
snippet st "struct"
struct ${1:`!p snip.rv = (snip.basename or "name") + "_t"`}
{
${0:/* data */}
};
endsnippet
snippet fun "function" b
${1:void} ${2:function_name}(${3})
{
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
}
endsnippet
snippet fund "function declaration" b
${1:void} ${2:function_name}(${3});
endsnippet
# vim:ft=snippets:

View File

@ -0,0 +1,89 @@
priority -50
extends c
# We want to overwrite everything in parent ft.
priority -49
###########################################################################
# TextMate Snippets #
###########################################################################
snippet beginend "$1.begin(), $1.end() (beginend)"
${1:v}${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}begin(), $1${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}end()
endsnippet
snippet cl "class .. (class)"
class ${1:`!p snip.rv = snip.basename or "name"`}
{
public:
${1/(\w+).*/$1/} (${2:arguments});
virtual ~${1/(\w+).*/$1/} ();
private:
${0:/* data */}
};
endsnippet
snippet ns "namespace .. (namespace)"
namespace${1/.+/ /m}${1:`!p snip.rv = snip.basename or "name"`}
{
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
}${1/.+/ \/* /m}$1${1/.+/ *\/ /m}
endsnippet
snippet readfile "read file (readF)"
std::vector<char> v;
if (FILE *fp = fopen(${1:"filename"}, "r"))
{
char buf[1024];
while(size_t len = fread(buf, 1, sizeof(buf), fp))
v.insert(v.end(), buf, buf + len);
fclose(fp);
}
endsnippet
snippet map "std::map (map)"
std::map<${1:key}, ${2:value}> map$0;
endsnippet
snippet vector "std::vector (v)"
std::vector<${1:char}> v$0;
endsnippet
snippet tp "template <typename ..> (template)"
template <typename ${1:_InputIter}>
endsnippet
## my own snippets
snippet dv "debug with var"
std::cout << "$1\n" << ${1:var} << "\n" << std::endl;
endsnippet
snippet dvif "debug with var (if)"
if ( output_ ) std::cout << "$1\n" << ${1:var} << "\n" << std::endl;
endsnippet
snippet pm "debug with message"
std::cout << "${1:message}" << std::endl;
endsnippet
snippet pmif "debug with message (if)"
if ( output_ ) std::cout << "${1:message}" << std::endl;
endsnippet
snippet cb "function comment block" s
// =============================================================================
// ${1:comment}
// =============================================================================
endsnippet
snippet cf "function comment block" s
// == Function =================================================================
// Name : ${1:Name}
// Description: ${2:Description}
// =============================================================================
endsnippet
# vim:ft=snippets:

View File

@ -0,0 +1,6 @@
priority -50
snippet disp "Display variable" i
disp('${1:${VISUAL:variableName}}')
disp(${2:${VISUAL:variable}})
endsnippet

View File

@ -0,0 +1,92 @@
priority -50
global !p
import vim
# Tests for the existence of a variable declared by Vim's filetype detection
# suggesting the type of shell script of the current file
def testShell(scope, shell):
return vim.eval("exists('" + scope + ":is_" + shell + "')")
# Loops over the possible variables, checking for global variables
# first since they indicate an override by the user.
def getShell():
for scope in ["g", "b"]:
for shell in ["bash", "posix", "sh", "kornshell"]:
if testShell(scope, shell) == "1":
if shell == "kornshell":
return "ksh"
if shell == "posix":
return "sh"
return shell
return "sh"
endglobal
###########################################################################
# TextMate Snippets #
###########################################################################
snippet #!
`!p snip.rv = '#!/bin/' + getShell() + "\n\n" `
endsnippet
snippet !env "#!/usr/bin/env (!env)"
`!p snip.rv = '#!/usr/bin/env ' + getShell() + "\n\n" `
endsnippet
snippet temp "Tempfile"
${1:TMPFILE}="$(mktemp -t ${2:`!p
snip.rv = re.sub(r'[^a-zA-Z]', '_', snip.fn) or "untitled"
`})"
${3:${4/(.+)/trap "/}${4:rm -f '$${1/.*\s//}'}${4/(.+)/" 0 # EXIT\n/}${5/(.+)/trap "/}${5:rm -f '$${1/.*\s//}'; exit 1}${5/(.+)/" 2 # INT\n/}${6/(.+)/trap "/}${6:rm -f '$${1/.*\s//}'; exit 1}${6/(.+)/" 1 15 # HUP TERM\n/}}
endsnippet
snippet case "case .. esac (case)"
case ${1:word} in
${2:pattern} )
$0;;
esac
endsnippet
snippet elif "elif .. (elif)"
elif ${2:[[ ${1:condition} ]]}; then
${0:#statements}
endsnippet
snippet for "for ... done (for)"
for (( i = 0; i < ${1:10}; i++ )); do
${0:#statements}
done
endsnippet
snippet forin "for ... in ... done (forin)"
for ${1:i}${2/.+/ in /}${2:words}; do
${0:#statements}
done
endsnippet
snippet here "here document (here)"
<<-${2:'${1:TOKEN}'}
$0
${1/['"`](.+)['"`]/$1/}
endsnippet
snippet if "if ... then (if)"
if ${2:[[ ${1:condition} ]]}; then
${0:#statements}
fi
endsnippet
snippet until "until ... (done)"
until ${2:[[ ${1:condition} ]]}; do
${0:#statements}
done
endsnippet
snippet while "while ... (done)"
while ${2:[[ ${1:condition} ]]}; do
${0:#statements}
done
endsnippet
# vim:ft=snippets:

View File

158
nvim/UltiSnips/tex.snippets Normal file
View File

@ -0,0 +1,158 @@
priority -50
extends texmath
snippet document "document setup"
\documentclass[a4paper]{article}
\usepackage{defaultTex}
% \usepackage[style=alphabetic]{biblatex}
% \addbibresource{lib.bib}
\begin{document}
${1:text}
\end{document}
endsnippet
snippet "b(egin)?" "begin{} / end{}" br
\begin{${1:something}}
${0:${VISUAL}}
\label{${2}}
\end{$1}
endsnippet
snippet bo "bold"
\textbf{${1:${VISUAL}}}$0
endsnippet
snippet tab
\begin{${1:t}${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}{${2:c}}
$0${2/((?<=.)c|l|r)|./(?1: & )/g}
\end{$1${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}
endsnippet
snippet fig "Figure environment" b
\begin{figure}${2:[htpb]}
\centering
\includegraphics[width=${3:0.8}\linewidth]{${4:name.ext}}
\caption{${4/(\w+)\.\w+/\u$1/}$0}
\label{fig:${4/(\w+)\.\w+/$1/}}
\end{figure}
endsnippet
snippet enum "Enumerate" b
\begin{enumerate}
\item $1
\end{enumerate}
endsnippet
snippet item "Itemize" b
\begin{itemize}
\item $1
\end{itemize}
endsnippet
snippet desc "Description" b
\begin{description}
\item[$1] $0
\end{description}
endsnippet
snippet eq "equation"
\begin{equation}
${2:${VISUAL}}
\end{equation}
endsnippet
snippet eql "equation with label"
\begin{equation}
${2:${VISUAL}}
\label{$1}
\end{equation}
endsnippet
snippet eqs "aligned equations"
\begin{equation}
\begin{aligned}
${2:${VISUAL}}
\end{aligned}
\end{equation}
endsnippet
snippet eqsl "aligned equations with label"
\begin{equation}
\begin{aligned}
${2:${VISUAL}}
\end{aligned}
\label{$1}
\end{equation}
endsnippet
snippet align "align"
\begin{align}
${2:${VISUAL}}
\label{$1}
\end{align}
endsnippet
snippet it "Individual item" b
\item $1
endsnippet
snippet part "Part" b
\part{${1:part name}}
\label{prt:${2:${1/(\w+)|\W+/(?1:\L$0\E:_)/ga}}}
${0}
endsnippet
snippet cha "Chapter" b
\chapter{${1:chapter name}}
\label{cha:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0}
endsnippet
snippet sec "Section" b
\section{${1:section name}}
\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0}
endsnippet
snippet sub "Subsection" b
\subsection{${1:subsection name}}
\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0}
endsnippet
snippet ssub "Subsubsection" b
\subsubsection{${1:subsubsection name}}
\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0}
endsnippet
snippet par "Paragraph" b
\paragraph{${1:paragraph name}}
\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0}
endsnippet
snippet subp "Subparagraph" b
\subparagraph{${1:subparagraph name}}
\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0}
endsnippet
snippet ni "Non-indented paragraph" b
\noindent
${0}
endsnippet
snippet pac "Package" b
\usepackage[${1:options}]{${2:package}}$0
endsnippet
# vim:ft=snippets:

View File

@ -0,0 +1,85 @@
priority -50
##############
# MATH STUFF #
##############
# snippet eq "Equation" b
# \begin{equation}
# $0
# \end{equation}
# endsnippet
# snippet eqnn "Equation without number" b
# \begin{equation*}
# $0
# \end{equation*}
# endsnippet
# snippet eqa "Equation array" b
# \begin{eqnarray}
# $1 & $2 & $0
# \end{eqnarray}
# endsnippet
# snippet eqann "Equation array without numbers" b
# \begin{eqnarray*}
# $1 & $2 & $0
# \end{eqnarray*}
# endsnippet
snippet frac "Fraction" w
\frac{${1:${VISUAL:nom}}}{${2:denom}}
endsnippet
snippet mat "Smart Matrix"
\begin{${1:p/b/v/V/B/small}matrix}
$0
\end{$1matrix}
endsnippet
snippet lrb "left( right)" w
\left( ${1:${VISUAL}} \right)
endsnippet
snippet lrv "left| right|" w
\left| ${1:${VISUAL}} \right|
endsnippet
snippet lrB "left\{ right\}" w
\left\\{ ${1:${VISUAL}} \right\\}
endsnippet
snippet lre "left[ right]" w
\left[ ${1:${VISUAL}} \right]
endsnippet
# my snippets
snippet func "Function" w
\func{${1:${VISUAL}}}{${2}}
endsnippet
snippet funcb "Function with brackets" w
\funcb{${1:${VISUAL}}}{${2}}
endsnippet
snippet int "integral"
\int_{${1}}^{${2}}
endsnippet
snippet sum "sum"
\sum_{${1}}^{${2}}
endsnippet
snippet eqr "eqref"
\eqref{${1}}
endsnippet
snippet v "Vector" w
\vec
endsnippet
snippet bis "bis" w
\bis{${1}}{${2}}
endsnippet
# vim:ft=snippets:

2699
nvim/autoload/plug.vim Normal file

File diff suppressed because it is too large Load Diff

2664
nvim/autoload/plug.vim.old Normal file

File diff suppressed because it is too large Load Diff

438
nvim/init.vim Normal file
View File

@ -0,0 +1,438 @@
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" vim
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible
set mouse=a
set history=1000
set ruler
set number
set showcmd
set ttimeoutlen=100
set backspace=indent,eol,start
set tabstop=4
set expandtab
set shiftwidth=4
set softtabstop=4
set autoindent
set showmatch
set incsearch
set hlsearch
set wrapscan
set ignorecase
set smartcase
set hidden
set splitright
set splitbelow
" set backupdir=~/.config/nvim/backup,/tmp
" set backup
set noswapfile
set wildmode=longest,list
set nospell
set foldmethod=syntax
set foldopen-=block
set foldlevel=99
set lazyredraw
set listchars=eol,tab:\ \ ,trail
set fillchars=vert:\|,fold:\
set list
set laststatus=2
set scrolloff=8
set background=light
" set colorcolumn=100
set wrap
set showbreak=..
set clipboard+=unnamedplus
" set formatoptions+=l
set noerrorbells
set visualbell
set t_vb=
set title
set autoread
syntax on
let g:tex_flavor="latex"
" set listchars=eol:¬,tab:▸\ ,trail:·
" set listchars=eol:¬,tab:>\ ,trail:·
if !has('nvim') | set encoding=utf-8 | endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" plugins
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
call plug#begin('~/.local/share/nvim/site/plugins')
Plug 'kien/ctrlp.vim' | Plug 'sgur/ctrlp-extensions.vim'
Plug 'scrooloose/nerdtree'
" Plug 'scrooloose/syntastic'
Plug 'vim-scripts/bufexplorer.zip'
Plug 'majutsushi/tagbar'
Plug 'Shougo/deoplete.nvim'
Plug 'SirVer/ultisnips'
Plug 'Raimondi/delimitMate'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'junegunn/vim-easy-align'
Plug 'maxbrunsfeld/vim-yankstack'
Plug 'tpope/vim-repeat'
Plug 'wellle/targets.vim'
Plug 'benekastah/neomake'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-dispatch'
Plug 'lervag/vimtex'
Plug 'vim-scripts/MatlabFilesEdition'
Plug 'vim-scripts/LanguageTool'
" Plug 'mhinz/neovim-remote'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | Plug 'junegunn/fzf.vim'
Plug 'rking/ag.vim'
Plug 'tpope/vim-obsession'
Plug 'mhinz/vim-startify'
Plug 'wesQ3/vim-windowswap'
Plug 'bling/vim-airline' | Plug 'vim-airline/vim-airline-themes' |Plug 'jonathanfilip/vim-lucius'
Plug 'altercation/vim-colors-solarized'
call plug#end()
filetype plugin indent on
set omnifunc=syntaxcomplete#Complete
set completeopt=menu
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" plugin specific
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" NerdTree
let NERDTreeQuitOnOpen=1
let NERDTreeHijackNetrw=1
" syntastic
" set statusline+=%#warningmsg#
" set statusline+=%{SyntasticStatuslineFlag()}
" set statusline+=%*
" let g:syntastic_always_populate_loc_list = 1
" let g:syntastic_auto_loc_list = 1
" let g:syntastic_check_on_open = 1
" let g:syntastic_check_on_wq = 0
" CtrlP
set wildignore+=main,*.o,*.d,*.aux,*.bbl,*.lof,*.loa,*.blg,*.fdb_latexmk,*.fls,*.tdo,*.pdf,*.pyc
let g:ctrlp_switch_buffer = 'e'
let g:ctrlp_working_path_mode = 'ra'
let g:ctrlp_extensions = [ 'tag', 'buffertag', 'mixed' ]
let g:ctrlp_map = ''
" let g:ctrlp_prompt_mappings = {
" \ 'PrtSelectMove("j")': ['<c-n>', '<down>'],
" \ 'PrtSelectMove("k")': ['<c-p>', '<up>'],
" \}
" tagbar
let g:tagbar_left=1
let g:tagbar_autoclose=1
let g:tagbar_autofocus=1
" deoplete
let g:deoplete#enable_at_startup=1
" if !exists('g:deoplete#omni#input_patterns')
" let g:deoplete#omni#input_patterns = {}
" endif
" DelimitMate
let delimitMate_expand_space=1
let delimitMate_expand_cr=1
" UltiSnips
let g:UltiSnipsSnippetsDir='~/.config/nvim/UltiSnips'
let g:UltiSnipsSnippetsDirectories=["UltiSnips"]
let g:UltiSnipsExpandTrigger="<C-j>"
let g:UltiSnipsJumpForwardTrigger="<C-j>"
let g:UltiSnipsJumpBackwardTrigger="<C-k>"
" YankStack
let g:yankstack_map_keys=0
call yankstack#setup()
" vimtex
let g:vimtex_fold_enabled = 1
let g:vimtex_view_method = 'zathura'
let g:vimtex_quickfix_mode = 2
" let g:deoplete#omni#input_patterns.tex =
" \ '\v\\%('
" \ . '\a*cite\a*%(\s*\[[^]]*\]){0,2}\s*\{[^}]*'
" \ . '|\a*ref%(\s*\{[^}]*|range\s*\{[^,}]*%(}\{)?)'
" \ . '|hyperref\s*\[[^]]*'
" \ . '|includegraphics\*?%(\s*\[[^]]*\]){0,2}\s*\{[^}]*'
" \ . '|%(include%(only)?|input)\s*\{[^}]*'
" \ . '|\a*(gls|Gls|GLS)(pl)?\a*%(\s*\[[^]]*\]){0,2}\s*\{[^}]*'
" \ . '|includepdf%(\s*\[[^]]*\])?\s*\{[^}]*'
" \ . '|includestandalone%(\s*\[[^]]*\])?\s*\{[^}]*'
" \ . ')'
" Startify
let g:startify_session_dir = '~/.config/nvim/obsessions'
let g:startify_list_order = [[' Sessions'],'sessions',
\ [' Bookmarks'],'bookmarks',
\ [' Recent dirs'],'dir',]
let g:startify_bookmarks = [ {'v': '~/.config/nvim/init.vim'} ]
" \ [' Recent files'],'files',
let g:startify_custom_header = []
" windowswap
let g:windowswap_map_keys=0
" airline
let g:airline_theme='lucius'
if !exists('g:airline_symbols')
let g:airline_symbols={}
endif
let g:airline_left_sep=''
let g:airline_right_sep=''
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = '␤'
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'
let g:airline_section_y=''
let g:airline#extensions#tabline#enabled=1
let g:airline#extensions#tabline#tab_nr_type = 1
let g:airline#extensions#tabline#show_buffers=0
let g:airline#extensions#tabline#show_tab_nr=1
let g:airline#extensions#tabline#show_tab_type=0
let g:airline#extensions#tabline#fnamemod = ':~:.'
" Lucius
colorscheme lucius
LuciusWhite
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" misc
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let mapleader = "\<Space>"
nnoremap <leader>w :w<CR>
nnoremap <silent> <leader>q :call ToggleList("Quickfix List", 'c')<CR>
nnoremap <silent> <leader>ev :tabnew ~/.config/nvim/init.vim<CR>
nnoremap Y y$
nnoremap j gj
nnoremap k gk
vnoremap j gj
vnoremap k gk
" file navigation
nnoremap <silent> <leader>f :Files ~<CR>
nnoremap <silent> <leader>F :e.<CR>
nnoremap <silent> <leader>o :CtrlPBuffer<CR>
nnoremap <silent> <leader>O :BufExplorer<CR>
nnoremap <silent> <leader>t :CtrlPBufTagAll<CR>
nnoremap <silent> <leader>T :TagbarToggle<CR>
nnoremap <leader>p :CtrlPYankring<CR>
nnoremap <C-p> <Plug>yankstack_substitute_newer_paste
nnoremap <C-n> <Plug>yankstack_substitute_older_paste
" command line mappings
cnoremap <C-p> <Up>
cnoremap <C-n> <Down>
cnoremap w!! w !sudo tee > /dev/null %
" quickfix mappings
nnoremap <silent> <leader>q :call ToggleList("Quickfix List", 'c')<CR>
nnoremap <silent> [q :cprevious<CR>
nnoremap <silent> ]q :cnext<CR>
" split movement
nnoremap <C-h> <C-w>h
nnoremap <BS> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
nnoremap <leader>s :call WindowSwap#EasyWindowSwap()<CR>
" terminal mappings
tnoremap <Esc> <C-\><C-n>
tnoremap <C-h> <C-\><C-n><C-w>h
tnoremap <C-j> <C-\><C-n><C-w>j
tnoremap <C-k> <C-\><C-n><C-w>k
tnoremap <C-l> <C-\><C-n><C-w>l
" alignment mappings
nnoremap <silent> <leader>= :normal vip<CR> :'<,'>EasyAlign =<CR>
vnoremap <silent> <leader>= :'<,'>EasyAlign =<CR>
vmap <Enter> <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
augroup Terminal
autocmd!
au BufWinEnter,WinEnter term://* startinsert
au TermOpen * call SetMatlabMaps()
augroup END
" no folding on open bracket
augroup Folding
autocmd!
au InsertEnter * if !exists('w:last_fdm') | let w:last_fdm=&foldmethod | setlocal foldmethod=manual | endif
au InsertLeave,WinLeave * if exists('w:last_fdm') | let &l:foldmethod=w:last_fdm | unlet w:last_fdm | endif
augroup END
" Source init.vim on write
augroup VimIntern
autocmd!
au BufWritePost ~/Documents/setup/nvim/init.vim source %
" check for file change
au FocusGained,BufEnter,CursorMoved,CursorMovedI,CursorHold,CursorHoldI * :silent! checktime
" change working directory to current files directory
au BufEnter * silent! lcd %:p:h
augroup END
" tmux window title
augroup TmuxTitle
autocmd!
au VimEnter * call SaveTmuxWindowName()
au SessionLoadPost * call ChangeTmuxToSessionName()
au VimLeave * call system("tmux rename-window '" . g:tmuxWindowName . "'")
augroup END
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" filetype specific
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" matlab
augroup Matlab
autocmd!
au FileType matlab let b:commentary_format='% %s'
au FileType matlab setlocal listchars=eol,tab:\|\ ,trail
au FileType matlab nnoremap <leader>ml :call OpenMatlabInTerminal()<CR>
" au FileType matlab inoremap <silent> = =<Esc>:call <SID>ealign()<CR>a
augroup END
" c/c++
augroup Cpp
autocmd!
au FileType c,cpp setlocal listchars=eol,tab:\|\ ,trail
au FileType c,cpp nnoremap <leader>ml :call OpenMatlabInTerminal()<CR>
" au FileType c,cpp inoremap <silent> = =<Esc>:call <SID>ealign()<CR>a
augroup END
" tex
augroup Tex
autocmd!
au Filetype tex,latex setlocal foldmethod=expr
au Filetype tex,latex setlocal foldlevel=0
au Filetype tex,latex setlocal spell
" au Filetype tex,latex setlocal textwidth=80
au Filetype tex,latex inoremap $ $$<Left>
au BufWritePost *.tex Neomake
augroup END
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" custom functions
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" open terminal with matlab in bottom right split
function! OpenMatlabInTerminal()
execute "normal \<C-w>l"
split
terminal mlnd
call SetMatlabMaps()
endfunction
function! SetMatlabMaps()
if bufname('') =~? "mlnd"
tnoremap <buffer> <leader><leader>mc close all<CR>
tnoremap <buffer> <leader><leader>mw clear<CR>
tnoremap <buffer> <leader><leader>mf clear functions<CR>
nnoremap <buffer> <C-c> i<C-c>
endif
endfunction
" change tmux window name to session
function! ChangeTmuxToSessionName()
let sessionName = v:this_session
if strlen(sessionName)
let session = substitute(sessionName, ".*/", "", "g")
call system("tmux rename-window '" . session . "'")
else
call system("tmux rename-window 'nvim'")
endif
endfunction
function! SaveTmuxWindowName()
let g:tmuxWindowName = system("tmux display-message -p '#W'")
call system("tmux rename-window 'nvim'")
endfunction
" remove whitespaces
function! TrimWhiteSpace()
%s/\s\+$//e
endfunction
" function! s:ealign()
" let p = '^.*=\s.*$'
" if exists(':Tabularize') && getline('.') =~# '^.*=' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
" let column = strlen(substitute(getline('.')[0:col('.')],'[^=]','','g'))
" let position = strlen(matchstr(getline('.')[0:col('.')],'.*=\s*\zs.*'))
" Tabularize/=/l1
" normal! 0
" call search(repeat('[^=]*=',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
" endif
" endfunction
" toggle the quickfix or location list window.
function! GetBufferList()
redir =>buflist
silent! ls
redir END
return buflist
endfunction
function! ToggleList(bufname, pfx)
let buflist = GetBufferList()
for bufnum in map(filter(split(buflist, '\n'), 'v:val =~ "'.a:bufname.'"'), 'str2nr(matchstr(v:val, "\\d\\+"))')
if bufwinnr(bufnum) != -1
exec(a:pfx.'close')
return
endif
endfor
if a:pfx == 'l' && len(getloclist(0)) == 0
echohl ErrorMsg
echo "Location List is Empty."
return
endif
let winnr = winnr()
exec(a:pfx.'open')
if winnr() != winnr
wincmd p
endif
endfunction
" let neomake_matlab_mlint_maker = {
" \ 'exe': 'mlint',
" \ 'errorformat':
" \ '%+PFile:\ %f,' .
" \ 'L\ %l\ (C\ %c):\ %m,' .
" \ 'L\ %l\ (C\ %c-%.):\ %m,',
" \ }
" neomake matlab maker
let neomake_matlab_mlint_maker = {
\ 'exe': 'mlint',
\ 'errorformat':
\ '%+PFile:\ %f,' .
\ 'L\ %l\ (C\ %c):\ %*[a-zA-Z0-9]:\ %m,'.
\ 'L\ %l\ (C\ %c-%*[0-9]):\ %*[a-zA-Z0-9]:\ %m'
\ }

2
nvim/obsessions/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
nvim/plugins/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
nvim/pluginstuff/yankring/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

1
nvim/pluginstuff/ycm/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.pyc

View File

@ -0,0 +1,117 @@
import os
import ycm_core
from clang_helpers import PrepareClangFlags
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-pendantic',
'-std=c++11',
'-x',
'c++',
'-I',
'.',
'-isystem',
'/usr/include/',
'-isystem',
'/usr/local/include/',
'-isystem',
'/Library/Developer/CommandLineTools/usr/include',
'-isystem',
'/Library/Developer/CommandLineTools/usr/lib/c++/v1'
]
compilation_database_folder = ''
if os.path.exists( compilation_database_folder ):
database = ycm_core.CompilationDatabase( compilation_database_folder )
else:
database = None
SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
def DirectoryOfThisScript():
return os.path.dirname( os.path.abspath( __file__ ) )
def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
if not working_directory:
return list( flags )
new_flags = []
make_next_absolute = False
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
for flag in flags:
new_flag = flag
if make_next_absolute:
make_next_absolute = False
if not flag.startswith( '/' ):
new_flag = os.path.join( working_directory, flag )
for path_flag in path_flags:
if flag == path_flag:
make_next_absolute = True
break
if flag.startswith( path_flag ):
path = flag[ len( path_flag ): ]
new_flag = path_flag + os.path.join( working_directory, path )
break
if new_flag:
new_flags.append( new_flag )
return new_flags
def IsHeaderFile( filename ):
extension = os.path.splitext( filename )[ 1 ]
return extension in [ '.h', '.hxx', '.hpp', '.hh' ]
def GetCompilationInfoForFile( filename ):
# The compilation_commands.json file generated by CMake does not have entries
# for header files. So we do our best by asking the db for flags for a
# corresponding source file, if any. If one exists, the flags for that file
# should be good enough.
if IsHeaderFile( filename ):
basename = os.path.splitext( filename )[ 0 ]
for extension in SOURCE_EXTENSIONS:
replacement_file = basename + extension
if os.path.exists( replacement_file ):
compilation_info = database.GetCompilationInfoForFile(
replacement_file )
if compilation_info.compiler_flags_:
return compilation_info
return None
return database.GetCompilationInfoForFile( filename )
def FlagsForFile( filename, **kwargs ):
if database:
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
# python list, but a "list-like" StringVec object
compilation_info = GetCompilationInfoForFile( filename )
if not compilation_info:
return None
final_flags = MakeRelativePathsInFlagsAbsolute(
compilation_info.compiler_flags_,
compilation_info.compiler_working_dir_ )
# NOTE: This is just for YouCompleteMe; it's highly likely that your project
# does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR
# ycm_extra_conf IF YOU'RE NOT 100% SURE YOU NEED IT.
try:
final_flags.remove( '-stdlib=libc++' )
except ValueError:
pass
else:
relative_to = DirectoryOfThisScript()
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
return {
'flags': final_flags,
'do_cache': True
}

BIN
nvim/spell/de.utf-8.spl Normal file

Binary file not shown.

4
nvim/spell/en.utf-8.add Normal file
View File

@ -0,0 +1,4 @@
resampling
reweighted
reweighting
Kalman

BIN
nvim/spell/en.utf-8.add.spl Normal file

Binary file not shown.

BIN
nvim/spell/en.utf-8.spl Normal file

Binary file not shown.

BIN
nvim/spell/en.utf-8.sug Normal file

Binary file not shown.

36
scripts/autocomplete.sh Normal file
View File

@ -0,0 +1,36 @@
#!/bin/bash
# if [[ -n ${ZSH_VERSION-} ]]; then
# autoload -U +X bashcompinit && bashcompinit
# fi
_o() {
local cur prev sessions
sessions=$(o params)
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
COMPREPLY=( $(compgen -W "${sessions}" -- ${cur}) )
}
complete -o nospace -F _o o
_vims() {
local cur prev sessions
sessions=$(vims sessions)
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
COMPREPLY=( $(compgen -W "${sessions}" -- ${cur}) )
}
complete -o nospace -F _vims vims

18
scripts/fillbucket Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
username="mustachiod"
if [ $# -gt 0 ]; then
reponame=$1
else
echo "Repo name"
read reponame
fi
echo "Password"
read -s password
curl --user $username:$password https://api.bitbucket.org/1.0/repositories/ --data name=$reponame --data is_private='true'
git remote add origin git@bitbucket.org:$username/$reponame.git
git push -u origin --all
git push -u origin --tags

107
scripts/gitall Executable file
View File

@ -0,0 +1,107 @@
#!/bin/bash
declare -a directories=(
"~/Documents/setup"
"~/org"
"~/matlab"
"~/tex"
)
divider="======================================================================="
git="/.git"
noCommits=0
if [ $# -gt 0 ]; then
if [ $1 == p ]; then
flag="p"
elif [ $1 == c ]; then
flag="c"
elif [ $1 == s ]; then
flag="s"
else
echo "wrong flag"
exit 1
fi
else
echo "no arguments"
exit 1
fi
for dir in "${directories[@]}"
do
eval gitdir=$dir$git
if [[ -d "$gitdir" ]]; then
if [ $flag == p ]; then
echo -e "\n"$divider
echo -e "$dir"
echo $divider
eval "git -C $dir pull --all"
elif [ $flag == c ]; then
OUTPUT=$(eval git -c color.status=always -C $dir status )
noCommit=$(echo $OUTPUT | grep -q "nothing to commit, working directory clean")$?
if [[ $noCommit -eq 1 ]]; then
echo -e "\n"$divider
echo -e "$dir"
echo $divider
eval "git -C $dir commit -a"
noCommits=1
fi
elif [ $flag == s ]; then
OUTPUT=$(eval git -c color.status=always -C $dir status )
noCommit=$(echo $OUTPUT | grep -q "nothing to commit, working directory clean")$?
upToDate=$(echo $OUTPUT | grep -q "Your branch is up-to-date")$?
isAhead=$(echo $OUTPUT | grep -q "Your branch is ahead")$?
hasUntracked=$(echo $OUTPUT | grep -q "Untracked files")$?
if [[ $upToDate -eq 1 ]] || [[ $noCommit -eq 1 ]]; then
noCommits=1
echo -e "\n"$divider
echo "$dir"
echo $divider
echo "$OUTPUT"
if [[ $isAhead -eq 0 ]]; then
echo "Push changes to origin? [Y/n]"
read answer
if [[ $answer == Y ]] || [[ $answer == y ]] || [[ -z "${answer}" ]]; then
eval "git -C $dir push"
fi
fi
if [[ $hasUntracked -eq 0 ]]; then
echo "Add untracked files? [Y/n]"
read answer
if [[ $answer == Y ]] || [[ $answer == y ]] || [[ -z "${answer}" ]]; then
eval "git -C $dir add -A $dir"
eval "git -C $dir status"
fi
fi
fi
fi
fi
done
if [[ ( $flag == s ) && ( $noCommits -eq 1 ) ]]; then
echo -e "\n"$divider
echo $divider
echo "Commit all? [Y/n]"
read answer
if [[ $answer == Y ]] || [[ $answer == y ]] || [[ -z "${answer}" ]]; then
eval "gitall c"
fi
fi
if [[ ( $flag == s ) && ( $noCommits -eq 0 ) ]]; then
echo -e "\n"$divider
echo "nothing to be done"
echo $divider
fi
if [[ ( $flag == c ) && ( $noCommits -eq 0 ) ]]; then
echo -e "\n"$divider
echo "nothing to commit, all done"
echo $divider
fi

7
scripts/mlint Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
if [ $# -gt 0 ]; then
arg=$1
echo "File:" $arg
(exec /usr/local/MATLAB/R2016a/bin/glnxa64/mlint $arg)
fi

4
scripts/nvimdiff Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
nvim -d -u ~/.config/nvim/init.vim "$1" "$2"

148
scripts/o Executable file
View File

@ -0,0 +1,148 @@
#!/bin/bash
# set -o nounset
# set -e
declare -A sessions=(
["misc"]="~/"
["qivOld"]="~/dev/projects/P11/workspace/qivserver"
["qiv"]="~/dev/projects/qiv/code/java/server"
# ["buchi"]="~/dev/projects/P17.02/Code/"
# ["bosch"]="~/dev/projects/bosch/Code/port/fredwick/source"
)
vimSessionsDir="~/.config/nvim/obsessions"
function setup() {
local session attach
session=$1
attach=$2
if tmux has-session -t $1>/dev/null 2>/dev/null; then
if [[ $attach == true ]]; then
attachSession $session
fi
else
makeSession $session
if [[ $attach == true ]]; then
attachSession $session
fi
fi
}
function makeSession() {
local session dir oldTMUX
session=$1
dir="${sessions[$session]}"
if [[ $insideSession == true ]]; then
oldTMUX="$TMUX"
TMUX=""
fi
case "$session" in
misc)
tmux new-session -s $session -n bash -d >/dev/null 2>/dev/null
tmux send-keys -t $session:0 "cd $dir" C-m
tmux send-keys -t $session:0 'clear' C-m
tmux selectp -t $session:0
tmux splitw -h -p 50
tmux selectp -l
tmux new-window -t $session:1 -n bash
tmux send-keys -t $session:1 "cd $dir" C-m
tmux send-keys -t $session:1 'clear' C-m
;;
qiv)
tmux new-session -s $session -n git -d >/dev/null 2>/dev/null
tmux send-keys -t $session:0 "cd $dir" C-m
tmux send-keys -t $session:0 'clear' C-m
tmux send-keys -t $session:0 'git st' C-m
# tmux send-keys -t $session:0 "cd $dir" C-m
# tmux send-keys -t $session:0 'clear' C-m
# tmux send-keys -t $session:0 "nvim" C-m
tmux new-window -t $session:1 -n bash
;;
qivOld)
tmux new-session -s $session -n git -d >/dev/null 2>/dev/null
tmux send-keys -t $session:0 "cd $dir" C-m
tmux send-keys -t $session:0 'clear' C-m
tmux send-keys -t $session:0 'git st' C-m
# tmux send-keys -t $session:0 "cd $dir" C-m
# tmux send-keys -t $session:0 'clear' C-m
# tmux send-keys -t $session:0 "nvim" C-m
tmux new-window -t $session:1 -n bash
;;
# bosch)
# tmux new-session -s $session -n code -d >/dev/null 2>/dev/null
# tmux send-keys -t $session:0 "cd $dir" C-m
# tmux send-keys -t $session:0 'clear' C-m
# tmux send-keys -t $session:0 "nvim" C-m
# tmux new-window -t $session:1 -n bash
# tmux send-keys -t $session:1 "cd $dir" C-m
# tmux send-keys -t $session:1 'clear' C-m
# tmux send-keys -t $session:1 'git st' C-m
# ;;
esac
tmux select-window -t $session:0
if [[ $insideSession == true ]]; then
TMUX="$oldTMUX"
fi
}
function attachSession() {
if [[ $insideSession == true ]]; then
tmux switch-client -t $1
else
tmux attach -t $1
fi
}
if [ $# -gt 0 ]; then
arg=$1
if [[ ! -z ${TMUX:-} ]]; then
insideSession=true
fi
case "$arg" in
all)
for session in "${!sessions[@]}"; do
setup $session false
done
attachSession misc
;;
kill)
if [ $# -eq 2 ]; then
tmux kill-session -t $2
else
tmux kill-server && echo "killed all sessions"
fi
;;
params)
parameters="${!sessions[@]} all kill"
echo "$parameters"
;;
*)
if [ ! -z "${sessions[$arg]:-}" ]; then
setup $arg true
else
echo "no such session"
exit 1
fi
;;
esac
else
setup misc true
fi

20
scripts/setup Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BINDIR="$HOME/bin"
if [[ ! -d $BINDIR ]]; then
mkdir $BINDIR
fi
for scripts in $SCRIPTDIR/*; do
script=${scripts##*/}
if [[ $script != "setup" ]] && [[ $script != "alarm.msg" ]]; then
if [[ ! -a $BINDIR/$script ]]; then
ln -s $SCRIPTDIR/$script $BINDIR/$script
echo $script "symlinked to" $BINDIR/$script
else
echo "already exists:" $BINDIR/$script
fi
fi
done

55
setup Executable file
View File

@ -0,0 +1,55 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
###########################################################
## call setups
###########################################################
for setupdir in *; do
if [[ $setupdir != "setup" ]]; then
if [[ -a $DIR/$setupdir/setup ]]; then
echo -e "\n###########################################################"
echo "## " $setupdir "will be setup"
echo "###########################################################"
( exec "$setupdir/setup" )
fi
fi
done
###########################################################
## nvim setup
###########################################################
NVIMDIR="$HOME/.config/nvim"
PLUGINDIR="$HOME/.local/share/nvim/site"
if [[ ! -d $PLUGINDIR ]]; then
mkdir -p $PLUGINDIR
fi
echo -e "\n###########################################################"
echo "## nvim will be setup"
echo "###########################################################"
if [[ ! -a $NVIMDIR ]]; then
ln -s $DIR/nvim $NVIMDIR
echo "nvim symlinked to" $NVIMDIR
else
echo "already exists:" $NVIMDIR
fi
if [[ ! -a $PLUGINDIR/plugins ]]; then
ln -s $DIR/nvim/plugins $PLUGINDIR/plugins
echo "plugins symlinked to" $PLUGINDIR/plugins
else
echo "already exists:" $PLUGINDIR/plugins
fi
if [[ ! -a $PLUGINDIR/autoload ]]; then
ln -s $DIR/nvim/autoload $PLUGINDIR/autoload
echo "autoload symlinked to" $PLUGINDIR/autoload
else
echo "already exists:" $PLUGINDIR/autoload
fi

88
tex/defaultTex.sty Executable file
View File

@ -0,0 +1,88 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{bm}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[hidelinks]{hyperref}
\usepackage{todonotes}
\mathtoolsset{showonlyrefs}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Operators
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareMathOperator{\dt}{d}
\DeclareMathOperator{\diverg}{div}
\DeclareMathOperator{\grad}{grad}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\diag}{diag}
\DeclareMathOperator{\sgn}{sgn}
\DeclareMathOperator{\sym}{sym}
\DeclareMathOperator{\skw}{skw}
\DeclareMathOperator{\cov}{Cov}
\DeclareMathOperator{\var}{Var}
\newcommand{\C}{\mathbf{C}}
\newcommand{\E}{\mathbf{E}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\PP}{\mathbb{P}}
\newcommand{\pdN}{\mathcal{N}}
\theoremstyle{plain}
\newtheorem{satz}{Satz}
\theoremstyle{definition}
\newtheorem{definition}{Definition}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Variables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\vx}{\underline{x}}
\newcommand{\vy}{\underline{y}}
\newcommand{\vz}{\underline{z}}
\newcommand{\vmu}{\underline{\mu}}
\newcommand{\rrx}{\bm{x}}
\newcommand{\rry}{\bm{y}}
\newcommand{\rrz}{\bm{z}}
\newcommand{\rvx}{\bm{\vx}}
\newcommand{\rvy}{\bm{\vy}}
\newcommand{\rvz}{\bm{\vz}}
\newcommand{\evx}{\hat{\vx}}
\newcommand{\evy}{\hat{\vy}}
\newcommand{\evz}{\hat{\vz}}
\renewcommand{\eps}{\ensuremath{\varepsilon}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Commands
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\vec}[1]{\underline{#1}}
\newcommand{\dx}[1][x]{\,\dt\!#1}
\newcommand{\func}[2]{ #1 ( #2 )}
\newcommand{\funcb}[2]{ #1 [ #2 ]}
\newcommand{\brr}[1]{\left( #1 \right)}
\newcommand{\bre}[1]{\left[ #1 \right]}
\newcommand{\brg}[1]{\left{ #1 \right}}
\newcommand{\bis}[2]{= #1,\ldots\,, #2}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Text
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\konst}{\textit{konst.}}
\newcommand{\const}{\textit{const.}}
\newcommand{\for}{\text{for }}

16
tex/setup Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
TEXDIR="$HOME/texmf/tex/latex/local"
for styles in $SCRIPTDIR/*; do
style=${styles##*/}
if [[ $style != "setup" ]]; then
if [[ ! -a "$TEXDIR/$style" ]]; then
ln -s $SCRIPTDIR/$style $TEXDIR/$style
echo $style "symlinked to" $TEXDIR/$style
else
echo "already exists:" $TEXDIR/$style
fi
fi
done