├── .KeyRemap4MacBook
└── private.xml
├── .Xmodmap
├── .Xresources
├── .alacritty.yml
├── .config
└── karabiner
│ └── karabiner.json
├── .gitconfig
├── .gitignore
├── .gitmodules
├── .gvimrc
├── .hammerspoon
└── init.lua
├── .inputrc
├── .oh-my-zsh
└── custom
│ └── extra.zsh
├── .slate
├── .slate.js
├── .teamocil
├── default.yml
└── laptop.yml
├── .tmux-powerlinerc
├── .tmux.conf
├── .tmux
├── mytheme.sh
└── zoom
├── .vim
├── UltiSnips
│ └── all.snippets
├── autoload
│ └── plug.vim
├── ftplugin
│ └── qf.vim
└── snippets
│ ├── _.snip
│ ├── javascript.snip
│ ├── python.snip
│ ├── sawzall.snip
│ ├── sh.snip
│ └── vim.snip
├── .vimrc
├── .vimrc_basic
├── .zprofile
├── .zsh
└── .vimpagerrc
├── .zshenv
├── .zshrc
├── README
├── bin
├── flavor
├── git-branches
├── karabiner-element-switch-profile.py
└── vimdiff-git
├── git
└── templates
│ └── hooks
│ └── pre-commit
├── install.sh
├── iterm
└── com.googlecode.iterm2.plist
├── pure.zsh-theme
└── work.applescript
/.KeyRemap4MacBook/private.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 | F19 to F19
5 | (F19 to Hyper (ctrl+shift+cmd+opt) + F19 Only, send escape)
6 | private.f192f19_escape
7 |
8 | --KeyOverlaidModifier--
9 | KeyCode::F19,
10 | KeyCode::COMMAND_L,
11 | ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L,
12 | KeyCode::ESCAPE
13 |
14 |
15 | -
16 | Use the correct shift keys.
17 | private.correct_shift_keys
18 |
19 | --KeyToKey-- KeyCode::Q, ModifierFlag::SHIFT_L, KeyCode::VK_NONE
20 | --KeyToKey-- KeyCode::W, ModifierFlag::SHIFT_L, KeyCode::VK_NONE
21 | --KeyToKey-- KeyCode::E, ModifierFlag::SHIFT_L, KeyCode::VK_NONE
22 | --KeyToKey-- KeyCode::R, ModifierFlag::SHIFT_L, KeyCode::VK_NONE
23 | --KeyToKey-- KeyCode::T, ModifierFlag::SHIFT_L, KeyCode::VK_NONE
24 | --KeyToKey-- KeyCode::A, ModifierFlag::SHIFT_L, KeyCode::VK_NONE
25 | --KeyToKey-- KeyCode::S, ModifierFlag::SHIFT_L, KeyCode::VK_NONE
26 | --KeyToKey-- KeyCode::D, ModifierFlag::SHIFT_L, KeyCode::VK_NONE
27 | --KeyToKey-- KeyCode::F, ModifierFlag::SHIFT_L, KeyCode::VK_NONE
28 | --KeyToKey-- KeyCode::G, ModifierFlag::SHIFT_L, KeyCode::VK_NONE
29 | --KeyToKey-- KeyCode::Z, ModifierFlag::SHIFT_L, KeyCode::VK_NONE
30 | --KeyToKey-- KeyCode::X, ModifierFlag::SHIFT_L, KeyCode::VK_NONE
31 | --KeyToKey-- KeyCode::C, ModifierFlag::SHIFT_L, KeyCode::VK_NONE
32 | --KeyToKey-- KeyCode::V, ModifierFlag::SHIFT_L, KeyCode::VK_NONE
33 |
34 | --KeyToKey-- KeyCode::Y, ModifierFlag::SHIFT_R, KeyCode::VK_NONE
35 | --KeyToKey-- KeyCode::U, ModifierFlag::SHIFT_R, KeyCode::VK_NONE
36 | --KeyToKey-- KeyCode::I, ModifierFlag::SHIFT_R, KeyCode::VK_NONE
37 | --KeyToKey-- KeyCode::O, ModifierFlag::SHIFT_R, KeyCode::VK_NONE
38 | --KeyToKey-- KeyCode::P, ModifierFlag::SHIFT_R, KeyCode::VK_NONE
39 | --KeyToKey-- KeyCode::H, ModifierFlag::SHIFT_R, KeyCode::VK_NONE
40 | --KeyToKey-- KeyCode::J, ModifierFlag::SHIFT_R, KeyCode::VK_NONE
41 | --KeyToKey-- KeyCode::K, ModifierFlag::SHIFT_R, KeyCode::VK_NONE
42 | --KeyToKey-- KeyCode::L, ModifierFlag::SHIFT_R, KeyCode::VK_NONE
43 | --KeyToKey-- KeyCode::SEMICOLON, ModifierFlag::SHIFT_R, KeyCode::VK_NONE
44 | --KeyToKey-- KeyCode::N, ModifierFlag::SHIFT_R, KeyCode::VK_NONE
45 | --KeyToKey-- KeyCode::M, ModifierFlag::SHIFT_R, KeyCode::VK_NONE
46 | --KeyToKey-- KeyCode::COMMA, ModifierFlag::SHIFT_R, KeyCode::VK_NONE
47 | --KeyToKey-- KeyCode::DOT, ModifierFlag::SHIFT_R, KeyCode::VK_NONE
48 | --KeyToKey-- KeyCode::QUOTE, ModifierFlag::SHIFT_R, KeyCode::VK_NONE
49 |
50 | -
51 | Shifts to Parentheses
52 | Shifts, when pressed alone, type parentheses. When used with other keys they're normal shifts.
53 |
54 | private.shifts_to_parens
55 |
56 |
57 | --KeyOverlaidModifier-- KeyCode::SHIFT_R, ModifierFlag::SHIFT_R | ModifierFlag::NONE, KeyCode::SHIFT_R, KeyCode::KEY_0, ModifierFlag::SHIFT_L
58 | --KeyOverlaidModifier-- KeyCode::SHIFT_L, ModifierFlag::SHIFT_L | ModifierFlag::NONE, KeyCode::SHIFT_L, KeyCode::KEY_9, ModifierFlag::SHIFT_R
59 |
60 |
65 | --KeyToKey-- KeyCode::SHIFT_L, ModifierFlag::SHIFT_R, KeyCode::KEY_0, ModifierFlag::SHIFT_L, KeyCode::KEY_9, ModifierFlag::SHIFT_L
66 | --KeyToKey-- KeyCode::SHIFT_R, ModifierFlag::SHIFT_L, KeyCode::KEY_9, ModifierFlag::SHIFT_L, KeyCode::KEY_0, ModifierFlag::SHIFT_L
67 |
68 |
72 | --KeyToKey-- KeyCode::SPACE, ModifierFlag::SHIFT_R, KeyCode::KEY_0, ModifierFlag::SHIFT_L, KeyCode::SPACE
73 |
74 |
75 |
--------------------------------------------------------------------------------
/.Xmodmap:
--------------------------------------------------------------------------------
1 | ! Both Command and Option act as Alt. Since I'm only using Eclipse through X11
2 | ! at this moment, this suits my need
3 | keycode 63 = Alt_L
4 | keycode 71 = Alt_R
5 | clear mod1
6 | clear mod2
7 | add mod1 = Alt_L
8 | add mod1 = Alt_R
9 |
--------------------------------------------------------------------------------
/.Xresources:
--------------------------------------------------------------------------------
1 | ! Xft*antialias: true
2 | ! Xft*dpi: 96
3 | xterm*utf8: 1
4 | ! xterm*font: -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1
5 | ! xterm*font: -misc-fixed-medium-r-normal-ja-13-120-75-75-c-120-iso10646-1
6 | ! xterm*wideFont: -misc-fixed-medium-r-normal-ja-18-120-100-100-c-180-iso10646-1
7 | xterm*faceName: Ubuntu Mono for Powerline
8 | xterm*faceSize: 12
9 | xterm*termName: xterm-256color
10 | xterm*font: fixed
11 | xterm*boldFont: fixed
12 |
13 | ! xterm ----------------------------------------------------------------------
14 |
15 | xterm*geometry: 80x25
16 | ! xterm*faceName: terminus:bold:pixelsize=14
17 | !xterm*font: -*-dina-medium-r-*-*-16-*-*-*-*-*-*-*
18 | xterm*dynamicColors: true
19 | xterm*utf8: 3
20 | xterm*eightBitInput: true
21 | xterm*saveLines: 512
22 | xterm*scrollKey: true
23 | xterm*scrollTtyOutput: false
24 | xterm*scrollBar: true
25 | xterm*rightScrollBar: true
26 | xterm*jumpScroll: true
27 | xterm*multiScroll: true
28 | xterm*toolBar: false
29 |
30 | ! Molokai theme
31 | *xterm*background: #101010
32 | *xterm*foreground: #d0d0d0
33 | *xterm*cursorColor: #d0d0d0
34 | *xterm*color0: #101010
35 | *xterm*color1: #960050
36 | *xterm*color2: #66aa11
37 | *xterm*color3: #c47f2c
38 | *xterm*color4: #30309b
39 | *xterm*color5: #7e40a5
40 | *xterm*color6: #3579a8
41 | *xterm*color7: #9999aa
42 | *xterm*color8: #303030
43 | *xterm*color9: #ff0090
44 | *xterm*color10: #80ff00
45 | *xterm*color11: #ffba68
46 | *xterm*color12: #5f5fee
47 | *xterm*color13: #bb88dd
48 | *xterm*color14: #4eb4fa
49 | *xterm*color15: #d0d0d0
50 |
51 |
52 |
53 |
54 |
55 | URxvt.depth: 32
56 | URxvt.geometry: 90x30
57 | URxvt.transparent: false
58 | URxvt.fading: 0
59 | ! URxvt.urgentOnBell: true
60 | ! URxvt.visualBell: true
61 | URxvt.loginShell: true
62 | URxvt.saveLines: 50
63 | URxvt.internalBorder: 3
64 | URxvt.lineSpace: 0
65 |
66 | ! Terminal
67 | ! URxvt*termName: xterm-256color
68 | URxvt*termName: rxvt-unicode-256color
69 | URxvt*meta8:False
70 |
71 | ! Fonts
72 | URxvt.allow_bold: true
73 | URxvt*font: xft:Ubuntu Mono for Powerline:size=12
74 | URxvt*imFont: xft:Ubuntu Mono for Powerline:regular:size=12
75 | URxvt*boldFont: xft:Ubuntu Mono for Powerline:bold:size=12
76 | URxvt*italicFont: xft:Ubuntu Mono for Powerline:italic:size=12
77 | URxvt*boldItalicFont: xft:Ubuntu Mono for Powerline:bold:italic:size=12
78 |
79 | ! Fix font space
80 | URxvt*letterSpace: -1
81 |
82 | ! Scrollbar
83 | URxvt.scrollStyle: rxvt
84 | URxvt.scrollBar: false
85 |
86 | ! Perl extensions
87 | URxvt.perl-ext-common: default,matcher
88 | URxvt.matcher.button: 1
89 | URxvt.urlLauncher: firefox
90 |
91 | ! Cursor
92 | URxvt.cursorBlink: true
93 | URxvt.cursorColor: #657b83
94 | URxvt.cursorUnderline: false
95 |
96 | ! Pointer
97 | URxvt.pointerBlank: true
98 |
99 | !Source http://github.com/altercation/solarized
100 |
101 | ! *background: #002b36
102 | ! *foreground: #657b83
103 | ! !!*fading: 40
104 | ! *fadeColor: #002b36
105 | ! *cursorColor: #93a1a1
106 | ! *pointerColorBackground: #586e75
107 | ! *pointerColorForeground: #93a1a1
108 |
109 | ! !! black dark/light
110 | ! *color0: #073642
111 | ! *color8: #002b36
112 |
113 | ! !! red dark/light
114 | ! *color1: #dc322f
115 | ! *color9: #cb4b16
116 |
117 | ! !! green dark/light
118 | ! *color2: #859900
119 | ! *color10: #586e75
120 |
121 | ! !! yellow dark/light
122 | ! *color3: #b58900
123 | ! *color11: #657b83
124 |
125 | ! !! blue dark/light
126 | ! *color4: #268bd2
127 | ! *color12: #839496
128 |
129 | ! !! magenta dark/light
130 | ! *color5: #d33682
131 | ! *color13: #6c71c4
132 |
133 | ! !! cyan dark/light
134 | ! *color6: #2aa198
135 | ! *color14: #93a1a1
136 |
137 | ! !! white dark/light
138 | ! *color7: #eee8d5
139 | ! *color15: #fdf6e3
140 |
--------------------------------------------------------------------------------
/.alacritty.yml:
--------------------------------------------------------------------------------
1 | # Configuration for Alacritty, the GPU enhanced terminal emulator
2 |
3 | # The FreeType rasterizer needs to know the device DPI for best results
4 | # (changes require restart)
5 | dpi:
6 | x: 96.0
7 | y: 96.0
8 |
9 | # Display tabs using this many cells (changes require restart)
10 | tabspaces: 8
11 |
12 | # When true, bold text is drawn using the bright variant of colors.
13 | draw_bold_text_with_bright_colors: true
14 |
15 | # Font configuration (changes require restart)
16 | font:
17 | # The normal (roman) font face to use.
18 | normal:
19 | # family: "Source Code Pro"
20 | # family: "Hack"
21 | family: "Iosevka"
22 | # family: "Input Mono"
23 | # family: "Droid Sans Mono Slashed for Powerline"
24 | # family: "Menlo"
25 | # Style can be specified to pick a specific face.
26 | # style: "weight=Regular"
27 |
28 | # The bold font face
29 | bold:
30 | family: "Droid Sans Mono Slashed for Powerline"
31 | # Style can be specified to pick a specific face.
32 | # style: Bold
33 |
34 | # The italic font face
35 | italic:
36 | family: "Droid Sans Mono Slashed for Powerline"
37 | # Style can be specified to pick a specific face.
38 | # style: Italic
39 |
40 | # Point size of the font
41 | size: 14.0
42 | # Offset is the extra space around each character. offset.y can be thought of
43 | # as modifying the linespacing, and offset.x as modifying the letter spacing.
44 | offset:
45 | x: 0.0
46 | y: 0.0
47 |
48 | # OS X only: use thin stroke font rendering. Thin strokes are suitable
49 | # for retina displays, but for non-retina you probably want this set to
50 | # false.
51 | use_thin_strokes: true
52 |
53 | # Should display the render timer
54 | render_timer: false
55 |
56 | # Colors (Tomorrow Night Bright)
57 | colors:
58 | # Default colors
59 | primary:
60 | background: '0x000000'
61 | foreground: '0xeaeaea'
62 |
63 | # Normal colors
64 | normal:
65 | black: '0x000000'
66 | red: '0xd54e53'
67 | green: '0xb9ca4a'
68 | yellow: '0xe6c547'
69 | blue: '0x7aa6da'
70 | magenta: '0xc397d8'
71 | cyan: '0x70c0ba'
72 | white: '0xc5c8c6'
73 |
74 | # Bright colors
75 | bright:
76 | black: '0x666666'
77 | red: '0xff3334'
78 | green: '0x9ec400'
79 | yellow: '0xe7c547'
80 | blue: '0x7aa6da'
81 | magenta: '0xb77ee0'
82 | cyan: '0x54ced6'
83 | white: '0x2a2a2a'
84 |
85 | visual_bell:
86 | animation: EaseOutExpo
87 | duration: 0
88 | # Colors (Solarized Dark)
89 | # colors:
90 | # # Default colors
91 | # primary:
92 | # background: '0x002b36'
93 | # foreground: '0x839496'
94 | #
95 | # # Normal colors
96 | # normal:
97 | # black: '0x073642'
98 | # red: '0xdc322f'
99 | # green: '0x859900'
100 | # yellow: '0xb58900'
101 | # blue: '0x268bd2'
102 | # magenta: '0xd33682'
103 | # cyan: '0x2aa198'
104 | # white: '0xeee8d5'
105 | #
106 | # # Bright colors
107 | # bright:
108 | # black: '0x002b36'
109 | # red: '0xcb4b16'
110 | # green: '0x586e75'
111 | # yellow: '0x657b83'
112 | # blue: '0x839496'
113 | # magenta: '0x6c71c4'
114 | # cyan: '0x93a1a1'
115 | # white: '0xfdf6e3'
116 |
117 | # Key bindings
118 | #
119 | # Each binding is defined as an object with some properties. Most of the
120 | # properties are optional. All of the alphabetical keys should have a letter for
121 | # the `key` value such as `V`. Function keys are probably what you would expect
122 | # as well (F1, F2, ..). The number keys above the main keyboard are encoded as
123 | # `Key1`, `Key2`, etc. Keys on the number pad are encoded `Number1`, `Number2`,
124 | # etc. These all match the glutin::VirtualKeyCode variants.
125 | #
126 | # Possible values for `mods`
127 | # `Command`, `Super` refer to the super/command/windows key
128 | # `Control` for the control key
129 | # `Shift` for the Shift key
130 | # `Alt` and `Option` refer to alt/option
131 | #
132 | # mods may be combined with a `|`. For example, requiring control and shift
133 | # looks like:
134 | #
135 | # mods: Control|Shift
136 | #
137 | # The parser is currently quite sensitive to whitespace and capitalization -
138 | # capitalization must match exactly, and piped items must not have whitespace
139 | # around them.
140 | #
141 | # Either an `action` or `chars` field must be present. `chars` writes the
142 | # specified string every time that binding is activated. These should generally
143 | # be escape sequences, but they can be configured to send arbitrary strings of
144 | # bytes. Possible values of `action` include `Paste` and `PasteSelection`.
145 | key_bindings:
146 | - { key: V, mods: Command, action: Paste }
147 | - { key: C, mods: Command, action: Copy }
148 | - { key: Home, chars: "\x1b[H", mode: ~AppCursor }
149 | - { key: Home, chars: "\x1b[1~", mode: AppCursor }
150 | - { key: End, chars: "\x1b[F", mode: ~AppCursor }
151 | - { key: End, chars: "\x1b[4~", mode: AppCursor }
152 | - { key: PageUp, chars: "\x1b[5~" }
153 | - { key: PageDown, chars: "\x1b[6~" }
154 | - { key: Left, mods: Shift, chars: "\x1b[1;2D" }
155 | - { key: Left, mods: Control, chars: "\x1b[1;5D" }
156 | - { key: Left, mods: Alt, chars: "\x1b[1;3D" }
157 | - { key: Left, chars: "\x1b[D", mode: ~AppCursor }
158 | - { key: Left, chars: "\x1bOD", mode: AppCursor }
159 | - { key: Right, mods: Shift, chars: "\x1b[1;2C" }
160 | - { key: Right, mods: Control, chars: "\x1b[1;5C" }
161 | - { key: Right, mods: Alt, chars: "\x1b[1;3C" }
162 | - { key: Right, chars: "\x1b[C", mode: ~AppCursor }
163 | - { key: Right, chars: "\x1bOC", mode: AppCursor }
164 | - { key: Up, mods: Shift, chars: "\x1b[1;2A" }
165 | - { key: Up, mods: Control, chars: "\x1b[1;5A" }
166 | - { key: Up, mods: Alt, chars: "\x1b[1;3A" }
167 | - { key: Up, chars: "\x1b[A", mode: ~AppCursor }
168 | - { key: Up, chars: "\x1bOA", mode: AppCursor }
169 | - { key: Down, mods: Shift, chars: "\x1b[1;2B" }
170 | - { key: Down, mods: Control, chars: "\x1b[1;5B" }
171 | - { key: Down, mods: Alt, chars: "\x1b[1;3B" }
172 | - { key: Down, chars: "\x1b[B", mode: ~AppCursor }
173 | - { key: Down, chars: "\x1bOB", mode: AppCursor }
174 | - { key: F1, chars: "\x1bOP" }
175 | - { key: F2, chars: "\x1bOQ" }
176 | - { key: F3, chars: "\x1bOR" }
177 | - { key: F4, chars: "\x1bOS" }
178 | - { key: F5, chars: "\x1b[15~" }
179 | - { key: F6, chars: "\x1b[17~" }
180 | - { key: F7, chars: "\x1b[18~" }
181 | - { key: F8, chars: "\x1b[19~" }
182 | - { key: F9, chars: "\x1b[20~" }
183 | - { key: F10, chars: "\x1b[21~" }
184 | - { key: F11, chars: "\x1b[23~" }
185 | - { key: F12, chars: "\x1b[24~" }
186 | - { key: Back, chars: "\x7f" }
187 | - { key: Delete, chars: "\x1b[3~", mode: AppKeypad }
188 | - { key: Delete, chars: "\x1b[P", mode: ~AppKeypad }
189 | - { key: A, mods: Alt, chars: "\x1ba" }
190 | - { key: S, mods: Alt, chars: "\x1bs" }
191 | - { key: W, mods: Alt, chars: "\x1bw" }
192 | - { key: W, mods: Command, chars: "\x1bw" }
193 | - { key: C, mods: Alt, chars: "\x1bc" }
194 | - { key: F, mods: Alt, chars: "\x1bf" }
195 | - { key: J, mods: Alt, chars: "\x1bj" }
196 | - { key: K, mods: Alt, chars: "\x1bk" }
197 | - { key: H, mods: Alt, chars: "\x1bh" }
198 | - { key: L, mods: Alt, chars: "\x1bl" }
199 | - { key: M, mods: Alt, chars: "\x1bm" }
200 | - { key: N, mods: Alt, chars: "\x1bn" }
201 | - { key: R, mods: Alt, chars: "\x1br" }
202 | - { key: P, mods: Alt, chars: "\x1bp" }
203 | - { key: T, mods: Alt, chars: "\x1bt" }
204 | - { key: Backslash, mods: Alt, chars: "\x1b\\" }
205 | - { key: Minus, mods: Alt, chars: "\x1b-" }
206 | - { key: Space, mods: Control, chars: "\x00" }
207 | - { key: Tab, mods: Shift, chars: "\x1b[Z" }
208 |
209 | # Mouse bindings
210 | #
211 | # Currently doesn't support modifiers. Both the `mouse` and `action` fields must
212 | # be specified.
213 | #
214 | # Values for `mouse`:
215 | # - Middle
216 | # - Left
217 | # - Right
218 | # - Numeric identifier such as `5`
219 | #
220 | # Values for `action`:
221 | # - Paste
222 | # - PasteSelection
223 | # - Copy (TODO)
224 | mouse_bindings:
225 | - { mouse: Middle, action: PasteSelection }
226 |
227 |
--------------------------------------------------------------------------------
/.config/karabiner/karabiner.json:
--------------------------------------------------------------------------------
1 | {
2 | "global": {
3 | "check_for_updates_on_startup": true,
4 | "show_in_menu_bar": true,
5 | "show_profile_name_in_menu_bar": false
6 | },
7 | "profiles": [
8 | {
9 | "complex_modifications": {
10 | "parameters": {
11 | "basic.simultaneous_threshold_milliseconds": 50,
12 | "basic.to_delayed_action_delay_milliseconds": 500,
13 | "basic.to_if_alone_timeout_milliseconds": 1000,
14 | "basic.to_if_held_down_threshold_milliseconds": 500
15 | },
16 | "rules": []
17 | },
18 | "devices": [
19 | {
20 | "disable_built_in_keyboard_if_exists": false,
21 | "fn_function_keys": [],
22 | "identifiers": {
23 | "is_keyboard": true,
24 | "is_pointing_device": false,
25 | "product_id": 627,
26 | "vendor_id": 1452
27 | },
28 | "ignore": false,
29 | "manipulate_caps_lock_led": true,
30 | "simple_modifications": []
31 | },
32 | {
33 | "disable_built_in_keyboard_if_exists": false,
34 | "fn_function_keys": [],
35 | "identifiers": {
36 | "is_keyboard": true,
37 | "is_pointing_device": false,
38 | "product_id": 8211,
39 | "vendor_id": 1241
40 | },
41 | "ignore": false,
42 | "manipulate_caps_lock_led": false,
43 | "simple_modifications": []
44 | },
45 | {
46 | "disable_built_in_keyboard_if_exists": false,
47 | "fn_function_keys": [],
48 | "identifiers": {
49 | "is_keyboard": true,
50 | "is_pointing_device": false,
51 | "product_id": 50475,
52 | "vendor_id": 1133
53 | },
54 | "ignore": false,
55 | "manipulate_caps_lock_led": false,
56 | "simple_modifications": []
57 | },
58 | {
59 | "disable_built_in_keyboard_if_exists": false,
60 | "fn_function_keys": [],
61 | "identifiers": {
62 | "is_keyboard": true,
63 | "is_pointing_device": false,
64 | "product_id": 65535,
65 | "vendor_id": 1452
66 | },
67 | "ignore": false,
68 | "manipulate_caps_lock_led": true,
69 | "simple_modifications": []
70 | }
71 | ],
72 | "fn_function_keys": [
73 | {
74 | "from": {
75 | "key_code": "f1"
76 | },
77 | "to": {
78 | "key_code": "vk_consumer_brightness_down"
79 | }
80 | },
81 | {
82 | "from": {
83 | "key_code": "f2"
84 | },
85 | "to": {
86 | "key_code": "vk_consumer_brightness_up"
87 | }
88 | },
89 | {
90 | "from": {
91 | "key_code": "f3"
92 | },
93 | "to": {
94 | "key_code": "vk_mission_control"
95 | }
96 | },
97 | {
98 | "from": {
99 | "key_code": "f4"
100 | },
101 | "to": {
102 | "key_code": "vk_launchpad"
103 | }
104 | },
105 | {
106 | "from": {
107 | "key_code": "f5"
108 | },
109 | "to": {
110 | "key_code": "vk_consumer_illumination_down"
111 | }
112 | },
113 | {
114 | "from": {
115 | "key_code": "f6"
116 | },
117 | "to": {
118 | "key_code": "vk_consumer_illumination_up"
119 | }
120 | },
121 | {
122 | "from": {
123 | "key_code": "f7"
124 | },
125 | "to": {
126 | "key_code": "vk_consumer_previous"
127 | }
128 | },
129 | {
130 | "from": {
131 | "key_code": "f8"
132 | },
133 | "to": {
134 | "key_code": "vk_consumer_play"
135 | }
136 | },
137 | {
138 | "from": {
139 | "key_code": "f9"
140 | },
141 | "to": {
142 | "key_code": "vk_consumer_next"
143 | }
144 | },
145 | {
146 | "from": {
147 | "key_code": "f10"
148 | },
149 | "to": {
150 | "key_code": "mute"
151 | }
152 | },
153 | {
154 | "from": {
155 | "key_code": "f11"
156 | },
157 | "to": {
158 | "key_code": "volume_down"
159 | }
160 | },
161 | {
162 | "from": {
163 | "key_code": "f12"
164 | },
165 | "to": {
166 | "key_code": "volume_up"
167 | }
168 | }
169 | ],
170 | "name": "internal",
171 | "selected": true,
172 | "simple_modifications": [
173 | {
174 | "from": {
175 | "key_code": "caps_lock"
176 | },
177 | "to": {
178 | "key_code": "f18"
179 | }
180 | },
181 | {
182 | "from": {
183 | "key_code": "left_command"
184 | },
185 | "to": {
186 | "key_code": "left_command"
187 | }
188 | },
189 | {
190 | "from": {
191 | "key_code": "left_option"
192 | },
193 | "to": {
194 | "key_code": "left_option"
195 | }
196 | }
197 | ],
198 | "virtual_hid_keyboard": {
199 | "caps_lock_delay_milliseconds": 0,
200 | "country_code": 0,
201 | "keyboard_type": "ansi"
202 | }
203 | },
204 | {
205 | "complex_modifications": {
206 | "parameters": {
207 | "basic.simultaneous_threshold_milliseconds": 50,
208 | "basic.to_delayed_action_delay_milliseconds": 500,
209 | "basic.to_if_alone_timeout_milliseconds": 1000,
210 | "basic.to_if_held_down_threshold_milliseconds": 500
211 | },
212 | "rules": []
213 | },
214 | "devices": [
215 | {
216 | "disable_built_in_keyboard_if_exists": false,
217 | "fn_function_keys": [],
218 | "identifiers": {
219 | "is_keyboard": true,
220 | "is_pointing_device": false,
221 | "product_id": 627,
222 | "vendor_id": 1452
223 | },
224 | "ignore": false,
225 | "manipulate_caps_lock_led": true,
226 | "simple_modifications": []
227 | },
228 | {
229 | "disable_built_in_keyboard_if_exists": false,
230 | "fn_function_keys": [],
231 | "identifiers": {
232 | "is_keyboard": true,
233 | "is_pointing_device": false,
234 | "product_id": 8211,
235 | "vendor_id": 1241
236 | },
237 | "ignore": false,
238 | "manipulate_caps_lock_led": false,
239 | "simple_modifications": []
240 | },
241 | {
242 | "disable_built_in_keyboard_if_exists": false,
243 | "fn_function_keys": [],
244 | "identifiers": {
245 | "is_keyboard": true,
246 | "is_pointing_device": false,
247 | "product_id": 50475,
248 | "vendor_id": 1133
249 | },
250 | "ignore": false,
251 | "manipulate_caps_lock_led": false,
252 | "simple_modifications": []
253 | },
254 | {
255 | "disable_built_in_keyboard_if_exists": false,
256 | "fn_function_keys": [],
257 | "identifiers": {
258 | "is_keyboard": true,
259 | "is_pointing_device": false,
260 | "product_id": 65535,
261 | "vendor_id": 1452
262 | },
263 | "ignore": false,
264 | "manipulate_caps_lock_led": true,
265 | "simple_modifications": []
266 | }
267 | ],
268 | "fn_function_keys": [
269 | {
270 | "from": {
271 | "key_code": "f1"
272 | },
273 | "to": {
274 | "key_code": "vk_consumer_brightness_down"
275 | }
276 | },
277 | {
278 | "from": {
279 | "key_code": "f2"
280 | },
281 | "to": {
282 | "key_code": "vk_consumer_brightness_up"
283 | }
284 | },
285 | {
286 | "from": {
287 | "key_code": "f3"
288 | },
289 | "to": {
290 | "key_code": "vk_mission_control"
291 | }
292 | },
293 | {
294 | "from": {
295 | "key_code": "f4"
296 | },
297 | "to": {
298 | "key_code": "vk_launchpad"
299 | }
300 | },
301 | {
302 | "from": {
303 | "key_code": "f5"
304 | },
305 | "to": {
306 | "key_code": "vk_consumer_illumination_down"
307 | }
308 | },
309 | {
310 | "from": {
311 | "key_code": "f6"
312 | },
313 | "to": {
314 | "key_code": "vk_consumer_illumination_up"
315 | }
316 | },
317 | {
318 | "from": {
319 | "key_code": "f7"
320 | },
321 | "to": {
322 | "key_code": "vk_consumer_previous"
323 | }
324 | },
325 | {
326 | "from": {
327 | "key_code": "f8"
328 | },
329 | "to": {
330 | "key_code": "vk_consumer_play"
331 | }
332 | },
333 | {
334 | "from": {
335 | "key_code": "f9"
336 | },
337 | "to": {
338 | "key_code": "vk_consumer_next"
339 | }
340 | },
341 | {
342 | "from": {
343 | "key_code": "f10"
344 | },
345 | "to": {
346 | "key_code": "mute"
347 | }
348 | },
349 | {
350 | "from": {
351 | "key_code": "f11"
352 | },
353 | "to": {
354 | "key_code": "volume_down"
355 | }
356 | },
357 | {
358 | "from": {
359 | "key_code": "f12"
360 | },
361 | "to": {
362 | "key_code": "volume_up"
363 | }
364 | }
365 | ],
366 | "name": "external",
367 | "selected": false,
368 | "simple_modifications": [
369 | {
370 | "from": {
371 | "key_code": "caps_lock"
372 | },
373 | "to": {
374 | "key_code": "f18"
375 | }
376 | },
377 | {
378 | "from": {
379 | "key_code": "left_command"
380 | },
381 | "to": {
382 | "key_code": "left_option"
383 | }
384 | },
385 | {
386 | "from": {
387 | "key_code": "left_option"
388 | },
389 | "to": {
390 | "key_code": "left_command"
391 | }
392 | }
393 | ],
394 | "virtual_hid_keyboard": {
395 | "caps_lock_delay_milliseconds": 0,
396 | "country_code": 0,
397 | "keyboard_type": "ansi"
398 | }
399 | }
400 | ]
401 | }
402 |
--------------------------------------------------------------------------------
/.gitconfig:
--------------------------------------------------------------------------------
1 | [user]
2 | name = Terry Ma
3 | email = hi@terry.ma
4 | [core]
5 | excludesfile = ~/.gitignore_global
6 | ; vimpager doesn't work very well with some log format, use less
7 | pager = less
8 | [alias]
9 | lg = log --abbrev-commit --decorate --pretty=oneline
10 | dag = log --graph --format='format:%C(yellow)%h%C(reset) %C(blue)\"%an\" <%ae>%C(reset) %C(magenta)%ar%C(reset)%C(auto)%d%C(reset)%n%s' --date-order
11 | [color]
12 | ui = auto
13 | [diff]
14 | tool = myvimdiff
15 | [difftool "myvimdiff"]
16 | cmd = vimdiff \"$REMOTE\" \"$LOCAL\"
17 | [pager]
18 | diff =
19 | ; log = false
20 | [merge]
21 | keepBackup = false
22 | tool = fugitive
23 | [mergetool]
24 | keepBackup = false
25 | keepTemporaries = false
26 | prompt = false
27 | [mergetool "fugitive"]
28 | cmd = vim -f -c \"Gdiff\" \"$MERGED\"
29 | keepTemporaries = false
30 | keepBackup = false
31 | [difftool "sourcetree"]
32 | cmd = opendiff \"$LOCAL\" \"$REMOTE\"
33 | path =
34 | [mergetool "sourcetree"]
35 | cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
36 | trustExitCode = true
37 | [push]
38 | default = simple
39 | [amazon]
40 | append-cr-url = true
41 | pull-request-by-default = false
42 | [credential]
43 | helper = osxkeychain
44 | [filter "lfs"]
45 | clean = git-lfs clean %f
46 | smudge = git-lfs smudge %f
47 | required = true
48 | [init]
49 | templatedir = ~/.git_template
50 | [hub]
51 | protocol = https
52 | [protocol]
53 | version = 2
54 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .VimballRecord
2 | .netrwhist
3 | spell/
4 | tags
5 | .vim/bundle/*
6 | .vim/sessions/*
7 | .vim/plugged/*
8 | .tmux/resurrect/
9 | .tmux/plugins/*
10 | !.tmux/plugins/tpm
11 | .config/configstore/*
12 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule ".tmux/tmux-powerline"]
2 | path = .tmux/tmux-powerline
3 | url = https://github.com/erikw/tmux-powerline.git
4 | ignore = untracked
5 | [submodule ".tmux/tmux-colors-solarized"]
6 | path = .tmux/tmux-colors-solarized
7 | url = https://github.com/seebi/tmux-colors-solarized.git
8 | [submodule ".dircolors-solarized"]
9 | path = .dircolors-solarized
10 | url = https://github.com/seebi/dircolors-solarized.git
11 | [submodule "git-extras"]
12 | path = git-extras
13 | url = https://github.com/visionmedia/git-extras.git
14 | [submodule ".themes/base16-iterm2"]
15 | path = .themes/base16-iterm2
16 | url = https://github.com/chriskempson/base16-iterm2.git
17 | [submodule ".zsh/vimpager"]
18 | path = .zsh/vimpager
19 | url = https://github.com/rkitover/vimpager.git
20 | [submodule ".themes/konsole-tomorrow-theme"]
21 | path = .themes/konsole-tomorrow-theme
22 | url = https://github.com/dram/konsole-tomorrow-theme.git
23 | ignore = dirty
24 | [submodule ".oh-my-zsh/custom/plugins/zsh-syntax-highlighting"]
25 | path = .oh-my-zsh/custom/plugins/zsh-syntax-highlighting
26 | url = https://github.com/zsh-users/zsh-syntax-highlighting.git
27 | [submodule ".fzf"]
28 | path = .fzf
29 | url = https://github.com/junegunn/fzf.git
30 | [submodule ".tmux/plugins/tpm"]
31 | path = .tmux/plugins/tpm
32 | url = https://github.com/tmux-plugins/tpm
33 |
--------------------------------------------------------------------------------
/.gvimrc:
--------------------------------------------------------------------------------
1 | set guifont=Droid\ Sans\ Mono\ Dotted\ for\ Powerline:h12
2 | set guioptions-=r
3 |
4 | " Red cursor
5 | highlight Cursor guibg=red
6 |
7 | inoremap u
8 | nnoremap
9 |
--------------------------------------------------------------------------------
/.hammerspoon/init.lua:
--------------------------------------------------------------------------------
1 | hs.window.animationDuration = 0
2 |
3 | -- A global variable for the Hyper Mode
4 | k = hs.hotkey.modal.new({}, "F17")
5 |
6 | -- Hyper+h: Left half window
7 | k:bind({}, 'h', nil, function()
8 | local win = hs.window.focusedWindow()
9 | local f = win:frame()
10 | local screen = win:screen()
11 | local max = screen:frame()
12 |
13 | f.x = max.x
14 | f.y = max.y
15 | f.w = max.w / 2
16 | f.h = max.h
17 | win:setFrame(f)
18 | k.triggered = true
19 | end)
20 |
21 | -- Hyper+l: Right half window
22 | k:bind({}, 'l', nil, function()
23 |
24 | local win = hs.window.focusedWindow()
25 | local f = win:frame()
26 | local screen = win:screen()
27 | local max = screen:frame()
28 |
29 | f.x = max.x + (max.w / 2)
30 | f.y = max.y
31 | f.w = max.w / 2
32 | f.h = max.h
33 | win:setFrame(f)
34 | k.triggered = true
35 | end)
36 |
37 |
38 | -- Hyper+f: Fullscreen
39 | k:bind({}, 'f', nil, function()
40 | local win = hs.window.focusedWindow()
41 | local f = win:frame()
42 | local screen = win:screen()
43 | local max = screen:frame()
44 |
45 | f.x = max.x
46 | f.y = max.y
47 | f.w = max.w
48 | f.h = max.h
49 | win:setFrame(f)
50 | k.triggered = true
51 | end)
52 |
53 | -- Hyper+a: Focus or launch Alacritty
54 | k:bind({}, 'a', nil, function()
55 | local name = 'Alacritty'
56 | local app = hs.application.get(name)
57 | if app then
58 | app:activate()
59 | else
60 | hs.application.open(name)
61 | end
62 | k.triggered = true
63 | end)
64 |
65 | -- Hyper+c: Focus or launch Chrome
66 | k:bind({}, 'c', nil, function()
67 | local name = 'Google Chrome'
68 | local app = hs.application.get(name)
69 | if app then
70 | app:activate()
71 | else
72 | hs.application.open(name)
73 | end
74 | k.triggered = true
75 | end)
76 |
77 | -- Hyper+q: Focus or launch VSCode
78 | k:bind({}, 'q', nil, function()
79 | local name = 'Code'
80 | local app = hs.application.get(name)
81 | if app then
82 | app:activate()
83 | else
84 | hs.application.open(name)
85 | end
86 | k.triggered = true
87 | end)
88 |
89 |
90 | -- Hyper+c: Focus or launch Trello
91 | k:bind({}, 't', nil, function()
92 | local name = 'Trello'
93 | local app = hs.application.get(name)
94 | if app then
95 | app:activate()
96 | else
97 | hs.application.open(name)
98 | end
99 | k.triggered = true
100 | end)
101 |
102 | -- Hyper+s: Focus or launch Slack
103 | k:bind({}, 's', nil, function()
104 | local name = 'Slack'
105 | local app = hs.application.get(name)
106 | if app then
107 | app:activate()
108 | else
109 | hs.application.open(name)
110 | end
111 | k.triggered = true
112 | end)
113 |
114 |
115 | -- Hyper+delete: Screensaver
116 | k:bind({}, 'delete', nil, function()
117 | hs.caffeinate.startScreensaver()
118 | end)
119 |
120 |
121 | -- Enter Hyper Mode when F18 (Hyper/Capslock) is pressed
122 | pressedF18 = function()
123 | k.triggered = false
124 | k:enter()
125 | end
126 |
127 | -- Leave Hyper Mode when F18 (Hyper/Capslock) is pressed,
128 | -- send ESCAPE if no other keys are pressed.
129 | releasedF18 = function()
130 | k:exit()
131 | if not k.triggered then
132 | hs.eventtap.keyStroke({}, 'ESCAPE')
133 | end
134 | end
135 |
136 | -- Bind the Hyper key
137 | f18 = hs.hotkey.bind({}, 'F18', pressedF18, releasedF18)
138 |
139 | -- Reload config when any lua file in config directory changes
140 | function reloadConfig(files)
141 | doReload = false
142 | for _,file in pairs(files) do
143 | if file:sub(-4) == '.lua' then
144 | doReload = true
145 | end
146 | end
147 | if doReload then
148 | hs.reload()
149 | end
150 | end
151 | local myWatcher = hs.pathwatcher.new(os.getenv('HOME') .. '/.hammerspoon/', reloadConfig):start()
152 | hs.alert.show('Config loaded')
153 |
154 | -- Detect external keyboard
155 | local usbWatcher = nil
156 | local externalKeyboardName = "daskeyboard"
157 |
158 | function usbDeviceCallback(data)
159 | if (data["productName"] == externalKeyboardName) then
160 | if (data["eventType"] == "added") then
161 | hs.execute('~/.dotfiles/bin/karabiner-element-switch-profile.py external')
162 | hs.notify.new({title="Hammerspoon", informativeText="Switched to external keyboard profile for Karabiner-Element"}):send()
163 | elseif (data["eventType"] == "removed") then
164 | hs.execute('~/.dotfiles/bin/karabiner-element-switch-profile.py internal')
165 | hs.notify.new({title="Hammerspoon", informativeText="Switched to internal keyboard profile for Karabiner-Element"}):send()
166 | end
167 | end
168 | end
169 |
170 | usbWatcher = hs.usb.watcher.new(usbDeviceCallback)
171 | usbWatcher:start()
172 |
--------------------------------------------------------------------------------
/.inputrc:
--------------------------------------------------------------------------------
1 | set editing-mode emacs
2 | "\C-w": backward-kill-word
3 | "\C-e": end-of-line
4 | "\C-r": reverse-search-history
5 | "\C-t": set-mark
6 | "\C-y": copy-region-as-kill
7 | "\C-u": unix-line-discard
8 | "\C-o": kill-line
9 | "\C-a": beginning-of-line
10 | "\C-s": forward-search-history
11 | "\C-d": kill-word
12 | "\C-f": backward-char
13 | "\C-g": forward-char
14 | "\C-h": backward-word
15 | "\C-j": next-history
16 | "\C-k": previous-history
17 | "\C-l": forward-word
18 | "\C-v": yank
19 | "\C-n": clear-screen
20 | "\C-_": undo
21 | # In iTerm, sends Alt-d
22 | "d": backward-kill-word
23 |
--------------------------------------------------------------------------------
/.oh-my-zsh/custom/extra.zsh:
--------------------------------------------------------------------------------
1 | # Fix the annoying autocomplete freeze
2 | setopt NO_cdable_vars
3 |
--------------------------------------------------------------------------------
/.slate:
--------------------------------------------------------------------------------
1 | # Configs
2 | config defaultToCurrentScreen true
3 | config windowHintsShowIcons true
4 | config windowHintsIgnoreHiddenWindows false
5 | config windowHintsSpread true
6 |
7 | # Monitor Aliases
8 | alias mon-retina 1920x1200
9 | alias mon-30in 2560x1600
10 |
11 | # alias: create alias variables
12 | alias full move screenOriginX;screenOriginY screenSizeX;screenSizeY
13 | alias lefthalf move screenOriginX;screenOriginY screenSizeX/2;screenSizeY
14 | alias righthalf move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY
15 | alias topleft corner top-left resize:screenSizeX/2;screenSizeY/2
16 | alias topright corner top-right resize:screenSizeX/2;screenSizeY/2
17 | alias bottomleft corner bottom-left resize:screenSizeX/2;screenSizeY/2
18 | alias bottomright corner bottom-right resize:screenSizeX/2;screenSizeY/2
19 | alias contact-list corner top-right
20 | alias chat-window corner bottom-left resize:screenSizeX/4;screenSizeY/2
21 |
22 | # Layout when using a single monitor
23 | layout 1monitor 'iTerm':REPEAT ${righthalf}
24 | layout 1monitor 'Google Chrome':REPEAT ${lefthalf}
25 | layout 1monitor 'Adium':IGNORE_FAIL,TITLE_ORDER_REGEX=Contacts ${contact-list} | ${chat-window}
26 | layout 1monitor 'nvALT':REPEAT ${righthalf}
27 |
28 | # Default Layouts
29 | default 1monitor resolutions:${mon-retina}
30 | default 1monitor resolutions:${mon-30in}
31 |
32 | ###############################################################################
33 | # Key Bindings
34 | ###############################################################################
35 |
36 | # Hyper key
37 | alias hyper ctrl;shift;alt;cmd
38 |
39 | # Super key
40 | alias super ctrl;alt;cmd
41 |
42 | # Hyper+w: Activate windows hint
43 | bind w:${hyper} hint asdfghjkl;'
44 |
45 | bind r:${hyper} relaunch
46 |
47 | # Hyper+h: Move window to left half
48 | bind h:${hyper} ${lefthalf}
49 | bind left:${super} ${lefthalf}
50 |
51 | # Hyper+j: Move focus left
52 | bind j:${hyper} focus left
53 |
54 | # Hyper+k: Move focus right
55 | bind k:${hyper} focus right
56 |
57 | # Hyper+l: Move window to right half
58 | bind l:${hyper} ${righthalf}
59 | bind right:${super} ${righthalf}
60 |
61 | # Hyper+f: Move window full screen
62 | bind f:${hyper} ${full}
63 | bind up:${super} ${full}
64 |
65 | # Application switcher
66 | bind b:${hyper} focus 'Google Chrome'
67 | bind g:${hyper} focus 'Google Chrome'
68 | bind t:${hyper} focus 'iTerm'
69 | bind return:${hyper} focus 'iTerm'
70 | bind e:${hyper} focus 'Eclipse'
71 | bind o:${hyper} focus 'Microsoft Outlook'
72 | # bind tab:cmd switch
73 | # Hyper+n: Switches to personal notes in nvAlt, mapped in nvAlt itself
74 | # Hyper+m: Switches to work notes in nvAlt, mapped in nvAlt itself
75 |
76 | # Hyper+Enter: Reset the default layout and focus Chrome and iTerm
77 | # bind return:${hyper} sequence layout 1monitor | focus 'Google Chrome' | focus 'iTerm'
78 |
79 | # source: load configs from another file
80 |
--------------------------------------------------------------------------------
/.slate.js:
--------------------------------------------------------------------------------
1 | slate.bind("tab:ctrl;shift;alt;cmd", function(win) {
2 | var appName = win.app().name();
3 | if (appName === "iTerm2") {
4 | win.doOperation(slate.operation("focus", {"app": "Google Chrome"}));
5 | } else {
6 | win.doOperation(slate.operation("focus", {"app": "iTerm2"}));
7 | }
8 | });
9 | slate.log("[SLATE] -------------- Finished Loading Config --------------");
10 |
--------------------------------------------------------------------------------
/.teamocil/default.yml:
--------------------------------------------------------------------------------
1 | session:
2 | name: "work"
3 | windows:
4 | - name: "chat"
5 | clear: true
6 | splits:
7 | - cmd: "weechat-curses"
8 | - name: "vim"
9 | clear: true
10 | splits:
11 | - cmd: "vim"
12 | - name: "git5"
13 | clear: true
14 | root: "~/git5"
15 | splits:
16 | - cmd: "l"
17 |
--------------------------------------------------------------------------------
/.teamocil/laptop.yml:
--------------------------------------------------------------------------------
1 | session:
2 | name: "laptop"
3 | windows:
4 | - name: "personal notes"
5 | clear: true
6 | splits:
7 | - cmd: "vim -c 'UniteSessionLoad personal-notes' -c 'let g:start_session_from_cmdline = 1'"
8 | - name: "work notes"
9 | clear: true
10 | splits:
11 | - cmd: "vim -c 'UniteSessionLoad work-notes' -c 'let g:start_session_from_cmdline = 1'"
12 | - name: "scratch"
13 | clear: true
14 | splits:
15 | - cmd: "date"
16 |
--------------------------------------------------------------------------------
/.tmux-powerlinerc:
--------------------------------------------------------------------------------
1 | # Default configuration file for tmux-powerline.
2 | # Modeline {
3 | # vi: foldmarker={,} foldmethod=marker foldlevel=0 tabstop=4 filetype=sh
4 | # }
5 |
6 | # General {
7 | # Show which segment fails and its exit code.
8 | export TMUX_POWERLINE_DEBUG_MODE_ENABLED="false"
9 | # Use patched font symbols.
10 | export TMUX_POWERLINE_PATCHED_FONT_IN_USE="true"
11 | # The theme to use.
12 | export TMUX_POWERLINE_THEME="mytheme"
13 | # Overlay dirctory to look for themes. There you can put your own themes outside the repo. Fallback will still be the "themes" directory in the repo.
14 | export TMUX_POWERLINE_DIR_USER_THEMES="~/.dotfiles/.tmux/"
15 | # Overlay dirctory to look for segments. There you can put your own segments outside the repo. Fallback will still be the "segments" directory in the repo.
16 | export TMUX_POWERLINE_DIR_USER_SEGMENTS=""
17 | # }
18 |
19 | # battery.sh {
20 | # How to display battery remaining. Can be {percentage, cute}.
21 | export TMUX_POWERLINE_SEG_BATTERY_TYPE="percentage"
22 | # How may hearts to show if cute indicators are used.
23 | export TMUX_POWERLINE_SEG_BATTERY_NUM_HEARTS="5"
24 | # }
25 |
26 | # date.sh {
27 | # date(1) format for the date. If you don't, for some reason like ISO 8601 format, you might want to have "%D" or "%m/%d/%Y".
28 | export TMUX_POWERLINE_SEG_DATE_FORMAT="%F"
29 | # }
30 |
31 | # earthquake.sh {
32 | # The data provider to use. Currently only "goo" is supported.
33 | export TMUX_POWERLINE_SEG_EARTHQUAKE_DATA_PROVIDER="goo"
34 | # How often to update the earthquake data in seconds.
35 | # Note: This is not an early warning detector, use this
36 | # to be informed about recent earthquake magnitudes in your
37 | # area. If this is too often, goo may decide to ban you form
38 | # their server
39 | export TMUX_POWERLINE_SEG_EARTHQUAKE_UPDATE_PERIOD="600"
40 | # Only display information when earthquakes are within this many minutes
41 | export TMUX_POWERLINE_SEG_EARTHQUAKE_ALERT_TIME_WINDOW="60"
42 | # Display time with this format
43 | export TMUX_POWERLINE_SEG_EARTHQUAKE_TIME_FORMAT='(%H:%M)'
44 | # Display only if magnitude is greater or equal to this number
45 | export TMUX_POWERLINE_SEG_EARTHQUAKE_MIN_MAGNITUDE="3"
46 | # }
47 |
48 | # hostname.sh {
49 | # Use short or long format for the hostname. Can be "short, long"
50 | export TMUX_POWERLINE_SEG_HOSTNAME_FORMAT="short"
51 | # }
52 |
53 | # mailcount.sh {
54 | # Mailbox type to use. Can be any of {apple_mail, gmail, maildir, mbox}
55 | export TMUX_POWERLINE_SEG_MAILCOUNT_MAILBOX_TYPE=""
56 |
57 | ## Gmail
58 | # Enter your Gmail username here WITH OUT @gmail.com.( OR @domain)
59 | export TMUX_POWERLINE_SEG_MAILCOUNT_GMAIL_USERNAME=""
60 | # Google password. Recomenned to use application specific password (https://accounts.google.com/b/0/IssuedAuthSubTokens) Leave this empty to get password from OS X keychain.
61 | # For OSX users : MAKE SURE that you add a key to the keychain in the format as follows
62 | # Keychain Item name : http://
63 | # Account name : @
64 | # Password : Your password ( Once again, try to use 2 step-verification and application-specific password)
65 | # See http://support.google.com/accounts/bin/answer.py?hl=en&answer=185833 for more info.
66 | export TMUX_POWERLINE_SEG_MAILCOUNT_GMAIL_PASSWORD=""
67 | # Domain name that will complete your email. For normal GMail users it probably is "gmail.com but can be "foo.tld" for Google Apps users.
68 | export TMUX_POWERLINE_SEG_MAILCOUNT_GMAIL_SERVER="gmail.com"
69 | # How often in minutes to check for new mails.
70 | export TMUX_POWERLINE_SEG_MAILCOUNT_GMAIL_INTERVAL="5"
71 |
72 | ## Maildir
73 | # Path to the maildir to check.
74 | export TMUX_POWERLINE_SEG_MAILCOUNT_MAILDIR_INBOX="/usr/local/google/home/terryma/.mail/inbox/new"
75 |
76 | ## mbox
77 | # Path to the mbox to check.
78 | export TMUX_POWERLINE_SEG_MAILCOUNT_MBOX_INBOX="/dev/null"
79 | # }
80 |
81 | # now_playing.sh {
82 | # Music player to use. Can be any of {audacious, banshee, cmus, itunes, lastfm, mocp, mpd, mpd_simple, rdio, rhythmbox, spotify, spotify_wine}.
83 | export TMUX_POWERLINE_SEG_NOW_PLAYING_MUSIC_PLAYER=""
84 | # Maximum output length.
85 | export TMUX_POWERLINE_SEG_NOW_PLAYING_MAX_LEN="40"
86 | # How to handle too long strings. Can be {trim, roll}.
87 | export TMUX_POWERLINE_SEG_NOW_PLAYING_TRIM_METHOD="trim"
88 | # Charcters per second to roll if rolling trim method is used.
89 | export TMUX_POWERLINE_SEG_NOW_PLAYING_ROLL_SPEED="2"
90 |
91 | # Hostname for MPD server in the format "[password@]host"
92 | export TMUX_POWERLINE_SEG_NOW_PLAYING_MPD_HOST="localhost"
93 | # Port the MPD server is running on.
94 | export TMUX_POWERLINE_SEG_NOW_PLAYING_MPD_PORT="6600"
95 |
96 | # Username for Last.fm if that music player is used.
97 | export TMUX_POWERLINE_SEG_NOW_PLAYING_LASTFM_USERNAME=""
98 | # How often in seconds to update the data from last.fm.
99 | export TMUX_POWERLINE_SEG_NOW_PLAYING_LASTFM_UPDATE_PERIOD="30"
100 | # }
101 |
102 | # pwd.sh {
103 | # Maximum length of output.
104 | export TMUX_POWERLINE_SEG_PWD_MAX_LEN="40"
105 | # }
106 |
107 | # time.sh {
108 | # date(1) format for the time. Americans might want to have "%I:%M %p".
109 | export TMUX_POWERLINE_SEG_TIME_FORMAT="%H:%M"
110 | # }
111 |
112 | # weather.sh {
113 | # The data provider to use. Currently only "yahoo" is supported.
114 | export TMUX_POWERLINE_SEG_WEATHER_DATA_PROVIDER="yahoo"
115 | # What unit to use. Can be any of {c,f,k}.
116 | export TMUX_POWERLINE_SEG_WEATHER_UNIT="c"
117 | # How often to update the weather in seconds.
118 | export TMUX_POWERLINE_SEG_WEATHER_UPDATE_PERIOD="600"
119 |
120 | # Your location. Find a code that works for you:
121 | # 1. Go to Yahoo weather http://weather.yahoo.com/
122 | # 2. Find the weather for you location
123 | # 3. Copy the last numbers in that URL. e.g. "http://weather.yahoo.com/united-states/california/newport-beach-12796587/" has the numbers "12796587"
124 | export TMUX_POWERLINE_SEG_WEATHER_LOCATION=""
125 | # }
126 |
--------------------------------------------------------------------------------
/.tmux.conf:
--------------------------------------------------------------------------------
1 | # Unbind all keys
2 | unbind-key -a
3 |
4 | # Set the terminal type so colors get rendered correctly
5 | set -g default-terminal "screen-256color"
6 |
7 | set -g default-shell "/usr/local/bin/zsh"
8 | set -g default-command "zsh"
9 | # set -g default-command "reattach-to-user-namespace -l ${SHELL}"
10 | set -g renumber-windows on
11 |
12 | # Powerline settings
13 | set -g status on
14 | set -g status-interval 2
15 | set -g status-justify "centre"
16 | set -g status-left-length 100
17 | set -g status-right-length 100
18 | set -g status-left "#(~/.dotfiles/.tmux/tmux-powerline/powerline.sh left)"
19 | set -g status-right "#(~/.dotfiles/.tmux/tmux-powerline/powerline.sh right)"
20 | set -g status-bg colour235
21 | set -g status-fg colour255
22 | setw -g window-status-current-format "#[fg=colour235, bg=colour27]#[fg=colour255, bg=colour27] #I #W #[fg=colour27, bg=colour235]"
23 | # ""
24 |
25 | # Set inactive/active window styles
26 | # set -g -u window-style 'fg=236,bg=colour236'
27 | set -g -u window-style
28 | # set -g window-style 'fg=colour248,bg=colour235'
29 | set -g -u window-active-style
30 | set -g window-active-style 'bg=colour235'
31 | # set -g window-active-style 'fg=white,bg=black'
32 |
33 | # Set the pane border colors
34 | # set -g pane-border-fg colour250
35 | # set -g pane-border-bg colour236
36 | set -g -u pane-border-style
37 | set -g -u pane-active-border-style
38 | # set -g pane-active-border-fg white
39 | # set -g pane-border-style "fg=white,bg=white"
40 | # set -g pane-active-border-style "fg=white,bg=white"
41 |
42 | # set -g pane-active-border-bg colour220
43 | set -g -u pane-active-border-style
44 | # set -g -u pane-border-style
45 |
46 | # History setting
47 | set -g history-limit 100000
48 |
49 | # Make switching to cmd mode in zsh quick!
50 | # set -s escape-time 0
51 | set -s escape-time 10
52 |
53 | # tmux messages are displayed for 4 seconds
54 | set -g display-time 4000
55 |
56 | # focus events enabled for terminals that support them
57 | # set -g focus-events on
58 |
59 | set -g status-keys emacs
60 | # vi-style controls in copy mode
61 | setw -g mode-keys vi
62 |
63 | # Turn on aggressive resize
64 | # setw -g aggressive-resize on
65 |
66 | # Set the prefix key to Ctrl-z
67 | set -g prefix C-z
68 |
69 | # Start pane numbering at 1
70 | set -g base-index 1
71 |
72 | # Load the solarized color theme
73 | # source ~/.dotfiles/.tmux/tmux-colors-solarized/tmuxcolors-256.conf
74 |
75 | # Sane scrolling
76 | # set -g terminal-overrides 'xterm*:smcup@:rmcup@'
77 | # set -g terminal-overrides '\*:smcup@:rmcup@'
78 |
79 | # Set window notifications
80 | set -g visual-activity on
81 | setw -g monitor-activity on
82 | ############################### KEY BINDINGS ##################################
83 |
84 | # Ctrl-R: Reload tmux config
85 | bind r source-file ~/.tmux.conf \; display 'Config reloaded'
86 |
87 | # Ctrl-[HJKL]: Switch panes
88 | bind C-H select-pane -L
89 | bind C-L select-pane -R
90 | bind C-J select-pane -D
91 | bind C-K select-pane -U
92 |
93 | # Ctrl-Z: Switch to last pane
94 | bind C-Z last-pane
95 |
96 | # Ctrl-O: Rotate pane
97 | bind C-O rotate-window
98 |
99 | # Ctrl-B: Break pane
100 | bind C-B break-pane
101 |
102 | # Ctrl-P: Next layout
103 | bind C-P next-layout
104 |
105 | # Ctrl-Q: Detach
106 | bind C-Q detach-client
107 |
108 | # Ctrl-0: Clock!
109 | bind 0 clock-mode
110 |
111 | # ;: Command prompt
112 | bind \; command-prompt
113 |
114 | # /: List keys
115 | # bind / list-keys
116 |
117 | # Alt-Arrow: Resize panes
118 | bind -n M-Left resize-pane -L 5
119 | bind -n M-Right resize-pane -R 5
120 | bind -n M-Up resize-pane -U 5
121 | bind -n M-Down resize-pane -D 5
122 |
123 | # PageUp
124 | bind -n Pageup copy-mode -u
125 |
126 | # Alt keys generally deal with windows and sessions
127 |
128 | # Alt-h: Previous window
129 | bind -n M-h prev
130 | bind -n M-H prev
131 | # Alt-l: Next window
132 | bind -n M-l next
133 | bind -n M-L next
134 | # Alt-n: New window
135 | bind -n M-n new-window -c "#{pane_current_path}"
136 | # Alt-t: New session
137 | bind -n M-t command-prompt "new-session -s '%%'"
138 | # Alt-p: Choose session. Use fzf
139 | bind -n M-p new-window 'session=$(tmux list-sessions -F "#{session_name}" | fzf --query="$1" --select-1 --exit-0) && tmux switch-client -t "$session"'
140 |
141 | # Alt-[: Switch to previous session
142 | # bind -n M-[ switch-client -p \; refresh-client -S
143 | # Alt-]: Switch to next session
144 | # bind -n M-] switch-client -n \; refresh-client -S
145 | # Alt-m: Zoom window and back
146 | bind -n M-m resize-pane -Z \; display 'Zoom zoom zoom!'
147 | # Alt-b: Break pane
148 | bind -n M-b break-pane
149 | # Alt-r: Rename window
150 | bind -n M-r command-prompt -I "#W" "rename-window '%%'"
151 | # Alt-Shift-r: Rename session
152 | bind -n M-R command-prompt -I "#S" "rename-session '%%'"
153 | # Alt-[1-9]: Switch to window
154 | bind -n M-1 select-window -t :1
155 | bind -n M-2 select-window -t :2
156 | bind -n M-3 select-window -t :3
157 | bind -n M-4 select-window -t :4
158 | bind -n M-5 select-window -t :5
159 | bind -n M-6 select-window -t :6
160 | bind -n M-7 select-window -t :7
161 | bind -n M-8 select-window -t :8
162 | bind -n M-9 select-window -t :9
163 | # Alt-q: Choose last session
164 | bind -n M-q switch-client -l \; refresh-client -S
165 | # Alt-w: Close pane
166 | bind -n M-w kill-pane
167 | # Alt-\: Split veritically
168 | bind -n M-\ split-window -h -c "#{pane_current_path}"
169 | # Alt--: Split horizontally
170 | bind -n M-- split-window -v -c "#{pane_current_path}"
171 | # Alt-c: Copy mode
172 | bind -n M-c copy-mode
173 | # Alt-f: Copy mode and search up
174 | bind -n M-f copy-mode \; send-keys ?
175 | # Alt-0: Display panes
176 | bind -n M-0 display-panes
177 |
178 | # Ctrl-Shift-Left/Right: Move window
179 | bind-key -n C-S-Left swap-window -t -1
180 | bind-key -n C-S-Right swap-window -t +1
181 |
182 | # Copy mode behaves more like vim
183 | # bind -t vi-copy v begin-selection
184 | bind-key -Tcopy-mode-vi 'v' send -X begin-selection
185 | # bind -t vi-copy V rectangle-toggle
186 |
187 | # Mouse mode
188 | set -g mouse on
189 | bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
190 | bind -n WheelDownPane select-pane -t= \; send-keys -M
191 | # This allows me to change the selection and press 'y' to copy if I wish
192 | # unbind -t vi-copy MouseDragEnd1Pane
193 | # bind-key -t vi-copy MouseDragEnd1Pane copy-selection -x
194 | # bind -t vi-copy MouseDragEnd1Pane copy-pipe "reattach-to-user-namespace pbcopy"
195 |
196 | setw -g xterm-keys on
197 |
198 | # Bind [ and ] to some common used layout
199 | bind [ select-layout even-horizontal
200 | bind ] select-layout even-vertical
201 |
202 | # List of plugins
203 | set -g @plugin 'tmux-plugins/tpm'
204 | # set -g @plugin 'tmux-plugins/tmux-resurrect'
205 | # set -g @plugin 'tmux-plugins/tmux-continuum'
206 | set -g @plugin 'tmux-plugins/tmux-yank'
207 | set -g @plugin 'tmux-plugins/tmux-open'
208 | set -g @plugin 'tmux-plugins/tmux-copycat'
209 | set -g @plugin 'Morantron/tmux-fingers'
210 |
211 | set -g @fingers-compact-hints 0
212 | set -g @fingers-key C-f
213 |
214 |
215 | # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
216 | run '~/.tmux/plugins/tpm/tpm'
217 |
--------------------------------------------------------------------------------
/.tmux/mytheme.sh:
--------------------------------------------------------------------------------
1 | # Default Theme
2 |
3 | if patched_font_in_use; then
4 | TMUX_POWERLINE_SEPARATOR_LEFT_BOLD=""
5 | TMUX_POWERLINE_SEPARATOR_LEFT_THIN=""
6 | TMUX_POWERLINE_SEPARATOR_RIGHT_BOLD=""
7 | TMUX_POWERLINE_SEPARATOR_RIGHT_THIN=""
8 | else
9 | TMUX_POWERLINE_SEPARATOR_LEFT_BOLD="◀"
10 | TMUX_POWERLINE_SEPARATOR_LEFT_THIN="❮"
11 | TMUX_POWERLINE_SEPARATOR_RIGHT_BOLD="▶"
12 | TMUX_POWERLINE_SEPARATOR_RIGHT_THIN="❯"
13 | fi
14 |
15 | TMUX_POWERLINE_DEFAULT_BACKGROUND_COLOR=${TMUX_POWERLINE_DEFAULT_BACKGROUND_COLOR:-'235'}
16 | TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR=${TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR:-'255'}
17 |
18 | TMUX_POWERLINE_DEFAULT_LEFTSIDE_SEPARATOR=${TMUX_POWERLINE_DEFAULT_LEFTSIDE_SEPARATOR:-$TMUX_POWERLINE_SEPARATOR_RIGHT_BOLD}
19 | TMUX_POWERLINE_DEFAULT_RIGHTSIDE_SEPARATOR=${TMUX_POWERLINE_DEFAULT_RIGHTSIDE_SEPARATOR:-$TMUX_POWERLINE_SEPARATOR_LEFT_BOLD}
20 |
21 |
22 | # Format: segment_name background_color foreground_color [non_default_separator]
23 |
24 | if [ -z $TMUX_POWERLINE_LEFT_STATUS_SEGMENTS ]; then
25 | TMUX_POWERLINE_LEFT_STATUS_SEGMENTS=(
26 | "tmux_session_info 148 234" \
27 | # "hostname 33 0" \
28 | #"ifstat 30 255" \
29 | #"ifstat_sys 30 255" \
30 | # "lan_ip 24 255 ${TMUX_POWERLINE_SEPARATOR_RIGHT_THIN}" \
31 | # "wan_ip 24 255" \
32 | # "vcs_branch 29 88" \
33 | # "vcs_compare 60 255" \
34 | # "vcs_staged 64 255" \
35 | # "vcs_modified 9 255" \
36 | # "vcs_others 245 0" \
37 | )
38 | fi
39 |
40 | if [ -z $TMUX_POWERLINE_RIGHT_STATUS_SEGMENTS ]; then
41 | TMUX_POWERLINE_RIGHT_STATUS_SEGMENTS=(
42 | #"earthquake 3 0" \
43 | # "pwd 89 211" \
44 | # "mailcount 9 255" \
45 | # "now_playing 234 37" \
46 | #"cpu 240 136" \
47 | # "load 237 167" \
48 | #"tmux_mem_cpu_load 234 136" \
49 | # "battery 137 127" \
50 | # "weather 37 255" \
51 | #"xkb_layout 125 117" \
52 | "date_day 235 136" \
53 | "date 235 136 ${TMUX_POWERLINE_SEPARATOR_LEFT_THIN}" \
54 | "time 235 136 ${TMUX_POWERLINE_SEPARATOR_LEFT_THIN}" \
55 | #"utc_time 235 136 ${TMUX_POWERLINE_SEPARATOR_LEFT_THIN}" \
56 | )
57 | fi
58 |
--------------------------------------------------------------------------------
/.tmux/zoom:
--------------------------------------------------------------------------------
1 | #!/bin/bash -f
2 | currentwindow=`tmux list-window | tr '\t' ' ' | sed -n -e '/(active)/s/^[^:]*: *\([^ ]*\) .*/\1/gp'`;
3 | currentpane=`tmux list-panes | sed -n -e '/(active)/s/^\([^:]*\):.*/\1/gp'`;
4 | panecount=`tmux list-panes | wc | sed -e 's/^ *//g' -e 's/ .*$//g'`;
5 | inzoom=`echo $currentwindow | sed -n -e '/^zoom/p'`;
6 | if [ $panecount -ne 1 ]; then
7 | inzoom="";
8 | fi
9 | if [ $inzoom ]; then
10 | lastpane=`echo $currentwindow | rev | cut -f 1 -d '@' | rev`;
11 | lastwindow=`echo $currentwindow | cut -f 2- -d '@' | rev | cut -f 2- -d '@' | rev`;
12 | tmux select-window -t $lastwindow;
13 | tmux select-pane -t $lastpane;
14 | tmux swap-pane -s $currentwindow;
15 | tmux kill-window -t $currentwindow;
16 | else
17 | newwindowname=zoom@$currentwindow@$currentpane;
18 | tmux new-window -d -n $newwindowname;
19 | tmux swap-pane -s $newwindowname;
20 | tmux select-window -t $newwindowname;
21 | fi
22 |
--------------------------------------------------------------------------------
/.vim/UltiSnips/all.snippets:
--------------------------------------------------------------------------------
1 | snippet == "80 character comment header" !b
2 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3 | " ${0:Title}
4 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
5 | endsnippet
6 |
--------------------------------------------------------------------------------
/.vim/ftplugin/qf.vim:
--------------------------------------------------------------------------------
1 | setlocal number
2 | setlocal colorcolumn=
3 |
--------------------------------------------------------------------------------
/.vim/snippets/_.snip:
--------------------------------------------------------------------------------
1 | snippet TODO
2 | abbr TODO
3 | options word
4 | TODO(`system("echo -n \`whoami\`")`):
5 |
6 | snippet FIXME
7 | abbr FIXME
8 | options word
9 | FIXME(`system("echo -n \`whoami\`")`):
10 |
11 |
--------------------------------------------------------------------------------
/.vim/snippets/javascript.snip:
--------------------------------------------------------------------------------
1 | snippet header
2 | abbr header
3 | options head
4 | // Copyright 2013 Google Inc. All Rights Reserved.
5 | // @author terryma@google.com (Terry Ma)
6 | ${1}
7 |
--------------------------------------------------------------------------------
/.vim/snippets/python.snip:
--------------------------------------------------------------------------------
1 | snippet header
2 | abbr header
3 | options head
4 | # Copyright 2013 Google Inc. All Rights Reserved.
5 |
6 | """${1:One-line documentation for test module.}
7 |
8 | ${2:A detailed description of test.}
9 | """
10 |
11 | __author__ = 'terryma@google.com (Terry Ma)'
12 |
13 | from google3.pyglib import app
14 | from google3.pyglib import flags
15 |
16 | FLAGS = flags.FLAGS
17 |
18 |
19 | def main(unused_argv):
20 | pass
21 |
22 |
23 | if __name__ == '__main__':
24 | app.run()
25 |
--------------------------------------------------------------------------------
/.vim/snippets/sawzall.snip:
--------------------------------------------------------------------------------
1 | snippet header
2 | abbr header
3 | options head
4 | # Copyright 2013 Google Inc. All Rights Reserved.
5 | # Author: terryma@google.com (Terry Ma)
6 | #
7 | # ${1:Description of what this file does.}
8 |
9 | ${2}
10 |
--------------------------------------------------------------------------------
/.vim/snippets/sh.snip:
--------------------------------------------------------------------------------
1 | snippet header
2 | abbr header
3 | options head
4 | #!/bin/bash
5 | #
6 | # Copyright 2013 Google Inc. All Rights Reserved.
7 | # Author: terryma@google.com (Terry Ma)
8 | #
9 | # ${1:Description of what this script does.}
10 |
11 | source gbash.sh || exit
12 |
13 | gbash::init_google "$@"
14 | set -- "${GBASH_ARGV[@]}"
15 |
16 | ${2}
17 |
--------------------------------------------------------------------------------
/.vim/snippets/vim.snip:
--------------------------------------------------------------------------------
1 | snippet section
2 | abbr section
3 | options head
4 | "===============================================================================
5 | " ${1:Title}
6 | "===============================================================================
7 |
8 | ${2}
9 |
--------------------------------------------------------------------------------
/.vimrc:
--------------------------------------------------------------------------------
1 | set nocompatible
2 |
3 | "===============================================================================
4 | " vim-plug
5 | "===============================================================================
6 | call plug#begin('~/.vim/plugged')
7 | Plug 'Shougo/vimproc.vim', { 'do': 'make' }
8 |
9 | " Fuzzy search
10 | Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
11 | Plug 'junegunn/fzf.vim'
12 |
13 | " Code completion
14 | " Plug 'Valloric/YouCompleteMe', { 'on': [] }
15 |
16 | " Snippets
17 | " Plug 'SirVer/ultisnips', { 'on': [] }
18 | " Plug 'honza/vim-snippets'
19 |
20 | " Marks
21 | " Plug 'airblade/vim-gitgutter'
22 |
23 | " Comments
24 | Plug 'scrooloose/nerdcommenter'
25 |
26 | " Navigation
27 | Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
28 | Plug 'ton/vim-bufsurf'
29 |
30 | " Syntax checker
31 | Plug 'Chiel92/vim-autoformat'
32 | Plug 'sbdchd/neoformat'
33 | Plug 'hynek/vim-python-pep8-indent'
34 | Plug 'fisadev/vim-isort'
35 | Plug 'w0rp/ale'
36 |
37 | " Shell
38 | Plug 'thinca/vim-quickrun'
39 |
40 | " Git
41 | Plug 'tpope/vim-fugitive'
42 | Plug 'tpope/vim-rhubarb'
43 | Plug 'junegunn/gv.vim'
44 | Plug 'mattn/webapi-vim'
45 | Plug 'mattn/gist-vim'
46 |
47 | " Motions
48 | Plug 'rhysd/clever-f.vim'
49 | " Plug 'easymotion/vim-easymotion'
50 | " Plug 'justinmk/vim-sneak'
51 |
52 | " Text Objects
53 | Plug 'tpope/vim-surround'
54 | Plug 'tpope/vim-repeat'
55 | Plug 'kana/vim-textobj-user'
56 | " Plug 'kana/vim-textobj-entire' " ae, ie
57 | Plug 'kana/vim-textobj-line' " al, il
58 | Plug 'terryma/vim-expand-region'
59 |
60 | " Tags
61 | " Plug 'xolox/vim-misc'
62 | " Plug 'xolox/vim-easytags'
63 |
64 | " Color themems
65 | Plug 'junegunn/seoul256.vim'
66 |
67 | " Misc
68 | Plug 'kchmck/vim-coffee-script'
69 | Plug 'leafgarland/typescript-vim'
70 | Plug 'mtth/scratch.vim'
71 | " Plug 'mhinz/vim-startify'
72 | Plug 'terryma/vim-smooth-scroll'
73 | Plug 'terryma/vim-multiple-cursors'
74 | Plug 'hashivim/vim-terraform'
75 | " Plug 'jiangmiao/auto-pairs'
76 | Plug 'vimwiki/vimwiki', { 'branch': 'dev' }
77 | Plug 'metakirby5/codi.vim'
78 | Plug 'junegunn/vim-peekaboo'
79 | Plug 'junegunn/goyo.vim'
80 |
81 | call plug#end()
82 |
83 | filetype plugin indent on
84 | syntax enable
85 | runtime macros/matchit.vim
86 |
87 | "===============================================================================
88 | " Local Settings
89 | " ===============================================================================
90 |
91 | try
92 | source ~/.vimrc.local
93 | catch
94 | endtry
95 |
96 | "===============================================================================
97 | " General Settings
98 | "===============================================================================
99 |
100 | " Set augroup
101 | augroup MyAutoCmd
102 | autocmd!
103 | augroup END
104 |
105 | syntax on
106 |
107 | set lazyredraw
108 | set ttyfast
109 |
110 | " Solid line for vsplit separator
111 | set fcs=vert:│
112 |
113 | " Don't show the intro
114 | set shortmess+=I
115 |
116 | " Turn on the mouse in all modes
117 | set mouse=a
118 |
119 | " Give one virtual space at end of line
120 | set virtualedit=onemore
121 |
122 | " Turn on line number
123 | set number
124 |
125 | " Always splits to the right and below
126 | set splitright
127 | set splitbelow
128 |
129 | " Boost performance of rendering long lines
130 | set synmaxcol=300
131 |
132 | " Colorscheme
133 | " 256bit terminal
134 | set t_Co=256
135 | let g:seoul256_background = 234
136 | colorscheme seoul256
137 |
138 | " Sets how many lines of history vim has to remember
139 | set history=1000
140 |
141 | " Set to auto read when a file is changed from the outside
142 | set autoread
143 |
144 | " Set to auto write file
145 | set autowriteall
146 |
147 | " Display unprintable chars
148 | set list
149 | set listchars=tab:▸\ ,extends:❯,precedes:❮,nbsp:␣
150 | set showbreak=↪
151 |
152 | " listchar=trail is not as flexible, use the below to highlight trailing
153 | " whitespace
154 | highlight ExtraWhitespace ctermbg=red guibg=red
155 | match ExtraWhitespace /\s\+$/
156 |
157 | " Minimal number of screen lines to keep above and below the cursor
158 | set scrolloff=10
159 |
160 | " How many lines to scroll at a time, make scrolling appears faster
161 | set scrolljump=5
162 |
163 | " Min width of the number column to the left
164 | set numberwidth=1
165 |
166 | " Open all folds initially
167 | set foldmethod=indent
168 | set foldlevelstart=99
169 |
170 | " No need to show mode
171 | set noshowmode
172 |
173 | " Auto complete setting
174 | set completeopt=longest,menuone
175 |
176 | set wildmode=list:longest,full
177 | set wildmenu "turn on wild menu
178 | set wildignore=*.o,*.obj,*~ "stuff to ignore when tab completing
179 | set wildignore+=*DS_Store*
180 | set wildignore+=vendor/rails/**
181 | set wildignore+=vendor/cache/**
182 | set wildignore+=*.gem
183 | set wildignore+=log/**
184 | set wildignore+=tmp/**
185 | set wildignore+=*.png,*.jpg,*.gif
186 | set wildignore+=*.so,*.swp,*.zip,*/.Trash/**,*.pdf,*.dmg,*/Library/**,*/.rbenv/**
187 | set wildignore+=*/.nx/**,*.app
188 |
189 | " Allow changing buffer without saving it first
190 | set hidden
191 |
192 | " Set backspace config
193 | set backspace=eol,start,indent
194 |
195 | " Case insensitive search
196 | set ignorecase
197 | set smartcase
198 |
199 | " Set sensible heights for splits
200 | " set winheight=50
201 |
202 | " Make search act like search in modern browsers
203 | set incsearch
204 |
205 | " Make regex a little easier to type
206 | set magic
207 |
208 | " Don't show matching brackets
209 | set noshowmatch
210 |
211 | " Show incomplete commands
212 | set showcmd
213 |
214 | " Turn off sound
215 | set vb
216 | set t_vb=
217 |
218 | " Always show the statusline
219 | set laststatus=2
220 |
221 | " Explicitly set encoding to utf-8
222 | set encoding=utf-8
223 |
224 | " Column width indicator
225 | set colorcolumn=+1
226 |
227 | " Lower the delay of escaping out of other modes
228 | " keycode times out fast, mapping times out in a bit more time
229 | set timeout timeoutlen=1000 ttimeout ttimeoutlen=1
230 |
231 | " Reload vimrc when edited
232 | " autocmd MyAutoCmd BufWritePost .vimrc,_vimrc,vimrc,.gvimrc,_gvimrc,gvimrc
233 | " \ so $MYVIMRC | if has('gui_running') | source $MYGVIMRC | endif | AirlineRefresh
234 | autocmd MyAutoCmd BufWritePost .vimrc,_vimrc,vimrc,.gvimrc,_gvimrc,gvimrc
235 | \ so $MYVIMRC | if has('gui_running') | source $MYGVIMRC | endif
236 | try
237 | lang en_us
238 | catch
239 | endtry
240 |
241 | " Turn backup off
242 | set nobackup
243 | set nowritebackup
244 | set noswapfile
245 |
246 | " Tab settings
247 | set expandtab
248 | set shiftwidth=2
249 | set tabstop=8
250 | set softtabstop=2
251 | set smarttab
252 |
253 | " Text display settings
254 | set linebreak
255 | set textwidth=120
256 | set autoindent
257 | set nowrap
258 | set whichwrap+=h,l,<,>,[,]
259 |
260 | " Writes to the unnamed register also writes to the * and + registers. This
261 | " makes it easy to interact with the system clipboard
262 | if has ('unnamedplus')
263 | set clipboard=unnamedplus
264 | else
265 | set clipboard=unnamed
266 | endif
267 |
268 | " Use a low updatetime. This is used by CursorHold
269 | set updatetime=1000
270 | " I like my word boundary to be a little bigger than the default
271 | " FIXME Apparently this affects html indenting. Figure out what the problem is
272 | " set iskeyword+=<,>,[,],:,-,`,!
273 | " set iskeyword-=_
274 |
275 | " Cursor settings. This makes terminal vim sooo much nicer!
276 | " Tmux will only forward escape sequences to the terminal if surrounded by a DCS
277 | " sequence
278 | if exists('$TMUX')
279 | let &t_SI = "\Ptmux;\\]50;CursorShape=1\x7\\\"
280 | let &t_EI = "\Ptmux;\\]50;CursorShape=0\x7\\\"
281 | else
282 | let &t_SI = "\]50;CursorShape=1\x7"
283 | let &t_EI = "\]50;CursorShape=0\x7"
284 | endif
285 |
286 | " Diff options
287 | set diffopt=filler,vertical
288 |
289 | " Disable viminfo, causes startup and shutdown to take longer
290 | set viminfo='10,<0,s0,h,/100,:100,@0
291 |
292 | "===============================================================================
293 | " Leader Key Mappings
294 | "===============================================================================
295 |
296 | " Map leader and localleader key to comma
297 | let mapleader = ","
298 | let g:mapleader = ","
299 | let maplocalleader = ","
300 | let g:maplocalleader = ","
301 |
302 | " 1: Toggle between paste mode
303 | nnoremap 1 :set paste!
304 |
305 | " 2: TODO
306 |
307 | " tab: TODO
308 |
309 | " q: Quit all, very useful in vimdiff
310 | nnoremap q :qa
311 |
312 | " w: TODO
313 |
314 | " e: Fast editing of the .vimrc
315 | nnoremap e :e! ~/.vimrc
316 |
317 | " r: TODO
318 |
319 | " t: TODO
320 |
321 | " y: TODO
322 |
323 | " u: TODO
324 |
325 | " o: TODO
326 |
327 | " p: TODO
328 |
329 | " a: TODO
330 | nnoremap a :lopen
331 |
332 | " s: TODO
333 |
334 | " d: TODO
335 |
336 | " f: Autoformat
337 | nnoremap f :Autoformat
338 |
339 | " g: Fugitive shortcuts
340 |
341 | " z: TODO
342 |
343 | " x: TODO
344 |
345 | " c*: NERDCommenter mappings
346 | " cd: Switch to the directory of the open buffer
347 | nnoremap cd :cd %:p:h:pwd
348 |
349 | " v: TODO
350 |
351 | " b: TODO
352 |
353 | " n: NERDTreeFind
354 | nnoremap n :NERDTreeFind :wincmd p
355 |
356 | " m: Maximize current split
357 | nnoremap m _
358 |
359 | " : TODO
360 |
361 | " ,: Switch to previous split
362 | nnoremap , p
363 |
364 | "===============================================================================
365 | " Command-line Mode Key Mappings
366 | "===============================================================================
367 |
368 | " Bash like keys for the command line. These resemble personal zsh mappings
369 | cnoremap
370 | cnoremap
371 |
372 | " Ctrl-[hl]: Move left/right by word
373 | cnoremap
374 | cnoremap
375 |
376 | cnoremap
377 | cnoremap
378 | cnoremap
379 | cnoremap
380 |
381 | " Ctrl-v: Paste
382 | cnoremap "
383 |
384 | " w!!: Writes using sudo
385 | cnoremap w!! w !sudo tee % >/dev/null
386 |
387 | autocmd MyAutoCmd CmdwinEnter : map
388 |
389 | "===============================================================================
390 | " Normal Mode Key Mappings
391 | "===============================================================================
392 | " q: record macros
393 | " w: Move word forward
394 | " e: Move to end of word
395 | " r: Replace single character
396 | " t: Find till
397 | " y: Yank. Last yank is always stored in register 0. So paste with "0p if you did a delete after the yank
398 | " u: Undo
399 | " i: Insert before cursor
400 | " o: Insert line below cursor
401 | " p: Paste
402 | nnoremap p gp
403 | " [: Many functions
404 | " ]: Many functions
405 | " \: Toggle comment
406 | nmap \ c
407 | " a: Insert after cursor
408 | " s: EasyMotion
409 | " d: Delete. Access it from register "" or "1-9
410 | " f: Clever-f
411 | " g: Many functions
412 | " gp to visually select pasted text
413 | nnoremap gp '`[' . strpart(getregtype(), 0, 1) . '`]'
414 | " h: Left
415 | " j: Down
416 | " k: Up
417 | " l: Right
418 | " ;: Command mode
419 | noremap ; :
420 | " ': Go to mark
421 | " z: Many functions
422 | " x: Delete char
423 | " c: Change into the blackhole register to not clobber the last yank
424 | nnoremap c "_c
425 | " v: Visual mode
426 | " b: Move word backward
427 | " n: Next, keep search matches in the middle of the window
428 | nnoremap n nzzzv
429 | " m: Marks
430 | " ,: Leader
431 | " .: Repeat last command
432 | " /" Search
433 | " Up Down Left Right move pane
434 | nnoremap k
435 | nnoremap j
436 | nnoremap h
437 | nnoremap l
438 |
439 | " Enter: Highlight cursor location
440 | " nnoremap :call CursorPing()
441 |
442 | " Backspace: Toggle search highlight
443 | nnoremap :set hlsearch! hlsearch?
444 |
445 | " Tab: Same as on the command line
446 |
447 | " Space: Scratch
448 | nnoremap :Scratch
449 |
450 | "===============================================================================
451 | " Normal Mode Shift Key Mappings
452 | "===============================================================================
453 |
454 | " Shift-Tab: NERDTree
455 | nnoremap :NERDTreeToggle
456 |
457 | " Shift-q: Closes the window
458 | nnoremap Q :q!
459 |
460 | " Shift-w: Move to start of next word
461 |
462 | " Shift-e: Move to end of word forward
463 |
464 | " Shift-r: Reindent entire file
465 | nnoremap R mqHmwgg=G`wzt`q
466 |
467 | " Shift-t: Finds till backwards
468 |
469 | " Shift-y: Remove join lines to this, Y looks like a join of two lines into one
470 | noremap Y J
471 |
472 | " Shift-u: Redos since 'u' undos
473 | nnoremap U :redo
474 |
475 | " Shift-i: Insert at beginning of line
476 |
477 | " Shift-o: Insert line above
478 |
479 | " Shift-p: Paste above line
480 |
481 | " Shift-[: Beginning of paragraph
482 |
483 | " Shift-]: End of paragraph
484 |
485 | " Shift--(_): Quick horizontal splits
486 | nnoremap _ :sp
487 |
488 | " Shift-\(|): Quick vertical splits
489 | nnoremap :vsp
490 |
491 | " Shift-a: Insert at end of line
492 |
493 | " Shift-s: Split and return to normal mode
494 | nnoremap S i
495 |
496 | " Shift-d: Deletes til the end of line
497 |
498 | " Shift-f: Finds backwards
499 |
500 | " Shift-g: Go to end of file
501 |
502 | " Shift-h: Go to beginning of line.
503 | noremap H ^
504 |
505 | " Shift-j: expand-region
506 | map K (expand_region_expand)
507 |
508 | " Shift-k: shrink-region
509 | map J (expand_region_shrink)
510 |
511 | " Shift-l: Go to end of line
512 | noremap L g_
513 |
514 | " :: TODO
515 |
516 | " Shift-'("): Handles registers
517 |
518 | " Shift-z: Bufsurf back
519 | nnoremap Z :BufSurfBack
520 |
521 | " Shift-z: Bufsurf forward
522 | nnoremap X :BufSurfForward
523 |
524 | " Shift-c: Deletes rest of line and go to insert mode
525 |
526 | " Shift-v: Visual line mode
527 |
528 | " Shift-b: Move word backward (TODO Replaced by , maybe remap?)
529 |
530 | " Shift-n: Find next occurrence backward
531 | nnoremap N Nzzzv
532 |
533 | " Shift-m: Move cursor to mid screen (TODO Remap since I don't ever use this)
534 | nmap M (ale_next_wrap)
535 |
536 | " <: Indent left
537 |
538 | " >: Indent right
539 |
540 | " ?: Search backwards
541 |
542 | " +/-: Increment number
543 | nnoremap +
544 | nnoremap -
545 |
546 | "===============================================================================
547 | " Normal Mode Ctrl Key Mappings
548 | "===============================================================================
549 |
550 | " Ctrl-q: Visual block mode
551 |
552 | " Ctrl-w: Window management
553 |
554 | " Ctrl-e: TODO
555 |
556 | " Ctrl-r: Show command history
557 | nmap :History:
558 |
559 | " Ctrl-t: Go to opposite tag
560 | nmap %
561 |
562 | " Ctrl-y: (Scroll up. Ctrl-k is much more effective TODO Remap)
563 | " Ctrl-u: Scroll half a screen up smoothly
564 | noremap :call smooth_scroll#up(&scroll, 5, 1)
565 |
566 | " Ctrl-i: Go forward in the jumplist, also realigns screen. See mapping for
567 | nnoremap zzzv
568 |
569 | " Ctrl-o: Go back in the jumplist, also realign the screen
570 | nnoremap zzzv
571 |
572 | " Ctrl-p: Recent files
573 | nnoremap :History
574 |
575 | " Ctrl-[: Esc
576 |
577 | " Ctrl-]: Go forward in tag stack
578 |
579 | " Ctrl-\: Quick outline
580 | nmap :BTags
581 |
582 | " Ctrl-a: All buffers
583 | nnoremap :Buffers
584 |
585 | " Ctrl-s: Save
586 | nmap :w!
587 |
588 | " Ctrl-d: Scroll half a screen down smoothly
589 | noremap :call smooth_scroll#down(&scroll, 5, 1)
590 |
591 | " Ctrl-f: fzf
592 | nnoremap :Ag
593 |
594 | " Ctrl-g: GitFiles
595 | nmap :GitFiles
596 |
597 | " Ctrl-h: Move word back. Consistent with zsh
598 | noremap B
599 | inoremap B
600 |
601 | " Ctrl-j: Scroll + move down through the file
602 | " noremap 55j
603 | noremap 5
604 |
605 | " Ctrl-k: Scroll + move up through the file
606 | " noremap 55k
607 | noremap 5
608 |
609 | " Ctrl-l: Move word forward. Consistent with zsh
610 | noremap W
611 | inoremap W
612 |
613 | " Ctrl-;: Vim can't map this
614 |
615 | " Ctrl-': Vim can't map this
616 |
617 | " Ctrl-z: This is the command key for tmux
618 |
619 | " Ctrl-x: Cycle through the splits. I don't ever use enough splits to justify
620 | " wasting 4 very easy to hit keys for them.
621 | nnoremap w
622 |
623 | " Ctrl-c: FZF commands
624 | nnoremap :Commands
625 |
626 | " Ctrl-v: Paste (works with system clipboard due to clipboard setting earlier)
627 | nnoremap p
628 |
629 | " Ctrl-b: Go to tag
630 | nnoremap
631 |
632 | " Ctrl-n: Next cursor in MultiCursor mode
633 |
634 | " Ctrl-m: Same as Enter
635 |
636 | " Ctrl-,: Vim can't map this
637 |
638 | " Ctrl-.: Vim can't map this
639 |
640 | " Ctrl-/: Vim can't map this
641 |
642 | " Ctrl-Space: FZF files
643 | nnoremap :Files
644 |
645 | "===============================================================================
646 | " Insert Mode Ctrl Key Mappings
647 | "===============================================================================
648 |
649 | " Ctrl-q: Quoted insert. Useful for doing key binding
650 |
651 | " Ctrl-w: Delete previous word, create undo point
652 | inoremap u
653 |
654 | " Ctrl-e: Go to end of line
655 | inoremap A
656 |
657 | " Ctrl-r: Insert register
658 |
659 | " Ctrl-t: Indent shiftwidth
660 |
661 | " Ctrl-y: Insert char above cursor
662 | " TODO: When do I ever use this?
663 |
664 | " Ctrl-u: Delete til beginning of line, create undo point
665 | inoremap u
666 |
667 | " Ctrl-i: Tab
668 |
669 | " Ctrl-o: Execute one normal mode command
670 |
671 | " Ctrl-p: Auto complete previous
672 | " TODO: When do I ever use this?
673 |
674 | " Ctrl-a: Go to begin of line
675 | inoremap I
676 |
677 | " Ctrl-s: Save
678 | inoremap :w
679 |
680 | " Ctrl-d: Unindent shiftwidth
681 |
682 | " Ctrl-f: Move cursor left
683 | inoremap
684 |
685 | " Ctrl-g: Move cursor right
686 | silent! iunmap s
687 | silent! iunmap S
688 | inoremap
689 |
690 | " Ctrl-h: Move word left
691 | inoremap B
692 |
693 | " Ctrl-j: Move cursor up
694 | inoremap pumvisible() ? "\\" : "\"
695 |
696 | " Ctrl-k: Move cursor up
697 | inoremap pumvisible() ? "\\" : "\"
698 |
699 | " Ctrl-l: Move word right
700 | inoremap W
701 |
702 | " Ctrl-z: This is the command key for tmux
703 |
704 | " Ctrl-x: Delete char under cursor. (If we simply use x, it wouldn't delete
705 | " newline chars
706 | " inoremap X
707 |
708 | " Ctrl-c: Inserts line below
709 | inoremap o
710 |
711 | " Ctrl-v: Paste. For some reason, is not creating an undo point in the
712 | " mapping
713 | inoremap ugP
714 |
715 | " Ctrl-b: TODO
716 |
717 | " Ctrl-n: Auto complete next
718 |
719 | " Ctrl-m: Same as Enter
720 |
721 | " Ctrl-space: YCM
722 |
723 | " Ctrl-/: Undo
724 | inoremap u
725 |
726 | "===============================================================================
727 | " Visual Mode Ctrl Key Mappings
728 | "===============================================================================
729 |
730 | " Ctrl-c: Copy (works with system clipboard due to clipboard setting)
731 | vnoremap y`]
732 |
733 | " Ctrl-r: Easier search and replace
734 | vnoremap "hy:%s/h//gc
735 |
736 | " Ctrl-s: Easier substitue
737 | vnoremap :s/\%V//g
738 |
739 | " Ctrl-f: Find highlight word with FZF
740 | vnoremap "hy:Ag h
741 |
742 | "===============================================================================
743 | " Normal Mode Meta/Alt Key Mappings
744 | "===============================================================================
745 | " Fix alt key keycodes. Using keycodes instead of escape sequence for mapping will use ttimeout instead of timeout,
746 | " which means pressing escape will not cause a delay.
747 | let c='a'
748 | while c <= 'z'
749 | exec "set =\e".c
750 | exec "set =\e".toupper(c)
751 | let c = nr2char(1+char2nr(c))
752 | endw
753 |
754 | " Alt-a: Select all
755 | nnoremap :keepjumps normal ggVG
756 |
757 | " Alt-s: isort and format
758 | nnoremap :Isort:Neoformat
759 |
760 | " Alt-h: tmux
761 |
762 | " Alt-j: Move current line down
763 | nnoremap mz:m+`z==
764 |
765 | " Alt-k: Move current line up
766 | nnoremap mz:m-2`z==
767 |
768 | " Alt-l: tmux
769 |
770 | " Alt-Shift-j: Duplicate line down
771 | nnoremap