GithubHelp home page GithubHelp logo

dotfiles's Introduction

Dotfiles

[#A] Basic Tools

Setup dotfiles

You need to have environment in your .zshenv first. My config is:

export WORKSPACE="$HOME/projects"
mkdir -p $WORKSPACE
cd $WORKSPACE
git clone [email protected]:suonlight/dotfiles.git
mkdir -p ~/.config/nvim
rm -rf ~/.zshrc ~/.tmux.conf ~/.tmux.sp ~/.ctags ~/.editorconfig ~/.config/doom ~/.config/nvim ~/.config/alacritty
ln -s $WORKSPACE/dotfiles/.zshrc ~/.zshrc
ln -s $WORKSPACE/dotfiles/.tmux.conf ~/.tmux.conf
ln -s $WORKSPACE/dotfiles/.tmux.sp ~/.tmux.sp
ln -s $WORKSPACE/dotfiles/.editorconfig ~/.editorconfig
ln -s $WORKSPACE/dotfiles/.ctags ~/.ctags
ln -s $WORKSPACE/dotfiles/nvim ~/.config/nvim
ln -s $WORKSPACE/dotfiles/alacritty ~/.config/alacritty
ln -s $WORKSPACE/dotfiles/doom ~/.config/doom
ln -s $WORKSPACE/dotfiles/karabiner ~/.config/karabiner
ln -s $WORKSPACE/dotfiles/tridactyl ~/.config/tridactyl

mkdir -p ~/.config/bat
ln -s $WORKSPACE/dotfiles/bat.conf ~/.config/bat/config

Neovim

brew install neovim

Start nvim then run `:PackerInstall` to install vim’s Plugins

Tmux

brew install tmux

# install tpm
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

Start tmux then press `C-SPC I` (C-SPC means tmux prefix) to install tpm plugins

ZSH

brew install zsh zsh-completions
chsh -s /bin/zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
brew install zplug

Emacs

Use emacs-plus

brew install gcc libgccjit
# need to reinstall if you already installed $ brew reinstall gcc libgccjit
brew tap d12frosted/emacs-plus
brew install emacs-plus@29 --with-native-comp --with-modern-sexy-v1-icon

Doom

rm -rf ~/.emacs.d
git clone --depth 1 https://github.com/hlissner/doom-emacs ~/projects/doom-emacs
ln -s ~/projects/doom-emacs ~/.config/emacs
ln -s ~/projects/dotfiles/doom ~/.config/doom
rm -rf ~/.config/doom/snippets
ln -s ~/.config/doom/private/snippets ~/.config/doom/snippets
cd ~/.config/emacs
bin/doom install

To make sure vterm use zsh by default

export SHELL=/usr/bin/zsh
bin/doom sync

Programming Languages

[#A] asdf

https://asdf-vm.com/#/core-manage-asdf-vm

asdf plugin-add postgres
asdf plugin-add ruby
asdf plugin-add nodejs https://github.com/asdf-vm/asdf-nodejs.git
asdf plugin-add yarn

[#A] Terminal tools

brew install ripgrep
brew install autojump
brew install wget
asdf plugin add fd
asdf install fd latest
asdf global fd 8.2.1
asdf plugin add fzf https://github.com/kompiro/asdf-fzf.git
asdf install fzf latest
asdf global fzf 0.27.2
asdf plugin-add yq https://github.com/sudermanjr/asdf-yq.git
asdf install yq 4.0.0
asdf global yq 4.0.0
asdf plugin add bat
asdf install bat latest
asdf global bat 0.18.3

[#A] Ruby

asdf install ruby 2.6.6
asdf global ruby 2.6.6

[#A] Postgres

POSTGRES_EXTRA_CONFIGURE_OPTIONS=--with-uuid=e2fs asdf install postgres 13.4
asdf global postgres 13.4

[#A] Redis

asdf plugin-add redis https://github.com/smashedtoatoms/asdf-redis.git
asdf install redis latest
asdf global redis 6.2.6

[#A] NodeJs

brew install gnupg
bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
asdf install nodejs 12.22.4
asdf global nodejs 12.22.4
asdf install yarn 1.21.1
asdf global yarn 1.21.1

[#B] Python

asdf plugin-add python
asdf install python 2.7.16
asdf install python 3.9.1
asdf global python 2.7.16 3.9.1

[#B] R

asdf plugin-add R https://github.com/taiar/asdf-R.git
R_EXTRA_CONFIGURE_OPTIONS=--with-x=no asdf install R 4.0.3
asdf global R 4.0.3
install.packages("dplyr")
install.packages("ggplot2")

[#B] Java

asdf plugin-add java https://github.com/halcyon/asdf-java.git
asdf install java adoptopenjdk-15.0.1+9
asdf global java adoptopenjdk-15.0.1+9

[#B] Rust

curl https://sh.rustup.rs -sSf | sh
rustup toolchain add nightly
cargo +nightly install racer
cargo install rustfmt
rustup component add rls rust-analysis rust-src

[#B] Others

brew install jq
brew install q
brew install ctags
# format sql
pip install sqlparse
brew install sqlformat
brew install mplayer

[#B] Advance Tools

Key Repeat

defaults write NSGlobalDomain KeyRepeat -int 1 # normal minimum is 2 (30 ms)
defaults write NSGlobalDomain InitialKeyRepeat -int 10

org-protocol

Test org-protocol

emacsclient -c 'org-protocol:/capture?template=L&url=foo&title=bar'
  • Test on Browser
location.href='org-protocol:/capture?template=E&url=foo&title=bar'

Creating org-protocol by Apple Script

on open location this_URL
  -- do shell script "/usr/local/bin/emacsclient \"" & this_URL & "\" -F '((name . \"doom-capture\") (width . 70) (height . 25) (transient . t))'"
  do shell script "/usr/local/bin/emacsclient -F '((name . \"doom-capture\") (width . 70) (height . 25) (transient . t))' -e '(org-protocol-open-frame \"" & this_URL & "\")'"
  activate application "Emacs"
end open location

or

cp ~/projects/dotfiles/org-protocol* /Applications/
  • Open org-protocol and export it by application
  • Edit Info.plist with
/Applications/org-protocol.app/Contents/Info.plist
<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLName</key>
    <string>org-protocol handler</string>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>org-protocol</string>
    </array>
  </dict>
</array>
  • IMPORTANT: Exit and Active org-protocol.app by clicking on it

Setup on Firefox

[
  {
    "key": "ctrl+shift+n",
    "action": "javascript",
    "blacklist": "false",
    "sites": "*mail.google.com*",
    "open": false,
    "activeInInputs": true,
    "code": "location.href = 'org-protocol://capture?template=N&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection()).replace(/'/g, '%27');",
    "exported": false,
    "sitesArray": [
      "*mail.google.com*"
    ],
    "customName": "Capture today notes"
  },
  {
    "key": "ctrl+shift+e",
    "action": "javascript",
    "blacklist": "false",
    "sites": "*mail.google.com*",
    "open": false,
    "code": "var activeTextarea = document.activeElement;\nvar selection = activeTextarea.tagName == \"TEXTAREA\" ? activeTextarea.value.substring(\n    activeTextarea.selectionStart, activeTextarea.selectionEnd\n ) : window.getSelection();\n\nlocation.href='org-protocol://capture?template=E&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(selection)",
    "activeInInputs": true,
    "exported": false,
    "sitesArray": [
      "*mail.google.com*"
    ]
  }
]

Install Fonts

brew tap homebrew/cask-fonts && brew install --cask font-source-code-pro

Install all the icons by Emacs

(all-the-icons-install-fonts)

talon

My talon config is here: https://github.com/suonlight/knausj_talon

git clone [email protected]:suonlight/knausj_talon.git $WORKSPACE/knausj_talon

mkdir -p ~/.talon/user ~/.config/polybar
rm -rf ~/.talon/user/knausj_talon
rm -rf ~/.talon/user/hero
ln -s $WORKSPACE/knausj_talon ~/.talon/user/knausj_talon
ln -s $WORKSPACE/dotfiles/doom/private/talon/hero ~/.talon/user/hero

aspell

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null

Linux

Using emacs exwm

# polybar
rm -rf ~/.config/polybar
ln -s $WORKSPACE/dotfiles/polybar ~/.config/polybar

# x window
rm ~/.xinitrc ~/.xprofile
ln -s $WORKSPACE/dotfiles/.xinitrc ~/.xinitrc
ln -s $WORKSPACE/dotfiles/.xprofile ~/.xprofile

dotfiles's People

Contributors

suonlight avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.