Added vim configuration

This commit is contained in:
Andreas Fendt 2016-07-01 12:57:23 +02:00
parent 9beb3f0c50
commit 88dfc7d0d4

View File

@ -14,6 +14,10 @@ function update-upgrade {
}
function common {
# get users directory
root_user=$(grep ':0:' /etc/passwd | awk -F':' '{print $6}')
default_user=$(grep ':1000:' /etc/passwd | awk -F':' '{print $6}')
# default shell
apt-get install -y sudo mc tree pv vim mosh bash-completion
@ -28,22 +32,19 @@ function common {
sed -i -- 's/\/bin\/bash/\/bin\/zsh/' /etc/passwd
wget -O /etc/zsh/newuser.zshrc.recommended \
http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc
root_user=$(grep ':0:' /etc/passwd | awk -F':' '{print $6}')
default_user=$(grep ':1000:' /etc/passwd | awk -F':' '{print $6}')
cp -f /etc/zsh/newuser.zshrc.recommended $default_user/.zshrc
cp -f /etc/zsh/newuser.zshrc.recommended $root_user/.zshrc
)
# tmux
apt-get install -y tmux && (
default_user=$(grep ':1000:' /etc/passwd | awk -F':' '{print $6}')
echo 'if [ "$TMUX" = "" ]; then tmux; fi' | cat - $default_user/.zshrc > \
/tmp/.zshrc && mv /tmp/.zshrc $default_user/.zshrc
)
# diagnostics
apt-get install -y htop iotop iftop nmon powertop stress lm-sensors \
gddrescue smartmontools kpartx
gddrescue smartmontools kpartx nmap
# programming
apt-get install -y git subversion libapache2-svn build-essential
@ -54,6 +55,15 @@ function common {
# misc. tools
apt-get install -y apt-file aptitude hexedit manpages-de
# configure vim
touch $root_user/.vimrc $default_user/.vimrc
for config in "filetype plugin indent on" "set tabstop=4" "set shiftwidth=4" \
"set expandtab" "syntax enable" "set softtabstop=4" \
"set number" "set showcmd" "set cursorline"; do
grep "$config" $root_user/.vimrc || echo "$config" >> $root_user/.vimrc
grep "$config" $default_user/.vimrc || echo "$config" >> $default_user/.vimrc
done
}
function common-end {