summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHorus32014-03-08 19:58:06 +0100
committerHorus32014-03-08 19:58:06 +0100
commit9f4b3494700eeb2061dfd840e8d030f66088b173 (patch)
tree248d041cb87ddb2debd2b926e2d095144a719b80
parent2c0e3234808dccbd7c622be7c4250ea405f3e166 (diff)
downloaddotfiles-9f4b3494700eeb2061dfd840e8d030f66088b173.tar.gz
structure
-rw-r--r--.gitignore13
-rw-r--r--bin/dirhistory.sh (renamed from dirhistory.sh)0
-rwxr-xr-xbin/play (renamed from play)0
-rwxr-xr-xbin/playf (renamed from playf)0
-rwxr-xr-xbin/screenfetch (renamed from screenfetch)0
-rwxr-xr-xbin/updatekernel.sh (renamed from updatekernel.sh)0
-rw-r--r--mpv/config (renamed from config)0
-rw-r--r--mpv/input.conf (renamed from input.conf)0
-rwxr-xr-xrtorrent/.rtorrent.rc (renamed from .rtorrent.rc)0
-rw-r--r--vim/.vimrc15
-rw-r--r--vim/plugin/autoclose.vim189
-rw-r--r--zsh/.zsh_aliases (renamed from zsh_aliases)0
-rw-r--r--zsh/.zsh_dirstack (renamed from zsh_dirstack)0
-rw-r--r--zsh/.zshrc (renamed from .zshrc)4
-rw-r--r--zsh/.zshrc_orig (renamed from .zshrc_orig)0
15 files changed, 221 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d2ef92e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,13 @@
+*.db
+*.sqlite
+*~
+*.save
+*.bak
+*.tmp
+*.log
+*-journal
+.classpath
+.settings/
+tmp/
+bin/
+
diff --git a/dirhistory.sh b/bin/dirhistory.sh
index cc652d2..cc652d2 100644
--- a/dirhistory.sh
+++ b/bin/dirhistory.sh
diff --git a/play b/bin/play
index a42a67f..a42a67f 100755
--- a/play
+++ b/bin/play
diff --git a/playf b/bin/playf
index 12dd5cb..12dd5cb 100755
--- a/playf
+++ b/bin/playf
diff --git a/screenfetch b/bin/screenfetch
index 67a0275..67a0275 100755
--- a/screenfetch
+++ b/bin/screenfetch
diff --git a/updatekernel.sh b/bin/updatekernel.sh
index ac2b579..ac2b579 100755
--- a/updatekernel.sh
+++ b/bin/updatekernel.sh
diff --git a/config b/mpv/config
index 68bb941..68bb941 100644
--- a/config
+++ b/mpv/config
diff --git a/input.conf b/mpv/input.conf
index 199c9bd..199c9bd 100644
--- a/input.conf
+++ b/mpv/input.conf
diff --git a/.rtorrent.rc b/rtorrent/.rtorrent.rc
index 772ad75..772ad75 100755
--- a/.rtorrent.rc
+++ b/rtorrent/.rtorrent.rc
diff --git a/vim/.vimrc b/vim/.vimrc
new file mode 100644
index 0000000..c6da008
--- /dev/null
+++ b/vim/.vimrc
@@ -0,0 +1,15 @@
+set number
+set ruler
+set ignorecase
+set hlsearch "highlighted gesuchte wörter
+set incsearch
+set magic
+set showmatch
+set autoindent "auto einrücken
+set scrolloff=4 "scrollt schon 4 Zeilen vor Ende
+set matchpairs=(:),{:},[:],<:>
+
+syntax enable
+set encoding=utf8
+
+"map! jj <ESC>
diff --git a/vim/plugin/autoclose.vim b/vim/plugin/autoclose.vim
new file mode 100644
index 0000000..957399e
--- /dev/null
+++ b/vim/plugin/autoclose.vim
@@ -0,0 +1,189 @@
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" AutoClose.vim - Automatically close pair of characters: ( with ), [ with ], { with }, etc.
+" Version: 1.1
+" Author: Thiago Alves <thiago.salves@gmail.com>
+" Maintainer: Thiago Alves <thiago.salves@gmail.com>
+" URL: http://thiagoalves.org
+" Licence: This script is released under the Vim License.
+" Last modified: 08/25/2008
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+let s:debug = 1
+
+" check if script is already loaded
+if s:debug == 0 && exists("g:loaded_AutoClose")
+ finish "stop loading the script"
+endif
+let g:loaded_AutoClose = 1
+
+let s:global_cpo = &cpo " store compatible-mode in local variable
+set cpo&vim " go into nocompatible-mode
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Functions
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+function! s:GetNextChar()
+ if col('$') == col('.')
+ return "\0"
+ endif
+ return strpart(getline('.'), col('.')-1, 1)
+endfunction
+
+function! s:GetPrevChar()
+ if col('.') == 1
+ return "\0"
+ endif
+ return strpart(getline('.'), col('.')-2, 1)
+endfunction
+
+function! s:IsEmptyPair()
+ let l:prev = s:GetPrevChar()
+ let l:next = s:GetNextChar()
+ if l:prev == "\0" || l:next == "\0"
+ return 0
+ endif
+ return get(s:charsToClose, l:prev, "\0") == l:next
+endfunction
+
+function! s:GetCurrentSyntaxRegion()
+ return synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
+endfunction
+
+function! s:GetCurrentSyntaxRegionIf(char)
+ let l:origin_line = getline('.')
+ let l:changed_line = strpart(l:origin_line, 0, col('.')-1) . a:char . strpart(l:origin_line, col('.')-1)
+ call setline('.', l:changed_line)
+ let l:region = synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
+ call setline('.', l:origin_line)
+ return l:region
+endfunction
+
+function! s:IsForbidden(char)
+ let l:result = index(s:protectedRegions, s:GetCurrentSyntaxRegion()) >= 0
+ if l:result
+ return l:result
+ endif
+ let l:region = s:GetCurrentSyntaxRegionIf(a:char)
+ let l:result = index(s:protectedRegions, l:region) >= 0
+ return l:result && l:region == 'Comment'
+endfunction
+
+function! s:InsertPair(char)
+ let l:next = s:GetNextChar()
+ let l:result = a:char
+ if s:running && !s:IsForbidden(a:char) && (l:next == "\0" || l:next !~ '\w')
+ let l:result .= s:charsToClose[a:char] . "\<Left>"
+ endif
+ return l:result
+endfunction
+
+function! s:ClosePair(char)
+ if s:running && s:GetNextChar() == a:char
+ let l:result = "\<Right>"
+ else
+ let l:result = a:char
+ endif
+ return l:result
+endfunction
+
+function! s:CheckPair(char)
+ let l:lastpos = 0
+ let l:occur = stridx(getline('.'), a:char, l:lastpos) == 0 ? 1 : 0
+
+ while l:lastpos > -1
+ let l:lastpos = stridx(getline('.'), a:char, l:lastpos+1)
+ if l:lastpos > col('.')-2
+ break
+ endif
+ if l:lastpos >= 0
+ let l:occur += 1
+ endif
+ endwhile
+
+ if l:occur == 0 || l:occur%2 == 0
+ " Opening char
+ return s:InsertPair(a:char)
+ else
+ " Closing char
+ return s:ClosePair(a:char)
+ endif
+endfunction
+
+function! s:Backspace()
+ if s:running && s:IsEmptyPair()
+ return "\<BS>\<Del>"
+ endif
+ return "\<BS>"
+endfunction
+
+function! s:ToggleAutoClose()
+ let s:running = !s:running
+ if s:running
+ echo "AutoClose ON"
+ else
+ echo "AutoClose OFF"
+ endif
+endfunction
+
+function! s:SetVEAll()
+ let s:save_ve = &ve
+ set ve=all
+ return ""
+endfunction
+
+function! s:RestoreVE()
+ exec "set ve=" . s:save_ve
+ unlet s:save_ve
+ return ""
+endfunction
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Configuration
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" let user define which character he/she wants to autocomplete
+if exists("g:AutoClosePairs") && type(g:AutoClosePairs) == type({})
+ let s:charsToClose = g:AutoClosePairs
+ unlet g:AutoClosePairs
+else
+ let s:charsToClose = {'(': ')', '{': '}', '[': ']', '"': '"', "'": "'"}
+endif
+
+" let user define in which regions the autocomplete feature should not occur
+if exists("g:AutoCloseProtectedRegions") && type(g:AutoCloseProtectedRegions) == type([])
+ let s:protectedRegions = g:AutoCloseProtectedRegions
+ unlet g:AutoCloseProtectedRegions
+else
+ let s:protectedRegions = ["Comment", "String", "Character"]
+endif
+
+" let user define if he/she wants the plugin turned on when vim start. Defaul is YES
+if exists("g:AutoCloseOn") && type(g:AutoCloseOn) == type(0)
+ let s:running = g:AutoCloseOn
+ unlet g:AutoCloseOn
+else
+ let s:running = 1
+endif
+
+" create appropriate maps to defined open/close characters
+for key in keys(s:charsToClose)
+ if key == '"'
+ let open_func_arg = '"\""'
+ let close_func_arg = '"\""'
+ else
+ let open_func_arg = '"' . key . '"'
+ let close_func_arg = '"' . s:charsToClose[key] . '"'
+ endif
+
+ if key == s:charsToClose[key]
+ exec "inoremap <silent> " . key . " <C-R>=<SID>SetVEAll()<CR><C-R>=<SID>CheckPair(" . open_func_arg . ")<CR><C-R>=<SID>RestoreVE()<CR>"
+ else
+ exec "inoremap <silent> " . s:charsToClose[key] . " <C-R>=<SID>SetVEAll()<CR><C-R>=<SID>ClosePair(" . close_func_arg . ")<CR><C-R>=<SID>RestoreVE()<CR>"
+ exec "inoremap <silent> " . key . " <C-R>=<SID>SetVEAll()<CR><C-R>=<SID>InsertPair(" . open_func_arg . ")<CR><C-R>=<SID>RestoreVE()<CR>"
+ endif
+endfor
+exec "inoremap <silent> <BS> <C-R>=<SID>SetVEAll()<CR><C-R>=<SID>Backspace()<CR><C-R>=<SID>RestoreVE()<CR>"
+
+" Define convenient commands
+command! AutoCloseOn :let s:running = 1
+command! AutoCloseOff :let s:running = 0
+command! AutoCloseToggle :call s:ToggleAutoClose()
diff --git a/zsh_aliases b/zsh/.zsh_aliases
index ba2299b..ba2299b 100644
--- a/zsh_aliases
+++ b/zsh/.zsh_aliases
diff --git a/zsh_dirstack b/zsh/.zsh_dirstack
index 88e6fe7..88e6fe7 100644
--- a/zsh_dirstack
+++ b/zsh/.zsh_dirstack
diff --git a/.zshrc b/zsh/.zshrc
index cdcb46e..612f5c1 100644
--- a/.zshrc
+++ b/zsh/.zshrc
@@ -3321,3 +3321,7 @@ zrclocal
if [ -f ~/.zsh_aliases ]; then
. ~/.zsh_aliases
fi
+
+if [ -f ~/.zsh_dirstack ]; then
+ . ~/.zsh_dirstack
+fi
diff --git a/.zshrc_orig b/zsh/.zshrc_orig
index 55be3ab..55be3ab 100644
--- a/.zshrc_orig
+++ b/zsh/.zshrc_orig