Update dotfiles setup script to do more Neovim and zsh setup

This commit is contained in:
Raoul Snyman 2023-07-07 12:05:39 -07:00
parent 1229666c9e
commit cb2da67a19
3 changed files with 129 additions and 7 deletions

View File

@ -29,12 +29,14 @@ Plug 'rainglow/vim'
Plug 'yuezk/vim-js'
Plug 'maxmellon/vim-jsx-pretty'
Plug 'freitass/todo.txt-vim'
Plug 'hashivim/vim-terraform'
Plug 'juliosueiras/vim-terraform-completion'
call plug#end()
set guifont=Hack:h10
set clipboard=unnamedplus
set noshowmode
set colorcolumn=100
set colorcolumn=120
set tw=0
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.pyo,build/*,*egg-info*,dist/*,node_modules/*,prime/*,stage/*
set number
@ -93,6 +95,8 @@ autocmd! BufWritePost * Neomake
" Deoplete
let g:deoplete#enable_at_startup = 1
let g:deoplete#sources#jedi#python_path = '/usr/bin/python3'
let g:deoplete#omni_patterns = {}
let g:deoplete#omni_patterns.terraform = '[^ *\t"{=$]\w*'
" Ack.vim
if executable('ag')

28
setup.sh Executable file → Normal file
View File

@ -18,6 +18,15 @@ function check_or_install() {
}
function install_build_tools() {
if [[ "${APT}x" == "x" ]]; then
# This is not Debian
return
fi
echo "Installing build tools..."
check_or_install gcc build-essential
}
function setup_neovim() {
# Set up Neovim
if [[ -d "$HOME/.config/nvim" ]]; then
@ -29,6 +38,8 @@ function setup_neovim() {
ln -s $DIR/nvim
curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
nvim --headless +PlugInstall +qa
nvim +UpdateRemotePlugins +qa
}
function setup_git() {
@ -52,15 +63,18 @@ function setup_git() {
function setup_zsh() {
# Set up ZSH
if [[ -d "$HOME/.oh-my-zsh" ]]; then
if [[ -d "$HOME/.zprezto" ]]; then
return
fi
echo "Setting up zsh..."
check_or_install zsh zsh
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
cd $HOME/.oh-my-zsh/custom/themes
ln -s $DIR/zsh/themes/raoul.zsh-theme raoul.zsh-theme
sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="raoul"/' $HOME/.zshrc
git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
if [[ -f "$HOME/.zshrc" ]]; then
mv "$HOME/.zshrc" "$HOME/.zshrc.original"
fi
zsh -c 'setopt EXTENDED_GLOB; for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"; done'
cd $HOME
patch -p0 < $DIR/zsh/prezto.diff
}
function setup_topydo() {
@ -84,7 +98,9 @@ function setup_topydo() {
# Set up a generic bin directory for scripts and tools
mkdir -p $HOME/bin
mkdir -p $HOME/.config
install_build_tools
setup_neovim
setup_git
setup_zsh
setup_topydo
# Not used anymore
# setup_topydo

102
zsh/prezto.diff Normal file
View File

@ -0,0 +1,102 @@
diff --git zpreztorc zpreztorc
index ae68a89..2c1e405 100644
--- zpreztorc
+++ zpreztorc
@@ -38,8 +38,11 @@ zstyle ':prezto:load' pmodule \
'spectrum' \
'utility' \
'completion' \
+ 'syntax-highlighting' \
'history-substring-search' \
- 'prompt'
+ 'autosuggestions' \
+ 'prompt' \
+ 'git'
#
# Autosuggestions
@@ -130,7 +133,7 @@ zstyle ':prezto:module:editor' key-bindings 'emacs'
# Set the prompt theme to load.
# Setting it to 'random' loads a random theme.
# Auto set to 'off' on dumb terminals.
-zstyle ':prezto:module:prompt' theme 'sorin'
+zstyle ':prezto:module:prompt' theme 'skwp'
# Set the working directory prompt display length.
# By default, it is set to 'short'. Set it to 'long' (without '~' expansion)
@@ -181,39 +184,39 @@ zstyle ':prezto:module:prompt' theme 'sorin'
# Set syntax highlighters.
# By default, only the main highlighter is enabled.
-# zstyle ':prezto:module:syntax-highlighting' highlighters \
-# 'main' \
-# 'brackets' \
-# 'pattern' \
-# 'line' \
-# 'cursor' \
-# 'root'
-#
+zstyle ':prezto:module:syntax-highlighting' highlighters \
+ 'main' \
+ 'brackets' \
+ 'pattern' \
+ 'line' \
+ 'cursor' \
+ 'root'
+
# Set syntax highlighting styles.
-# zstyle ':prezto:module:syntax-highlighting' styles \
-# 'builtin' 'bg=blue' \
-# 'command' 'bg=blue' \
-# 'function' 'bg=blue'
-#
+zstyle ':prezto:module:syntax-highlighting' styles \
+ 'builtin' 'bg=blue' \
+ 'command' 'bg=blue' \
+ 'function' 'bg=blue'
+
# Set syntax pattern styles.
-# zstyle ':prezto:module:syntax-highlighting' pattern \
-# 'rm*-rf*' 'fg=white,bold,bg=red'
+zstyle ':prezto:module:syntax-highlighting' pattern \
+ 'rm*-rf*' 'fg=white,bold,bg=red'
#
# Terminal
#
# Auto set the tab and window titles.
-# zstyle ':prezto:module:terminal' auto-title 'yes'
+zstyle ':prezto:module:terminal' auto-title 'yes'
# Set the window title format.
-# zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s'
+zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s'
# Set the tab title format.
-# zstyle ':prezto:module:terminal:tab-title' format '%m: %s'
+zstyle ':prezto:module:terminal:tab-title' format '%m: %s'
# Set the terminal multiplexer title format.
-# zstyle ':prezto:module:terminal:multiplexer-title' format '%s'
+zstyle ':prezto:module:terminal:multiplexer-title' format '%s'
#
# Tmux
diff --git zshrc zshrc
index 039b882..58f1b30 100644
--- zshrc
+++ zshrc
@@ -10,4 +10,11 @@ if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
-# Customize to your needs...
+# Exports
+export PATH="$HOME/bin:$PATH"
+export VISUAL=nvim
+export EDITOR="$VISUAL"
+export GIT_EDITOR=nvim
+
+# Aliases
+alias k=kubectl