Skip to content

ctjoy/dotfiles

Repository files navigation

My Dotfiles

Personal shell, Git, and Vim configuration, installed with Dotbot.

Portable defaults live in this repository. Put machine-specific settings in ~/.zshrc.local (or ~/.bashrc.local) and Git-specific settings in ~/.gitconfig_local.

A fresh macOS setup

  1. Install the Command Line Tools: xcode-select --install

  2. Clone this repository to ~/.dotfiles

  3. Install Homebrew: ./install_brew.sh

  4. Link the dotfiles and initialize submodules: ./install

  5. Install the configured development tools, including Worktrunk: ./brew.sh

  6. Set the Git email for this machine (this file is intentionally untracked):

    git config --file ~/.gitconfig_local user.email "you@example.com"

Worktrunk uses the tracked worktrunk.toml configuration. To generate a commit message for staged changes, run git cl.

For daily update

Run dfu, or update manually with:

git pull --ff-only
./install

Shell

.bashrc vs .bash_profile

這兩者的差別在於系統上認定有無登入會選擇其中一種來初始化 bash,不同系統會有不同作法,我的設定是如果系統要 load bash_profile 就把它轉到 bashrc,這樣只要設定好 bashrc 就好,bashrc 和 bash_profile 差別可參考別人的回覆

aliases

  • extract: 解壓縮後面接的檔案
  • mkd: 創建資料夾且進入

color

Vim

好東西

外掛列表

Appearance

Easy editing

Syntax color and indent

指令

以下只記錄自訂指令與外掛指令。

自訂指令

可搭配 vimrc 一起看會比較清楚

<Leader> = ,

  • <Leader>w = :w!
  • jk = <Esc> (跳回 normal mode)
  • 9 = $ (跳到此行的最後一個字)
  • 0 = ^ (跳到此行的第一個字)
  • <Leader>dw: 把白色空白刪掉 (delete whitespace)
windows and buffers

我目前把 buffer 當 tab 在用

  • <C-hjkl> window 上下左右跳
  • <Tab> 跳下一個 buffer
  • <Shift-Tab> 跳上一個 buffer
  • <Leader>t 開一個新的 buffer
  • <Leader>q 關掉目前所在 buffer

外掛指令

t comment

  • <Leader>c 註解選擇的範圍

NerdTree

  • <Leader>n 開關 NerdTree
  • o 在 NerdTree 底下開啟檔案或開關目錄
  • I 顯示隱藏被隱藏的檔案與目錄
  • u 跳到上一個目錄

EasyMotion

  • <Space>f『目標』 用 EasyMotion 找『目標』
  • <Space>w 用 EasyMotion 找字
  • <Space>j 用 EasyMotion 往下面行跳
  • <Space>k 用 EasyMotion 往上面行跳

vim surround

  • ysiw) 在所在字上加 () 號,例如;hello -> (hello) ( yield surround inside word )
  • yss) 在所在行加 () 號
  • S) 在 visual mode 下輸入,可在選取的字旁加 ()

CtrlP

  • ; 開啟 ctrlp 模糊查詢
Once CtrlP is open:
  • 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.

vim gitgutter

  • [c 跳到上一個 hunk
  • ]c 跳到下一個 hunk
  • <Leader>hp preview a hunk's changes
  • <Leader>hs stage a hunk
  • <Leader>hu undo a hunk

gundo

  • <Leader>u 開啟 gundo

Pangu

  • :Pangu 中文排版

vim prettier

  • <Leader>p format file

vim vista

  • <Leader>v show functions and tags

vim signature

  • mx Toggle mark 'x' and display it in the leftmost column
  • dmx Remove mark 'x' where x is a-zA-Z
  • m, Place the next available mark
  • m<Space> Delete all marks from the current buffer
  • m<BS> Remove all markers
  • ]' Jump to start of next line containing a mark
  • [' Jump to start of prev line containing a mark
  • m/ Open location list and display marks from current buffer

Special thanks to

About

my dotfiles

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors