👋

個人的Windowsを買ったときのセットアップ

2021/04/15に公開

毎回するセットアップのメモ

とりあえずインストール

WSL Ubuntuセットアップ

# とりあえずパッケージアプデ
sudo apt update
sudo apt upgrade

# ライブラリ系
sudo apt-get install -y libnss3-dev libatk1.0-0 libatk-bridge2.0-0 libcups2-dev libxkbcommon.so.0 libgbm-dev libgtk-3-0 libmysqlclient-dev imagemagick libmagickwand-dev mysql-client
sudo ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config /usr/bin/Magick-config
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig

# https://qiita.com/mtsgi/items/8a844870f30b30ef21e4#fluent-terminal
sudo apt install build-essential curl file

# Linux brew
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

# git
brew intall git
git config --global user.name 'akinov'
git config --global user.email  'メアド'

# zsh
brew install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions

# peco
brew install peco

# rbenv
brew install rbenv
sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev
rbenv install 2.6.6
rbenv global 2.6.6
rbenv rehash

# nodenv
brew install anyenv
echo 'export PATH="$HOME/.anyenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(anyenv init -)"' >> ~/.zshrc
eval "$(anyenv init -)"
anyenv install --init
anyenv install nodenv
exec $SHELL -l
nodenv install 15.12.0
nodenv global 15.12.0

# pg
sudo apt install postgresql
sudo apt install libpq-dev

brew install imagemagick

chromedriverインストール

https://akinov.hatenablog.com/entry/2020/11/29/143301

.zshrc 関係

# alias
alias g='git'
alias rs='rails s'
alias rs4='rails s -p 4000'
alias rc='rails c'
alias cre='rails db:create'
alias mig='rails db:migrate'
alias rol='rails db:rollback'
alias seed='rails db:seed'
alias drop='rails db:drop'
alias rr='rake routes'
alias be='bundle exec'
alias bi='bundle install'
alias pbcopy='clip.exe'
alias dc='docker-compose'

# peco
function peco-history-selection() {
    BUFFER=`history -n 1 | tac  | awk '!a[$0]++' | peco`
    CURSOR=$#BUFFER
    zle reset-prompt
}

zle -N peco-history-selection
bindkey '^R' peco-history-selection

# rbenv
eval "$(rbenv init -)"

# nodenv
eval "$(nodenv init -)"

.gitconfig

[core]
        autocrlf = false
        ignorecase = false
        editor = vi
[color]
        ui = true
[pull]
        ff = only
[alias]
        co = checkout
        br = branch
        cm = commit
        st = status
        last = log -1 HEAD
        sw = switch
        swc = switch -c
        delete-merged-branch = !git branch --merged | egrep -v '\\*|master|release' | xargs git branch -d
[fetch]
        prune = true
[push]
        default = simple

エイリアス参照

https://suwaru.tokyo/【-zshrc解説】コピペで簡単zshカスタマイズ【設定方法/

環境構築で参照

https://zenn.dev/moroya/articles/0ab24a733e4b7a

anyenv系で参照

https://qiita.com/masako5121/items/2afa847cab1a67be1f47

rmagikインストールで参照

https://qiita.com/ikedakohei/items/48c18f91bb40554d5615


※こちらの記事は自ブログからの転載です

https://akinov.hatenablog.com/entry/2021/04/02/154516

Discussion