Just keep my dotfiles and notes in one place. I use master
branch for generic setting. For machine-specific configuration, is located in different branch. This dotfile is powered by Dotbot.
First, go through the checklist below to make sure you didn't forget anything before you wipe your hard drive.
- Did you commit and push any changes/branches to your git repositories?
- Did you remember to save all important documents from non-iCloud directories?
- Did you save all of your work from apps which aren't synced through iCloud?
- Did you remember to export important data from your local database?
If you did all of the above you may now follow these install instructions to setup a new Mac.
- Update macOS to the latest version with the App Store
- Install macOS Command Line Tools by running xcode-select --install
- Generate a new public and private SSH key and add them to Github
- Clone this repo to ~/.dotfiles
- Run
install
to start the installation - Restart your computer to finalize the process
Your Mac is now ready to use!
- Check out to the machine-specific branch
- Comment out the command you don't want in
install.conf.yaml
- Run
install
```
master
|
+- mac
```
這兩者的差別在於系統上認定有無登入會選擇其中一種來初始化 bash,不同系統會有不同作法,我的設定是如果系統要 load bash_profile 就把它轉到 bashrc,這樣只要設定好 bashrc 就好,bashrc 和 bash_profile 差別可參考別人的回覆。
extract
: 解壓縮後面接的檔案mkd
: 創建資料夾且進入
ltm
: 如果有 tmux session 就 attach,如果沒有就新開一個 (lazy tmux)tml
: tmux lstma
: tmux attach-sessiontmk
: tmux kill-sessiontmc
: clear tmux stufftmna
: rename session
<C-a>
: prefix
d
: detach 目前的 session,
: rename 目前的 windownumber
: 跳到那個 number 的 windowc
: 開啟新的 window (create)n
: 跳到下一個 window (next)p
: 跳到上一個 window (previous)r
: 重新 load tmux.conf (reload)|
: split window h_
: split window vH
: resize leftK
: resize downJ
: resize upL
: resize right<hjkl>
: pane 上下左右跳
用 ssh 時會有 nested tmux 的狀況
<S-Up>
: 轉到 ssh 的 tmux<S-Down>
: 轉回 local 的 tmux
- Learn Vim Progressively: 這個教學我看了好幾次是當初學 vim 的救星
- Vim Cheat Sheet: 適合印出來貼在電腦旁看
- Vim Awesome: vim plugin 排行榜
- vimgifs: 學 vim tips 的好地方
- viminum: 可以在瀏覽器上用 vim 的快速鍵
- lightline : Beautiful and light weight status bar.
- base16-vim : Base16 color theme.
- vim-buftabline : Buffer list that lives in the tabline.
- nerdtree : Explore file system in vim.
- nerdtree-git-plugin : Show git status on nerdtree.
- pangu : Auto format Chinese and English text.
- tcomment_vim : Fast shortcut for commenting.
- gundo : Fast undo.
- tagbar : Easy way to browse the tags of the current file.
- vim-easymotion : Vim motions on speed.
- vim-surround : Quickly deals surrounding things.
- supertab : Vim insert mode completions with Tab.
- auto-pairs : Insert or delete brackets, parens, quotes in pair.
- ctrlp : Fuzzy file, buffer, mru, tag, etc finder.
- vim-gitgutter : A Vim plugin which shows a git diff in the gutter (sign column) and stages/undoes hunks.
- vim-fugitive : Use git in vim.
- vim-signature : Easy mark in vim.
- vim-repeat : Let
.
more powerful in vim.
- syntastic : Powerful syntax checking plugin.
- vim-javascript : Javascript syntax hightlight and intent.
- vim-json : Syntax for json file.
- vim-jsx-pretty : React syntax highlighting and indenting plugin.
- vim-prettier : Auto format javascript, typescript, less, scss, css, json, graphql and markdown files.
- vim-css-color : Show color in vim.
以下只記錄自訂指令與外掛指令。
可搭配 vimrc 一起看會比較清楚
<Leader>
= ,
<Leader>w
= :w!jk
=<Esc>
(跳回 normal mode)9
= $ (跳到此行的最後一個字)0
= ^ (跳到此行的第一個字)<Leader>dw
: 把白色空白刪掉 (delete whitespace)
我目前把 buffer 當 tab 在用
<C-hjkl>
window 上下左右跳<Tab>
跳下一個 buffer<Shift-Tab>
跳上一個 buffer<Leader>t
開一個新的 buffer<Leader>q
關掉目前所在 buffer
<Leader>c
註解選擇的範圍
<Leader>n
開關 NerdTreeo
在 NerdTree 底下開啟檔案或開關目錄I
顯示隱藏被隱藏的檔案與目錄u
跳到上一個目錄
<Space>f『目標』
用 EasyMotion 找『目標』<Space>w
用 EasyMotion 找字<Space>j
用 EasyMotion 往下面行跳<Space>k
用 EasyMotion 往上面行跳
ysiw)
在所在字上加 () 號,例如;hello -> (hello) ( yield surround inside word )yss)
在所在行加 () 號S)
在 visual mode 下輸入,可在選取的字旁加 ()
;
開啟 ctrlp 模糊查詢
- Press
<Ctrl-f>
and<Ctrl-b>
to cycle between modes. - Use
<Ctrl-j>
,<Ctrl-k>
or the arrow keys to navigate the result list. - Use
<Ctrl-t>
or<Ctrl-v>
,<Ctrl-x>
to open the selected entry in a new tab or in a new split.
[c
跳到上一個 hunk]c
跳到下一個 hunk<Leader>hp
preview a hunk's changes<Leader>hs
stage a hunk<Leader>hu
undo a hunk
<Leader>u
開啟 gundo
:Pangu
中文排版
<Leader>p
format file
<Leader>v
show functions and tags
mx
Toggle mark 'x' and display it in the leftmost columndmx
Remove mark 'x' where x is a-zA-Zm,
Place the next available markm<Space>
Delete all marks from the current bufferm<BS>
Remove all markers]'
Jump to start of next line containing a mark['
Jump to start of prev line containing a markm/
Open location list and display marks from current buffer