Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcgrady committed Feb 26, 2023
1 parent 21ab9f2 commit 5799562
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/fish/config.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if status is-interactive
eval (/opt/homebrew/bin/brew shellenv)
pyenv init - | source
load_nvm > /dev/stderr
end
Binary file added config/fish/functions/.DS_Store
Binary file not shown.
62 changes: 62 additions & 0 deletions config/fish/functions/fish_prompt.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
set fish_greeting

set fish_color_autosuggestion 555 yellow
set fish_color_command normal --bold
set fish_color_comment black
set fish_color_cwd blue
set fish_color_cwd_root black
set fish_color_error red --bold
set fish_color_escape cyan
set fish_color_history_current cyan
set fish_color_match cyan
set fish_color_normal normal
set fish_color_operator cyan
set fish_color_param normal
set fish_color_quote green
set fish_color_redirection cyan
set fish_color_search_match --background=515151
set fish_color_selection --background=purple
set fish_color_valid_path --underline

set fish_pager_color_completion blue
set fish_pager_color_description black
set fish_pager_color_prefix normal
set fish_pager_color_progress cyan

function _git_branch_name
echo (git symbolic-ref --short HEAD 2>/dev/null)
end

function _is_git_dirty
echo (git status --short --ignore-submodules=dirty 2>/dev/null)
end

function fish_prompt
if test $status -eq 0
set_color $fish_color_cwd
else
set_color $fish_color_error
end

echo -ns (prompt_pwd) " "

set -l branch (_git_branch_name)

if test -n $branch
set_color yellow
echo -n "$branch "

if test -n (_is_git_dirty)
set_color red
echo -n ""
else
set_color green
echo -n ""
end
else
set_color magenta
echo -n '$ '
end

set_color normal
end
17 changes: 17 additions & 0 deletions config/fish/functions/load_nvm.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
function load_nvm --on-variable="PWD"
set -l default_node_version (nvm version default)
set -l node_version (nvm version)
set -l nvmrc_path (nvm_find_nvmrc)
if test -n "$nvmrc_path"
set -l nvmrc_node_version (nvm version (cat $nvmrc_path))
if test "$nvmrc_node_version" = "N/A"
nvm install (cat $nvmrc_path)
else if test "$nvmrc_node_version" != "$node_version"
nvm use $nvmrc_node_version
end
else if test "$node_version" != "$default_node_version"
echo "Reverting to default Node version"
nvm use default
end
end

4 changes: 4 additions & 0 deletions config/fish/functions/nvm.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function nvm
bass source ~/.nvm/nvm.sh --no-use ';' nvm $argv
end

4 changes: 4 additions & 0 deletions config/fish/functions/nvm_find_nvmrc.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function nvm_find_nvmrc
bass source ~/.nvm/nvm.sh --no-use ';' nvm_find_nvmrc
end

59 changes: 59 additions & 0 deletions setup-script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Install Brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

brew install git
git config --global init.defaultBranch main
git config --global user.email 'ken.mcgrady@gmail.com'
git config --global user.name 'Ken McGrady'
curl -fsSL https://git.io/vKZJ8 | sh
echo "Git is installed and configured"

# Install Terminal Profile
curl -fsSL https://raw.githubusercontent.com/ryansobol/sea-c17-ruby/master/class1/osx/Tomorrow%20Night%20Eighties.terminal

# Install the Shortcuts
# | Menu Title | Keyboard Shortcut | Symbols |
# |---------------------|----------------------------|---------|
# | Select Next Tab | `Option` + `Command` + `→` | ⌥⌘→ |
# | Select Previous Tab | `Option` + `Command` + `←` | ⌥⌘← |
# | Show Next Tab | `Option` + `Command` + `→` | ⌥⌘→ |
# | Show Previous Tab | `Option` + `Command` + `←` | ⌥⌘← |

# Install Fish
echo -n 'Install Fish...'
brew install fish
echo 'done'
echo '/opt/homebrew/bin/fish' | sudo tee -a /etc/shells
chsh -s /opt/homebrew/bin/fish

# Install Python
echo -n 'Installing Pyenv...'
brew install xz
brew install pyenv
set -Ux PYENV_ROOT $HOME/.pyenv
fish_add_path $PYENV_ROOT/bin
echo 'done'

echo -n 'Installing Python...'
pyenv install 3.11
pyenv global 3.11.1
echo 'done'

# Install Node
echo -n 'Installing NVM...'
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
echo 'done'

echo -n 'Installing Node...'
nvm install 18
echo 'done'

# Configure Fish
echo -n 'Configuring Done...'
fish_update_completions
cp -r config/fish ~/.config
curl https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install | fish
omf install bass
echo 'done'

echo 'Completed'

0 comments on commit 5799562

Please sign in to comment.