Browse Source

First draft

main
Zen 3 years ago
commit
d2ed2b130e
  1. 60
      init.sh
  2. 1117
      resources/solarized.vim
  3. 90
      resources/tmux-powerline-theme.sh
  4. 36
      resources/tmux.conf
  5. 34
      resources/vimrc

60
init.sh

@ -0,0 +1,60 @@
#!/bin/bash
# This is a script to be run on a fresh installation of Raspbian in order to make it suitable (to me) for CLI development
# ~ Zen, 2022
if [ -f "/etc/debian_version" ]; then
DISTRO="debian"
echo "Debian, Ubuntu, or Raspbian OS detected, proceeding with Debian-compatible AO installation."
elif [ -f "/etc/arch-release" ]; then
DISTRO="arch"
echo Arch- or Manjaro-based OS detected, proceeding with Arch-compatible AO installation.
elif [ $(uname | grep -c "Darwin") -eq 1 ]; then
DISTRO="mac"
echo MacOS detected, proceeding with Mac-compatible AO installation.
else
echo Could not detect your OS distribution. Running this script could make a mess, so installing manually is recommended.
exit 1
fi
echo ""
install_if_needed() {
if [ "$DISTRO" = "debian" ]; then
for package in "$@"
do
if [ -z $(which $package) ]; then
echo "installing" $package
sudo apt install -y $package
else
echo $package 'already installed!'
fi
done
else
echo "Only working on Debian right now!"
fi
}
echo "Making sure we've got the basics..."
install_if_needed vim tmux zsh git silversearcher-ag
echo ""
echo "Getting tmux-powerline"
mkdir $HOME/.tmux
git clone https://github.com/erikw/tmux-powerline.git $HOME/.tmux/
echo ""
echo "Copying configuration files"
mkdir -p $HOME/.vim/colors
cp resources/solarized.vim $HOME/.vim/colors/
cp resouces/vimrc $HOME/.vimrc
cp resouces/tmux.conf $HOME/.tmux.conf
cp resouces/tmux-powerline-theme.sh $HOME/.tmux/tmux-powerline/themes/default.sh
echo ""
echo "Installing Oh My Zsh for theming - this could take a moment"
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo "Adding p10k for optimal dev experience"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
sed -i 's/^ZSH_THEME.*/ZSH_THEME="powerlevel10k\/powerlevel10k"/' $HOME/.zshrc

1117
resources/solarized.vim

File diff suppressed because it is too large Load Diff

90
resources/tmux-powerline-theme.sh

@ -0,0 +1,90 @@
# Default Theme
if patched_font_in_use; then
TMUX_POWERLINE_SEPARATOR_LEFT_BOLD=""
TMUX_POWERLINE_SEPARATOR_LEFT_THIN=""
TMUX_POWERLINE_SEPARATOR_RIGHT_BOLD=""
TMUX_POWERLINE_SEPARATOR_RIGHT_THIN=""
else
TMUX_POWERLINE_SEPARATOR_LEFT_BOLD="◀"
TMUX_POWERLINE_SEPARATOR_LEFT_THIN="❮"
TMUX_POWERLINE_SEPARATOR_RIGHT_BOLD="▶"
TMUX_POWERLINE_SEPARATOR_RIGHT_THIN="❯"
fi
TMUX_POWERLINE_DEFAULT_BACKGROUND_COLOR=${TMUX_POWERLINE_DEFAULT_BACKGROUND_COLOR:-'235'}
TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR=${TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR:-'255'}
TMUX_POWERLINE_DEFAULT_LEFTSIDE_SEPARATOR=${TMUX_POWERLINE_DEFAULT_LEFTSIDE_SEPARATOR:-$TMUX_POWERLINE_SEPARATOR_RIGHT_BOLD}
TMUX_POWERLINE_DEFAULT_RIGHTSIDE_SEPARATOR=${TMUX_POWERLINE_DEFAULT_RIGHTSIDE_SEPARATOR:-$TMUX_POWERLINE_SEPARATOR_LEFT_BOLD}
# See man tmux.conf for additional formatting options for the status line.
# The `format regular` and `format inverse` functions are provided as conveinences
if [ -z $TMUX_POWERLINE_WINDOW_STATUS_CURRENT ]; then
TMUX_POWERLINE_WINDOW_STATUS_CURRENT=(
"#[$(format inverse)]" \
"$TMUX_POWERLINE_DEFAULT_LEFTSIDE_SEPARATOR" \
" #I#F " \
"$TMUX_POWERLINE_SEPARATOR_RIGHT_THIN" \
" #W " \
"#[$(format regular)]" \
"$TMUX_POWERLINE_DEFAULT_LEFTSIDE_SEPARATOR"
)
fi
if [ -z $TMUX_POWERLINE_WINDOW_STATUS_STYLE ]; then
TMUX_POWERLINE_WINDOW_STATUS_STYLE=(
"$(format regular)"
)
fi
if [ -z $TMUX_POWERLINE_WINDOW_STATUS_FORMAT ]; then
TMUX_POWERLINE_WINDOW_STATUS_FORMAT=(
"#[$(format regular)]" \
" #I#{?window_flags,#F, } " \
"$TMUX_POWERLINE_SEPARATOR_RIGHT_THIN" \
" #W "
)
fi
# Format: segment_name background_color foreground_color [non_default_separator]
if [ -z $TMUX_POWERLINE_LEFT_STATUS_SEGMENTS ]; then
TMUX_POWERLINE_LEFT_STATUS_SEGMENTS=(
"tmux_session_info 148 234" \
"hostname 33 0" \
#"ifstat 30 255" \
#"ifstat_sys 30 255" \
#"lan_ip 24 255 ${TMUX_POWERLINE_SEPARATOR_RIGHT_THIN}" \
#"wan_ip 24 255" \
#"vcs_branch 29 88" \
#"vcs_compare 60 255" \
#"vcs_staged 64 255" \
#"vcs_modified 9 255" \
#"vcs_others 245 0" \
)
fi
if [ -z $TMUX_POWERLINE_RIGHT_STATUS_SEGMENTS ]; then
TMUX_POWERLINE_RIGHT_STATUS_SEGMENTS=(
#"earthquake 3 0" \
#"pwd 89 211" \
#"macos_notification_count 29 255" \
#"mailcount 9 255" \
#"now_playing 234 37" \
#"cpu 240 136" \
"lan_ip 0 255" \
"wan_ip 24 255 " \
"load 237 167 " \
#"tmux_mem_cpu_load 234 136" \
"battery 137 127" \
#"weather 37 255" \
#"rainbarf 0 ${TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR}" \
#"xkb_layout 125 117" \
#"date_day 235 136" \
#"date 235 136 ${TMUX_POWERLINE_SEPARATOR_LEFT_THIN}" \
#"time 235 136 ${TMUX_POWERLINE_SEPARATOR_LEFT_THIN}" \
#"utc_time 235 136 ${TMUX_POWERLINE_SEPARATOR_LEFT_THIN}" \
)
fi

36
resources/tmux.conf

@ -0,0 +1,36 @@
# Zen's tmux configuration, 2022
# Prefix rebinding
unbind-key C-b
set-option -g prefix `
bind-key ` send-prefix
# Start numbering at 1
set -g base-index 1
# Window splitting and navigation
bind \\ split-window -h
bind - split-window -v
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# reloading for faster tmux configuration
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# a e s t h e t i c s
set -g default-terminal "screen-256color"
set-option -g status on
set-option -g status-interval 2
set-option -g status-justify "centre"
set-option -g status-left-length 60
set-option -g status-right-length 90
set-option -g status-left "#(~/.tmux/tmux-powerline/powerline.sh left)"
set-option -g status-right "#(~/.tmux/tmux-powerline/powerline.sh right)"
set-hook -g session-created 'run-shell "~/.tmux/tmux-powerline/powerline.sh init"' # prettifies the window-status segments
# tmux powerline can be overwhelming
bind C-[ run '~/.tmux/tmux-powerline/mute_powerline.sh left' # Mute left statusbar.
bind C-] run '~/.tmux/tmux-powerline/mute_powerline.sh right' # Mute right statusbar.

34
resources/vimrc

@ -0,0 +1,34 @@
" Zen's .vimrc file, 2022
" the basics
set nocompatible " vi is for nerds, unlike vim
filetype on " gotta know what we're working with
filetype plugin on
filetype indent on
syntax enable " syntax highlighting, always and forever
" a e s t h e t i c s
set number " I like knowing where I am
set scrolloff=10 " don't scroll right to the edge
set nowrap " not a fan of wrapping lines
set showmode " In case you forget when you're in normal mode
let g:solarized_termcolors=256
colorscheme solarized
set background=dark
" Tabs
set shiftwidth=4
set tabstop=4
set expandtab
" Searching -- press '/' to search in vim (or '?' to search backwards)
set incsearch " Highlights as you type
set ignorecase
set smartcase " ignore case, unless you capitalise
set hlsearch
set showmatch
" I like to remap my escape key to jj when I'm coding
inoremap jj <Esc>
Loading…
Cancel
Save