“ We shape our tools, and thereafter our tools shape us. ”
- distorted from original quote, by Marshall McLuhan
This is my dotfiles. Feel free to open an issue if you need clarification to my configs.
- LaTex
- React/Typescript with LSP
- Jsx support with rjsx-mode
- Haskell with LSP
- Python with pyright and poetry
- Elixir
- Clojure (WIP)
- Somewhat heavily configurated Emacs config based on Doom
- Org-Roam (aka Roam Research on Emacs)
- Elfeed (RSS feed reader)
- Working example of Org Agenda configuration
- Opinionated keybindings. J and K would scroll, S would save buffer
- Simple and quick Neovim config
- A working tiling window manager configuration for Mac (with yabai)
- Minimal mouse dependency with skhd
- Embedded floating window in Vim, see screenshot
- Seamless integration between tmux, vim and alacritty
- Shows currently played Spotify song
- Customized command prompt with starship
- Modularized zsh config with the demonstration of Zinit async syntax
- An earthy theme ported from Miramare
- Highly customizable Prose linter/checker using Vale
See here: https://gist.github.com/sagittaros/a632a853e6e3f78c64f1b4c017217b30
Send me a PR to let me know what issues you find. I am hoping to turn this into a reproducible bundle, but I might overlooked some hardcoded variables.
git clone https://github.com/sagittaros/dotfiles.git
cd dotfiles
./install.sh
For first time access, run the following commands in order:
:PlugInstall
:UpdateRemotePlugins
:checkhealth
I use Zinit as ZSH's plugin manager. My .zshrc
is here.
$ZDOTDIR
is set in $HOME/.zshenv
, so that zsh configs are self-contained.
- Sensitive environment variables should not be version controlled, they are placed in
$ZDOTDIR/secrets.zsh
. - Add additional zsh scripts to the bottom of
$ZDOTDIR/.zshrc
Pick any distro that you like.
https://github.com/hlissner/doom-emacs
git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d
~/.emacs.d/bin/doom install
after installation, run doom doctor
to determine missing packages
Follow the following steps to install it, require reboots and messing with csrutil
- Enable
Displays have separate Spaces
under System Preferences -> Mission Control - Follow the instruction to disable SIP here
- Install Yabai
- Install Skhd
- yabai and skhd should be running in
brew services list
- if it doesn't work, check the error by running
tail -f /usr/local/var/log/yabai/yabai.err.log
basicPackages
includes a number of packages, refer .config/nixpkgs/config.nix
Find packages at https://search.nixos.org/packages
nix-env -iA nixpkgs.<package-name>
installs a package with exact matchnix-env -q
shows installed packagesnix-env --uninstall <installed-package>
uninstalls package
# Essential libraries with brew
brew install cliclick starship yabai shkd gh coreutils fontconfig ranger
brew install vale # modern proselint
# Fzf history search
brew install fzf
$(brew --prefix)/opt/fzf/install
# Install emacs 28
brew install emacs-head@28 --with-cocoa --with-native-comp --with-native-full-aot --with-modern-icon-doom-cacodemon
# install Nix and cachix, follow the instructions
curl -L https://nixos.org/nix/install | sh
nix-channel --update
# install nix packages
nix-env -iA nixpkgs.basicPackages
# rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# haskell
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
# golang
nix-env -iA nixpkgs.go
go get -u github.com/motemen/gore/cmd/gore
go get -u github.com/stamblerre/gocode
go get -u golang.org/x/tools/cmd/godoc
go get -u golang.org/x/tools/cmd/goimports
go get -u golang.org/x/tools/cmd/gorename
go get -u golang.org/x/tools/cmd/guru
go get -u github.com/cweill/gotests/...
go get -u github.com/fatih/gomodifytags
# python and pips
nix-env -iA nixpkgs.python38 # or python39
curl https://bootstrap.pypa.io/get-pip.py | python
pip install black pyflakes isort nose pytest pipenv pipx
pipx install grip # for markdown preview
# others via yarn
yarn global add marked
yarn global add stylelint prettier js-beautify
yarn global add pyright
# required by org +roam
nix-env -iA nixpkgs.sqlite # it is required for org-roam to work properly
# LATEX and some fonts (See latex keybindings at the bottom of this doc)
brew install --cask mactex
brew install --cask skim # preview app
brew install latexindent
brew install --cask font-gentium-plus
brew install --cask font-tex-gyre-pagella
brew install --cask font-tex-gyre-pagella-math
# Cabal setup (I don't use stack)
cabal install implicit-hie # gen-hie > hie.yaml (required for haskell-language-server)
cabal install cabal-fmt
cabal install stylish-haskell
cabal install hoogle
# default = -int 1
defaults write org.gnu.Emacs AppleFontSmoothing -int 0
Cmd + H: Move to left tmux tab
Cmd + L: Move to right tmux tab
Cmd + K: Clear buffer
Cmd + n: New tab
Cmd + w: Kill tab
Cmd + e: Rename tab
Cmd + s: Rename session
Cmd + Enter: Toggle Full Screen
` + o: View all open tmux windows
` + \: Split tmux pane to the right
` + -: Split tmux pane to the bottom
Ctrl + HJKL: Move between panes (even across neovim/tmux)
For more, refer:
# `i` to enter vim mode
# ESC to quit vim mode
bindkey -v
bindkey '^R' fzf-history-widget # ctrl+r to search history with fzf
# emacs style 0
bindkey '^A' beginning-of-line
bindkey '^E' end-of-line
bindkey '^K' kill-line
bindkey '^W' backward-kill-word
# open a fzf-found file
bindkey -s '^o' 'nvim $(fzf)\n'
(map! :nv "S" #'save-buffer
:nv "F" #'avy-goto-char-timer
:nv "f" #'avy-goto-char-in-line
:nv "J" #'evil-scroll-down
:nv "K" #'evil-scroll-up
:nv "gx" #'browse-url
:nv "rr" #'evil-ex-nohighlight
:nv "rb" #'revert-bufferm
:nv "rc" #'lsp-workspace-restart)
;; Easier navigation
(map! :ne "C-h" #'evil-window-left
:ne "C-l" #'evil-window-right
:ne "C-j" #'evil-window-down
:ne "C-k" #'evil-window-up
:ne "s-h" #'+workspace/switch-left
:ne "s-l" #'+workspace/switch-right
:ne "s-n" #'+workspace/new
:ne "s-w" #'+workspace/close-window-or-workspace
:ne "s-r" #'+workspace/rename)
;; Easier window split
(map! :leader
"\\" #'evil-window-vsplit
"-" #'evil-window-split)
;; Ace window
(map! :leader "w w" #'ace-window)
# simple glucose
nnoremap <silent> rr :noh<cr>
nnoremap <silent> re :e!<cr>
nnoremap <silent> rw <C-w>=
nnoremap <silent> rf :set foldmethod=manual<CR> zE
inoremap <silent> jj <Esc>
nnoremap j gj
nnoremap k gk
vnoremap B ^
vnoremap E $
nnoremap B ^
nnoremap E $
nmap f <Plug>(easymotion-sl)
nmap F <Plug>(easymotion-s2)
# split screen
nnoremap <silent> ss :sp<CR>
nnoremap <silent> vv :vsp<CR>
nnoremap <silent> qq <C-w>q
# toggle embedded LazyGit
nnoremap <silent> <space>lg :<C-u>call ToggleLazyGit()<CR>
# quick scroll
nnoremap <silent> K :call ScrollQuarter('up')<CR>
nnoremap <silent> J :call ScrollQuarter('down')<CR>
To compile the document, C-c C-c
and select LaTex
in the menu.
To preview LaTex while editing, C-c C-v
. I use "Skim.app" for previewing