added rc files

This commit is contained in:
hendrik 2024-01-25 19:27:33 +01:00
commit b18de5304d
3 changed files with 259 additions and 0 deletions

84
.bashrc Normal file
View File

@ -0,0 +1,84 @@
test -s ~/.alias && . ~/.alias || true
alias bashrc='vim ~/.bashrc'
alias vimrc='vim ~/.vimrc'
alias screenrc='vim ~/.screenrc'
alias q='exit'
alias h='history'
alias ...='cd ..; cd ..'
alias ..='cd ..'
alias ....='cd ..; cd ..; cd ..'
alias scred='screen -d'
alias g='grep'
alias gr='grep -rnH'
alias py='python'
alias l='ll'
alias reload='source ~/.bashrc'
alias tmpscren='screen -S tmp'
alias ll='ls -lh'
alias apRe='apache2ctl graceful'
alias sapRe='sudo apache2ctl graceful'
alias sudocommit='sudo git commit --author="hendrik <hendrik@shoogee.com>"'
alias mongodrepair='sudo mongod --repair; sudo mongod --fork --syslog'
#alias screen='screen -c ~/.screenhenrc'
#alias screen='screen -c ~/.screenhenrc -rcfile \"/root/.bashhenrc\"'
#alias vim='vim -u ~/.vimhenrc'
#alias vimdiff='vimdiff -u ~/.vimhenrc'
alias diffWhite="vimdiff -c 'set diffopt+=iwhite'"
alias runMail='cat /home/mailcore/debug.log | perl /home/mailcore/get-mail'
alias git='HOME=~/hendrik/ git'
HISTSIZE=5000
HISTFILESIZE=10000
shopt -s histappend
export PS1="\e[32m\u@\h\e[m \e[1;36m\w>\e[m "
export VISUAL=vim
export EDITOR="$VISUAL"
#pskill()
#{
# local pid
# pid=$(ps -ax | grep $1 | grep -v grep | gawk '{ print $1 }')
# echo -n "killing $1 (process $pid)..."
# kill -9 $pid
# echo "slaughtered."
#}
stty -ixon
function gVAR(){
grep -ni $1 $(find -iname "*$2*")
}
function get(){
find -iname "*$1*"
}
alias Task='vim /data/hendrikProd/Endpoints/Task.pm'
alias Prod='cd /data/hendrikProd'
alias mailcore='cd /home/mailcore'
alias Components='cd /data/hendrikProd/Endpoints/Components'
alias Endpoints='cd /data/hendrikProd/Endpoints'
alias endpoint='vim /var/www/bogdol.inducingflow.com/json/endpoint'
alias www='cd /var/www/hendrik.inducingflow.com'
alias json='cd /var/www/bogdol.inducingflow.com/json'
alias bogimages='cd /var/www/bogdol.inducingflow.com/images'
alias CleaningOrders='cd /data/hendrikProd/Endpoints/Components/CleaningOrders'
alias Workflows='cd /data/hendrikProd/Workflows'
alias CleaningItems='cd /data/hendrikProd/Endpoints/Components/CleaningItems'
alias Builder='vim /data/hendrikProd/Builder.pm'
alias Fetcher='vim /data/hendrikProd/Fetcher.pm'
alias MongoWrapper='vim /data/hendrikProd/DB/MongoWrapper.pm'
alias Utils='cd /data/hendrikProd/Utils'
alias EndpointHandler='vim /data/hendrikProd/EndpointHandler.pm'
alias grace='apache2ctl graceful'
snakecase(){
perl -pe 's#([A-Z])#_\L$1#g' | perl -pe 's#^_##'
}

82
.screenrc Normal file
View File

@ -0,0 +1,82 @@
startup_message off
#defflow on # will force screen to process ^S/^Q
deflogin on
#autodetach off
vbell off
defscrollback 5000
# 256 colors
attrcolor b ".I"
termcapinfo xterm*|linux*|rxvt*|Eterm* 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
defbce on
altscreen on
source /home/hendrik/.bashrc
# set shell
shell -$SHELL
#default vindows
screen -t SHELL1 1 bash
select 0
bind c screen 1 #window numbering starts at 1 not 0
bind 0 select 10
#shell='/root/.bashhenrc'
# ------------------------------------------------------------------------------
# SCREEN KEYBINDINGS
# ------------------------------------------------------------------------------
# Remove some stupid / dangerous key bindings
bind ^k
#bind L
bind ^\
# Make them better
bind \\ quit
bind K kill
bind I login on
bind O login off
bind } history
# make screen list keybinding less stupid -> now C-a space
bind ' ' windowlist -b
# An example of a "screen scraper" which will launch urlview on the current
# screen window
#
#bind ^B eval "hardcopy_append off" "hardcopy -h $HOME/.screen-urlview" "screen urlview $HOME/.screen-urlview"
# ------------------------------------------------------------------------------
# TERMINAL SETTINGS
# ------------------------------------------------------------------------------
# The vt100 description does not mention "dl". *sigh*
termcapinfo vt100 dl=5\E[M
# turn sending of screen messages to hardstatus off
hardstatus off
hardstatus alwayslastline
#hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
backtick 0 30 30 sh -c 'screen -ls | grep --color=no -o "$PPID[^[:space:]]*"' #backtick command: name of current screen session
#hardstatus string '%{= Kg}[ %{W}%`%?%{-} ][%= %{W}%-w%{Yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][ %{W}%H%?%{-} ]' #without time
hardstatus string '%{= KY} %?%`%? %=%{W}%-w%{Gk} %n %t %{-}%+w%{-} %= %c %Y-%m-%d%{-}'
# set these terminals up to be 'optimal' instead of vt100
termcapinfo xterm*|linux*|rxvt*|Eterm* OP
# Change the xterm initialization string from is2=\E[!p\E[?3;4l\E[4l\E>
# (This fixes the "Aborted because of window size change" konsole symptoms found
# in bug #134198)
termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'
# To get screen to add lines to xterm's scrollback buffer, uncomment the
# following termcapinfo line which tells xterm to use the normal screen buffer
# (which has scrollback), not the alternate screen buffer.
#
#termcapinfo xterm|xterms|xs|rxvt ti@:te@
# Enable non-blocking mode to better cope with flaky ssh connections.
defnonblock 5

93
.vimrc Normal file
View File

@ -0,0 +1,93 @@
set number
colo zellner
filetype plugin indent on
set nocompatible
syntax on
set ignorecase
set showmatch
let g:netrw_banner = 0
let g:netrw_liststyle = 3
let g:netrw_browse_split = 3
let g:netrw_altv = 1
let g:netrw_winsize = 15
let mapleader = ","
let g:mapleader = ","
set wildmenu
"Trying to fix syntaxHighlighting
"autocmd BufEnter * :syntax sync fromstart
set hidden
" Enable folding
set foldmethod=indent
set foldlevel=99
" fold with space
nnoremap <space> za
" always show status line
set laststatus=2
" format status line
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l
set backspace=indent,eol,start
" always show status line
set laststatus=2
" format status line
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l
"
" Movement
"
" treat long lines as break lines
map j gj
map k gk
" useful mappings for tabs
map <leader>tn :tabnew
map <leader>tm :tabmove
map <leader>to :tabonly<cr>
map <leader>tc :tabclose<cr>
" move smarter between windows
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
au BufRead,BufNewFile *.c,*.h,*.conf match Error /\s\+$/
au BufRead,BufNewFile *.py,*.pyw match pythonSpaceError /\s\+$/
au BufWritePost *.pm silent! %s/\s\+$//c
au BufWritePost *.pm silent! %s/^\(\s\+}\)\(for\|if\|else\)/\1 \2/c
" au BufWritePost *.pm silent! %s/\(\S\)\s\s\+/\1 /c
" au BufWritePost *.pm %s/^\(\s\+\)\(for\|if\|else\)\((\|{\)/\1\2 \3/c
au BufWritePost *.pm silent! %s/^\(\s\+}*\s*\)\(for\|if\|unless\|else\)\((\|{\)/\1\2 \3/c
au BufWritePost *.pm silent! %s/\v(\s*(if|for|else|unless|while|until).*\))\{\s*$/\1 \{/gc
"au BufWritePost *.pm %s/\(\$[a-z_]\+\)\(\(->{[\$a-z_]\+}\)\{-}\)\(->[a-z_]\+\)\(;\)/\1\2\4()\5/gc
" au BufWritePost *.pm silent! %s/\v(\$\w+)((-\>\{\"*\$*\w+\"*\}|-\>\w+\(\))*)(-\>\w+)(-\>|;)/\1\2\4\(\)\5/gc
"au BufWritePost *.pm silent! %s/\v(\S+),(\S+)/\1, \2/gc
"au BufWritePost *.pm silent! %s/){/) {/gc
"au BufWritePost *.pm silent! %s/\(\w\){/\1 {/gc
"au BufWritePost *.pm silent! %s/\s\+$//gc
" au BufWritePost *.pm silent! %s/ \{4\}/\t/gc
au BufWritePost *.pm silent! %s/\n\{3,\}/\r\r/c
" %s/\v^(sub \w+)\{/\1 \{/gc -> sub ..{ -> sub .. {
"augroup format_save | au!
" autocmd BufWritePost %s/^\s\+\n/\r/gce
"augroup end
" helper functions
function! HasPaste()
if &paste
return 'PASTE MODE '
en
return ''
endfunction