mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 20:25:30 +00:00
Add asdf as version manager (#2)
* feat(asdf): add new version manager asdf * feat(asdf): replace nvm with asdf * feat(asdf): replace rbenv with asdf * chore: add aliases for git * feat(asdf): replace pyenv with asdf * feat(asdf): add asdf as version manager for rust * chore: shorten comments * feat(asdf): add asdf as deno version manager * feat(asdf): add direnv plugin and setup shell * chore(asdf): move configuration in folder
This commit is contained in:
@@ -7,12 +7,16 @@
|
|||||||
- link:
|
- link:
|
||||||
~/.ack: ack
|
~/.ack: ack
|
||||||
~/.ag: ag
|
~/.ag: ag
|
||||||
|
~/.asdfrc: asdf/asdfrc
|
||||||
~/.config/base16-shell: .base16-shell
|
~/.config/base16-shell: .base16-shell
|
||||||
~/.config/kitty: kitty
|
~/.config/kitty: kitty
|
||||||
~/.config/nvim: nvim
|
~/.config/nvim: nvim
|
||||||
~/.config/starship.toml: starship.toml
|
~/.config/starship.toml: starship.toml
|
||||||
~/.config/tmuxinator: tmuxinator
|
~/.config/tmuxinator: tmuxinator
|
||||||
~/.ctags: ctags
|
~/.ctags: ctags
|
||||||
|
~/.default-gems: asdf/default-gems
|
||||||
|
~/.default-npm-packages: asdf/default-npm-packages
|
||||||
|
~/.default-python-packages: asdf/default-python-packages
|
||||||
~/.editorconfig: editorconfig
|
~/.editorconfig: editorconfig
|
||||||
~/.gitconfig: gitconfig
|
~/.gitconfig: gitconfig
|
||||||
~/.gitignore: gitignore
|
~/.gitignore: gitignore
|
||||||
|
|||||||
9
Gemfile
9
Gemfile
@@ -2,7 +2,10 @@
|
|||||||
|
|
||||||
source "https://rubygems.org"
|
source "https://rubygems.org"
|
||||||
|
|
||||||
gem "neovim"
|
gem "bundler"
|
||||||
gem "lunchy"
|
|
||||||
gem "git-up"
|
|
||||||
gem "erb_lint"
|
gem "erb_lint"
|
||||||
|
gem "git-up"
|
||||||
|
gem "github-linguist"
|
||||||
|
gem "lunchy"
|
||||||
|
gem "neovim"
|
||||||
|
gem "tmuxinator"
|
||||||
|
|||||||
1
asdf/asdfrc
Normal file
1
asdf/asdfrc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
legacy_version_file = yes
|
||||||
6
asdf/default-gems
Normal file
6
asdf/default-gems
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
bundler
|
||||||
|
erb_lint
|
||||||
|
git-up
|
||||||
|
lunchy
|
||||||
|
neovim
|
||||||
|
tmuxinator
|
||||||
31
asdf/default-npm-packages
Normal file
31
asdf/default-npm-packages
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
@fsouza/prettierd
|
||||||
|
a11y
|
||||||
|
alex
|
||||||
|
babel-cli
|
||||||
|
browser-sync
|
||||||
|
caniuse-cmd
|
||||||
|
commitizen
|
||||||
|
cz-conventional-changelog
|
||||||
|
eslint
|
||||||
|
eslint_d
|
||||||
|
fast-cli
|
||||||
|
gifify
|
||||||
|
github-codeowners
|
||||||
|
json-server
|
||||||
|
jsonlint
|
||||||
|
lighthouse
|
||||||
|
markdownlint-cli
|
||||||
|
neovim
|
||||||
|
netlify-cli
|
||||||
|
npm-check
|
||||||
|
npm-check-updates
|
||||||
|
pageres-cli
|
||||||
|
pageres-cli
|
||||||
|
prettier
|
||||||
|
prettier-init
|
||||||
|
prettier-stylelint
|
||||||
|
prettier_d_slim
|
||||||
|
prettyjson
|
||||||
|
typesync
|
||||||
|
write-good
|
||||||
|
yarn
|
||||||
3
asdf/default-python-packages
Normal file
3
asdf/default-python-packages
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
codespell
|
||||||
|
fawkes
|
||||||
|
pipenv
|
||||||
5
setup/deno.sh
Executable file
5
setup/deno.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
asdf plugin add deno
|
||||||
|
asdf install deno latest
|
||||||
|
asdf global deno latest
|
||||||
4
setup/direnv.sh
Executable file
4
setup/direnv.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
asdf plugin add direnv
|
||||||
|
asdf direnv setup --shell zsh --version latest
|
||||||
10
setup/gem.sh
10
setup/gem.sh
@@ -1,10 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
brew install brew-gem
|
|
||||||
|
|
||||||
brew gem install bundler # Bundler manages an application's dependencies
|
|
||||||
brew gem install git-up # git command to fetch and rebase all branches
|
|
||||||
brew gem install github-linguist # Language Savant.
|
|
||||||
brew gem install lunchy # Friendly wrapper around launchctl
|
|
||||||
brew gem install neovim # Ruby provider for NeoVim
|
|
||||||
brew gem install erb_lint # Lint ERB or HTML
|
|
||||||
@@ -1,37 +1,34 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Install Xcode Developer Tools
|
# Xcode Developer Tools
|
||||||
xcode-select --install
|
xcode-select --install
|
||||||
|
|
||||||
# Install TMUX Plugin Manager
|
# TMUX Plugin Manager
|
||||||
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
|
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
|
||||||
|
|
||||||
# Install Homebrew
|
# Homebrew
|
||||||
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||||
|
|
||||||
# Installing Homebrew packages, Cask binaries and Mac App Store software
|
# Homebrew packages, Cask binaries and Mac App Store software
|
||||||
source ./brew.sh
|
source ./brew.sh
|
||||||
|
|
||||||
# Installing Node.js
|
# Direnv
|
||||||
source ./nvm.sh
|
source ./direnv.sh
|
||||||
|
|
||||||
# Installing global Node.js modules
|
# Node.js
|
||||||
source ./npm.sh
|
source ./nodejs.sh
|
||||||
|
|
||||||
# Installing Python version manager
|
# Python
|
||||||
source ./python.sh
|
source ./python.sh
|
||||||
|
|
||||||
# Installing Lua packages
|
# Lua
|
||||||
source ./lua.sh
|
source ./lua.sh
|
||||||
|
|
||||||
# Installing Rust packages
|
# Rust
|
||||||
source ./rust.sh
|
source ./rust.sh
|
||||||
|
|
||||||
# Install current version of Ruby
|
# Ruby
|
||||||
source ./ruby.sh
|
source ./ruby.sh
|
||||||
|
|
||||||
# Install global Gems
|
# Visual Studio Code Extensions
|
||||||
source ./gem.sh
|
|
||||||
|
|
||||||
# Install Visual Studio Code Extensions
|
|
||||||
source ./vscode.sh
|
source ./vscode.sh
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
asdf plugin add lua
|
||||||
|
asdf install lua latest
|
||||||
|
asdf global lua latest
|
||||||
|
|
||||||
luarocks install --server=https://luarocks.org/dev luaformatter
|
luarocks install --server=https://luarocks.org/dev luaformatter
|
||||||
|
|||||||
5
setup/nodejs.sh
Executable file
5
setup/nodejs.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
asdf plugin add nodejs
|
||||||
|
asdf install nodejs latest
|
||||||
|
asdf global nodejs latest
|
||||||
62
setup/npm.sh
62
setup/npm.sh
@@ -1,62 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
npm install -g @11ty/eleventy # Eleventy
|
|
||||||
npm install -g @hyperspace/cli # Hyp CLI
|
|
||||||
npm install -g @fsouza/prettierd # Prettier, as a daemon, for ludicrous formatting speed
|
|
||||||
npm install -g a11y # Runs an accessibility audit against a URL
|
|
||||||
npm install -g alex # Catch insensitive, inconsiderate writing
|
|
||||||
npm install -g babel-cli # Babel command line
|
|
||||||
npm install -g browser-sync # Live CSS Reload & Browser Syncing
|
|
||||||
npm install -g caniuse-cmd # caniuse for the command line ➜ caniuse border-radius
|
|
||||||
npm install -g commitizen # Git commit, but play nice with conventions ➜ git cz
|
|
||||||
npm install -g cz-conventional-changelog # Prompts for conventional changelog standard
|
|
||||||
npm install -g degit # Straightforward project scaffolding
|
|
||||||
npm install -g esbuild # An extremely fast JavaScript bundler
|
|
||||||
npm install -g eslint # An AST-based pattern checker for JavaScript
|
|
||||||
npm install -g eslint-plugin-babel
|
|
||||||
npm install -g eslint-plugin-chai
|
|
||||||
npm install -g eslint-plugin-chai-expect
|
|
||||||
npm install -g eslint-plugin-flowtype
|
|
||||||
npm install -g eslint-plugin-html
|
|
||||||
npm install -g eslint-plugin-jasmine
|
|
||||||
npm install -g eslint-plugin-jsdoc
|
|
||||||
npm install -g eslint-plugin-json
|
|
||||||
npm install -g eslint-plugin-jsx
|
|
||||||
npm install -g eslint-plugin-jsx-extras
|
|
||||||
npm install -g eslint-plugin-lodash
|
|
||||||
npm install -g eslint-plugin-mocha
|
|
||||||
npm install -g eslint-plugin-node
|
|
||||||
npm install -g eslint-plugin-react
|
|
||||||
npm install -g eslint-plugin-redux
|
|
||||||
npm install -g eslint_d # Like Eslint, but faster
|
|
||||||
npm install -g fast-cli # Test your download speed using fast.com ➜ fast
|
|
||||||
npm install -g gifify # Convert any video file to an optimized animated GIF
|
|
||||||
npm install -g github-codeowners # A CLI tool for working with GitHub CODEOWNERS
|
|
||||||
npm install -g glyphhanger # Your web font utility belt
|
|
||||||
npm install -g http-server # A simple zero-configuration command-line http server
|
|
||||||
npm install -g json-server # Small JSON file server for REST API mock ➜ touch db.json; json-server --watch db.json
|
|
||||||
npm install -g jsonlint # A JSON linter
|
|
||||||
npm install -g lighthouse # Lighthouse analyzes web apps and web pages.
|
|
||||||
npm install -g nativefier # Wrap web apps natively
|
|
||||||
npm install -g neovim # Node.js provider for NeoVim
|
|
||||||
npm install -g netlify-cli # The Netlify CLI tools.
|
|
||||||
npm install -g nodemon # Simple monitor script for use during development of a node.js app.
|
|
||||||
npm install -g npm-check # Check for outdated, incorrect, and unused dependencies. ➜ npm-check -g
|
|
||||||
npm install -g npm-check-updates # Find newer versions of dependencies ➜ ncu
|
|
||||||
npm install -g npx # Executes commands
|
|
||||||
npm install -g markdownlint # Markdown lint tool and style checker
|
|
||||||
npm install -g markdownlint-cli # Command Line Interface for MarkdownLint
|
|
||||||
npm install -g pageres-cli # Capture website screenshots ➜ pageres [ todomvc.com 1200x1000 ] [ yeoman.io 800x600 1200x1000 ] --crop
|
|
||||||
npm install -g prettier # Prettier is an opinionated code formatter
|
|
||||||
npm install -g prettier-init # Just a CLI for creating a .prettierrc file.
|
|
||||||
npm install -g prettier-stylelint # Format your styles with ease
|
|
||||||
npm install -g prettier_d_slim # Prettier, but fast
|
|
||||||
npm install -g prettyjson # Package for formatting JSON data ➜ prettyjson package.json. curl https://api.github.com/users/rafeca | prettyjson
|
|
||||||
npm install -g stylelint # Modern CSS linter
|
|
||||||
npm install -g stylelint-config-prettier
|
|
||||||
npm install -g stylelint-config-standard
|
|
||||||
npm install -g tldr # tldr;
|
|
||||||
npm install -g typescript # TypeScript is a language for application scale JavaScript development
|
|
||||||
npm install -g typesync # Install missing TypeScript typings for dependencies in your package.json.
|
|
||||||
npm install -g write-good # Linter for English prose
|
|
||||||
npm install -g yarn # Fast, reliable, and secure dependency management.
|
|
||||||
14
setup/nvm.sh
14
setup/nvm.sh
@@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Manual install of nvm
|
|
||||||
git clone https://github.com/creationix/nvm.git ~/.nvm
|
|
||||||
cd ~/.nvm
|
|
||||||
git checkout `git describe --abbrev=0 --tags`
|
|
||||||
cd ~/.dotfiles/
|
|
||||||
|
|
||||||
# Reload nvm into this environment
|
|
||||||
export NVM_DIR="$HOME/.nvm/"
|
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
|
|
||||||
|
|
||||||
nvm install stable
|
|
||||||
nvm alias default stable
|
|
||||||
@@ -1,21 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Install Pyenv
|
asdf plugin add python
|
||||||
curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
|
asdf install python latest
|
||||||
|
asdf global python latest
|
||||||
# Activate Pyenv
|
|
||||||
export PYENV_ROOT="$HOME/.pyenv"
|
|
||||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
|
||||||
eval "$(pyenv init --path)"
|
|
||||||
eval "$(pyenv virtualenv-init -)"
|
|
||||||
|
|
||||||
pyenv install 3.10.1
|
|
||||||
|
|
||||||
pip install -r ~/.dotfiles/python/pip-requirements.txt
|
pip install -r ~/.dotfiles/python/pip-requirements.txt
|
||||||
|
|
||||||
jupyter nbextension install --py --sys-prefix jupyter_ascending
|
|
||||||
jupyter nbextension enable jupyter_ascending --sys-prefix --py
|
|
||||||
jupyter serverextension enable jupyter_ascending --sys-prefix --py
|
|
||||||
|
|
||||||
conda install -n base ipykernel --update-deps --force-reinstall
|
conda install -n base ipykernel --update-deps --force-reinstall
|
||||||
conda install --file ~/.dotfiles/python/conda-requirements.txt
|
conda install --file ~/.dotfiles/python/conda-requirements.txt
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
rbenv install $(rbenv install -l | grep -v - | tail -1)
|
asdf plugin add ruby
|
||||||
rbenv global $(rbenv install -l | grep -v - | tail -1)
|
asdf install ruby latest
|
||||||
|
asdf global ruby latest
|
||||||
|
|
||||||
bundle install --gemfile=~/.dotfiles/Gemfile
|
bundle install --gemfile=~/.dotfiles/Gemfile
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Install Rust
|
asdf plugin add rust
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
asdf install rust latest
|
||||||
|
asdf global rust latest
|
||||||
|
|
||||||
cargo install stylua
|
cargo install stylua
|
||||||
|
|||||||
@@ -1,6 +1,20 @@
|
|||||||
# Don't print a new line at the start of the prompt
|
# Don't print a new line at the start of the prompt
|
||||||
add_newline = false
|
add_newline = false
|
||||||
|
|
||||||
|
command_timeout = 1000
|
||||||
|
|
||||||
|
[nodejs]
|
||||||
|
detect_files = ["package.json", ".node-version", ".nvmrc", ".tool-versions"]
|
||||||
|
|
||||||
|
[ruby]
|
||||||
|
detect_files = ["Gemfile", ".ruby-version", ".tool-versions"]
|
||||||
|
|
||||||
|
[python]
|
||||||
|
detect_files = [".python-version", "Pipfile", "__init__.py", "pyproject.toml", "requirements.txt", "setup.py", "tox.ini", '.tool-versions']
|
||||||
|
|
||||||
|
[rust]
|
||||||
|
detect_files = ["Cargo.toml", ".tool-versions"]
|
||||||
|
|
||||||
# "bold red" style when capacity is between 0% and 10%
|
# "bold red" style when capacity is between 0% and 10%
|
||||||
[[battery.display]]
|
[[battery.display]]
|
||||||
threshold = 10
|
threshold = 10
|
||||||
|
|||||||
35
zshrc
35
zshrc
@@ -31,28 +31,12 @@ export FZF_CTRL_T_OPTS="--preview 'bat --color=always --style=numbers {}' --bind
|
|||||||
export FZF_ALT_C_COMMAND="fd --type d $FD_OPTIONS --color=never --hidden"
|
export FZF_ALT_C_COMMAND="fd --type d $FD_OPTIONS --color=never --hidden"
|
||||||
export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -50'"
|
export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -50'"
|
||||||
|
|
||||||
# rbenv
|
|
||||||
export RBENV_ROOT="$HOME/.rbenv/"
|
|
||||||
|
|
||||||
# nvm (Node Version Manager)
|
|
||||||
export NVM_DIR="$HOME/.nvm"
|
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
|
|
||||||
|
|
||||||
# Rancher
|
# Rancher
|
||||||
export PATH="$HOME/.rd/bin:$PATH"
|
export PATH="$HOME/.rd/bin:$PATH"
|
||||||
|
|
||||||
# Rust
|
# Rust
|
||||||
export PATH="$HOME/.cargo/bin:$PATH"
|
export PATH="$HOME/.cargo/bin:$PATH"
|
||||||
|
|
||||||
# Ruby
|
|
||||||
export PATH="/usr/local/opt/ruby/bin:$PATH"
|
|
||||||
|
|
||||||
# Pyenv
|
|
||||||
export PYENV_ROOT="$HOME/.pyenv"
|
|
||||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
|
||||||
eval "$(pyenv init --path)"
|
|
||||||
eval "$(pyenv virtualenv-init -)"
|
|
||||||
|
|
||||||
# Conda
|
# Conda
|
||||||
# >>> conda initialize >>>
|
# >>> conda initialize >>>
|
||||||
# !! Contents within this block are managed by 'conda init' !!
|
# !! Contents within this block are managed by 'conda init' !!
|
||||||
@@ -75,6 +59,10 @@ export MANPATH="/usr/local/man:$MANPATH"
|
|||||||
# Bat
|
# Bat
|
||||||
export BAT_PAGER="less -R"
|
export BAT_PAGER="less -R"
|
||||||
|
|
||||||
|
# Asdf
|
||||||
|
. /usr/local/opt/asdf/libexec/asdf.sh
|
||||||
|
source "${XDG_CONFIG_HOME:-$HOME/.config}/asdf-direnv/zshrc"
|
||||||
|
|
||||||
# Starship
|
# Starship
|
||||||
eval "$(starship init zsh)"
|
eval "$(starship init zsh)"
|
||||||
|
|
||||||
@@ -160,17 +148,6 @@ unquarantine() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Auto change the nvm version based on a .nvmrc file based on the current directory.
|
|
||||||
# See https://github.com/creationix/nvm/issues/110#issuecomment-190125863
|
|
||||||
autoload -U add-zsh-hook
|
|
||||||
load-nvmrc() {
|
|
||||||
if [[ -f .nvmrc && -r .nvmrc ]]; then
|
|
||||||
nvm use
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
add-zsh-hook chpwd load-nvmrc
|
|
||||||
load-nvmrc
|
|
||||||
|
|
||||||
# fe [FUZZY PATTERN] - Open the selected file with the default editor
|
# fe [FUZZY PATTERN] - Open the selected file with the default editor
|
||||||
# - Bypass fuzzy finder if there's only one match (--select-1)
|
# - Bypass fuzzy finder if there's only one match (--select-1)
|
||||||
# - Exit if there's no match (--exit-0)
|
# - Exit if there's no match (--exit-0)
|
||||||
@@ -323,11 +300,9 @@ antigen bundle jira
|
|||||||
antigen bundle man
|
antigen bundle man
|
||||||
antigen bundle node
|
antigen bundle node
|
||||||
antigen bundle npm
|
antigen bundle npm
|
||||||
antigen bundle nvm
|
|
||||||
antigen bundle pip
|
antigen bundle pip
|
||||||
antigen bundle pyenv
|
antigen bundle pyenv
|
||||||
antigen bundle python
|
antigen bundle python
|
||||||
antigen bundle rbenv
|
|
||||||
antigen bundle rsync
|
antigen bundle rsync
|
||||||
antigen bundle ssh-agent
|
antigen bundle ssh-agent
|
||||||
antigen bundle sudo
|
antigen bundle sudo
|
||||||
@@ -368,6 +343,8 @@ alias gb='git branch'
|
|||||||
alias gba='git branch -a'
|
alias gba='git branch -a'
|
||||||
alias gc='git commit -v'
|
alias gc='git commit -v'
|
||||||
alias gca='git commit -v -a'
|
alias gca='git commit -v -a'
|
||||||
|
alias gcam='git commit --amend'
|
||||||
|
alias gcan='git commit --amend --no-edit'
|
||||||
alias gd='git diff -- . ":(exclude)yarn.lock"' # Show differences between index and working tree
|
alias gd='git diff -- . ":(exclude)yarn.lock"' # Show differences between index and working tree
|
||||||
alias gdc='git diff --cached' # Show changes in next commit (differences between index and last commit)
|
alias gdc='git diff --cached' # Show changes in next commit (differences between index and last commit)
|
||||||
alias gdh='git diff head' # Show difference between files in working tree and last commit
|
alias gdh='git diff head' # Show difference between files in working tree and last commit
|
||||||
|
|||||||
Reference in New Issue
Block a user