mirror of
https://github.com/troglobit/libuev.git
synced 2026-10-13 10:04:41 +00:00
My stuff
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
PATH=~/bin:/usr/local/bin:$PATH
|
||||
. $HOME/.bashrc
|
||||
+214
@@ -0,0 +1,214 @@
|
||||
[ -n "$DISPLAY" ] && export TERM=xterm-color
|
||||
SHELL=$BASH
|
||||
|
||||
if [ -n "$PS1" ] ;then
|
||||
[[ $0 != -* && $- != *l* ]] && . /etc/profile
|
||||
[[ $BASH_COMPLETION ]] || . /etc/bash_completion
|
||||
#. /etc/profile
|
||||
|
||||
for p in ~/bin /usr/local/bin ;do
|
||||
[[ $PATH != *${p}:* ]] && PATH=${p}:$PATH ;done
|
||||
export SVN_EDITOR=vi
|
||||
HISTCONTROL=ignoredups
|
||||
IGNOREEOF=3
|
||||
HISTSIZE=2000
|
||||
HISTFILESIZE=50000
|
||||
|
||||
__col() {
|
||||
[[ $TERM == xterm* || $TERM == linux ]] && echo -n '\[\e[3'${1}'m\]'
|
||||
}
|
||||
PS1="[$(__col 1)\h $(__col 2)\W$(__col 3)\$(exitrep)$(__col 9)]\\\$ "
|
||||
eval `dircolors ~/.dircolors`
|
||||
|
||||
[ -f /etc/rc.d/functions ] && USECOLOR=yes source /etc/rc.d/functions
|
||||
|
||||
alias mark='echo -e "\n\n\n\n ${C_H2}---- `date` ----${C_CLEAR}\n\n\n\n"'
|
||||
alias l=' less'
|
||||
alias m=' mark'
|
||||
alias df=' df -k'
|
||||
alias ll=' ls -la'
|
||||
alias ls=' ls --color=auto'
|
||||
alias where='type -a'
|
||||
alias grep='grep --color=auto'
|
||||
alias svnhead="svnlog --limit=20"
|
||||
alias sort='LC_ALL=C sort'
|
||||
|
||||
export SVN=svn+ssh://ampsvn/srv/ampemb
|
||||
svnlast() { if [[ $# -ge 1 ]] ;then svnlog -p -l 25 "$@" ;else svnlog -p -a $USER -l 25 ;fi; }
|
||||
svnminfo() { svn mergeinfo $SVN/trunk/embedded \
|
||||
--show-revs ${@:-eligible} | \
|
||||
xargs -i svnlog '-{}' svn+ssh://ampsvn/srv/ampemb/trunk/embedded; }
|
||||
|
||||
svnst() { svn st "$@" | grep -v '^[X?]'; }
|
||||
lth() { ls -lat "$@" | head -20; }
|
||||
alias open='kfmclient exec'
|
||||
url() { kfmclient openURL "$*"; }
|
||||
vimless() { vim --cmd 'let no_plugin_maps = 1 | let load_less = 1' \
|
||||
--cmd 'set readonly noswapfile' \
|
||||
-c 'set mouse=a' \
|
||||
-c 'runtime macros/less.vim' "${@:--}"; }
|
||||
p() { "$@" | less;}
|
||||
v() { if [[ $# -eq 1 && -e $1 ]] ;then vimless $1 ;else "$@" | vimless ;fi }
|
||||
vis() { vi +set\ hlsearch $(which "$@"); }
|
||||
_txt() { eval "file $*" | grep -w text | cut -d: -f1; }
|
||||
vif() { vi -c set\ hlsearch "+/$*/" $(egrep -l "$*" $(_txt \*)); }
|
||||
vdiff() { vi -g -f -d --cmd 'set columns=164' -c 'normal <C-W>=' "$@"; }
|
||||
mt() { xterm +tb -e sh -c "while multitail $@; do : ;done"; }
|
||||
ToAURoot() { tar zcf - $2 | command ssh $1 tar zxvf - -C /flash/root/; }
|
||||
Trace() { amp-backtrace.lua "$@" | less +/'ERROR=>' --jump-target=.5; }
|
||||
psman() { man -aW "$@" | xargs zcat | groff -man -Tps -P-pa4 \
|
||||
| psnup -pa4 -2 -d1 | less;}
|
||||
f() { awk -v N="$*" 'BEGIN {split(N, Nr, / |,/)}
|
||||
{for (n in Nr) {printf("%s%s", (n>1) ? " " : "", $Nr[n])}; print ""}'; }
|
||||
e() { lua -e "print($*)"; }
|
||||
|
||||
__h()
|
||||
{
|
||||
local -a C
|
||||
local -i I
|
||||
local N
|
||||
eval $(grep "$@" ~/.bash_history | uniq | command tail -10 | tac \
|
||||
| awk '{print "C[" I++ "]=\047" gensub("\047", "\047\\\\\047\047", "g", $0) "\047"}')
|
||||
if [[ ${#C[@]} > 0 ]] ;then
|
||||
for ((I=0; I<${#C[@]}; I++ )) ;do echo "$I: ${C[$I]}" > /dev/tty ;done
|
||||
read -n 1 -p "Select command: " N </dev/tty >/dev/tty
|
||||
if [[ $N = [0-9] && ${#C[$N]} > 0 ]] ;then
|
||||
echo " ... Running [$N]" >/dev/tty
|
||||
echo "${C[$N]}"
|
||||
else
|
||||
echo '' >/dev/tty
|
||||
fi
|
||||
fi
|
||||
}
|
||||
h() {
|
||||
local ___Very_UnL1leLy_7ar=$(__h "$@")
|
||||
history -s $___Very_UnL1leLy_7ar
|
||||
eval $___Very_UnL1leLy_7ar
|
||||
}
|
||||
alias hi="history|tail"
|
||||
|
||||
case $TERM in
|
||||
sun-cmd) stln() { printf "\033]l %s \033" "$*"; } ; itit() { :; }
|
||||
;;
|
||||
xterm*) stln() { printf "\033]2;%s\007" "$*" ; }
|
||||
itit() { printf "\033]1;%s\007" "$*" ; }
|
||||
;;
|
||||
*) stln() { :; } ; itit() { :; }
|
||||
;;
|
||||
esac
|
||||
HostnTty=`uname -n | tr '[a-z]' '[A-Z]'`:`tty | cut -c9-`
|
||||
Tty=`tty | cut -c10-`
|
||||
stdir() {
|
||||
local p=${PWD/$AMPROOT/@}
|
||||
if [[ $p = @/* ]] ;then Path=${p:2}; else Path=""; fi
|
||||
local p=${p/$HOME/\~}
|
||||
local V=''
|
||||
stln "-- $HostnTty ${TOOLCHAIN_PS1_LABEL/#tt/[tt${TARGET_PLATFORM/#V26/26}] }- $p --"
|
||||
itit "$Tty - $(sed 's/\([a-zA-Z]\)[a-zA-Z]*/\1/g' <<< ${AMPROOT##*/}) - ${p##*/}"
|
||||
}
|
||||
|
||||
sshwrap() {
|
||||
local Cmd Host CmdU
|
||||
Cmd=$1 ; shift
|
||||
Host=$(command ssh -o 'ProxyCommand=echo %h >/dev/fd/9' -o ControlPath=none "$@" 9>&1 2>&-)
|
||||
CmdU=$(tr a-z A-Z <<<$Cmd)
|
||||
itit "$Tty - $CmdU $Host"
|
||||
command $Cmd "$@"
|
||||
}
|
||||
ssh() { sshwrap ssh "$@"; }
|
||||
aussh() { sshwrap aussh "$@"; }
|
||||
au-sshgw() { sshwrap au-sshgw "$@"; }
|
||||
tail() { itit "$Tty - TAIL $@" ; command tail "$@"; }
|
||||
cu() { itit "$Tty - CU $@" ; command cu "$@"; }
|
||||
locate()
|
||||
{
|
||||
if [[ $# == 1 ]] ;then
|
||||
command locate -b "$@"
|
||||
else
|
||||
command locate "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
timerep() {
|
||||
local timeRep=$TIMESHOW ; [[ $timeRep ]] || timeRep=$TIMEREPORT
|
||||
[[ ! -n $timeRep ]] && return
|
||||
times > /tmp/.time$$
|
||||
local no timeStart cmd timeNow
|
||||
timeNow=$(< /tmp/.time$$)
|
||||
HISTTIMEFORMAT="%s " history 1 > /tmp/.time$$
|
||||
read no timeStart cmd < /tmp/.time$$
|
||||
if [[ -n $_timeprev ]] ;then
|
||||
echo $_timeprev $timeNow | tr ms ' ' | awk '
|
||||
{
|
||||
usrPrev = $5*60 + $6
|
||||
sysPrev = $7*60 + $8
|
||||
usrCur = $13*60 + $14
|
||||
sysCur = $15*60 + $16
|
||||
total = (usrCur + sysCur) - (usrPrev + sysPrev)
|
||||
if (total >= timeRep) {
|
||||
printf("%.3fu %.3fs %d:%02d %.1f%%\n",
|
||||
usrCur - usrPrev, sysCur - sysPrev,
|
||||
duration / 60, duration % 60, total / duration * 100.0)
|
||||
}
|
||||
}' timeRep=$timeRep duration=$(( $(date +%s) - $timeStart ))
|
||||
fi
|
||||
_timeprev=$timeNow
|
||||
unset TIMESHOW
|
||||
rm -f /tmp/.time$$
|
||||
}
|
||||
TIMEREPORT=1
|
||||
tim() { TIMESHOW=0 ; "$@"; }
|
||||
|
||||
exitrep() {
|
||||
declare -a P=( ${PIPESTATUS[@]} )
|
||||
local Last=$((${#P[*]} - 1))
|
||||
[[ ${P[$Last]} -ne 0 ]] && echo " E:${P[$Last]}"
|
||||
}
|
||||
|
||||
profile_check() {
|
||||
local curtime=$(stat -c %y $HOME/.bashrc)
|
||||
if [[ $_profile_time && $_profile_time != $curtime ]] ;then
|
||||
source $HOME/.bashrc
|
||||
fi
|
||||
_profile_time=$curtime
|
||||
}
|
||||
|
||||
PROMPT_COMMAND='history -a; stdir; timerep; profile_check'
|
||||
if [[ -d ~/.keychain && "$UID" -ne 0 ]] ;then
|
||||
#keychain --quiet ~/.ssh/id_dsa --timeout 1440 # 24 hours.
|
||||
keychain --quiet ~/.ssh/id_dsa
|
||||
. ~/.keychain/`uname -n`-sh
|
||||
fi
|
||||
|
||||
if [[ -f /opt/toolchain/toolchain-setup ]] ;then
|
||||
tt() { unset TOOLCHAIN_HOME ;. /opt/toolchain/toolchain-setup>/dev/null; }
|
||||
untt() { unset CROSS_COMPILE ARCH TOOLCHAIN_PS1_LABEL TOOLCHAIN_HOME
|
||||
unalias make; }
|
||||
tt; untt
|
||||
fi
|
||||
|
||||
amptree() {
|
||||
if [ $# -eq 0 ] ;then echo $AMPROOT ; return ;fi
|
||||
if [ $1 == --completions ] ;then
|
||||
( cd ~/amplex ; ls -1d */arm9 ) | cut -d/ -f1 | grep "^$3"
|
||||
return
|
||||
fi
|
||||
local noCD=""
|
||||
if [[ $1 == --nocd ]] ;then noCD=1; shift; fi
|
||||
AMPROOT=~/amplex/$1
|
||||
CDPATH=""
|
||||
for d in ~ $AMPROOT/{,arm9,arm9/agentframework/{,agents,libs},arm9/apps/{,drivers},arm9/utils,arm9/drivers} ~/{amplex,releases,src,abs,abs2} ;do
|
||||
CDPATH=$CDPATH:$d
|
||||
done
|
||||
export LUA_CPATH="$AMPROOT/arm9/agentframework/lua/?.so"
|
||||
if [[ ! -n $noCD ]] ;then
|
||||
echo $AMPROOT/arm9
|
||||
cd $AMPROOT/arm9
|
||||
fi
|
||||
}
|
||||
complete -C 'amptree --completions' amptree
|
||||
amptree --nocd embedded
|
||||
complete -F _command -o filenames p v
|
||||
complete -c vis env where
|
||||
fi
|
||||
# vim: set sw=3 sts=3 et:
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
# @(#)cshrc 1.11 89/11/29 SMI
|
||||
umask 2
|
||||
set path = ( ~/bin /usr/local/bin $path )
|
||||
if ( $?prompt ) then
|
||||
# source /etc/CciCshEnv
|
||||
#foreach l ( "` env - PATH=/bin sh -c '. /etc/profile; env' | awk -f ~/.envtocsh`" )
|
||||
# eval "$l"
|
||||
#end
|
||||
set HostnTty = `uname -n | tr '[a-z]' '[A-Z]'`
|
||||
set HostnTty = "$HostnTty":`tty | cut -c9-`
|
||||
set cdpath = ( /var/abs/* ~ )
|
||||
if (`tty` !~ /dev/pts/*) then
|
||||
set term = `tset -Q -` >&/dev/null
|
||||
else if ( ! $?TERM) then
|
||||
set term = vt100
|
||||
endif
|
||||
eval `dircolors -c ~/.dircolors`
|
||||
alias h history
|
||||
alias more less
|
||||
alias m more
|
||||
alias df 'df -k'
|
||||
alias ll 'ls -la'
|
||||
alias ls 'ls --color=auto'
|
||||
alias grep 'grep --color=auto'
|
||||
alias lth 'ls -lat \!* | head -20'
|
||||
alias open 'kfmclient exec'
|
||||
alias url 'kfmclient openURL "\!:*"'
|
||||
alias l less
|
||||
alias p '\!* | l'
|
||||
alias v '\!* | vi - +set\ nomodified'
|
||||
alias vis 'vi +set\ hlsearch `/usr/bin/which \!*`'
|
||||
alias vif 'vi -c set\ hlsearch +/\!*/ `egrep -l \!* *`'
|
||||
alias prnt 'enscript -2 -r -j'
|
||||
alias vdiff "vi -g -f -d --cmd 'set columns=164' -c 'normal <C-W>=' \!:*"
|
||||
alias mt 'xterm +tb -e sh -c "while multitail \!* ; do : ;done"'
|
||||
alias ToAURoot 'tar zcf - \!:2 | ssh \!:1 tar zxvf - -C /flash/root/'
|
||||
alias psman 'man -aW \!* | xargs zcat | groff -man -Tps -P-pa4 | psnup -pa4 -2 -d1 | less '
|
||||
alias autunnel 'ssh -L 22000:localhost:20532 -t ssh@gatekeeper ssh -p22\!:1 -L20532:localhost:22 root@localhost'
|
||||
alias aetunnel 'ssh -L 22000:localhost:20532 -t amplex@172.23.0.230 ssh -L20532:localhost:22 root@\!:1'
|
||||
|
||||
if ( $TERM == sun-cmd ) then
|
||||
alias stln 'printf "\033]l %s \033\" \!*'
|
||||
else if ( $TERM =~ xterm* ) then
|
||||
alias stln 'printf "\033]2;%s\007\033]1;%s\007" \!* "$HostnTty"'
|
||||
alias xtitle 'printf "\033]2;%s\007\033]1;%s\007" \!:1 \!:1'
|
||||
printf "\033]1;%s\007" "$HostnTty"
|
||||
else
|
||||
alias stln 'echo "\!*" >/dev/null'
|
||||
endif
|
||||
alias stdir 'stln "-- $HostnTty - `/bin/pwd | sed s,^$HOME,~,` --"'
|
||||
alias cd 'set old="$cwd"; chdir \!:*; stdir'
|
||||
alias back 'set tmp="$cwd"; chdir "$old"; set old="$tmp" ; stdir'
|
||||
alias cb back
|
||||
|
||||
set history=200
|
||||
if ($?tcsh) then
|
||||
setenv SHELL /bin/sh
|
||||
set autolist
|
||||
set visiblebell
|
||||
set time = 2
|
||||
set histdup = prev
|
||||
set printexitvalue
|
||||
set ignoreeof = 2
|
||||
set echo_style = both
|
||||
set matchbeep=nomatch
|
||||
set color=ls-F
|
||||
unset autologout
|
||||
#bindkey -v
|
||||
#bindkey vi-cmd-mode
|
||||
bindkey -e
|
||||
bindkey [1\;2~ complete-word-fwd
|
||||
bindkey [1\;6~ complete-word-back
|
||||
bindkey [1\;4~ complete-word-raw
|
||||
bindkey [1~ complete-word-fwd
|
||||
bindkey ' ' magic-space
|
||||
bindkey -b ^W backward-delete-word
|
||||
bindkey -b ^G list-glob
|
||||
bindkey -b M-G expand-glob
|
||||
bindkey -b M-P dabbrev-expand
|
||||
bindkey -k up history-search-backward
|
||||
bindkey -k down history-search-forward
|
||||
bindkey -b ^A spell-word
|
||||
bindkey -b ^P dabbrev-expand
|
||||
bindkey -b ^N normalize-path
|
||||
bindkey -b ^K normalize-command
|
||||
|
||||
alias _col ': \!:1'
|
||||
|
||||
if ( $term =~ xterm* ) alias _col 'echo -n "%{^[[3\!:1m%}"'
|
||||
if ($uid > 0) then
|
||||
set prompt="`_col 1`%m`_col 9`.%h.`_col 2`%c`_col 9`> "
|
||||
else
|
||||
set prompt="`_col 1`%m`_col 9`.%h.`_col 2`%c`_col 9`# "
|
||||
endif
|
||||
|
||||
# Esoteric
|
||||
complete find 'n/-fstype/(nfs ufs)/' 'n/-name/f/' \
|
||||
'n/-type/(c b d f p l s)/' 'n/-user/u/' 'n/-exec/c/' \
|
||||
'n/-ok/c/' 'n/-cpio/f/' 'n/-ncpio/f/' 'n/-newer/f/' \
|
||||
'c/-/(fstype name perm prune type user nouser \
|
||||
group nogroup size inum atime mtime ctime exec \
|
||||
ok print ls cpio ncpio newer xdev depth)/' \
|
||||
'n/*/d/'
|
||||
complete dd 'c/conv=/(ascii ebcdic ibm block lcase ucase swab \
|
||||
noerror notrunc sync)/' \
|
||||
'c/if=/f/' 'c/of=/f/' \
|
||||
'p/*/(if of ibs obs bs cbs files skip iseek \
|
||||
oseek seek count conv)/=/'
|
||||
|
||||
complete set 'p/1/s/'
|
||||
complete setenv 'p/1/e/'
|
||||
complete unset 'p/1/s/'
|
||||
complete unsetenv 'p/1/e/'
|
||||
complete vis 'p/1/c/'
|
||||
complete p 'p/1/c/'
|
||||
complete v 'p/1/c/'
|
||||
complete man 'p/1/c/'
|
||||
complete sudo 'p/1/c/'
|
||||
complete Su 'p/1/c/'
|
||||
complete alias 'p/1/a/'
|
||||
complete unalias 'p/1/a/'
|
||||
complete bindkey 'p/1/()' 'p/2/b/'
|
||||
complete complete 'p/1/c/'
|
||||
complete uncomplete 'p/1/C/'
|
||||
complete which 'p/*/c/'
|
||||
complete where 'p/*/c/'
|
||||
complete cd 'p/1/d/'
|
||||
endif
|
||||
if ( "$USER" != "root" ) then
|
||||
keychain --quiet ~/.ssh/id_dsa --timeout 1440 # 24 hours.
|
||||
source ~/.keychain/`uname -n`-csh
|
||||
endif
|
||||
alias tt 'source ~/.cshrc.tt'
|
||||
alias amptree 'setenv AMPROOT \!:1; set cdpath = ( ~ ~/{amplex,releases,src,abs,abs2} \!:1/{,arm9,arm9/agentframework/{,agents,libs},arm9/apps/{,drivers},arm9/utils,arm9/drivers} )'
|
||||
amptree ~/amplex/embedded_ampcom
|
||||
setenv SVN_EDITOR vi
|
||||
|
||||
cd .
|
||||
endif
|
||||
@@ -0,0 +1,54 @@
|
||||
|
||||
# Readline settings
|
||||
set bell-style visible
|
||||
set show-all-if-ambiguous on
|
||||
set visible-stats on
|
||||
set input-meta on
|
||||
set convert-meta off
|
||||
set output-meta on
|
||||
set expand-tilde on
|
||||
set completion-ignore-case on
|
||||
set completion-query-items 10000
|
||||
|
||||
# Bindings - make it somewhat more like tcsh
|
||||
"\C-r": redraw-current-line
|
||||
"\C-d": delete-char-or-list
|
||||
|
||||
# Menu completion on Shift-TAB go back with Shift-F1
|
||||
"\e[Z": menu-complete
|
||||
"\e[1;2~": menu-complete
|
||||
"\eO2P": "\e-\e[Z"
|
||||
|
||||
# More line editing
|
||||
$if Bash
|
||||
" ": magic-space
|
||||
$endif
|
||||
"\d": forward-backward-delete-char
|
||||
"\C-h": backward-delete-char
|
||||
"\C-x\C-h": backward-kill-line
|
||||
"\C-x\C-s": reverse-search-history
|
||||
"\C-x\C-f": forward-search-history
|
||||
"\C-s": reverse-search-history
|
||||
"\C-w": unix-filename-rubout
|
||||
"\ew": unix-word-rubout
|
||||
"\eu": undo
|
||||
|
||||
# CTRL Arrow up and down searches for what is typed so far
|
||||
"\e[1;3A": history-search-backward
|
||||
"\e[1;3B": history-search-forward
|
||||
"\e[1;5A": history-search-backward
|
||||
"\e[1;5B": history-search-forward
|
||||
|
||||
"\e[1;3D": backward-char
|
||||
"\e[1;3C": forward-char
|
||||
"\e[D": backward-char
|
||||
"\e[C": forward-char
|
||||
|
||||
# Misc
|
||||
"\C-xsk": dump-functions
|
||||
# At least Rdlf has it
|
||||
"\C-xsh": dump-history
|
||||
|
||||
"\C-xkr": kill-region
|
||||
"\C-xcr": copy-region-as-kill
|
||||
|
||||
Executable
+409
@@ -0,0 +1,409 @@
|
||||
" vim: set ts=3 sw=3 et:
|
||||
"""
|
||||
""" %Z%%E% %U%, %I% %P%
|
||||
""" (C) Copyright 2000 CCI-Europe. Author : fma
|
||||
"""
|
||||
""" Revision History """
|
||||
""" End of Revisions """
|
||||
"
|
||||
" My .vimrc file
|
||||
"
|
||||
if has("win32")
|
||||
" Use CCI standard setup. This happens automatically on UNIX
|
||||
if filereadable($VIM . "/vimrc")
|
||||
source $VIM/vimrc
|
||||
endif
|
||||
endif
|
||||
|
||||
syntax on
|
||||
filetype plugin indent on
|
||||
augroup filetype
|
||||
autocmd BufEnter *.r set ft=xdefaults
|
||||
augroup END
|
||||
|
||||
set tags=tags,../tags,/opt/toolchain/include/tags
|
||||
set path=.,include,../include,/opt/toolchain/include
|
||||
let CurPath = getcwd()
|
||||
while strlen(CurPath) > 3
|
||||
if filereadable(CurPath."/tags")
|
||||
exe "set tags+=".CurPath."/tags"
|
||||
endif
|
||||
if strlen(glob(CurPath."/include"))
|
||||
exe "set path+=".CurPath."/include"
|
||||
endif
|
||||
if strlen(glob(CurPath."/*.h"))
|
||||
exe "set path+=".CurPath
|
||||
endif
|
||||
if !exists("g:GlimpsePath") && filereadable(CurPath."/.glimpse_index")
|
||||
let g:GlimpsePath = CurPath
|
||||
execute "set path+=".CurPath
|
||||
endif
|
||||
let CurPath = substitute(CurPath, '[/\\]\+[^/\\]*$', "", "")
|
||||
endwhile
|
||||
|
||||
if has("win32")
|
||||
behave xterm
|
||||
set directory=C:/temp/preserve// " Home of the swap files_
|
||||
if filereadable('C:\Programs\NT_SFU\Shell\grep.EXE')
|
||||
set grepprg=grep\ -n " Use POSIX grep if available
|
||||
endif
|
||||
|
||||
" Let VIM know about VisualC++ include files
|
||||
if exists("$include")
|
||||
let more = substitute($include, ';', ',', 'g')
|
||||
let more = substitute(more, ' ', '\\\\\\ ', 'g')
|
||||
execute "set path+=" . more
|
||||
let g:incdirs = g:incdirs.",".more
|
||||
|
||||
let more = substitute($include, ';', '\\\\\\tags,', 'g')
|
||||
execute "set tags+=" . substitute(more, ' ', '\\\\\\ ', 'g') . '\\tags'
|
||||
unlet more
|
||||
endif
|
||||
|
||||
if exists("$SCCSHOME")
|
||||
" Can not handle '/' to '\' conversion otherwise
|
||||
let $SCCSHOME = $SCCSHOME . "/"
|
||||
endif
|
||||
|
||||
if has("gui_running")
|
||||
set guifont=Courier_New:h9
|
||||
" System menu and quick minimize
|
||||
map <M-Space> :simalt ~<CR>
|
||||
map <M-n> :simalt ~n<CR>
|
||||
" Size the GUI window. Delay positioning until window is created
|
||||
set lines=50
|
||||
set columns=82
|
||||
augroup AutoPos
|
||||
autocmd BufEnter * winp 200 50 | autocmd! AutoPos
|
||||
augroup END
|
||||
endif
|
||||
else
|
||||
if (&term == "cygwin") " This seem to have some quirks, work around some
|
||||
set directory=/var/preserve/
|
||||
let &t_@7="\<Esc>[4~" " Make <End> work
|
||||
let &t_kh="\<Esc>[1~" " Make <Home> work
|
||||
else
|
||||
set directory=/var/preserve//
|
||||
if has("gui_running")
|
||||
set guifont=fixed
|
||||
else
|
||||
" Uncomment line below to use :emenu. Adds ~1 second to startup time
|
||||
" source $VIMRUNTIME/menu.vim
|
||||
|
||||
" Make <End> work - Some options cannot be assigned to with 'let'
|
||||
exe "set t_@7=\<Esc>OF"
|
||||
|
||||
" Must be _very_ slow to handle triple clicks
|
||||
set mousetime=1500
|
||||
if &ttymouse == "xterm2"
|
||||
" The xterm2 mode will flood us with messages
|
||||
set ttymouse=xterm
|
||||
endif
|
||||
|
||||
" Save and restore the "shell" screen on enter and exit
|
||||
let &t_te = "\<Esc>[2J\<Esc>[?47l\<Esc>8"
|
||||
let &t_ti = "\<Esc>7\<Esc>[?47h"
|
||||
|
||||
" Make <Del> mappings work
|
||||
exe "set t_kb=\x08"
|
||||
exe "set t_kD=\x7f"
|
||||
|
||||
exe "set t_Co=16"
|
||||
|
||||
" Make shifted cursor keys work.
|
||||
" For the necessary xmodmap commands, see :help hpterm
|
||||
map <t_F3> <S-Up>
|
||||
map! <t_F3> <S-Up>
|
||||
map <t_F6> <S-Down>
|
||||
map! <t_F6> <S-Down>
|
||||
map <t_F8> <S-Left>
|
||||
map! <t_F8> <S-Left>
|
||||
map <t_F9> <S-Right>
|
||||
map! <t_F9> <S-Right>
|
||||
" To make the shift-Tab <S-Tab> key work, also see :help suffixes
|
||||
cmap <Esc>[1~ <C-P>
|
||||
cmap <Esc>[1;2~ <C-P>
|
||||
endif
|
||||
endif
|
||||
if has("gui_running")
|
||||
let &guifont="Bitstream Vera Sans Mono 10"
|
||||
endif
|
||||
endif
|
||||
|
||||
if has("gui_running")
|
||||
set title icon
|
||||
set titlestring=%F%(\ --\ %a%)
|
||||
set iconstring=%f
|
||||
else
|
||||
set notitle noicon " Do _not_ mess with title string of my xterm
|
||||
endif
|
||||
|
||||
set showcmd " Show chars for command in progress on ruler
|
||||
set exrc " Allow .vimrc in current dir
|
||||
set hidden " Dont unload buffers BEWARE OF :q! and :qa! !!!
|
||||
set backspace=indent,eol " Can ^H/^W/^U across lines in insert
|
||||
set sidescroll=5
|
||||
set scrolloff=4
|
||||
set textwidth=100
|
||||
set whichwrap=h,l,<,>,[,] " Do not backspace/space across line boundaries
|
||||
set autoindent
|
||||
set winheight=10 " Make new windows this high
|
||||
set cmdheight=2 " status line area height - higher for quickfix
|
||||
set laststatus=2 " always with statusline
|
||||
set showmatch
|
||||
set autowrite " write files back at ^Z, :make etc.
|
||||
set mouse=nv " Use xterm mouse mode in insert/cmdline/prompt
|
||||
set clipboard=autoselect " Visual to/from clipboard
|
||||
set fileformats=unix,dos,mac
|
||||
set showbreak=________ " Show me where long lines break
|
||||
set showfulltag " Insert function prototype in ^X^]
|
||||
set incsearch nohlsearch " Search while typing, 'zx' toggles highlighting
|
||||
set helpheight=100 " Maximize help windows
|
||||
set shortmess=ato " Brief messages to avoid 'Hit Return' prompts
|
||||
set formatoptions=crqlo " Comment handling / Dont break while typing
|
||||
set history=100
|
||||
set viminfo='20,\"500 " Keep history listings across sessions
|
||||
set wildmenu " Show completion matches on statusline
|
||||
set wildmode=list:longest,full
|
||||
set complete=.,w,b,u,d " The ,t,i from the default was too much, now ,d
|
||||
set isfname-== " No = allows 'gf' in File=<Path> Constructs
|
||||
set shiftwidth=4
|
||||
set softtabstop=4
|
||||
set expandtab
|
||||
set spelllang=en_us
|
||||
set equalprg=csb
|
||||
set visualbell
|
||||
set printfont=:h7.5
|
||||
set printoptions=number:y,duplex:off,left:5mm,top:5mm,bottom:5mm,right:5mm
|
||||
|
||||
let c_gnu = 1
|
||||
let c_no_curly_error = 1
|
||||
"let &errorformat =
|
||||
|
||||
" For running edit-compile-edit (quickfix)
|
||||
nmap <Esc>n :cnext<CR>
|
||||
nmap <Esc>l :clist<CR>
|
||||
nmap <Esc>c :cc<CR>
|
||||
nmap <Esc>p :cprevious<CR>
|
||||
nmap <Esc>m :make<CR>
|
||||
|
||||
" Various utility keys
|
||||
nmap ( :bprev<CR>
|
||||
nmap ) :bnext<CR>
|
||||
nmap F :files<CR>
|
||||
nmap Q :bdelete<CR>
|
||||
nmap !Q :bdelete!<CR>
|
||||
nmap [f :bunload<CR>
|
||||
nmap zx :set invhlsearch<CR>
|
||||
nmap zs :set invspell<CR>
|
||||
nmap zn :set invnumber<CR>
|
||||
nmap zf :set invfoldenable<CR>
|
||||
nmap [s :exe "g/".@/."/p"<CR>
|
||||
|
||||
|
||||
" These seem to be suitable for hitting all keys in mapping within timeout
|
||||
set timeoutlen=500
|
||||
set ttimeoutlen=50
|
||||
|
||||
" Make cursor keys jump out of insert. Your preference may differ
|
||||
imap <Left> <Esc>
|
||||
imap <Right> <Esc>
|
||||
imap <Up> <Esc>
|
||||
imap <Down> <Esc>
|
||||
imap <S-Left> <Esc>
|
||||
imap <S-Right> <Esc>
|
||||
imap <S-Up> <Esc>
|
||||
imap <S-Down> <Esc>
|
||||
|
||||
" Movement with "2x3" block navigation keys. Customize to your liking
|
||||
nnoremap <PageUp> <C-U>
|
||||
nnoremap <PageDown> <C-D>
|
||||
nnoremap <Home> <C-Y>
|
||||
nnoremap <xHome> <C-Y>
|
||||
nnoremap <End> <C-E>
|
||||
nmap <Insert> [[z.
|
||||
nmap <Del> ]]z.
|
||||
nmap <kDel> ]]z.
|
||||
nmap <S-Up> {
|
||||
nmap <S-Down> }
|
||||
|
||||
" Insert some standard blobs
|
||||
map <F2> :r $SCCSHOME/SccsHeaders/static.hdr<CR>
|
||||
|
||||
" Always delete to left of cursor
|
||||
inoremap <Del> <C-H>
|
||||
cnoremap <Del> <C-H>
|
||||
|
||||
" List multiple matches at CTRL-]
|
||||
nmap <C-]> :T <C-R><C-W><CR>
|
||||
" Tag "preview" window
|
||||
nmap <C-X><C-]> :ptag <C-R><C-W><CR>
|
||||
nmap <C-X><Right> :ptnext<CR>
|
||||
nmap <C-X><Left> :ptprevious<CR>
|
||||
nmap <C-X><Down> :ppop<CR>
|
||||
nmap <C-X><Up> :ptag<CR>
|
||||
nmap <C-X>x :pclose<CR>
|
||||
|
||||
" Some coloring. These are _my_ preferences
|
||||
hi statusLine term=bold,reverse cterm=NONE ctermbg=7 gui=NONE guibg=grey
|
||||
hi statusLineNC term=reverse cterm=NONE ctermbg=8 gui=NONE guibg=darkgrey
|
||||
hi NonText ctermfg=lightgray
|
||||
hi Visual cterm=Inverse ctermfg=grey ctermbg=black
|
||||
|
||||
if &term == "ansi" || &term == "console" || &term == "linux"
|
||||
set background=dark
|
||||
hi statusLine ctermfg=black
|
||||
hi statusLineNC ctermfg=black ctermbg=yellow
|
||||
endif
|
||||
|
||||
" Use :T instead of :ta to see file names in ^D complete-lists
|
||||
command! -complete=tag_listfiles -nargs=1 T tjump <args>|
|
||||
\call histadd("cmd", "T <args>")
|
||||
|
||||
" File type dependent settings
|
||||
augroup Private
|
||||
" Use smartindent in these files.
|
||||
autocmd FileType tcl,postscr set nocindent smartindent|inoremap # X<BS>#
|
||||
" Use cindent for C files.
|
||||
autocmd FileType c,cpp set cindent cinoptions=(0,w1,u0,:1,=2|inoremap # #
|
||||
" Autowrap while typing in other types of files
|
||||
autocmd FileType * set formatoptions-=t|set formatoptions+=t
|
||||
" NO autowrap while typing in source code files
|
||||
autocmd FileType tcl,postscr,c,cpp set formatoptions-=t | call SetPathAdd()
|
||||
|
||||
" These are for CCI source files
|
||||
"autocmd BufRead * set ts=3 sts=3 sw=3
|
||||
" And _these_ are most sensible for VIM (ao. PD) source code
|
||||
"autocmd BufRead */src* set sts=4 sw=4 cinoptions&
|
||||
|
||||
" Handle global (non bufferspecific) options
|
||||
autocmd BufEnter * call BufEnterGlobalOpts()
|
||||
augroup end
|
||||
|
||||
function! SetPathAdd()
|
||||
let fpath = fnamemodify(expand("<afile>:p"), ":h")
|
||||
let SccsPath = $SCCSPATH
|
||||
let b:incdirs = ""
|
||||
while strlen(SccsPath) > 0
|
||||
let spc = match(SccsPath, " ")
|
||||
if spc >= 0
|
||||
let Part = strpart(SccsPath, 0, spc)
|
||||
let SccsPath = strpart(SccsPath, spc + 1)
|
||||
else
|
||||
let Part = SccsPath
|
||||
let SccsPath = ""
|
||||
endif
|
||||
if strlen(Part) > 0
|
||||
let b:incdirs = b:incdirs.",".$SCCSHOME."/".$REL.".".Part."/".fpath
|
||||
endif
|
||||
endwhile
|
||||
if strlen(b:incdirs) > 1
|
||||
let b:incdirs = strpart(b:incdirs, 1)
|
||||
else
|
||||
unlet b:incdirs
|
||||
endif
|
||||
endfunc
|
||||
|
||||
function! BufEnterGlobalOpts()
|
||||
" Avoid '#-in-1.-column' problem with cindent & smartindent
|
||||
if &filetype == 'c' || &filetype == 'cpp'
|
||||
inoremap # #
|
||||
" Dont highligh this as an error
|
||||
hi link cCommentStartError Comment
|
||||
else
|
||||
inoremap # X<BS>#
|
||||
endif
|
||||
|
||||
" Set up path for private include files - w. help from SetPathAdd()
|
||||
if exists("g:incdirs")
|
||||
if exists("b:incdirs")
|
||||
let &path = ".,".b:incdirs.",".g:incdirs
|
||||
else
|
||||
let &path = ".,".g:incdirs
|
||||
endif
|
||||
endif
|
||||
|
||||
let fpath = expand("<afile>:p")
|
||||
if fpath =~ '\f\/src\f' || fpath =~ '\f\/BUILD\f' || fpath =~ '\f-\d'
|
||||
setlocal patchmode=.orig " Always save original file
|
||||
else
|
||||
setlocal patchmode&
|
||||
endif
|
||||
endfunc
|
||||
|
||||
|
||||
" Pick a status line, or craft one yourself
|
||||
" statusline #1, two expressions -- Use a continuation line & quote SCCS keys
|
||||
set statusline=%<%f%=\ %([%1*%M\%*%n%R\%Y%{VarExists(',GZ','b:zipflag')}
|
||||
\]%)\ %02c%V(%02B)C\ %3l/%LL\ %P
|
||||
" statusline #2, zero expressions
|
||||
"set statusline=%<%f%=\ %([%n%Xm%Xr%&,HL&h]%)\ %-19(%3l,%02c%'%o%)'%02Xb'
|
||||
" statusline #3, the default one
|
||||
"set statusline&
|
||||
|
||||
" Coloring of the modified flag
|
||||
highlight User1 cterm=bold ctermfg=red ctermbg=gray gui=bold guifg=red guibg=gray
|
||||
|
||||
" Testing
|
||||
"set title titlestring=%<%F%=%l/%L-%P titlelen=70
|
||||
"set rulerformat=%l,%c%_%t-%P
|
||||
|
||||
function! VarExists(s,v)
|
||||
if exists(a:v)
|
||||
return a:s
|
||||
else
|
||||
return ""
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! Show_g_CTRLG()
|
||||
let col = col(".")
|
||||
let vcol = virtcol(".")
|
||||
let line = line(".")
|
||||
let lline = line("$")
|
||||
exe "normal $"
|
||||
let cole = col(".")
|
||||
let vcole = virtcol(".")
|
||||
exe "normal " vcol . "|"
|
||||
|
||||
let out_str = "Col " . col
|
||||
if col != vcol
|
||||
let out_str = out_str . "-" . vcol
|
||||
endif
|
||||
let out_str = out_str . " of " . cole
|
||||
if cole != vcole
|
||||
let out_str = out_str . "-" . vcole
|
||||
endif
|
||||
let out_str = out_str . "; Line " . line . " of " . lline
|
||||
let out_str = out_str . " (" . (line * 100 / lline) . "%)"
|
||||
let byte = line2byte(line) + col - 1
|
||||
let out_str = out_str . "; Char " . byte
|
||||
let lbyte = line2byte(lline) + strlen(getline(lline))
|
||||
let out_str = out_str . " of " . lbyte . " (" . (byte * 100 / lbyte) . "%)"
|
||||
echo out_str
|
||||
endfunction
|
||||
" This is _much_ faster than g<C-G> on large files. And it is more verbose
|
||||
map gK :call Show_g_CTRLG()<CR>
|
||||
|
||||
function! Incr()
|
||||
if ! exists("g:Incr")
|
||||
let g:Incr = 0
|
||||
else
|
||||
let g:Incr = g:Incr + 1
|
||||
endif
|
||||
return g:Incr
|
||||
endfunc
|
||||
|
||||
if filereadable($HOME."/.vimrc.priv")
|
||||
source $HOME/.vimrc.priv
|
||||
endif
|
||||
|
||||
if exists("load_less")
|
||||
set directory=
|
||||
set statusline=%3l/%LL\ %P\ %o/%{line2byte(line(\"$\")+1)-1}\ %=%<%f%a
|
||||
set cmdheight=1
|
||||
endif
|
||||
|
||||
let loaded_explorer=1 " Don't want plugin/explorer.vim
|
||||
" echo "DONE sourcing"
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
"
|
||||
" Extra vim stuff
|
||||
"
|
||||
|
||||
nmap <F2> :call SetCHdr()<CR>
|
||||
|
||||
map gy "*y
|
||||
map gp "*p
|
||||
map g]p "*]p
|
||||
map g[P "*[P
|
||||
|
||||
function! SetCHdr()
|
||||
call append(0, ["/*",
|
||||
\ " $Id$",
|
||||
\ " (C) Copyright ".strftime("%Y")." Amplex, ".$USER."@amplex.dk",
|
||||
\ "",
|
||||
\ " ABSTRACT: ",
|
||||
\ "*/"])
|
||||
call append(line('$'), ["", "// vim: set sw=3 sts=3 et:"])
|
||||
normal 5G$
|
||||
set sw=3 sts=3 et
|
||||
endfunction
|
||||
|
||||
function! TextEnableCodeSnip(filetype,start,end) abort
|
||||
let ft=toupper(a:filetype)
|
||||
let group='textGroup'.ft
|
||||
if exists('b:current_syntax')
|
||||
let s:current_syntax=b:current_syntax
|
||||
" Remove current syntax definition, as some syntax files (e.g. cpp.vim)
|
||||
" do nothing if b:current_syntax is defined.
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
execute 'syntax include @'.group.' syntax/'.a:filetype.'.vim'
|
||||
try
|
||||
execute 'syntax include @'.group.' after/syntax/'.a:filetype.'.vim'
|
||||
catch
|
||||
endtry
|
||||
if exists('s:current_syntax')
|
||||
let b:current_syntax=s:current_syntax
|
||||
else
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
exe 'syntax region textSnip'.ft.
|
||||
\ ' matchgroup=textSnip '.
|
||||
\ ' start="'.a:start.'" end="'.a:end.'" '.
|
||||
\ ' contains=@'.group.' containedin=ALL'
|
||||
hi link textSnip SpecialComment
|
||||
endfunction
|
||||
|
||||
autocmd Private FileType sh call TextEnableCodeSnip('lua', '--LUA--', '--EOF--') |
|
||||
\ call TextEnableCodeSnip('awk', '#AWK#', '#EOF#')
|
||||
|
||||
nmap gmd :Glimpse NodeType.<C-R><C-W><CR>
|
||||
|
||||
let vimrcdir = expand("<sfile>:h")."/dot/usr/vim"
|
||||
func! CciPostLoad(Pattern, File)
|
||||
augroup CciAutoLoad
|
||||
exe "autocmd BufNewFile ".a:Pattern "source ".g:vimrcdir."/".a:File
|
||||
\ ." |let b:isNew = 1 | autocmd! CciAutoLoad BufNewFile ".a:Pattern
|
||||
augroup CCIstart
|
||||
exe "autocmd BufNewFile ".a:Pattern "let b:autohdr = 1"
|
||||
augroup END
|
||||
endfunc
|
||||
call CciPostLoad("GLM::*", "srcmgr.vim")
|
||||
call CciPostLoad("GLW::*", "srcmgr.vim")
|
||||
delfunction CciPostLoad
|
||||
exe "source ".expand("<sfile>:h")."/dot/usr/vim/"."utils.vim"
|
||||
"exe "source ".expand("<sfile>:h")."/dot/usr/vim/"."newfmgr.vim"
|
||||
|
||||
nmap gG :call OpenSpec("GLW::<C-R><C-W>")<CR>
|
||||
vmap gG :call VisualOpenSpec("GLM::")<CR>
|
||||
command! -nargs=1 Glimpse call OpenSpec("GLM::<args>")
|
||||
command! -nargs=1 GlimpseW call OpenSpec("GLW::<args>")
|
||||
|
||||
func! OpenSpec(str)
|
||||
let Str = a:str
|
||||
exe "edit ".Str
|
||||
call histadd("cmd", "edit ".Str)
|
||||
endfunction
|
||||
|
||||
func! VisualOpenSpec(Pre)
|
||||
let Col1 = col("'<")
|
||||
let Col2 = col("'>")
|
||||
if line("'<") != line("'>") | return | endif
|
||||
let Str = strpart(getline(line("'<")), Col1 - 1, Col2 - Col1)
|
||||
let Str = substitute(Str, " ", ".", "g")
|
||||
call OpenSpec(a:Pre.Str)
|
||||
endfunc
|
||||
|
||||
set statusline=%<%f%=\ %2*%{VimBuddy()}%*\ %([%1*%M\%*%n%R\%Y
|
||||
\%{VarExists(',GZ','b:zipflag')}]%)\ %02c%V(%02B)C\ %3l/%LL\ %P
|
||||
highlight User2 ctermfg=blue ctermbg=gray guifg=darkblue guibg=gray
|
||||
" OK. So here is the infamous VimBuddy. You can delete it, if it is not
|
||||
" referenced from your 'statusline'
|
||||
function! VimBuddy()
|
||||
" Take a copy for others to see the messages
|
||||
if ! exists("s:vimbuddy_msg")
|
||||
let s:vimbuddy_msg = v:statusmsg
|
||||
endif
|
||||
if ! exists("s:vimbuddy_warn")
|
||||
let s:vimbuddy_warn = v:warningmsg
|
||||
endif
|
||||
if ! exists("s:vimbuddy_err")
|
||||
let s:vimbuddy_err = v:errmsg
|
||||
endif
|
||||
if ! exists("s:vimbuddy_onemore")
|
||||
let s:vimbuddy_onemore = ""
|
||||
endif
|
||||
|
||||
if g:actual_curbuf != bufnr("%")
|
||||
" Not my buffer, sleeping
|
||||
return "|-o"
|
||||
elseif s:vimbuddy_err != v:errmsg
|
||||
let v:errmsg = v:errmsg . " "
|
||||
let s:vimbuddy_err = v:errmsg
|
||||
return ":-("
|
||||
elseif s:vimbuddy_warn != v:warningmsg
|
||||
let v:warningmsg = v:warningmsg . " "
|
||||
let s:vimbuddy_warn = v:warningmsg
|
||||
return "(-:"
|
||||
elseif s:vimbuddy_msg != v:statusmsg
|
||||
let v:statusmsg = v:statusmsg . " "
|
||||
let s:vimbuddy_msg = v:statusmsg
|
||||
let test = matchstr(v:statusmsg, 'lines *$')
|
||||
let num = substitute(v:statusmsg, '^\([0-9]*\).*', '\1', '') + 0
|
||||
" How impressed should we be
|
||||
if test != "" && num > 20
|
||||
let str = ":-O"
|
||||
elseif test != "" && num
|
||||
let str = ":-o"
|
||||
else
|
||||
let str = ":-/"
|
||||
endif
|
||||
let s:vimbuddy_onemore = str
|
||||
return str
|
||||
elseif s:vimbuddy_onemore != ""
|
||||
let str = s:vimbuddy_onemore
|
||||
let s:vimbuddy_onemore = ""
|
||||
return str
|
||||
endif
|
||||
|
||||
if ! exists("b:lastcol")
|
||||
let b:lastcol = col(".")
|
||||
endif
|
||||
if ! exists("b:lastlineno")
|
||||
let b:lastlineno = line(".")
|
||||
endif
|
||||
let num = b:lastcol - col(".")
|
||||
let b:lastcol = col(".")
|
||||
if (num == 1 || num == -1) && b:lastlineno == line(".")
|
||||
" Let VimBuddy rotate his nose
|
||||
let num = b:lastcol % 4
|
||||
if num == 0
|
||||
let ch = '/'
|
||||
elseif num == 1
|
||||
let ch = '-'
|
||||
elseif num == 2
|
||||
let ch = '\'
|
||||
else
|
||||
let ch = '|'
|
||||
endif
|
||||
return ":" . ch . ")"
|
||||
endif
|
||||
let b:lastlineno = line(".")
|
||||
|
||||
" Happiness is my favourite mood
|
||||
return ":-)"
|
||||
endfunction
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
if &background == "dark"
|
||||
hi Comment term=bold ctermfg=Cyan guifg=#80a0ff
|
||||
hi Type term=underline ctermfg=Magenta guifg=#ffa0a0
|
||||
hi Special term=bold ctermfg=LightRed guifg=Orange
|
||||
hi Identifier term=underline cterm=bold ctermfg=Cyan guifg=#40ffff
|
||||
hi Statement term=bold ctermfg=Yellow guifg=#ffff60 gui=bold
|
||||
hi PreProc term=underline ctermfg=LightBlue guifg=#ff80ff
|
||||
hi Constant term=underline ctermfg=LightGreen guifg=#60ff60 gui=bold
|
||||
hi Ignore ctermfg=black guifg=bg
|
||||
else
|
||||
hi Comment term=bold ctermfg=DarkBlue guifg=DarkBlue
|
||||
hi Type term=underline ctermfg=Brown gui=NONE guifg=DarkRed
|
||||
hi Special term=bold ctermfg=DarkMagenta guifg=DarkMagenta
|
||||
hi Identifier term=underline ctermfg=DarkCyan guifg=DarkCyan
|
||||
hi Statement term=bold ctermfg=DarkRed guifg=DarkRed
|
||||
hi PreProc term=underline ctermfg=DarkMagenta guifg=DarkMagenta
|
||||
hi Constant term=underline ctermfg=DarkGreen guifg=DarkGreen gui=italic
|
||||
hi Ignore ctermfg=white guifg=bg
|
||||
hi NonText ctermfg=white
|
||||
hi! link NonText Ignore
|
||||
endif
|
||||
hi Error term=reverse ctermbg=Red ctermfg=White guibg=Red guifg=White
|
||||
hi Todo term=standout ctermbg=Yellow ctermfg=Black guifg=Blue guibg=Yellow
|
||||
au! Syntax postscr source /usr/local2/share/vim/syntax/postscr.vim
|
||||
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/kermit +
|
||||
set line /dev/ttyS0
|
||||
set speed 115200
|
||||
set flow none
|
||||
set modem none
|
||||
set carrier-watch off
|
||||
show communications
|
||||
connect
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
##
|
||||
# $Id$
|
||||
# (C) Copyright 2009 Amplex, fm@amplex.dk
|
||||
#
|
||||
# ABSTRACT: Global grep with prebuilt index
|
||||
##
|
||||
|
||||
Dir=$(pwd)
|
||||
while [ "$Dir" ] ;do
|
||||
[ -f $Dir/.glimpse_index ] && break
|
||||
Dir=${Dir%/*}
|
||||
done
|
||||
[ "$Dir" ] || { echo "No glimpse index in this directory branch" ; exit 1; }
|
||||
|
||||
echo "-- Paths relative to: $Dir"
|
||||
exec glimpse-tt -y -H $Dir "$@"
|
||||
|
||||
|
||||
// vim: set sw=3 sts=3 et:
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec make $CROSS_COMPILE_MAKE_ARGS $TOOLCHAIN_MAKE_ARGS "$@"
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
Dir=.
|
||||
[ $# -gt 0 ] && Dir=$1
|
||||
cd $Dir
|
||||
rm -f .glimpse_filenames .glimpse_filenames_index .glimpse_filetimes \
|
||||
.glimpse_index .glimpse_messages .glimpse_partitions .glimpse_statistics
|
||||
find . \
|
||||
-name .svn -prune -o -name rootdisk -prune -o -name shadows -prune -o -name \*-pak -prune -o \
|
||||
-name doxygen -prune -o -type f -print | cut -c3- \
|
||||
| /bin/grep -v -E '^tags$|\.glimpse_|\.pdf$|\.o$|\.so$|\.so\.|\.a$|/mapfile$' \
|
||||
| while read L ;do
|
||||
read -n4 T < "$L"; [[ $T != ?ELF && $T != BZh* && $T != $'\x1f\x8b\x08'* ]] && echo "$L"
|
||||
done \
|
||||
| glimpseindex-tt -n -F -H $Dir | awk '!/^Indexing /'
|
||||
echo -n "Creating tags ... "
|
||||
ctags --recurse --exclude=.svn --exclude=rootdisk --exclude=\*-pak \
|
||||
--sort=no --links=no --excmd=number -f - --extra=+fq --totals=yes \
|
||||
| { X=$(mktemp); rm -f $X; ctags -f $X /dev/null; cat $X -; rm -f $X; } \
|
||||
| gawk -F '\t' '
|
||||
/^!_TAG_FILE_SORTED/ {sub(/[0-9]/, "2")}
|
||||
{print}
|
||||
$NF == "F" && $1 ~ /\.h$/ {
|
||||
file = $2
|
||||
#print "Searching " file " .." >"/dev/stderr"
|
||||
lno = 0
|
||||
while (getline l <file) {
|
||||
lno++
|
||||
if (l ~ /^MessageNodeType\(/) {
|
||||
split(substr(l, 17), arg, ",")
|
||||
tag = gensub(/^ */, "", 1, arg[1])
|
||||
print tag "\t" file "\t" lno " \"\tt"
|
||||
#tags=tags " " tag
|
||||
extra++
|
||||
}
|
||||
}
|
||||
}
|
||||
$NF == "f" && $1 ~ /:/ && $2 ~ /\.lua$/ {
|
||||
npath = split($1, pth, ":")
|
||||
print pth[npath] "\t" $2 "\t" $3 "\tf"
|
||||
}
|
||||
END {print extra+0 " extra tags added" tags >"/dev/stderr"}
|
||||
' > tags
|
||||
LC_ALL=C sort --ignore-case -o tags tags
|
||||
|
||||
echo done
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
# Mkp - Makepkg front for easy cleanup
|
||||
#
|
||||
|
||||
mkdir -p BUILD
|
||||
cp `ls -1 | grep -v '^BUILD$'` BUILD
|
||||
(cd BUILD; makepkg "$@"; rm PKGBUILD)
|
||||
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
for DEV in "TPPS/2 IBM TrackPoint" "Synaptics Inc. Composite TouchPad / TrackPoint" ;do
|
||||
xinput set-int-prop "$DEV" "Evdev Wheel Emulation" 8 1
|
||||
xinput set-int-prop "$DEV" "Evdev Wheel Emulation Button" 8 2
|
||||
xinput set-int-prop "$DEV" "Evdev Wheel Emulation Axes" 8 6 7 4 5
|
||||
done
|
||||
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare -a BACKUP=( ampdev0 Backup )
|
||||
|
||||
if [[ $1 == "restore" ]] ;then
|
||||
fname=$(cut -d: -f1 <<< $2)
|
||||
pattern=$(cut -d: -f2 <<< $2)
|
||||
ssh ${BACKUP[0]} "cd ${BACKUP[1]}; cat b-$fname.cpio.lzo" | lzop -d | cpio -ivBdum $pattern
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#eval $(keychain --eval --quiet)
|
||||
|
||||
BackupName=$1
|
||||
cd ~/amplex
|
||||
for Dir in */backmeup */*/backmeup ;do
|
||||
Dir=${Dir%/*}
|
||||
[[ -d $Dir ]] || continue
|
||||
FDir=${Dir//\//_}
|
||||
(cd $Dir
|
||||
svn status | grep '^[AM]' | cut -c9- > /tmp/fn$$
|
||||
cat /tmp/fn$$ | cpio -o --quiet | lzop \
|
||||
| ssh ${BACKUP[0]} "cd ${BACKUP[1]}; cat >b-$FDir-$BackupName.cpio.lzo"
|
||||
scp -q /tmp/fn$$ ${BACKUP[0]}:${BACKUP[1]}/i-$FDir-$BackupName
|
||||
rm -f /tmp/fn$$
|
||||
)
|
||||
done
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env lua
|
||||
|
||||
function system(command)
|
||||
local fd = io.popen(command, "r")
|
||||
string = fd:read("*all")
|
||||
fd:close()
|
||||
return (string.gsub(string, "\n$", ""))
|
||||
end
|
||||
|
||||
amppath = os.getenv("AMPROOT") or error("AMPROOT not defined")
|
||||
print((string.gsub(arg[1] or system("pwd"), "^"..amppath, "")))
|
||||
Executable
+78
@@ -0,0 +1,78 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This script is intended to be run as '~+flashboot.cu <args> from inside cu(1)
|
||||
#
|
||||
# Contact the debug port with 'cu -s 115200 -l /dev/ttyS0' or equivalent
|
||||
# You will of course need the cu(1) program (may be part of uucp).
|
||||
# You will need chat (from ppp), lsx (lrzsz) and gkermit too.
|
||||
# Devdump (for sn.txt) is in arm9/utils/devdump
|
||||
#
|
||||
# The file boot.bin must be in the current directory.
|
||||
# Copy the 'Files' directory from the AUTester to support bootstrap mode.
|
||||
# Create the file sn.txt as 7 numbers to have the serialnumber block programmed.
|
||||
#
|
||||
|
||||
TT=/opt/toolchain/utils/flash-scripts/files
|
||||
|
||||
say() { echo "$@" 1>&2; }
|
||||
die() { say "$@"; exit 1; }
|
||||
|
||||
say "Checking for bootstrap mode ..."
|
||||
if chat -t 3 -e CCC '\c' ;then
|
||||
[ -f loader.bin ] && P="" || P="$TT/"
|
||||
[ -f ${P}loader.bin ] \
|
||||
|| die "Board is in bootstrap mode but no boot files here!"
|
||||
|
||||
# Prepare for uboot
|
||||
lsx ${P}loader.bin
|
||||
|
||||
[ -f u-boot.bin ] && P="" || P="$TT/"
|
||||
[ -f ${P}u-boot.bin ] \
|
||||
|| die "Board is in bootstrap mode but no boot files here!"
|
||||
|
||||
# Send uboot.
|
||||
chat -t 5 -e CCC '\c' || die "Loader did not load"
|
||||
lsx ${P}u-boot.bin
|
||||
chat -e 'autoboot: ' '\rversion' || die "U-boot did not load"
|
||||
fi
|
||||
[ "$1" = "boot" ] && exit 0
|
||||
|
||||
chat -t 10 -e '' 'blah' 'boot>' 'loadb' || die "Not in u-boot mode"
|
||||
gkermit --x -s boot.bin
|
||||
|
||||
# Remove write protection for boot area in the flash chip
|
||||
chat -t 10 -e 'boot>' "protect off 10000000 10003fff" \
|
||||
'boot>' "erase 10000000 10003fff" \
|
||||
'Erasing' '\c' ECHO OFF \
|
||||
'Erased' '\c' ECHO ON ' 2 sectors' '\c' \
|
||||
|| die "Could not erase flash sectors"
|
||||
|
||||
# Copy boot.bin from SDRAM to flash. 0x21000000 ==> 0x10000000, 0x3D00 bytes
|
||||
chat -t 10 -e 'boot>' "cp.b 21000000 10000000 3D00" \
|
||||
' done' '\c' \
|
||||
|| die "Could not write to flash"
|
||||
|
||||
snSize=1c
|
||||
if [ -f sn.txt ] ;then
|
||||
# The sn.txt file is five decimal integers in 1 or more lines
|
||||
dumpdev -if sn.txt -iformat D4 -of sn.bin -bs 28
|
||||
if [ -f eth.txt ] ;then
|
||||
# The eth.txt file is six hex bytes in 1 or more lines
|
||||
dumpdev -if eth.txt -iformat H1 -bs 6 >> sn.bin
|
||||
snSize=22
|
||||
fi
|
||||
fi
|
||||
if [ -f sn.bin ] ;then
|
||||
# Program the serial number block too (34/0x1C bytes)
|
||||
chat -t 10 -e 'boot>' 'loadb' || die "Missing u-boot prompt ?!"
|
||||
gkermit --x -s sn.bin
|
||||
chat -t 10 -e 'boot>' "cp.b 21000000 10003D00 $snSize" \
|
||||
' done' '\c' \
|
||||
|| die "Could not write to flash"
|
||||
fi
|
||||
|
||||
# Reprotect the boot sectors in flash
|
||||
chat -t 10 -e 'boot>' "protect on 10000000 10003fff" \
|
||||
'Protected 2 sectors' 'blah' \
|
||||
|| die "Could not reprotect flash"
|
||||
#
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh -x
|
||||
|
||||
/usr/share/wicd/scripts/50-wicd-suspend.sh
|
||||
killall vpnc
|
||||
/etc/rc.d/dnsmasq stop
|
||||
rm -f /var/run/resolvconf/interfaces/*
|
||||
|
||||
echo -n mem >/sys/power/state
|
||||
|
||||
/etc/rc.d/dnsmasq start
|
||||
/usr/share/wicd/scripts/80-wicd-connect.sh
|
||||
sleep 2
|
||||
/etc/rc.d/tpfand restart
|
||||
sh -c 'sleep 10 ; /home/fm/bin/unbind-ultranav-touchpad' &
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
awk '$1 >= T1+0 && $1 <= T2+2' T1=`date -d "$1" +%s` T2=`date -d "$2" +%s` $3
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
##
|
||||
# $Id$
|
||||
# (C) Copyright 2006 Amplex, fm@amplex.dk
|
||||
#
|
||||
# ABSTRACT: Nice formatted hex dump in bytes, hex & ascii
|
||||
##
|
||||
exec hexdump -e '"%08.8_Ax\n"' \
|
||||
-e '"%08.8_ax " 8/1 "%02x " " " 8/1 "%02x "' \
|
||||
-e '" |" 16/1 "%_p" "|\n"' \
|
||||
"$@"
|
||||
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
cd
|
||||
WINEPREFIX="/home/fm/.ies4linux/ie6" wine "/home/fm/.ies4linux/ie6/drive_c/Program Files/Internet Explorer/IEXPLORE.EXE" "$@"
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
export SSH_ASKPASS="/home/fm/bin/gksupass"
|
||||
#export SSH_ASKPASS=/usr/bin/gnome-ssh-askpass2
|
||||
export DISPLAY=:0
|
||||
|
||||
keyFile=$HOME/.ssh/id_dsa
|
||||
leaveTime=19:00:00
|
||||
leastMins=120
|
||||
|
||||
if [[ ! -f ~/.keychain/`uname -n`-lockf &&
|
||||
`/usr/bin/xscreensaver-command -time 2>&1` == *non-blanked* ]]
|
||||
then
|
||||
eval $(keychain --eval -q)
|
||||
if [[ `ssh-add -l` != *$keyFile* ]] ;then
|
||||
#mins=$(((($(date -d $leaveTime +%s) - $(date +%s)) / 60)))
|
||||
[[ $mins -lt $leastMins ]] && mins=$leastMins
|
||||
#keychain --lockwait 1 --quiet $keyFile --timeout $mins >/dev/null 2>&1
|
||||
keychain --lockwait 1 --quiet $keyFile >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
LUADIR=${LUA_CPATH%/?.so}
|
||||
LUADIR=${LUADIR##*;}
|
||||
EXEC $VALGRIND ${LUADIR}/lua-agent "$@"DIR
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
grep -v ^time $1 | awk -F $'\t' '{print strftime("%d-%m-%y %T", $1), "\t", $0}' | cut -d$'\t' -f1,3-
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
kfmclient openURL "$@"
|
||||
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
enscript --columns=2 --landscape --borders --highlight "$@"
|
||||
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
dcop kded wmiface findAllWindows '' Thunderbird-bin '' '' '' 0 \
|
||||
| xargs -l dcop kded wmiface forceActiveWindow
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
VENDOR=06cb
|
||||
PRODUCT=0009
|
||||
IF=1.0
|
||||
|
||||
while read VENDOR PRODUCT ;do
|
||||
for i in /sys/bus/usb/devices/* ; do
|
||||
if [ -e $i/idVendor ] && [ `cat $i/idVendor` = $VENDOR ] && \
|
||||
[ -e $i/idProduct ] && [ `cat $i/idProduct` = $PRODUCT ] && \
|
||||
[ -e $i\:$IF/driver/unbind ]
|
||||
then
|
||||
echo -n `basename $i`\:$IF > $i\:$IF/driver/unbind
|
||||
break
|
||||
fi
|
||||
done
|
||||
done << EOF
|
||||
06cb 0009
|
||||
0002 0007
|
||||
EOF
|
||||
Executable
+65
@@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
|
||||
HTTOOLS=$HOME/amplex/ampep/HtTools
|
||||
|
||||
runBS() {
|
||||
BSSERVER=$1 $HTTOOLS/bsTest $HTTOOLS/bsh/$2.bsh
|
||||
}
|
||||
|
||||
mkTemp() {
|
||||
mktemp /tmp/.updssh-tmp.XXXXXXXXXX
|
||||
}
|
||||
|
||||
getList() {
|
||||
local F=`mkTemp`
|
||||
runBS $1 listBoxes > $F
|
||||
if grep --silent ANNOT: $F ;then
|
||||
awk '/\t/' $F | sort
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
rm $F
|
||||
}
|
||||
|
||||
updFile() {
|
||||
local Ip=`au-sshgw $1 hostip`
|
||||
local F=`mkTemp`
|
||||
[[ $1 == *-stg ]] && Ip=${Ip}:8000
|
||||
echo -n "Updating list for $1 ($Ip) ... "
|
||||
if getList $Ip > $2.tmp ;then
|
||||
mv -f $2.tmp $2
|
||||
echo 'DONE'
|
||||
else
|
||||
rm -f $2.tmp
|
||||
echo 'FAILED'
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ ! $1 ]] ;then
|
||||
echo 'Usage: upd-ssh-boxlists {<Server-list>|UPDATE}' 1>&2
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ $1 == UPDATE ]] ;then
|
||||
#sudo vpnc-disconnect
|
||||
#sudo vpnc amp-ae
|
||||
for i in `au-sshgw gwlist | grep ^ad-` ;do
|
||||
File=/opt/toolchain/utils/sshgw/files/boxes-${i}.db
|
||||
[[ -f $File ]] && updFile $i $File
|
||||
done
|
||||
#sudo vpnc-disconnect
|
||||
#sudo vpnc amp-ain
|
||||
for i in `au-sshgw gwlist | grep ^ain-` ;do
|
||||
File=/opt/toolchain/utils/sshgw/files/boxes-${i}.db
|
||||
[[ -f $File ]] && updFile $i $File
|
||||
done
|
||||
svn st /opt/toolchain/utils/sshgw/files
|
||||
#sudo vpnc-disconnect
|
||||
exit
|
||||
fi
|
||||
|
||||
for i ;do
|
||||
getList $i
|
||||
done
|
||||
|
||||
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec valgrind --db-attach=yes --db-command='clewn -ga "%f %p"' "$@"
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec valgrind --db-attach=yes --db-command='ups %f %p' "$@"
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
/usr/bin/gvim
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
/usr/bin/gvim
|
||||
Executable
+60
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env lua
|
||||
|
||||
|
||||
local function copyrec(s, d)
|
||||
d = d or {}
|
||||
for k,v in pairs(s) do d[k] = v end
|
||||
return d
|
||||
end
|
||||
|
||||
local function findandset(line, pattern, ret)
|
||||
local t = { line:find(pattern) }
|
||||
return t[1] and copyrec({ start = t[1], stop = t[2], select(3, unpack(t)) }, ret)
|
||||
or nil
|
||||
end
|
||||
|
||||
local function regsub_s(t, reg, sub)
|
||||
local num
|
||||
t.s, num = string.gsub(t.s, reg, sub, 1234567890)
|
||||
return num > 0
|
||||
end
|
||||
|
||||
local line,file,modified,pid,running
|
||||
local pids = {}
|
||||
local fd = io.popen("sh -c 'vi -r 2>&1'", "r")
|
||||
while true do
|
||||
local t = {}
|
||||
|
||||
line = fd:read("*line")
|
||||
if not line then break end
|
||||
if findandset(line, "^ *In directory (.*)", t) then
|
||||
io.write(t[1].."\n")
|
||||
elseif findandset(line, "^ *file name: (.*)", t) then
|
||||
file = t[1]
|
||||
elseif findandset(line, "^ *modified: (%a*)", t) then
|
||||
modified = t[1] ~= "no"
|
||||
elseif findandset(line, "^ *process ID: (%d*)(.*)", t) then
|
||||
pid = t[1]
|
||||
tty = { s = "" }
|
||||
if string.find(t[2], "(still running)", 1, true) ~= nil then
|
||||
if pids["pid-"..pid] then
|
||||
tty.s = pids["pid-"..pid]
|
||||
else
|
||||
local ifd = io.popen("ps --no-headers --format tty --pid " .. pid, "r")
|
||||
tty.s = ":" .. ifd:read("*line")
|
||||
ifd:close()
|
||||
if regsub_s(tty, "tty", "") then
|
||||
elseif regsub_s(tty, "pts/", "pt") then
|
||||
elseif regsub_s(tty, "tts/", "t") then
|
||||
end
|
||||
pids["pid-"..pid] = tty.s
|
||||
end
|
||||
end
|
||||
if file and modified ~= nil then
|
||||
io.write(string.format("%s %5d%-5s %s\n", modified and "+" or "-",
|
||||
pid, tty.s, file))
|
||||
end
|
||||
line,file,modified,pid,running = nil
|
||||
end
|
||||
end
|
||||
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec ck-launch-session startxfce4
|
||||
Reference in New Issue
Block a user