Scripts to setup shell and install base packages
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
2.8 KiB

  1. #! /bin/sh
  2. if [ "$(whoami)" != "root" ]; then
  3. SUDO=sudo
  4. fi
  5. ${SUDO} apt update
  6. ${SUDO} apt install -y vim net-tools zsh fzf curl wget git net-tools curl dnsutils telnet htop mc screen iotop iperf3 glances
  7. # Install and configure Zimfw
  8. curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh
  9. echo '
  10. zmodule environment
  11. zmodule git
  12. zmodule input
  13. zmodule termtitle
  14. zmodule utility
  15. zmodule duration-info
  16. zmodule git-info
  17. zmodule prompt-pwd
  18. zmodule eriner
  19. zmodule zsh-users/zsh-completions --fpath src
  20. zmodule completion
  21. zmodule zsh-users/zsh-syntax-highlighting
  22. zmodule zsh-users/zsh-history-substring-search
  23. zmodule zsh-users/zsh-autosuggestions' > ~/.zimrc
  24. # Configure FZF
  25. ${SUDO} echo " source /usr/share/doc/fzf/examples/completion.zsh" >> ~/.zshrc
  26. ${SUDO} echo "source /usr/share/doc/fzf/examples/key-bindings.zsh" >> ~/.zshrc
  27. ${SUDO} echo 'alias vi="vim"' >> ~/.zshrc
  28. # Configure screen
  29. echo "# Allow bold colors - necessary for some reason
  30. attrcolor b ".I"
  31. # Tell screen how to set colors. AB = background, AF=foreground
  32. termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
  33. # Enables use of shift-PgUp and shift-PgDn
  34. #termcapinfo xterm|xterms|xs|rxvt ti@:te@
  35. # Erase background with current bg color
  36. #defbce "on"
  37. # Enable 256 color term
  38. #term xterm-256color
  39. # Cache 30000 lines for scroll back
  40. defscrollback 300000
  41. # New mail notification
  42. #backtick 101 30 15 $HOME/bin/mailstatus.sh
  43. hardstatus alwayslastline
  44. # Very nice tabbed colored hardstatus line
  45. hardstatus string '%{= Kd} %{= Kd}%-w%{= Kr}[%{= KW}%n: %H%{= Kr} %{= Kr}]%{= Kd}%+w %-= %{KG} %H %{KW}|%{KY}%110`%{KW}|%D %M %d %Y%{= Kc} %C%A%{-}'
  46. #hardstatus string "%{= KW} %H [%` %h] %{= Kw}|%{-} %-Lw%{= bW}%n%f %t%{-}%+Lw %=%C%a %Y-%M-%d"
  47. #hardstatus string '%?%F%{;4}%?%3n %t%? [%h]%?'
  48. #hardstatus alwayslastline "%{rk}%H %{gk}%c %{yk}%M%d %{wk}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{wk}%?%+Lw%?"
  49. # change command character from ctrl-a to ctrl-b (emacs users may want this)
  50. #escape ^Bb
  51. # Hide hardstatus: ctrl-a f
  52. bind f eval "hardstatus ignore"
  53. # Show hardstatus: ctrl-a F
  54. bind F eval "hardstatus alwayslastline"
  55. defshell -zsh" > ~/.screenrc
  56. # Configure VIM
  57. curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  58. echo "
  59. call plug#begin()
  60. Plug 'preservim/nerdtree'
  61. call plug#end()
  62. autocmd StdinReadPre * let s:std_in=1
  63. autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NERDTree | endif
  64. map <C-n> :NERDTreeToggle<CR>
  65. map <C-l> <C-w>l
  66. map <C-h> <C-w>h
  67. map <C-j> <C-w>j
  68. map <C-k> <C-w>k
  69. set ts=2
  70. set syntax=
  71. set sw=2
  72. set mouse=
  73. set undodir=~/.vim/undo/
  74. set undofile" > ~/.vimrc
  75. vim +PlugInstall +qall
  76. # Set Timezone
  77. timedatectl set-timezone Asia/Kolkata
  78. # Change shell to zsh
  79. chsh -s /bin/zsh
  80. zsh
  81. # Install Zimfw modules
  82. zimfw install