Commit 22248b44 by PotatoGim

bashrc: mkgotags 추가, 히스토리 옵션 조정 등

parent dd779d86
......@@ -18,15 +18,15 @@
#---------------------------------------------------------------------------
function mkctags
{
rm -f tags cscope.files cscope.out
rm -f tags cscope.files cscope.out &>/dev/null
ctags --recurse --totals --sort=foldcase \
--exclude=".svn" --exclude=".git" --exclude="*~" \
--file-scope=no -f tags .
find $PWD \( -name "*.asm" -o -name "*.[chsS]" -o -name "Makefile" \
find $PWD \( -name "*.asm" -o -name "*.[chsSlxy]" -o -name "Makefile" \
-o -name "*.mk" \) \
-print > cscope.files
-print | sed -e 's/ /\\ /g;' > cscope.files
cscope -i cscope.files
}
......@@ -44,7 +44,7 @@ function mkktags
$src="$PWD"
$arch=`uname -m`
rm -f tags cscope.files cscope.out
rm -f tags cscope.files cscope.out &>/dev/null
ctags --recurse --totals --sort=foldcase \
--exclude=".svn" --exclude=".git" --exclude="*~" \
......@@ -57,7 +57,7 @@ function mkktags
-o -path "$src/Documentation*" -prune \
-o -path "$src/scripts*" -prune
-o -path "$src/drivers*" -prune \
-o -name "*.[chxsS]" -o -name "*.asm" \) \
-o -name "*.[chsS]" -o -name "*.asm" \) \
-print > $src/cscope.files
cscope -b -q -k -k -i cscope.files
......@@ -72,7 +72,7 @@ function mkktags
#---------------------------------------------------------------------------
function mkcpptags
{
rm -f tags cscope.files cscope.out
rm -f tags cscope.files cscope.out &>/dev/null
ctags --recurse --totals --sort=foldcase \
--exclude=".svn" --exclude=".git" --exclude="*~" \
......@@ -101,7 +101,7 @@ function mkcpptags
#---------------------------------------------------------------------------
function mkperltags
{
rm -f tags cscope.files cscope.out
rm -f tags cscope.files cscope.out &>/dev/null
ctags --recurse --totals --sort=foldcase \
--exclude="blib" --exclude=".svn" --exclude=".git" --exclude="*~" \
......@@ -115,6 +115,32 @@ function mkperltags
}
#--- FUNCTION ------------------------------------------------------------
# NAME: mkgotags
# DESCRIPTION: Make tags using ctags with Go sources
# PARAMETERS: ---
# RETURNS: ---
# NOTES: ---
#---------------------------------------------------------------------------
function mkgotags
{
rm -f tags cscope.files cscope.out &>/dev/null
ctags --recurse --totals --sort=foldcase \
--exclude=".svn" --exclude=".git" --exclude="*~" \
--langdef=Go \
--langmap=Go:.go \
--regex-Go="/func([ \t]+\([^)]+\))?[ \t]+([a-zA-Z0-9_]+)/\2/d,func/" \
--regex-Go="/var[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,var/" \
--regex-Go="/type[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,type/" \
--fields=+iaS --extra=+q --file-scope=no -f tags .
find $PWD \( -name "*.go" -o -name "Makefile" -o -name "*.mk" \) \
-print > cscope.files
cscope -i cscope.files
}
#--- FUNCTION ------------------------------------------------------------
# NAME: mkgtags
# DESCRIPTION: Make global tags using ctags with default headers
# PARAMETERS: ---
......@@ -206,6 +232,12 @@ function cd()
{
builtin cd "$@";
RETVAL=$?
if [[ $RETVAL -ne 0 ]]; then
return $RETVAL;
fi
if [[ "x$TMUX" != "x" ]]; then
svn info 1>/dev/null 2>&1
......@@ -223,7 +255,7 @@ function cd()
return;
fi
#tmux rename-window "${PWD/#${HOME}/~}";
tmux rename-window "${PWD/#$HOME/\~}";
fi;
}
......@@ -233,7 +265,8 @@ function cd()
# Environment Variables
#
############################################################################
export HISTSIZE=16384
#shopt -s histappend
export HISTSIZE=1048576
export HISTFILESIZE=1048576
export HISTTIMEFORMAT="%Y-%m-%d [%T] "
export HISTCONTROL=ignoreboth:erasedups
......@@ -274,6 +307,11 @@ case ${TERM} in
;;
esac
# Vi 모드로 명령줄 편집
#set -o vi
export VISUAL="vim"
# Arch latest news
#if [ "$PS1" ] && [[ $(ping -c1 www.google.com 2>&-) ]]; then
# # The characters "£, §" are used as metacharacters. They should not be encountered in a feed...
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment