Skip to content

Commit

Permalink
refactor: further simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
fisenkodv committed Nov 17, 2023
1 parent 535f296 commit f86b79d
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 49 deletions.
12 changes: 2 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
.PHONY: install brew brew-restore

install:
./install
./scripts/install

# Save snapshot of all Homebrew packages to macos/brewfile
brew:
brew bundle dump -f --file=config/os/macos/brewfile
brew bundle --force cleanup --file=config/os/macos/brewfile

# Restore Homebrew packages
brew-restore:
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install | ruby
brew update
brew upgrade
brew install mas
brew bundle install --file=config/os/macos/brewfile
brew bundle install --file=brew/brewfile
brew cleanup
File renamed without changes.
12 changes: 1 addition & 11 deletions config/zsh/zshrc.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ setopt hist_verify

# Share history across all your terminal windows
setopt share_history
# setopt noclobber

# set some more options
setopt pushd_ignore_dups
Expand All @@ -40,7 +39,7 @@ setopt pushd_silent
HISTSIZE=100000
SAVEHIST=100000
HISTFILE=~/.zsh_history
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"
export HISTIGNORE="&:ls:cd:pwd:exit:date:* --help"

# Return time on long running processes
REPORTTIME=2
Expand All @@ -65,13 +64,4 @@ if type fd >/dev/null 2>&1; then
export FZF_DEFAULT_COMMAND='fd --type f'
fi

export FZF_DEFAULT_OPTS='--reverse --bind 'ctrl-l:cancel''
export FZF_TMUX_HEIGHT=80%
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

# export BAT_THEME='Monokai Extended Bright'
# export AWS_PAGER='bat -p'

source ~/.asdf/asdf.sh

eval "$(starship init zsh)"
File renamed without changes.
28 changes: 0 additions & 28 deletions install

This file was deleted.

38 changes: 38 additions & 0 deletions scripts/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

set -e

SOURCE_CONFIG_DIR="$PWD/config"
SOURCE_MODULES_DIR="$PWD/modules"
TARGET_CONFIG_DIR="$HOME/.config"

function link_config() {
local source=$1
local target=$2

echo "Checking '${source}'..."
if [ ! -L ${target} ]; then
echo "=> Linking '${source}' to '${target}'..."
ln -s ${source} ${target}
fi
}

# shell prompt for zsh, fish
link_config $SOURCE_CONFIG_DIR/starship/starship.toml $TARGET_CONFIG_DIR/starship.toml

# zsh
link_config $SOURCE_MODULES_DIR/zgen $HOME/.zgen
link_config $SOURCE_CONFIG_DIR/zsh/zshrc.zsh $HOME/.zshrc
link_config $SOURCE_CONFIG_DIR/zsh $TARGET_CONFIG_DIR/zsh

# fish
link_config $SOURCE_CONFIG_DIR/fish $TARGET_CONFIG_DIR/fish

# nvim
link_config $SOURCE_MODULES_DIR/nvchad $TARGET_CONFIG_DIR/nvim
link_config $SOURCE_CONFIG_DIR/nvim/custom $TARGET_CONFIG_DIR/nvim/lua/custom

# tools
link_config $SOURCE_CONFIG_DIR/htop $TARGET_CONFIG_DIR/htop
link_config $SOURCE_CONFIG_DIR/tmux $TARGET_CONFIG_DIR/tmux
link_config $SOURCE_CONFIG_DIR/iterm2 $TARGET_CONFIG_DIR/iterm2

0 comments on commit f86b79d

Please sign in to comment.