-alias sl=ls
-alias la='ls -A'
-alias ll='ls -Al'
-alias l1='ls -1'
-alias l.='ls -d .[a-z]*'
-
-lsflags="-hF"
-# Detect which `ls` flavor is in use
-if [ -x "$(which dircolors 2>/dev/null)" ]; then # GNU `ls`
- eval $(dircolors -b $HOME/.dir_colors)
- colorflag="--color=auto"
- lsflags="$lsflags -I NTUSER.\* -I ntuser.\*"
-else # OS X `ls`
- export CLICOLOR=1
- colorflag="-G"
-fi
-
-alias ls="ls $colorflag $lsflags"
-alias grep='grep --color=auto'
-alias egrep='egrep --color=auto'
-alias fgrep='fgrep --color=auto'
-
-if [ -e /usr/bin/vimx ]; then alias vim='/usr/bin/vimx'; fi
-
-# Shortcuts
-alias g='git'
-alias h='history'
-alias j='jobs'
-alias v='vim'
-alias q='exit'
-alias c='clear'
-alias cls='clear'
-
-alias edit="$EDITOR"
-alias pager="$PAGER"
-
-# Easier navigation: .., ..., ...., ....., ~ and -
-alias ..="cd .."
-alias ...="cd ../.."
-alias ....="cd ../../.."
-alias .....="cd ../../../.."
-alias ~="cd ~" # `cd` is probably faster to type though
-alias -- -="cd -"
-alias cd=cd_func
-alias -- --="cd --"
-alias -- -0="cd -0"
-alias -- -1="cd -1"
-alias -- -2="cd -2"
-alias -- -3="cd -3"
-alias -- -4="cd -4"
-alias -- -5="cd -5"
-alias -- -6="cd -6"
-alias -- -7="cd -7"
-alias -- -8="cd -8"
-alias -- -9="cd -9"
-
-# Secure settings
-alias rm='rm -i'
-alias cp='cp -i'
-alias mv='mv -i'
-alias md='mkdir -p'
-alias rd='rmdir'
-alias mkdate='mkdir "$(date +'%Y%m%d')"'
-
-if [ ! -x "$(which tree 2>/dev/null)" ]
-then
- alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
-fi
-
-alias info='info --vi-keys'
-#alias less='less -rX' # raw control characters, don't clear the screen after quitting
-
-# Enable aliases to be sudo'ed
-alias sudo='sudo '
-alias _="sudo"
-
-# Get week number
-alias week='date +%V'
-
-# Stopwatch
-alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'
-
-# Reload the shell (i.e. invoke as a login shell)
-alias reload="exec $SHELL -l"
-
-# alias bashhere='chere -il -t mintty -s bash'
-alias gtypist='gtypist -wi'
-alias startxwin='run /usr/bin/bash.exe -l -c "/usr/bin/startxwin -- -nolock -unixkill"'
-alias startvnc='vncserver -geometry 1870x980 -depth 24'
-alias startvnc4='vnc4server -geometry 1870x980 -depth 24'
-alias dotfiles='git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
-alias genilog='$HOME/repos/genilog/genilog.py'
-alias msbuild='winpty "c:/program files (x86)/msbuild/12.0/bin/msbuild.exe"'
+alias sl=ls\r
+alias la='ls -A'\r
+alias ll='ls -Al'\r
+alias l1='ls -1'\r
+alias l.='ls -d .[a-z]*'\r
+\r
+lsflags="-hF"\r
+# Detect which `ls` flavor is in use\r
+if [ -x "$(which dircolors 2>/dev/null)" ]; then # GNU `ls`\r
+ eval $(dircolors -b $HOME/.dir_colors)\r
+ colorflag="--color=auto"\r
+ lsflags="$lsflags -I NTUSER.\* -I ntuser.\*"\r
+else # OS X `ls`\r
+ export CLICOLOR=1\r
+ colorflag="-G"\r
+fi\r
+\r
+alias ls="ls $colorflag $lsflags"\r
+alias grep='grep --color=auto'\r
+alias egrep='egrep --color=auto'\r
+alias fgrep='fgrep --color=auto'\r
+\r
+if [ -e /usr/bin/vimx ]; then alias vim='/usr/bin/vimx'; fi\r
+\r
+# Shortcuts\r
+alias g='git'\r
+alias h='history'\r
+alias j='jobs'\r
+alias v='vim'\r
+alias q='exit'\r
+alias c='clear'\r
+alias cls='clear'\r
+\r
+alias edit="$EDITOR"\r
+alias pager="$PAGER"\r
+\r
+# Easier navigation: .., ..., ...., ....., ~ and -\r
+alias ..="cd .."\r
+alias ...="cd ../.."\r
+alias ....="cd ../../.."\r
+alias .....="cd ../../../.."\r
+alias ~="cd ~" # `cd` is probably faster to type though\r
+alias -- -="cd -"\r
+alias cd=cd_func\r
+alias -- --="cd --"\r
+alias -- -0="cd -0"\r
+alias -- -1="cd -1"\r
+alias -- -2="cd -2"\r
+alias -- -3="cd -3"\r
+alias -- -4="cd -4"\r
+alias -- -5="cd -5"\r
+alias -- -6="cd -6"\r
+alias -- -7="cd -7"\r
+alias -- -8="cd -8"\r
+alias -- -9="cd -9"\r
+\r
+# Secure settings\r
+alias rm='rm -i'\r
+alias cp='cp -i'\r
+alias mv='mv -i'\r
+alias md='mkdir -p'\r
+alias rd='rmdir'\r
+alias mkdate='mkdir "$(date +'%Y%m%d')"'\r
+\r
+if [ ! -x "$(which tree 2>/dev/null)" ]\r
+then\r
+ alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"\r
+fi\r
+\r
+alias info='info --vi-keys'\r
+#alias less='less -rX' # raw control characters, don't clear the screen after quitting\r
+\r
+# Enable aliases to be sudo'ed\r
+alias sudo='sudo '\r
+alias _="sudo"\r
+\r
+# Get week number\r
+alias week='date +%V'\r
+\r
+# Stopwatch\r
+alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'\r
+\r
+# Reload the shell (i.e. invoke as a login shell)\r
+alias reload="exec $SHELL -l"\r
+alias gtypist='gtypist -wi'\r
+alias startxwin='run /usr/bin/bash.exe -l -c "/usr/bin/startxwin -- -nolock -unixkill"'\r
+alias startvnc='vncserver -geometry 1870x980 -depth 24'\r
+alias startvnc4='vnc4server -geometry 1870x980 -depth 24'\r
+alias dot='git --git-dir=$HOME/.dotfiles --work-tree=$HOME'\r
+alias genilog='$HOME/repos/genilog/genilog.py'\r
-# ~/.config/git/config
-
-[github]
- user = jannikz
-[alias]
- a = add
- una = reset HEAD --
- uha = checkout HEAD --
- unaa = reset HEAD
- uhaa = reset --hard HEAD
- br = branch
- brdm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
- co = checkout
- go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
- ci = commit
- amend = commit --amend
- unci = reset --soft HEAD~
- diff = diff --word-diff
- dt = difftool
- mt = mergetool
- # dont pull without rebase, and dont push without pull (fetch & merge)
- p = pull --rebase
- pp = "!git pull --rebase && git push"
- # avoid merge commits
- mf = merge --ff-only
- cp = cherry-pick
- wc = whatchanged -p
- ch = cherry -v
- s = status -sb
- fs = "!git fetch && git status"
- rb = rebase
- ec = config --global -e
- l = log --oneline --decorate
- lg = log --pretty=format:"%C(yellow)%h\\ %C(green)%ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short --graph
- last = log -1 HEAD
- ls = ls-files
- lt = tag -l
- type = cat-file -t
- dump = cat-file -p
- who = shortlog -s --
- remotes = remote -v
- root = rev-parse --show-toplevel
- cl = clone --recursive
-
- # Show the diff between the latest commit and the current state
- d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
- # `git di $number` shows the diff between the state `$number` revisions ago and the current state
- di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
-
- # Find branches containing commit
- fb = "!f() { git branch -a --contains $1; }; f"
- # Find tags containing commit
- ft = "!f() { git describe --always --contains $1; }; f"
- # Find commits by source code
- fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"
- # Find commits by commit message
- fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
-
-# Credit an author on the latest commit
- credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
- # List contributors with number of commits
- contributors = shortlog --summary --numbered
-
- k = !gitk
- visual = !gitk
-
- ctags = "!sh -c '[ -f .git/hooks/ctags ] || git init; .git/hooks/ctags' git-ctags"
- gtags = "!sh -c '[ -f .git/hooks/gtags ] || git init; .git/hooks/gtags' git-gtags"
- cscope = "!sh -c '[ -f .git/hooks/cscope ] || git init; .git/hooks/cscope' git-cscope"
-
-[help]
- autocorrect = 10
-[branch]
- autosetupmerge = always
- autosetuprebase = always
-[rebase]
- autosquash = true
- autostash = true
-[pull]
- rebase = true
-[push]
- default = simple
-[diff]
- tool = vimdiff
-[difftool]
- prompt = false
-[merge]
- tool = vimdiff
- conflictstyle = diff3
-[mergetool]
- prompt = false
-[init]
- templatedir = ~/.config/git/templates
-[core]
- excludesfile = ~/.config/git/ignore
- attributesFile = ~/.config/git/attributes
- editor = vim
- autocrlf = false
- safecrlf = true
+# ~/.config/git/config\r
+[github]\r
+ user = jannikz\r
+[alias]\r
+ a = add\r
+ una = reset HEAD --\r
+ uha = checkout HEAD --\r
+ unaa = reset HEAD\r
+ uhaa = reset --hard HEAD\r
+ br = branch\r
+ brdm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"\r
+ co = checkout\r
+ go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"\r
+ ci = commit\r
+ amend = commit --amend\r
+ unci = reset --soft HEAD~\r
+ diff = diff --word-diff\r
+ dt = difftool\r
+ mt = mergetool\r
+ # dont pull without rebase, and dont push without pull (fetch & merge)\r
+ p = pull --rebase\r
+ pp = "!git pull --rebase && git push"\r
+ # avoid merge commits\r
+ mf = merge --ff-only\r
+ cp = cherry-pick\r
+ wc = whatchanged -p\r
+ ch = cherry -v\r
+ s = status -sb\r
+ fs = "!git fetch && git status"\r
+ rb = rebase\r
+ ec = config --global -e\r
+ l = log --oneline --decorate\r
+ lg = log --pretty=format:"%C(yellow)%h\\ %C(green)%ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short --graph\r
+ last = log -1 HEAD\r
+ ls = ls-files\r
+ lt = tag -l\r
+ type = cat-file -t\r
+ dump = cat-file -p\r
+ who = shortlog -s --\r
+ remotes = remote -v\r
+ root = rev-parse --show-toplevel\r
+ cl = clone --recursive\r
+
+ # Show the diff between the latest commit and the current state\r
+ d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"\r
+ # `git di $number` shows the diff between the state `$number` revisions ago and the current state\r
+ di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"\r
+
+ # Find branches containing commit\r
+ fb = "!f() { git branch -a --contains $1; }; f"\r
+ # Find tags containing commit\r
+ ft = "!f() { git describe --always --contains $1; }; f"\r
+ # Find commits by source code\r
+ fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"\r
+ # Find commits by commit message\r
+ fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"\r
+
+ #Credit an author on the latest commit\r
+ credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"\r
+ # List contributors with number of commits\r
+ contributors = shortlog --summary --numbered\r
+
+ k = !gitk\r
+ visual = !gitk\r
+
+ ctags = "!sh -c '[ -f .git/hooks/ctags ] || git init; .git/hooks/ctags' git-ctags"\r
+ gtags = "!sh -c '[ -f .git/hooks/gtags ] || git init; .git/hooks/gtags' git-gtags"\r
+ cscope = "!sh -c '[ -f .git/hooks/cscope ] || git init; .git/hooks/cscope' git-cscope"\r
+ \r
+[help]\r
+ autocorrect = 10\r
+[branch]\r
+ autosetupmerge = always\r
+ autosetuprebase = always\r
+[rebase]\r
+ autosquash = true\r
+ autostash = true\r
+[pull]\r
+ rebase = true\r
+[push]\r
+ default = simple\r
+[diff]\r
+ tool = vimdiff\r
+[difftool]\r
+ prompt = false\r
+[merge]\r
+ tool = vimdiff\r
+ conflictstyle = diff3\r
+[mergetool]\r
+ prompt = false\r
+[init]\r
+ templatedir = ~/.config/git/templates\r
+[core]\r
+ excludesfile = ~/.config/git/ignore\r
+ attributesFile = ~/.config/git/attributes\r
+ editor = vim\r
+ eol = native
+[filter "lfs"]
+ clean = git-lfs clean -- %f
+ smudge = git-lfs smudge -- %f
+ required = true
[include]
- path = ~/.config/git/config_local
-[user]
- name = Jannik Zander
- email = jannikz@gmail.com
+ path = ~/.config/git/config_local
-export USERNAME=$LOGNAME
-export HOSTNAME=`hostname`
-#echo Welcome $USERNAME. You are on Server: $HOSTNAME !!!
-
-# Set defaults
-export SHELL='bash'
-export EDITOR='vim'
-export VISUAL='vim'
-export PAGER='less -eFRX'
-export MANPAGER="less -eFRX"
-export BROWSER='lynx -vikeys -use_mouse'
-
-
-# Prefer US language and UTF-8
-export LANG="en_US.UTF-8";
-export LC_ALL="en_US.UTF-8";
-#export LC_ALL="en_DK.UTF-8";
-#export LC_NUMERIC=en_DK.UTF-8
-#export LC_TIME=en_DK.UTF-8
-#export LC_MONETARY=en_DK.UTF-8
-#export LC_PAPER=en_DK.UTF-8
-#export LC_MEASUREMENT=en_DK.UTF-8
-export KEYMAP=us
-# Highlight section titles in manual pages
-export LESS_TERMCAP_md="${yellow}";
-
-# Always enable colored `grep` output
-#export GREP_OPTIONS="--color=auto";
-
-# Set up syntax highlighting for 'less' (requires source-highlight package)
-# See http://www.gnu.org/software/src-highlite/source-highlight.html
-# export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s"
-export LESS=-eFRX
-
-export GTEST_DIR='c:/users/59698/repos/googletest/googletest'
-export CPPUNITDIR='c:/users/59698/repos/cppunit'
-export VIRTUALENVWRAPPER_PYTHON=/mingw64/bin/python3
-
-#export XDG_CONFIG_HOME = ~/.config/
-#export XDG_DATA_HOME = ~/.local/share/
-#export XDG_DATA_DIRS = /usr/local/share/:/usr/share/
-if [ -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs ]; then
- . ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs
- export XDG_DESKTOP_DIR XDG_DOWNLOAD_DIR XDG_TEMPLATES_DIR XDG_PUBLICSHARE_DIR XDG_DOCUMENTS_DIR XDG_MUSIC_DIR XDG_PICTURES_DIR XDG_VIDEOS_DIR
-fi
+export USERNAME=$LOGNAME\r
+export HOSTNAME=`hostname`\r
+#echo Welcome $USERNAME. You are on Server: $HOSTNAME !!!\r
+\r
+# Set defaults\r
+export SHELL='bash'\r
+export EDITOR='vim'\r
+export VISUAL='vim'\r
+export PAGER='less -eFRX'\r
+export MANPAGER="less -eFRX"\r
+export BROWSER='lynx -vikeys -use_mouse'\r
+\r
+\r
+# Prefer US language and UTF-8\r
+export LANG="en_US.UTF-8";\r
+export LC_ALL="en_US.UTF-8";\r
+#export LC_ALL="en_DK.UTF-8";\r
+#export LC_NUMERIC=en_DK.UTF-8\r
+#export LC_TIME=en_DK.UTF-8\r
+#export LC_MONETARY=en_DK.UTF-8\r
+#export LC_PAPER=en_DK.UTF-8\r
+#export LC_MEASUREMENT=en_DK.UTF-8\r
+export KEYMAP=us\r
+# Highlight section titles in manual pages\r
+export LESS_TERMCAP_md="${yellow}";\r
+\r
+# Always enable colored `grep` output\r
+#export GREP_OPTIONS="--color=auto";\r
+\r
+# Set up syntax highlighting for 'less' (requires source-highlight package)\r
+# See http://www.gnu.org/software/src-highlite/source-highlight.html\r
+# export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s"\r
+export LESS=-eFRX\r
+\r
+#export GTEST_DIR='c:/googletest-release-1.7.0'\r
+#export GTEST_DIR='c:/googletest-release-1.8.0'\r
+export CPPUNITDIR='c:/cppunit-1.12.1'\r
+#export CPPUNITDIR='c:/cppunit-1.13.2'\r
+export VIRTUALENVWRAPPER_PYTHON=/mingw64/bin/python3\r
+\r
+#export XDG_CONFIG_HOME = ~/.config/\r
+#export XDG_DATA_HOME = ~/.local/share/\r
+#export XDG_DATA_DIRS = /usr/local/share/:/usr/share/\r
+if [ -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs ]; then\r
+ . ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs\r
+ export XDG_DESKTOP_DIR XDG_DOWNLOAD_DIR XDG_TEMPLATES_DIR XDG_PUBLICSHARE_DIR XDG_DOCUMENTS_DIR XDG_MUSIC_DIR XDG_PICTURES_DIR XDG_VIDEOS_DIR\r
+fi\r
-" section: environment {{{1
-" ---------------------
-
-if (empty(glob('~/.cache/vim/autoload/plug.vim')) ||
- \ empty(glob('~/.local/share/vim/viminfo')))
- cd ~
- silent !mkdir -p .local/share/vim/{swap,backup,undo}
- silent !mkdir -p .cache/vim/autoload
- silent !curl -fLo .cache/vim/autoload/plug.vim
- \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
- autocmd VimEnter * PlugInstall | source $MYVIMRC
- cd -
-endif
-
-set directory=~/.local/share/vim/swap
-set backupdir=~/.local/share/vim/backup
-set undodir=~/.local/share/vim/undo
-set viminfo+=n~/.local/share/vim/viminfo
-set runtimepath+=~/.cache/vim
-
-" section: plugins {{{1
-" ---------------------
-silent call plug#begin('~/.cache/vim/bundle')
-Plug 'tpope/vim-repeat'
-Plug 'tpope/vim-surround'
-Plug 'tpope/vim-fugitive'
-Plug 'tpope/vim-commentary'
-Plug 'tpope/vim-dispatch'
-Plug 'tpope/vim-vinager'
-Plug 'scrooloose/syntastic'
-Plug 'ctrlpvim/ctrlp.vim'
-Plug 'brandonbloom/csearch.vim'
-Plug 'chazy/cscope_maps'
-Plug 'altercation/vim-colors-solarized'
-Plug 'editorconfig/editorconfig-vim'
-Plug 'fholgado/minibufexpl.vim'
-Plug 'a.vim'
-"Plug 'L9'
-"Plug 'FuzzyFinder'
-call plug#end()
-
-" section: options {{{1
-" ---------------------
-
-"set autoindent
-set autoread
-set autowrite " automatically save before commands like :next and :make
-set background=dark
-set backspace=2
-if exists('+breakindent')
- set breakindent showbreak=\ +
-endif
-set cmdheight=2
-setglobal commentstring=#\ %s
-set complete-=i " searching includes can be slow
-"if has("win32") || has("win64")
-" does not work for msys2
-set clipboard=unnamed
-"else
-"set clipboard=unnamedplus
-"endif
-set fileformats=unix,dos,mac
-"set foldlevel=99
-"set foldmethod=indent
-set foldmethod=marker
-set foldopen+=jump
-set guioptions+=a
-set history=200
-set incsearch " incremental search
-set laststatus=2 " always show status line
-set lazyredraw
-set linebreak
-set mouse=nvi
-set mousemodel=popup
-set number
-"set pastetoggle=<f2>
-set printoptions=paper:letter
-set scrolloff=1
-set shiftround
-set shortmess=aoOtI
-"set showcmd " show (partial) command in status line.
-set showmatch " show matching brackets.
-set sidescrolloff=5
-set smartcase " case insensitive searches become sensitive with capitals
-"setglobal tags=./tags;
-set timeoutlen=500 " leader key timeout
-set ttimeoutlen=50 " make esc work faster
-set visualbell
-if exists('+undofile')
- set undofile
-endif
-set virtualedit=block
-set wildmenu
-set wildmode=longest:full,full
-set wildignore+=tags,.*.un~,*.pyc
-set winaltkeys=no
-
-"if !has("gui_running") && $display == '' || !has("gui")
-" set mouse=
-"endif
-
-set errorformat=\ %#%f(%l):\ %m
-"set makeprg=msbuild.exe\ -nologo\ -v:q\ -property:GenerateFullPaths=true\
-set makeprg=build.cmd
-
-" plugin settings {{{2
-let g:netrw_liststyle=3
-let g:netrw_banner = 0
-let g:netrw_sort_sequence = '[\/]$,*'
-
-let g:solarized_menu=0
-let g:markdown_fenced_languages = ['html', 'python', 'bash=sh']
-let g:markdown_syntax_conceal = 0
-
-" %s is replaced with fzf command
-"let g:fzf_launcher = 'xterm -e bash -ic %s'
-"let g:fzf_launcher = "in_a_new_term_function %s"
-
-"for airline
-"let g:airline#extensions#tabline#enabled = 1
-
-let g:editorconfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
-let g:editorconfig_verbose=1
-"let g:editorconfig_exec_path = 'Path to your EditorConfig Core executable'
-
-set colorcolumn=80
-highlight ColorColumn ctermbg=9
-
-" block cursor in normal mode
-let &t_ti.="\e[1 q"
-let &t_SI.="\e[5 q"
-let &t_EI.="\e[1 q"
-let &t_te.="\e[0 q"
-
-" }}}2
-" section: commands {{{1
-"-----------------------
-
-if has("cscope")
- set nocscopetag
- set cscopequickfix=s-,c-,d-,i-,t-,e-
- set nocscopeverbose
- if filereadable(".git/cscope.out")
- cscope add .git/cscope.out
- endif
- set cscopeverbose
-
- function! Cscoperebuild()
- cscope kill .git/cscope.out
- silent execute "!./.git/hooks/cscope"
- if v:shell_error
- redraw!
- echohl errormsg | echo "unable to run cscope command." | echohl none
- else
- if filereadable(".git/cscope.out")
- redraw!
- cscope add .git/cscope.out
- else
- redraw!
- echohl errormsg | echo "unable to read cscope database." | echohl none
- endif
- endif
- endfunction
-
- command! Cscope call Cscoperebuild()
-endif"
-
-
-" section: mappings {{{1
-" ----------------------
-"
-let mapleader = "\<space>"
-
-" explorer
-nnoremap <leader>e :Lexplore .<cr>
-" cd to same directory as file
-nnoremap <leader>cd :cd %:p:h<cr>:pwd<cr>
-" source .vimrc
-nnoremap <leader>v :so ~/.vimrc<cr>
-
-" copy/paste from system clipboard
-if has("win32")
-vnoremap <Leader>y "*y
-vnoremap <Leader>d "*d
-nnoremap <Leader>p "*p
-nnoremap <Leader>P "*P
-vnoremap <Leader>p "*p
-Hvnoremap <Leader>P "*P
-else
-" nnoremap <Leader>y "*y
-" nnoremap <Leader>p "*p
-" nnoremap <Leader>Y "+y
-" nnoremap <Leader>P "+p
-" nnoremap <Leader>y "*y
-" nnoremap <Leader>yy "*yy
-" noremap <Leader>p "*p
-" noremap <Leader>P "*P
-endif
-
-if has("cscope")
- cnoreabbrev <expr> csa
- \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs add' : 'csa')
- cnoreabbrev <expr> csf
- \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs find' : 'csf')
- cnoreabbrev <expr> csk
- \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs kill' : 'csk')
- cnoreabbrev <expr> csr
- \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs reset' : 'csr')
- cnoreabbrev <expr> css
- \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs show' : 'css')
- cnoreabbrev <expr> csh
- \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs help' : 'csh')
-
- nnoremap <leader>fs :cscope find s <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
- nnoremap <leader>fg :cscope find g <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
- nnoremap <leader>fc :cscope find c <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
- nnoremap <leader>ft :cscope find t <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
- nnoremap <leader>fe :cscope find e <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
- nnoremap <leader>ff :cscope find f <c-r>=expand("<cfile>")<cr><cr>:botright cwindow<cr>
- nnoremap <leader>fd :cscope find d <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
- nnoremap <leader>fi :cscope find i ^<c-r>=expand("<cfile>")<cr>$<cr>:botright cwindow<cr>
- "todo: figure out how to get cstag output in quickfix or a popup menu.
- map <c-_> :cstag <c-r>=expand("<cword>")<cr><cr>
-endif
-
-" Maps leader-[h,j,k,l] to windows split navigations
-nnoremap <leader>h <C-W><C-H>
-nnoremap <leader>j <C-W><C-J>
-nnoremap <leader>k <C-W><C-K>
-nnoremap <leader>l <C-W><C-L>
-
-" Maps Ctrl-[h,j,k,l] to resizing a window split
-nnoremap <C-H> <C-W><
-nnoremap <C-J> <C-W>-
-nnoremap <C-K> <C-W>+
-nnoremap <C-L> <C-W>>
-
-"exit insert mode
-inoremap jj <esc>
-inoremap j<space> j
-" folding
-noremap <cr> za
-" In the quickfix window, <CR> is used to jump to the error under the
-" cursor, so undefine the mapping there.
-autocmd BufReadPost quickfix nnoremap <buffer> <CR> <CR>
-
-" section: autocommands {{{1
-" --------------------------
-if has("autocmd")
- filetype plugin indent on
- autocmd bufnewfile,bufread *.md set filetype=markdown
- autocmd bufnewfile,bufread *.gradle set filetype=groovy
-endif " has("autocmd")
-" }}}1
-" section: visual {{{1
-" --------------------
-
-" switch syntax highlighting on, when the terminal has colors
-if (&t_Co > 2 || has("gui_running")) && has("syntax")
- if exists("&guifont")
- if has("mac")
- set guifont=monaco:h11
- elseif has("unix")
- set guifont=inconsolata\ 11
- elseif has("win32")
- set guifont=consolas:h11,courier\ new:h10
- endif
- endif
-
-
- if exists("syntax_on") || exists("syntax_manual")
- else
- syntax on
- endif
- set list
- if !exists('g:colors_name')
- silent! colorscheme solarized
- endif
-endif
-" }}}1
-
-if filereadable(expand('~/.vimrc_local'))
- source ~/.vimrc_local
-endif
+" section: environment {{{1\r
+" ---------------------\r
+\r
+if (empty(glob('~/.cache/vim/autoload/plug.vim')) ||\r
+ \ empty(glob('~/.local/share/vim/viminfo')))\r
+ cd ~\r
+ silent !mkdir -p .local/share/vim/{swap,backup,undo}\r
+ silent !mkdir -p .cache/vim/autoload\r
+ silent !curl -fLo .cache/vim/autoload/plug.vim\r
+ \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim\r
+ autocmd VimEnter * PlugInstall | source $MYVIMRC\r
+ cd -\r
+endif\r
+\r
+set directory=~/.local/share/vim/swap\r
+set backupdir=~/.local/share/vim/backup\r
+set undodir=~/.local/share/vim/undo\r
+set viminfo+=n~/.local/share/vim/viminfo\r
+set runtimepath+=~/.cache/vim\r
+\r
+" section: plugins {{{1\r
+" ---------------------\r
+silent call plug#begin('~/.cache/vim/bundle')\r
+Plug 'tpope/vim-repeat'\r
+Plug 'tpope/vim-surround'\r
+Plug 'tpope/vim-fugitive'\r
+Plug 'tpope/vim-commentary'\r
+Plug 'tpope/vim-dispatch'\r
+"Plug 'tpope/vim-vinager'\r
+Plug 'scrooloose/syntastic'\r
+Plug 'ctrlpvim/ctrlp.vim'\r
+Plug 'brandonbloom/csearch.vim'\r
+Plug 'chazy/cscope_maps'\r
+Plug 'altercation/vim-colors-solarized'\r
+"Plug 'editorconfig/editorconfig-vim'\r
+Plug 'fholgado/minibufexpl.vim'\r
+Plug 'a.vim'\r
+Plug 'heaths/vim-msbuild'\r
+Plug 'klen/python-mode'\r
+"Plug 'jalcine/cmake.vim'\r
+call plug#end()\r
+\r
+" section: options {{{1\r
+" ---------------------\r
+\r
+"set autoindent\r
+set autoread\r
+set autowrite " automatically save before commands like :next and :make\r
+set background=dark\r
+set backspace=2\r
+if exists('+breakindent')\r
+ set breakindent showbreak=\ +\r
+endif\r
+set cmdheight=2\r
+setglobal commentstring=#\ %s\r
+set complete-=i " searching includes can be slow\r
+"if has("win32") || has("win64")\r
+" does not work for msys2\r
+set clipboard=unnamed\r
+"else\r
+"set clipboard=unnamedplus\r
+"endif\r
+set fileformats=unix,dos,mac\r
+"set foldmethod=indent\r
+"set foldlevel=99\r
+"set foldmethod=marker\r
+"set foldopen+=jump\r
+set guioptions+=a\r
+set history=200\r
+set incsearch " incremental search\r
+set laststatus=2 " always show status line\r
+set lazyredraw\r
+set linebreak\r
+set mouse=nvi\r
+set mousemodel=popup\r
+set number\r
+"set pastetoggle=<f2>\r
+set path=**\r
+set printoptions=paper:letter\r
+set scrolloff=1\r
+set shiftround\r
+set shortmess=aoOtI\r
+"set showcmd " show (partial) command in status line.\r
+set showmatch " show matching brackets.\r
+set sidescrolloff=5\r
+set smartcase " case insensitive searches become sensitive with capitals\r
+"setglobal tags=./tags;\r
+set timeoutlen=500 " leader key timeout\r
+set ttimeoutlen=50 " make esc work faster\r
+set visualbell\r
+if exists('+undofile')\r
+ set undofile\r
+endif\r
+set virtualedit=block\r
+set wildmenu\r
+set wildmode=longest:full,full\r
+set wildignore+=tags,.*.un~,*.pyc\r
+set winaltkeys=no\r
+\r
+"if !has("gui_running") && $display == '' || !has("gui")\r
+" set mouse=\r
+"endif\r
+\r
+set makeprg=cmake\ --build\ .\r
+" Visual studio 2013\r
+"set errorformat=\ %#%f(%l):\ %m\r
+" Visual studio 2008\r
+set errorformat=%.%#>\ %#%f(%l)\ :\ %m\r
+\r
+let g:syntastic_quiet_messages = { "type": "style" }\r
+\r
+" plugin settings {{{1\r
+let g:netrw_liststyle=3\r
+let g:netrw_banner = 0\r
+let g:netrw_sort_sequence = '[\/]$,*'\r
+\r
+let g:solarized_menu=0\r
+let g:markdown_fenced_languages = ['html', 'python', 'bash=sh']\r
+let g:markdown_syntax_conceal = 0\r
+\r
+" %s is replaced with fzf command\r
+"let g:fzf_launcher = 'xterm -e bash -ic %s'\r
+"let g:fzf_launcher = "in_a_new_term_function %s"\r
+\r
+"for airline\r
+"let g:airline#extensions#tabline#enabled = 1\r
+\r
+let g:editorconfig_exclude_patterns = ['fugitive://.*', 'scp://.*']\r
+let g:editorconfig_verbose = 1\r
+\r
+if has("win32")\r
+ let g:EditorConfig_exec_path = "C:\programs\editorconfig\bin\editorconfig.exe"\r
+else\r
+ let g:editorconfig_core_mode = "python_builtin"\r
+endif\r
+\r
+set colorcolumn=80\r
+highlight ColorColumn ctermbg=9\r
+\r
+" block cursor in normal mode\r
+let &t_ti.="\e[1 q"\r
+let &t_SI.="\e[5 q"\r
+let &t_EI.="\e[1 q"\r
+let &t_te.="\e[0 q"\r
+\r
+" }}}2\r
+" section: commands {{{1\r
+"-----------------------\r
+\r
+if has("cscope")\r
+ set nocscopetag\r
+ set cscopequickfix=s-,c-,d-,i-,t-,e-\r
+ set nocscopeverbose\r
+ if filereadable(".git/cscope.out")\r
+ cscope add .git/cscope.out\r
+ endif\r
+ set cscopeverbose\r
+\r
+ function! Cscoperebuild()\r
+ cscope kill .git/cscope.out\r
+ silent execute "!./.git/hooks/cscope"\r
+ if v:shell_error\r
+ redraw!\r
+ echohl errormsg | echo "unable to run cscope command." | echohl none\r
+ else\r
+ if filereadable(".git/cscope.out")\r
+ redraw!\r
+ cscope add .git/cscope.out\r
+ else\r
+ redraw!\r
+ echohl errormsg | echo "unable to read cscope database." | echohl none\r
+ endif\r
+ endif\r
+ endfunction\r
+\r
+ command! Cscope call Cscoperebuild()\r
+endif"\r
+\r
+\r
+" section: mappings {{{1\r
+" ----------------------\r
+"\r
+let mapleader = ","\r
+\r
+" Quickly edit/reload the vimrc file\r
+nmap <silent> <leader>ev :e $MYVIMRC<CR>\r
+nmap <silent> <leader>sv :so $MYVIMRC<CR>\r
+\r
+" Minibufferexplorer\r
+nnoremap <Leader>b :MBEToggle<cr>\r
+"let g:miniBufExplMapWindowNavVim = 1\r
+"let g:miniBufExplMapCTabSwitchBufs = 1\r
+\r
+" copy/paste from system clipboard\r
+if has("win32")\r
+vnoremap <Leader>y "*y\r
+vnoremap <Leader>d "*d\r
+nnoremap <Leader>p "*p\r
+nnoremap <Leader>P "*P\r
+vnoremap <Leader>p "*p\r
+vnoremap <Leader>P "*P\r
+else\r
+" nnoremap <Leader>y "*y\r
+" nnoremap <Leader>p "*p\r
+" nnoremap <Leader>Y "+y\r
+" nnoremap <Leader>P "+p\r
+" nnoremap <Leader>y "*y\r
+" nnoremap <Leader>yy "*yy\r
+" noremap <Leader>p "*p\r
+" noremap <Leader>P "*P\r
+endif\r
+\r
+if has("cscope")\r
+ cnoreabbrev <expr> csa\r
+ \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs add' : 'csa')\r
+ cnoreabbrev <expr> csf\r
+ \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs find' : 'csf')\r
+ cnoreabbrev <expr> csk\r
+ \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs kill' : 'csk')\r
+ cnoreabbrev <expr> csr\r
+ \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs reset' : 'csr')\r
+ cnoreabbrev <expr> css\r
+ \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs show' : 'css')\r
+ cnoreabbrev <expr> csh\r
+ \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs help' : 'csh')\r
+\r
+ nnoremap <leader>fs :cscope find s <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>\r
+ nnoremap <leader>fg :cscope find g <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>\r
+ nnoremap <leader>fc :cscope find c <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>\r
+ nnoremap <leader>ft :cscope find t <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>\r
+ nnoremap <leader>fe :cscope find e <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>\r
+ nnoremap <leader>ff :cscope find f <c-r>=expand("<cfile>")<cr><cr>:botright cwindow<cr>\r
+ nnoremap <leader>fd :cscope find d <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>\r
+ nnoremap <leader>fi :cscope find i ^<c-r>=expand("<cfile>")<cr>$<cr>:botright cwindow<cr>\r
+ "todo: figure out how to get cstag output in quickfix or a popup menu.\r
+ map <c-_> :cstag <c-r>=expand("<cword>")<cr><cr>\r
+endif\r
+\r
+" Maps Ctrl-[h,j,k,l] to windows split navigations\r
+nnoremap <C-h> <C-W><C-H>\r
+nnoremap <C-j> <C-W><C-J>\r
+nnoremap <C-k> <C-W><C-K>\r
+nnoremap <C-l> <C-W><C-L>\r
+\r
+" Maps leader-[h,j,k,l] to windows split navigations\r
+"nnoremap <leader>h <C-W><C-H>\r
+"nnoremap <leader>j <C-W><C-J>\r
+"nnoremap <leader>k <C-W><C-K>\r
+"nnoremap <leader>l <C-W><C-L>\r
+"\r
+"" Maps Ctrl-[h,j,k,l] to resizing a window split\r
+"nnoremap <C-H> <C-W><\r
+"nnoremap <C-J> <C-W>-\r
+"nnoremap <C-K> <C-W>+\r
+"nnoremap <C-L> <C-W>>\r
+\r
+"exit insert mode\r
+inoremap jj <esc>\r
+inoremap j<space> j\r
+" folding\r
+noremap <space> za\r
+" In the quickfix window, <CR> is used to jump to the error under the\r
+" cursor, so undefine the mapping there.\r
+autocmd BufReadPost quickfix nnoremap <buffer> <CR> <CR>\r
+\r
+" section: autocommands {{{1\r
+" --------------------------\r
+if has("autocmd")\r
+ filetype plugin indent on\r
+ autocmd bufnewfile,bufread *.md set filetype=markdown\r
+ autocmd bufnewfile,bufread *.gradle set filetype=groovy\r
+endif " has("autocmd")\r
+" }}}1\r
+" section: visual {{{1\r
+" --------------------\r
+\r
+" switch syntax highlighting on, when the terminal has colors\r
+if (&t_Co > 2 || has("gui_running")) && has("syntax")\r
+ if exists("&guifont")\r
+ if has("mac")\r
+ set guifont=monaco:h11\r
+ elseif has("unix")\r
+ set guifont=inconsolata\ 11\r
+ elseif has("win32")\r
+ set guifont=consolas:h11,courier\ new:h10\r
+ endif\r
+ endif\r
+\r
+\r
+ if exists("syntax_on") || exists("syntax_manual")\r
+ else\r
+ syntax on\r
+ endif\r
+ set list\r
+ if !exists('g:colors_name')\r
+ silent! colorscheme solarized\r
+ endif\r
+endif\r
+" }}}1\r
+\r
+if filereadable(expand('~/.vimrc_local'))\r
+ source ~/.vimrc_local\r
+endif\r