Merge branch 'prezto'
This commit is contained in:
commit
a776cd07c4
13 changed files with 166 additions and 84 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@ log/
|
|||
*.zwc
|
||||
*.zwc.old
|
||||
prezto/
|
||||
tmux/t-theme/
|
||||
|
|
10
bash.sh
Executable file
10
bash.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
#download sensible bash if it doesnt exist
|
||||
if [ ! -f ~/.sensible.bash ]; then
|
||||
wget -O "$HOME/.sensible.bash" https://raw.githubusercontent.com/mrzool/bash-sensible/master/sensible.bash
|
||||
fi
|
||||
|
||||
#inject source line into bashrc
|
||||
if ! grep -q ".sensible.bash" "$HOME/.bashrc"; then
|
||||
echo "source \"\$HOME/.sensible.bash\"" >> "$HOME/.bashrc"
|
||||
fi
|
35
bash/.bash_aliases
Normal file
35
bash/.bash_aliases
Normal file
|
@ -0,0 +1,35 @@
|
|||
#Readability aliases
|
||||
if which exa > /dev/null; then
|
||||
alias lss='exa -alh'
|
||||
else
|
||||
alias lss='ls -alh --color=auto'
|
||||
fi
|
||||
alias mount='mount |column -t'
|
||||
alias df='df -H -x squashfs -x tmpfs -x devtmpfs'
|
||||
alias bat=batcat
|
||||
alias ncdu='ncdu --color dark'
|
||||
|
||||
#Shell Function aliases
|
||||
alias dirs="dirs -v"
|
||||
alias h='history'
|
||||
alias jb='jobs -l'
|
||||
alias reload=". ~/.bashrc"
|
||||
|
||||
#shortcuts aliases
|
||||
alias please="sudo !!"
|
||||
alias ping='ping -c 5'
|
||||
alias ax="chmod a+x"
|
||||
alias wmip="curl icanhazip.com"
|
||||
|
||||
#git aliases
|
||||
alias gitS='git status'
|
||||
alias gitL='git log'
|
||||
alias gitD='git diff'
|
||||
alias gitC='git commit -a'
|
||||
|
||||
#Apt aliases
|
||||
alias aptup="sudo apt update && sudo apt full-upgrade"
|
||||
alias aptrm="sudo apt autoremove && sudo apt autoclean"
|
||||
|
||||
#ssh aliases
|
||||
alias sagent="eval `ssh-agent`"
|
34
init.sh
34
init.sh
|
@ -6,23 +6,20 @@ if [[ $answer = "U" ]] || [[ $answer = "u" ]]; then
|
|||
elif [[ $answer = "O" ]] || [[ $answer = "o" ]]; then
|
||||
bash odeps.sh
|
||||
else
|
||||
echo "Aborting!"
|
||||
exit 1
|
||||
echo "Skipping!"
|
||||
fi
|
||||
|
||||
#setup prezto
|
||||
#setup shell
|
||||
bash bash.sh
|
||||
echo "Select which shell to configure and use: zsh/fish/bash"; read -r answer
|
||||
if [[ $answer = "zsh" ]] || [[ $answer = "z" ]]; then
|
||||
echo "Initializing ZSH"
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma/zinit/master/doc/install.sh)"
|
||||
#This will install Zinit in ~/.zinit/bin. .zshrc will be updated with three lines of code that will be added to the bottom. The lines will be sourcing zinit.zsh and setting up completion for command zinit. After installing and reloading the shell compile Zinit with zinit self-update.
|
||||
zinit self-update
|
||||
zinit update
|
||||
chsh -s /bin/zsh
|
||||
echo "Initializing Prezto"
|
||||
zsh prezto.zsh
|
||||
chsh -s /usr/bin/zsh
|
||||
elif [[ $answer = "fish" ]] || [[ $answer = "f" ]]; then
|
||||
echo "Installing Oh-My-Fish"
|
||||
bash fish.sh
|
||||
chsh -s /bin/fish
|
||||
chsh -s /usr/bin/fish
|
||||
else
|
||||
echo "Guess we're sticking with default bash then..."
|
||||
fi
|
||||
|
@ -30,13 +27,15 @@ fi
|
|||
#create symlinks using stow
|
||||
mkdir ~/.ssh
|
||||
echo "Stowing Configs"
|
||||
stow bash
|
||||
stow tmux
|
||||
#init TMP
|
||||
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
|
||||
stow vim
|
||||
stow zsh
|
||||
stow config
|
||||
chmod 0700 ~/.ssh
|
||||
chmod -R 0600 ~/.ssh/*
|
||||
#cp "$HOME/stevset/mc" "$HOME/.config/mc"
|
||||
|
||||
#Configure git user
|
||||
echo -n "Would you like to configure your git name and email? (y/n) => "; read -r answer
|
||||
|
@ -48,22 +47,15 @@ if [[ $answer = "Y" ]] || [[ $answer = "y" ]]; then
|
|||
fi
|
||||
|
||||
#install spacevim
|
||||
if [ ! -e ~/.space-vim ]
|
||||
then
|
||||
mv "$HOME/.vim" "$HOME/vim_bk"
|
||||
mv "$HOME/.vimrc" "$HOME/vimrc_bk"
|
||||
if [ ! -e ~/.space-vim ]; then
|
||||
echo "Install SpaceVim now? y/n"; read -r answer
|
||||
if [[ $answer = "Y" ]] || [[ $answer = "y" ]]; then
|
||||
mv "$HOME/.vim" "$HOME/vim_bk"
|
||||
mv "$HOME/.vimrc" "$HOME/vimrc_bk"
|
||||
(curl -sLf https://spacevim.org/install.sh | bash)
|
||||
fi
|
||||
fi
|
||||
|
||||
# #install Emacs Doom
|
||||
# echo "Install Emacs Doom now? y/n"; read -r answer
|
||||
# if [[ $answer = "Y" ]] || [[ $answer = "y" ]]; then
|
||||
# ./emacs_doom.sh
|
||||
# fi
|
||||
###Doom's requirements are outside the scope of Ubuntu 20.04LTS
|
||||
echo "*******************************"
|
||||
echo "* Restart your terminal *"
|
||||
echo "*******************************"
|
||||
|
|
21
prezto.zsh
Executable file
21
prezto.zsh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/zsh
|
||||
#Initializes Prezto
|
||||
git clone --recursive -j 4 https://github.com/steveokard/prezto.git "$HOME/stevset/prezto/.zprezto"
|
||||
|
||||
#Remove old stuff
|
||||
echo "....Creating symlinks"
|
||||
rm -rf ~/.zshrc ~/.zsh ~/.zprofile ~/.zlogin ~/.zlogout ~/.zpreztorc ~/.zshenv
|
||||
|
||||
#Make Environment Links, per github readme
|
||||
setopt EXTENDED_GLOB
|
||||
for rcfile in "${ZDOTDIR:-$HOME}"/stevset/prezto/.zprezto/runcoms/^README.md(.N); do
|
||||
ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
|
||||
done
|
||||
|
||||
#setup theme
|
||||
echo "remember to run p10k configure to configure the theme!"
|
||||
#ln -s $HOME/.zprezto/modules/prompt/external/powerlevel10k/prompt_powerlevel10k_setup $HOME/.zprezto/modules/prompt/functions/prompt_powerlevel10k_setup
|
||||
|
||||
#finally, fix permissions to avoid compaudit flag
|
||||
chmod -R go-w ~/.zprezto
|
||||
|
|
@ -1,9 +1 @@
|
|||
#!/bin/bash
|
||||
# clone
|
||||
git clone https://github.com/powerline/fonts.git --depth=1
|
||||
# install
|
||||
cd fonts
|
||||
./install.sh
|
||||
# clean-up a bit
|
||||
cd ..
|
||||
rm -rf fonts
|
||||
echo "visit https://github.com/ryanoasis/nerd-fonts"
|
||||
|
|
1
scripts/preztoUpstream.zsh
Executable file
1
scripts/preztoUpstream.zsh
Executable file
|
@ -0,0 +1 @@
|
|||
git remote add upstream https://github.com/sorin-ionescu/prezto.git
|
|
@ -1,2 +1,7 @@
|
|||
#this command changes the git repo from HTTPS to SSH so you can use the key instead of typing in your password all the time.
|
||||
git remote set-url origin git@github.com:steveokard/stevset.git
|
||||
USER=steveokard
|
||||
if [ -n "$1" ]
|
||||
then
|
||||
git remote set-url origin git@github.com:$USER/$1.git
|
||||
git remote -v
|
||||
fi
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
#!/bin/zsh
|
||||
#This will install Spacemacs (again)
|
||||
#cleanup
|
||||
echo "Removing old emacs"
|
||||
if [ -e ~/.emacs.d/]
|
||||
then
|
||||
if [ -d "$HOME/.emacs.d" ]; then
|
||||
echo "Moved Doom Config"
|
||||
mv ~/.emacs.d ~/doom.d
|
||||
fi
|
||||
|
||||
#Select Stable or Develop
|
||||
read -p "Should we use the development version of emacs?" dist
|
||||
if [[ $dist = y ]] then
|
||||
if read -q "REPLY?Should we use the development version of emacs? \n"; then
|
||||
git clone -b develop https://github.com/syl20bnr/spacemacs ~/.emacs.d
|
||||
else
|
||||
git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,37 +1,21 @@
|
|||
# -- general -------------------------------------------------------------------
|
||||
set -g default-terminal "screen-256color" # colors!
|
||||
set -g xterm-keys on
|
||||
#Tmux Plugins
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
set -g @plugin 'wfxr/tmux-power'
|
||||
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
|
||||
set -g @plugin 'CrispyConductor/tmux-copy-toolkit'
|
||||
set -g @plugin 'tmux-plugins/tmux-pain-control'
|
||||
|
||||
# -- general
|
||||
set -g xterm-keys on
|
||||
# remap prefix to Control + a
|
||||
set -g prefix C-a
|
||||
unbind C-b
|
||||
bind C-a send-prefix
|
||||
set -sg escape-time 0
|
||||
|
||||
#Mouse/Scrollback Tweaks
|
||||
set -g history-limit 100000
|
||||
#setw -g mode-keys vi
|
||||
set-option -g mouse on
|
||||
set-window-option -g xterm-keys on
|
||||
#set-option -g pane-active-border-fg yellow
|
||||
|
||||
#New Keybindings
|
||||
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
|
||||
|
||||
# split panes using | and -
|
||||
bind | split-window -h
|
||||
bind - split-window -v
|
||||
unbind '"'
|
||||
unbind %
|
||||
|
||||
# switch panes using Alt-arrow without prefix
|
||||
bind -n M-Left select-pane -L
|
||||
bind -n M-Right select-pane -R
|
||||
bind -n M-Up select-pane -U
|
||||
bind -n M-Down select-pane -D
|
||||
|
||||
# For nested tmux'es
|
||||
bind a send-prefix
|
||||
|
||||
#Powerline Settings
|
||||
run-shell "powerline-daemon -q"
|
||||
|
@ -60,4 +44,15 @@ bind m \
|
|||
bind M \
|
||||
set-option -g mouse off \;\
|
||||
display 'Mouse: OFF'
|
||||
#plugin settings
|
||||
# Prefix Highlight: 'L' for left only, 'R' for right only and 'LR' for both
|
||||
set -g @tmux_power_prefix_highlight_pos 'LR'
|
||||
run-shell "$HOME/.tmux/plugins/tmux-prefix-highlight/prefix_highlight.tmux"
|
||||
#Themes
|
||||
set -g @tmux_power_theme 'default'
|
||||
run-shell "$HOME/.tmux/plugins/tmux-power/tmux-power.tmux"
|
||||
#Pain Control
|
||||
run-shell "$HOME/.tmux/plugins/tmux-pain-control/pain_control.tmux"
|
||||
|
||||
#init tmux plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
||||
|
|
53
udeps.sh
53
udeps.sh
|
@ -1,8 +1,19 @@
|
|||
#!/bin/bash
|
||||
#These are the programs I expect to find on any install
|
||||
function dpkg_url() {
|
||||
local tmp_deb="$(mktemp)"
|
||||
local src_url=$1
|
||||
local args=${@:2}
|
||||
|
||||
echo "installing base dependencies"
|
||||
sudo apt-get -my install git \
|
||||
wget -O $tmp_deb $src_url &&
|
||||
sudo dpkg -i $tmp_deb $args &&
|
||||
{ rm -f $tmp_deb; true; } || # commands above succeeded, remove tmp file
|
||||
{ rm -f $tmp_deb; false; } # commands above failed, remove tmp file anyway
|
||||
}
|
||||
|
||||
# installing base dependencies
|
||||
sudo apt-get -my install \
|
||||
git \
|
||||
stow \
|
||||
etckeeper \
|
||||
tmux \
|
||||
|
@ -13,16 +24,40 @@ sudo apt-get -my install git \
|
|||
mc \
|
||||
curl \
|
||||
aptitude \
|
||||
tree \
|
||||
ack
|
||||
nnn \
|
||||
ack \
|
||||
fzf \
|
||||
ripgrep \
|
||||
grc \
|
||||
fd-find \
|
||||
ncdu
|
||||
|
||||
read -n1 -p $'Does this system need ssh access?\n' REPLY
|
||||
read -n1 -p $'Does this system need a ssh server?\n' REPLY
|
||||
if [[ $REPLY == [Yy] ]]; then
|
||||
sudo apt-get install openssh-server
|
||||
sudo apt-get install openssh-server fail2ban
|
||||
fi
|
||||
read -n1 -p $'\nDoes this system have a GUI?\n' REPLY
|
||||
if [[ $REPLY == [Yy] ]]; then
|
||||
sudo apt-get install synaptic
|
||||
# else
|
||||
# sudo apt-get install emacs-nox
|
||||
sudo apt-get install synaptic emacs vim-gtk3
|
||||
else
|
||||
sudo apt-get install emacs-nox
|
||||
fi
|
||||
#Fix stupid Rust issue
|
||||
if [ -f "/usr/.crates2.json" ]; then
|
||||
sudo sed -i '/crates2/d' /var/lib/dpkg/info/ripgrep.list
|
||||
sudo rm -f /usr/.crates2.json
|
||||
sudo apt-get -my install bat
|
||||
sudo sed -i '/crates2/d' /var/lib/dpkg/info/bat.list
|
||||
sudo rm -f /usr/.crates2.json
|
||||
fi
|
||||
|
||||
#This section installs software outside apt
|
||||
|
||||
#select exa or lsd
|
||||
if [[ ! "which exa > /dev/null" ]]; then
|
||||
dpkg_url http://mirrors.kernel.org/ubuntu/pool/universe/r/rust-exa/exa_0.9.0-4_amd64.deb
|
||||
# wget https://github.com/Peltoche/lsd/releases/download/0.20.1/lsd_0.20.1_amd64.deb; sudo dpkg -i ./lsd_0.20.1_amd64.deb; rm lsd_0.20.1_amd64.deb
|
||||
dpkg_url https://github.com/muesli/duf/releases/download/v0.6.2/duf_0.6.2_linux_amd64.deb
|
||||
dpkg_url https://github.com/ClementTsang/bottom/releases/download/0.6.1/bottom_0.6.1_amd64.deb
|
||||
#https://github.com/dandavison/delta/releases/download/0.8.0/delta-0.8.0-x86_64-unknown-linux-gnu.tar.gz
|
||||
fi
|
||||
|
|
16
update.zsh
16
update.zsh
|
@ -1,12 +1,8 @@
|
|||
#!/bin/zsh
|
||||
echo "Remove Doom"
|
||||
rm -r --interactive=never $HOME/.emacs.d $HOME/.doom.d
|
||||
#delete current zsh config
|
||||
ln -s ~/stevset/prezto/.zprezto ~/.zprezto
|
||||
./udeps.sh
|
||||
./prezto.zsh
|
||||
|
||||
echo "Install zinit"
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma/zinit/master/doc/install.sh)"
|
||||
#This will install Zinit in ~/.zinit/bin. .zshrc will be updated with three lines of code that wi │ ll be added to the bottom. The lines will be sourcing zinit.zsh and setting up completion for com │ mand zinit. After installing and reloading the shell compile Zinit with zinit self-update.
|
||||
rm ~/.zshrc ~/.zpreztorc ~/.zlogin ~/.zlogout ~/.zprofile ~/.zshenv
|
||||
ln -s ~/stevset/zsh/.zshrc ~/.zshrc
|
||||
ln -s ~/stevset/zsh/aliases.zsh ~/.zsh_aliases
|
||||
ln -s ~/stevset/zsh/.zprofile ~/.zprofile
|
||||
source ~/.zshrc
|
||||
#Tmux Theme
|
||||
git clone https://github.com/wfxr/tmux-power.git "$HOME/stevset/tmux/t-theme"
|
||||
|
|
|
@ -11,11 +11,11 @@ let g:spacevim_plug_home = '~/.vim/plugged'
|
|||
" Enable the existing layers in space-vim.
|
||||
" Refer to https://github.com/liuchengxu/space-vim/blob/master/layers/LAYERS.md for all available layers.
|
||||
let g:spacevim_layers = [
|
||||
\ 'fzf', 'better-defaults', 'which-key',
|
||||
\ 'fzf', 'better-defaults', 'which-key', 'better-motion', 'airline', 'ctrlp', 'git',
|
||||
\ ]
|
||||
|
||||
" Uncomment the following line if your terminal(-emulator) supports true colors.
|
||||
" let g:spacevim_enable_true_color = 1
|
||||
let g:spacevim_enable_true_color = 1
|
||||
|
||||
" If you want to have more control over the layer, try using Layer command.
|
||||
" if g:spacevim.gui
|
||||
|
@ -41,6 +41,6 @@ function! UserConfig()
|
|||
" Adding extras.
|
||||
" Uncomment the following line If you have installed the powerline fonts.
|
||||
" It is good for airline layer.
|
||||
" let g:airline_powerline_fonts = 1
|
||||
let g:airline_powerline_fonts = 1
|
||||
|
||||
endfunction
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue