├── .tmux.conf ├── .tmux.conf.local ├── README.md ├── applescripts └── tunes.js ├── eslintrc ├── gemrc ├── gitconfig ├── gitignore ├── linux └── .zshrc ├── nvim ├── UltiSnips │ ├── all.snippets │ ├── css.snippets │ ├── html.snippets │ ├── javascript.snippets │ ├── markdown.snippets │ └── typescript.snippets ├── autoload │ ├── applylocalsettings.vim │ ├── functions.vim │ └── hiinterestingword.vim ├── ftdetect │ ├── html.vim │ ├── javascript.vim │ ├── json.vim │ ├── markdown.vim │ └── xml.vim ├── ftplugin │ ├── git.vim │ ├── help.vim │ ├── html.vim │ ├── javascript.vim │ ├── markdown.vim │ ├── ruby.vim │ ├── typescript.vim │ ├── vim.vim │ └── xml.vim ├── init.vim ├── plugin │ ├── applylocalsettings.vim │ └── hiinterestingword.vim └── syntax │ └── markdown.vim ├── vimrc ├── zshrc └── zshrc.theme /.tmux.conf: -------------------------------------------------------------------------------- 1 | # https://c.com/gpakosz/.tmux 2 | # (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license, 3 | # without any warranty. 4 | # Copyright 2012— Gregory Pakosz (@gpakosz). 5 | 6 | 7 | # -- navigation ---------------------------------------------------------------- 8 | 9 | # if you're running tmux within iTerm2 10 | # - and tmux is 1.9 or 1.9a 11 | # - and iTerm2 is configured to let option key act as +Esc 12 | # - and iTerm2 is configured to send [1;9A -> [1;9D for option + arrow keys 13 | # then uncomment the following line to make Meta + arrow keys mapping work 14 | #set -ga terminal-overrides "*:kUP3=\e[1;9A,*:kDN3=\e[1;9B,*:kRIT3=\e[1;9C,*:kLFT3=\e[1;9D" 15 | 16 | 17 | # -- windows & pane creation --------------------------------------------------- 18 | 19 | # new window retains current path, possible values are: 20 | # - true 21 | # - false (default) 22 | tmux_conf_new_window_retain_current_path=true 23 | 24 | # new pane retains current path, possible values are: 25 | # - true (default) 26 | # - false 27 | tmux_conf_new_pane_retain_current_path=true 28 | 29 | # new pane tries to reconnect ssh sessions (experimental), possible values are: 30 | # - true 31 | # - false (default) 32 | tmux_conf_new_pane_reconnect_ssh=false 33 | 34 | # prompt for session name when creating a new session, possible values are: 35 | # - true 36 | # - false (default) 37 | tmux_conf_new_session_prompt=false 38 | 39 | 40 | 41 | # -- display ------------------------------------------------------------------- 42 | 43 | # RGB 24-bit colour support (tmux >= 2.2), possible values are: 44 | # - true 45 | # - false (default) 46 | tmux_conf_theme_24b_colour=true 47 | 48 | # window style 49 | tmux_conf_theme_window_fg='default' 50 | tmux_conf_theme_window_bg='default' 51 | 52 | # highlight focused pane (tmux >= 2.1), possible values are: 53 | # - true 54 | # - false (default) 55 | tmux_conf_theme_highlight_focused_pane=false 56 | 57 | # focused pane colours: 58 | tmux_conf_theme_focused_pane_fg='default' 59 | tmux_conf_theme_focused_pane_bg='#0087d7' # light blue 60 | 61 | # pane border style, possible values are: 62 | # - thin (default) 63 | # - fat 64 | tmux_conf_theme_pane_border_style=thin 65 | 66 | # pane borders colours: 67 | tmux_conf_theme_pane_border='#444444' # gray 68 | tmux_conf_theme_pane_active_border='#a1b56c' # light blue 69 | 70 | # pane indicator colours 71 | tmux_conf_theme_pane_indicator='#a1b56c' # light blue 72 | tmux_conf_theme_pane_active_indicator='#a1b56c' # light blue 73 | 74 | # status line style 75 | tmux_conf_theme_message_fg='#000000' # black 76 | tmux_conf_theme_message_bg='#f7ca88' # yellow 77 | tmux_conf_theme_message_attr='bold' 78 | 79 | # status line command style ( : Escape) 80 | tmux_conf_theme_message_command_fg='#f7ca88' # yellow 81 | tmux_conf_theme_message_command_bg='#000000' # black 82 | tmux_conf_theme_message_command_attr='bold' 83 | 84 | # window modes style 85 | tmux_conf_theme_mode_fg='#000000' # black 86 | tmux_conf_theme_mode_bg='#f7ca88' # yellow 87 | tmux_conf_theme_mode_attr='bold' 88 | 89 | # status line style 90 | tmux_conf_theme_status_fg='#8a8a8a' # light gray 91 | tmux_conf_theme_status_bg='#080808' # dark gray 92 | tmux_conf_theme_status_attr='none' 93 | 94 | # terminal title 95 | # - built-in variables are: 96 | # - #{circled_window_index} 97 | # - #{circled_session_name} 98 | # - #{hostname} 99 | # - #{hostname_ssh} 100 | # - #{username} 101 | # - #{username_ssh} 102 | tmux_conf_theme_terminal_title='❐ #S ● #I #W' 103 | 104 | # window status style 105 | # - built-in variables are: 106 | # - #{circled_window_index} 107 | # - #{circled_session_name} 108 | # - #{hostname} 109 | # - #{hostname_ssh} 110 | # - #{username} 111 | # - #{username_ssh} 112 | tmux_conf_theme_window_status_fg='#8a8a8a' # light gray 113 | tmux_conf_theme_window_status_bg='#080808' # dark gray 114 | tmux_conf_theme_window_status_attr='none' 115 | tmux_conf_theme_window_status_format='#I #W' 116 | #tmux_conf_theme_window_status_format='#{circled_window_index} #W' 117 | #tmux_conf_theme_window_status_format='#I #W#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}' 118 | 119 | # window current status style 120 | # - built-in variables are: 121 | # - #{circled_window_index} 122 | # - #{circled_session_name} 123 | # - #{hostname} 124 | # - #{hostname_ssh} 125 | # - #{username} 126 | # - #{username_ssh} 127 | tmux_conf_theme_window_status_current_fg='#000000' # black 128 | tmux_conf_theme_window_status_current_bg='#a1b56c' # light blue 129 | tmux_conf_theme_window_status_current_attr='bold' 130 | tmux_conf_theme_window_status_current_format='#I #W' 131 | #tmux_conf_theme_window_status_current_format='#{circled_window_index} #W' 132 | #tmux_conf_theme_window_status_current_format='#I #W#{?window_zoomed_flag,🔍,}' 133 | 134 | # window activity status style 135 | tmux_conf_theme_window_status_activity_fg='default' 136 | tmux_conf_theme_window_status_activity_bg='default' 137 | tmux_conf_theme_window_status_activity_attr='underscore' 138 | 139 | # window bell status style 140 | tmux_conf_theme_window_status_bell_fg='#f7ca88' # yellow 141 | tmux_conf_theme_window_status_bell_bg='default' 142 | tmux_conf_theme_window_status_bell_attr='blink,bold' 143 | 144 | # window last status style 145 | tmux_conf_theme_window_status_last_fg='#a1b56c' # light blue 146 | tmux_conf_theme_window_status_last_bg='default' 147 | tmux_conf_theme_window_status_last_attr='none' 148 | 149 | # status left/right sections separators 150 | tmux_conf_theme_left_separator_main='' 151 | tmux_conf_theme_left_separator_sub='|' 152 | tmux_conf_theme_right_separator_main='' 153 | tmux_conf_theme_right_separator_sub='|' 154 | #tmux_conf_theme_left_separator_main='' # /!\ you don't need to install Powerline 155 | #tmux_conf_theme_left_separator_sub='' # you only need fonts patched with 156 | #tmux_conf_theme_right_separator_main='' # Powerline symbols or the standalone 157 | #tmux_conf_theme_right_separator_sub='' # PowerlineSymbols.otf font 158 | 159 | # status left/right content: 160 | # - separate main sections with '|' 161 | # - separate subsections with ',' 162 | # - built-in variables are: 163 | # - #{battery_bar} 164 | # - #{battery_hbar} 165 | # - #{battery_percentage} 166 | # - #{battery_status} 167 | # - #{battery_vbar} 168 | # - #{circled_session_name} 169 | # - #{hostname_ssh} 170 | # - #{hostname} 171 | # - #{loadavg} 172 | # - #{pairing} 173 | # - #{prefix} 174 | # - #{root} 175 | # - #{synchronized} 176 | # - #{uptime_d} 177 | # - #{uptime_h} 178 | # - #{uptime_m} 179 | # - #{uptime_s} 180 | # - #{username} 181 | # - #{username_ssh} 182 | tmux_conf_theme_status_left=' ❐ #S ' 183 | tmux_conf_theme_status_right='#{prefix}#{pairing}#{synchronized} ♫ #(osascript -l JavaScript ~/.bin/dotfiles/applescripts/tunes.js) #{?battery_status, #{battery_vbar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}' 184 | 185 | # status left style 186 | tmux_conf_theme_status_left_fg='#000000,#e4e4e4,#e4e4e4' # black, white , white 187 | tmux_conf_theme_status_left_bg='#ab4642,#ff00af,#a1b56c' # yellow, pink, white blue 188 | tmux_conf_theme_status_left_attr='bold,none,none' 189 | 190 | # status right style 191 | tmux_conf_theme_status_right_fg='#8a8a8a,#000000,#000000' # light gray, white, black 192 | tmux_conf_theme_status_right_bg='#080808,#ab4642,#e4e4e4' # dark gray, red, white 193 | tmux_conf_theme_status_right_attr='none,none,bold' 194 | 195 | # pairing indicator 196 | tmux_conf_theme_pairing='👓 ' # U+1F453 197 | tmux_conf_theme_pairing_fg='none' 198 | tmux_conf_theme_pairing_bg='none' 199 | tmux_conf_theme_pairing_attr='none' 200 | 201 | # prefix indicator 202 | tmux_conf_theme_prefix='⌨ ' # U+2328 203 | tmux_conf_theme_prefix_fg='none' 204 | tmux_conf_theme_prefix_bg='none' 205 | tmux_conf_theme_prefix_attr='none' 206 | 207 | # root indicator 208 | tmux_conf_theme_root='!' 209 | tmux_conf_theme_root_fg='none' 210 | tmux_conf_theme_root_bg='none' 211 | tmux_conf_theme_root_attr='bold,blink' 212 | 213 | # synchronized indicator 214 | tmux_conf_theme_synchronized='🔒' # U+1F512 215 | tmux_conf_theme_synchronized_fg='none' 216 | tmux_conf_theme_synchronized_bg='none' 217 | tmux_conf_theme_synchronized_attr='none' 218 | 219 | # battery bar symbols 220 | tmux_conf_battery_bar_symbol_full='◼' 221 | tmux_conf_battery_bar_symbol_empty='◻' 222 | #tmux_conf_battery_bar_symbol_full='♥' 223 | #tmux_conf_battery_bar_symbol_empty='·' 224 | 225 | # battery bar length (in number of symbols), possible values are: 226 | # - auto 227 | # - a number, e.g. 5 228 | tmux_conf_battery_bar_length='auto' 229 | 230 | # battery bar palette, possible values are: 231 | # - gradient (default) 232 | # - heat 233 | # - 'colour_full_fg,colour_empty_fg,colour_bg' 234 | tmux_conf_battery_bar_palette='gradient' 235 | #tmux_conf_battery_bar_palette='#d70000,#e4e4e4,#000000' # red, white, black 236 | 237 | # battery hbar palette, possible values are: 238 | # - gradient (default) 239 | # - heat 240 | # - 'colour_low,colour_half,colour_full' 241 | tmux_conf_battery_hbar_palette='gradient' 242 | #tmux_conf_battery_hbar_palette='#d70000,#ff5f00,#5fff00' # red, orange, green 243 | 244 | # battery vbar palette, possible values are: 245 | # - gradient (default) 246 | # - heat 247 | # - 'colour_low,colour_half,colour_full' 248 | tmux_conf_battery_vbar_palette='gradient' 249 | tmux_conf_battery_vbar_palette='#ab4642,#f7ca88,#a1b56c' # red, orange, green 250 | 251 | # symbols used to indicate whether battery is charging or discharging 252 | tmux_conf_battery_status_charging='↑' # U+2191 253 | tmux_conf_battery_status_discharging='↓' # U+2193 254 | #tmux_conf_battery_status_charging='⚡ ' # U+26A1 255 | tmux_conf_battery_status_charging='🔌 ' # U+1F50C 256 | #tmux_conf_battery_status_discharging='🔋 ' # U+1F50B 257 | 258 | # clock style 259 | tmux_conf_theme_clock_colour='#a1b56c' # light blue 260 | tmux_conf_theme_clock_style='12' 261 | 262 | 263 | # -- clipboard ----------------------------------------------------------------- 264 | 265 | # in copy mode, copying selection also copies to the OS clipboard 266 | # - true 267 | # - false (default) 268 | # on macOS, this requires installing reattach-to-user-namespace, see README.md 269 | # on Linux, this requires xsel or xclip 270 | tmux_conf_copy_to_os_clipboard=true 271 | 272 | 273 | # -- user customizations ------------------------------------------------------- 274 | # this is the place to override or undo settings 275 | 276 | # Better vim tmux integration 277 | set -g focus-events on 278 | 279 | # increase history size 280 | #set -g history-limit 10000 281 | 282 | # start with mouse mode enabled 283 | # set -g mouse on 284 | 285 | # force Vi mode 286 | # really you should export VISUAL or EDITOR environment variable, see manual 287 | #set -g status-keys vi 288 | #set -g mode-keys vi 289 | 290 | # When caps lock is mapped to control. C-s is more home row friendly 291 | # Shift fingers one key to right to avoid awkward little finger and ring finger press 292 | # and use stronger middle finger for prefix key instead 293 | # Use same middle finger to move between vim splits with Ctrl-w 294 | unbind C-a 295 | unbind C-b 296 | set -g prefix C-s 297 | bind C-s send-prefix 298 | 299 | # Use - for horizontal split 300 | # \ or _ for vertical split 301 | # split current window vertically 302 | bind \ split-window -h 303 | 304 | # use zsh as default shell 305 | set-option -g default-shell /bin/zsh 306 | 307 | # move status line to top 308 | #set -g status-position top 309 | 310 | unbind I 311 | set -g @plugin 'tmux-plugins/tpm' 312 | set -g @plugin 'tmux-plugins/tmux-sensible' 313 | # set -g @plugin 'Morantron/tmux-fingers' # not working 314 | 315 | 316 | # unbind F 317 | # set -g @fingers-key F 318 | 319 | run -b '~/.tmux/plugins/tpm/tpm' 320 | 321 | -------------------------------------------------------------------------------- /.tmux.conf.local: -------------------------------------------------------------------------------- 1 | # https://github.com/gpakosz/.tmux 2 | # (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license, 3 | # without any warranty. 4 | # Copyright 2012— Gregory Pakosz (@gpakosz). 5 | 6 | 7 | # -- navigation ---------------------------------------------------------------- 8 | 9 | # if you're running tmux within iTerm2 10 | # - and tmux is 1.9 or 1.9a 11 | # - and iTerm2 is configured to let option key act as +Esc 12 | # - and iTerm2 is configured to send [1;9A -> [1;9D for option + arrow keys 13 | # then uncomment the following line to make Meta + arrow keys mapping work 14 | #set -ga terminal-overrides "*:kUP3=\e[1;9A,*:kDN3=\e[1;9B,*:kRIT3=\e[1;9C,*:kLFT3=\e[1;9D" 15 | 16 | 17 | # -- windows & pane creation --------------------------------------------------- 18 | 19 | # new window retains current path, possible values are: 20 | # - true 21 | # - false (default) 22 | tmux_conf_new_window_retain_current_path=false 23 | 24 | # new pane retains current path, possible values are: 25 | # - true (default) 26 | # - false 27 | tmux_conf_new_pane_retain_current_path=true 28 | 29 | # new pane tries to reconnect ssh sessions (experimental), possible values are: 30 | # - true 31 | # - false (default) 32 | tmux_conf_new_pane_reconnect_ssh=false 33 | 34 | # prompt for session name when creating a new session, possible values are: 35 | # - true 36 | # - false (default) 37 | tmux_conf_new_session_prompt=false 38 | 39 | 40 | # -- display ------------------------------------------------------------------- 41 | 42 | # RGB 24-bit colour support (tmux >= 2.2), possible values are: 43 | # - true 44 | # - false (default) 45 | tmux_conf_theme_24b_colour=false 46 | 47 | # window style 48 | tmux_conf_theme_window_fg='default' 49 | tmux_conf_theme_window_bg='default' 50 | 51 | # highlight focused pane (tmux >= 2.1), possible values are: 52 | # - true 53 | # - false (default) 54 | tmux_conf_theme_highlight_focused_pane=false 55 | 56 | # focused pane colours: 57 | tmux_conf_theme_focused_pane_fg='default' 58 | tmux_conf_theme_focused_pane_bg='#0087d7' # light blue 59 | 60 | # pane border style, possible values are: 61 | # - thin (default) 62 | # - fat 63 | tmux_conf_theme_pane_border_style=thin 64 | 65 | # pane borders colours: 66 | tmux_conf_theme_pane_border='#444444' # gray 67 | tmux_conf_theme_pane_active_border='#00afff' # light blue 68 | 69 | # pane indicator colours 70 | tmux_conf_theme_pane_indicator='#00afff' # light blue 71 | tmux_conf_theme_pane_active_indicator='#00afff' # light blue 72 | 73 | # status line style 74 | tmux_conf_theme_message_fg='#000000' # black 75 | tmux_conf_theme_message_bg='#ffff00' # yellow 76 | tmux_conf_theme_message_attr='bold' 77 | 78 | # status line command style ( : Escape) 79 | tmux_conf_theme_message_command_fg='#ffff00' # yellow 80 | tmux_conf_theme_message_command_bg='#000000' # black 81 | tmux_conf_theme_message_command_attr='bold' 82 | 83 | # window modes style 84 | tmux_conf_theme_mode_fg='#000000' # black 85 | tmux_conf_theme_mode_bg='#ffff00' # yellow 86 | tmux_conf_theme_mode_attr='bold' 87 | 88 | # status line style 89 | tmux_conf_theme_status_fg='#8a8a8a' # light gray 90 | tmux_conf_theme_status_bg='#080808' # dark gray 91 | tmux_conf_theme_status_attr='none' 92 | 93 | # terminal title 94 | # - built-in variables are: 95 | # - #{circled_window_index} 96 | # - #{circled_session_name} 97 | # - #{hostname} 98 | # - #{hostname_ssh} 99 | # - #{username} 100 | # - #{username_ssh} 101 | tmux_conf_theme_terminal_title='#h ❐ #S ● #I #W' 102 | 103 | # window status style 104 | # - built-in variables are: 105 | # - #{circled_window_index} 106 | # - #{circled_session_name} 107 | # - #{hostname} 108 | # - #{hostname_ssh} 109 | # - #{username} 110 | # - #{username_ssh} 111 | tmux_conf_theme_window_status_fg='#8a8a8a' # light gray 112 | tmux_conf_theme_window_status_bg='#080808' # dark gray 113 | tmux_conf_theme_window_status_attr='none' 114 | tmux_conf_theme_window_status_format='#I #W' 115 | #tmux_conf_theme_window_status_format='#{circled_window_index} #W' 116 | #tmux_conf_theme_window_status_format='#I #W#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}' 117 | 118 | # window current status style 119 | # - built-in variables are: 120 | # - #{circled_window_index} 121 | # - #{circled_session_name} 122 | # - #{hostname} 123 | # - #{hostname_ssh} 124 | # - #{username} 125 | # - #{username_ssh} 126 | tmux_conf_theme_window_status_current_fg='#000000' # black 127 | tmux_conf_theme_window_status_current_bg='#00afff' # light blue 128 | tmux_conf_theme_window_status_current_attr='bold' 129 | tmux_conf_theme_window_status_current_format='#I #W' 130 | #tmux_conf_theme_window_status_current_format='#{circled_window_index} #W' 131 | #tmux_conf_theme_window_status_current_format='#I #W#{?window_zoomed_flag,🔍,}' 132 | 133 | # window activity status style 134 | tmux_conf_theme_window_status_activity_fg='default' 135 | tmux_conf_theme_window_status_activity_bg='default' 136 | tmux_conf_theme_window_status_activity_attr='underscore' 137 | 138 | # window bell status style 139 | tmux_conf_theme_window_status_bell_fg='#ffff00' # yellow 140 | tmux_conf_theme_window_status_bell_bg='default' 141 | tmux_conf_theme_window_status_bell_attr='blink,bold' 142 | 143 | # window last status style 144 | tmux_conf_theme_window_status_last_fg='#00afff' # light blue 145 | tmux_conf_theme_window_status_last_bg='default' 146 | tmux_conf_theme_window_status_last_attr='none' 147 | 148 | # status left/right sections separators 149 | tmux_conf_theme_left_separator_main='' 150 | tmux_conf_theme_left_separator_sub='|' 151 | tmux_conf_theme_right_separator_main='' 152 | tmux_conf_theme_right_separator_sub='|' 153 | #tmux_conf_theme_left_separator_main='\uE0B0' # /!\ you don't need to install Powerline 154 | #tmux_conf_theme_left_separator_sub='\uE0B1' # you only need fonts patched with 155 | #tmux_conf_theme_right_separator_main='\uE0B2' # Powerline symbols or the standalone 156 | #tmux_conf_theme_right_separator_sub='\uE0B3' # PowerlineSymbols.otf font, see README.md 157 | 158 | # status left/right content: 159 | # - separate main sections with '|' 160 | # - separate subsections with ',' 161 | # - built-in variables are: 162 | # - #{battery_bar} 163 | # - #{battery_hbar} 164 | # - #{battery_percentage} 165 | # - #{battery_status} 166 | # - #{battery_vbar} 167 | # - #{circled_session_name} 168 | # - #{hostname_ssh} 169 | # - #{hostname} 170 | # - #{loadavg} 171 | # - #{pairing} 172 | # - #{prefix} 173 | # - #{root} 174 | # - #{synchronized} 175 | # - #{uptime_y} 176 | # - #{uptime_d} (modulo 365 when #{uptime_y} is used) 177 | # - #{uptime_h} 178 | # - #{uptime_m} 179 | # - #{uptime_s} 180 | # - #{username} 181 | # - #{username_ssh} 182 | tmux_conf_theme_status_left=' ❐ #S ' 183 | tmux_conf_theme_status_right='#{prefix}#{pairing}#{synchronized} #{?battery_status, #{battery_status},} #{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root}' 184 | 185 | # status left style 186 | tmux_conf_theme_status_left_fg='#000000,#e4e4e4,#e4e4e4' # black, white , white 187 | tmux_conf_theme_status_left_bg='#ffff00,#ff00af,#00afff' # yellow, pink, white blue 188 | tmux_conf_theme_status_left_attr='bold,none,none' 189 | 190 | # status right style 191 | tmux_conf_theme_status_right_fg='#8a8a8a,#e4e4e4,#000000' # light gray, white, black 192 | tmux_conf_theme_status_right_bg='#080808,#d70000,#e4e4e4' # dark gray, red, white 193 | tmux_conf_theme_status_right_attr='none,none,bold' 194 | 195 | # pairing indicator 196 | tmux_conf_theme_pairing='👓 ' # U+1F453 197 | tmux_conf_theme_pairing_fg='none' 198 | tmux_conf_theme_pairing_bg='none' 199 | tmux_conf_theme_pairing_attr='none' 200 | 201 | # prefix indicator 202 | tmux_conf_theme_prefix='⌨ ' # U+2328 203 | tmux_conf_theme_prefix_fg='none' 204 | tmux_conf_theme_prefix_bg='none' 205 | tmux_conf_theme_prefix_attr='none' 206 | 207 | # root indicator 208 | tmux_conf_theme_root='!' 209 | tmux_conf_theme_root_fg='none' 210 | tmux_conf_theme_root_bg='none' 211 | tmux_conf_theme_root_attr='bold,blink' 212 | 213 | # synchronized indicator 214 | tmux_conf_theme_synchronized='🔒' # U+1F512 215 | tmux_conf_theme_synchronized_fg='none' 216 | tmux_conf_theme_synchronized_bg='none' 217 | tmux_conf_theme_synchronized_attr='none' 218 | 219 | # battery bar symbols 220 | tmux_conf_battery_bar_symbol_full='◼' 221 | tmux_conf_battery_bar_symbol_empty='◻' 222 | #tmux_conf_battery_bar_symbol_full='♥' 223 | #tmux_conf_battery_bar_symbol_empty='·' 224 | 225 | # battery bar length (in number of symbols), possible values are: 226 | # - auto 227 | # - a number, e.g. 5 228 | tmux_conf_battery_bar_length='auto' 229 | 230 | # battery bar palette, possible values are: 231 | # - gradient (default) 232 | # - heat 233 | # - 'colour_full_fg,colour_empty_fg,colour_bg' 234 | tmux_conf_battery_bar_palette='gradient' 235 | #tmux_conf_battery_bar_palette='#d70000,#e4e4e4,#000000' # red, white, black 236 | 237 | # battery hbar palette, possible values are: 238 | # - gradient (default) 239 | # - heat 240 | # - 'colour_low,colour_half,colour_full' 241 | tmux_conf_battery_hbar_palette='gradient' 242 | #tmux_conf_battery_hbar_palette='#d70000,#ff5f00,#5fff00' # red, orange, green 243 | 244 | # battery vbar palette, possible values are: 245 | # - gradient (default) 246 | # - heat 247 | # - 'colour_low,colour_half,colour_full' 248 | tmux_conf_battery_vbar_palette='gradient' 249 | #tmux_conf_battery_vbar_palette='#d70000,#ff5f00,#5fff00' # red, orange, green 250 | 251 | # symbols used to indicate whether battery is charging or discharging 252 | tmux_conf_battery_status_charging='↑' # U+2191 253 | tmux_conf_battery_status_discharging='↓' # U+2193 254 | #tmux_conf_battery_status_charging='⚡ ' # U+26A1 255 | #tmux_conf_battery_status_charging='🔌 ' # U+1F50C 256 | #tmux_conf_battery_status_discharging='🔋 ' # U+1F50B 257 | 258 | # clock style (when you hit + t) 259 | # you may want to use %I:%M %p in place of %R in tmux_conf_theme_status_right 260 | tmux_conf_theme_clock_colour='#00afff' # light blue 261 | tmux_conf_theme_clock_style='24' 262 | 263 | 264 | # -- clipboard ----------------------------------------------------------------- 265 | 266 | # in copy mode, copying selection also copies to the OS clipboard 267 | # - true 268 | # - false (default) 269 | # on macOS, this requires installing reattach-to-user-namespace, see README.md 270 | # on Linux, this requires xsel or xclip 271 | tmux_conf_copy_to_os_clipboard=false 272 | 273 | 274 | # -- user customizations ------------------------------------------------------- 275 | # this is the place to override or undo settings 276 | 277 | # increase history size 278 | #set -g history-limit 10000 279 | 280 | # start with mouse mode enabled 281 | set -g mouse on 282 | 283 | # force Vi mode 284 | # really you should export VISUAL or EDITOR environment variable, see manual 285 | #set -g status-keys vi 286 | #set -g mode-keys vi 287 | 288 | # replace C-b by C-a instead of using both prefixes 289 | # set -gu prefix2 290 | unbind C-a 291 | unbind C-b 292 | set -g prefix M-j 293 | bind M-j send-prefix 294 | 295 | # move status line to top 296 | #set -g status-position top 297 | 298 | # Uses zsh as default shell 299 | set-option -g default-shell /bin/zsh 300 | 301 | # Disable zsh from renaming window name 302 | # set allow-rename off 303 | set allow-rename off 304 | 305 | # bind double b to last window 306 | bind M-j last-window # move to last window 307 | 308 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dotfiles 2 | 3 | My personal dev setup. Includes config files for tmux, NeoVim, zsh. Optimized to improve speed, and keep your hands on home row. Tries to reduce cost of context switch. 4 | 5 | ![tmux + NeoVim setup](https://i.imgur.com/Jo4F4b1.png) 6 | 7 | ## tmux config 8 | 9 | * tmux config extends [gpakosz/.tmux](https://github.com/gpakosz/.tmux). 10 | * changes to colorscheme to match *base16-default-dark* colorscheme. 11 | * applescript displays itunes and spotify track on status line 12 | * M-j for tmux prefix. Use stronger index to move between both tmux and vim splits 13 | 14 | ## NeoVim setup 15 | 16 | Map your caps lock to ctrl for best experience. 17 | 18 | * Uses vim-plug 19 | * Uses ``,`` for leader 20 | * Works great for react development and tdd. Includes sensible plugins like 21 | - Ultisnips 22 | - vim-react-snippets 23 | - vim-jest-snippets 24 | - istanbul 25 | - vim-test 26 | - vim-jsx 27 | - vim-prettier 28 | - vim-styled-components 29 | * Switching to normal mode saves buffer 30 | * Some notable plugins include 31 | - vim-commentary 32 | - vim-surround 33 | - vim-repeat 34 | - netrw istead of NerdTree 35 | - FastFold 36 | - vim-stay 37 | - vimwiki 38 | - fzf 39 | - deoplete 40 | - vim-fugitive 41 | - EasyMotion 42 | - Ale for linting 43 | - vim-rails 44 | - vim-markdown 45 | 46 | ## colorscheme 47 | 48 | iTerm2, NeoVim and tmux all use same color scheme *base16-default-dark* 49 | 50 | # fonts 51 | 52 | * Uses *Fira Code* without ligature. Disabling ligatures helps iTerm2 use gpu. 53 | * *Hack regular code nerd complete* for icons in iTerm2. 54 | 55 | -------------------------------------------------------------------------------- /applescripts/tunes.js: -------------------------------------------------------------------------------- 1 | output = ''; 2 | if (Application('iTunes').running()) { 3 | const track = Application('iTunes').currentTrack; 4 | const artist = track.artist(); 5 | const title = track.name(); 6 | output = (`${title} - ${artist}`).substr(0, 50); 7 | } else if (Application('Spotify').running()) { 8 | const track = Application('Spotify').currentTrack; 9 | const artist = track.artist(); 10 | const title = track.name(); 11 | output = (`${title} - ${artist}`).substr(0, 50); 12 | } 13 | 14 | output; 15 | -------------------------------------------------------------------------------- /eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "plugins": [ 4 | "react" 5 | ], 6 | "env": { 7 | "browser": true, 8 | "node": true 9 | }, 10 | "ecmaFeatures": { 11 | "arrowFunctions": true, 12 | "blockBindings": true, 13 | "classes": true, 14 | "defaultParams": true, 15 | "destructuring": true, 16 | "forOf": true, 17 | "generators": false, 18 | "modules": false, 19 | "objectLiteralComputedProperties": true, 20 | "objectLiteralDuplicateProperties": false, 21 | "objectLiteralShorthandMethods": true, 22 | "objectLiteralShorthandProperties": true, 23 | "spread": true, 24 | "superInFunctions": true, 25 | "templateStrings": true, 26 | "jsx": true 27 | }, 28 | "rules": { 29 | 30 | /** 31 | * Variables 32 | */ 33 | "no-shadow": 2, // http://eslint.org/docs/rules/no-shadow 34 | "no-shadow-restricted-names": 2, // http://eslint.org/docs/rules/no-shadow-restricted-names 35 | "no-unused-vars": [2, { // http://eslint.org/docs/rules/no-unused-vars 36 | "vars": "local", 37 | "args": "after-used", 38 | "argsIgnorePattern": "^_", 39 | "varsIgnorePattern": "^_" 40 | }], 41 | "no-use-before-define": 0, // http://eslint.org/docs/rules/no-use-before-define 42 | 43 | /** 44 | * Possible errors 45 | */ 46 | "comma-dangle": 0, // http://eslint.org/docs/rules/comma-dangle 47 | "no-cond-assign": [2, "always"], // http://eslint.org/docs/rules/no-cond-assign 48 | "no-debugger": 1, // http://eslint.org/docs/rules/no-debugger 49 | "no-alert": 0, // http://eslint.org/docs/rules/no-alert 50 | "no-constant-condition": 1, // http://eslint.org/docs/rules/no-constant-condition 51 | "no-dupe-keys": 2, // http://eslint.org/docs/rules/no-dupe-keys 52 | "no-duplicate-case": 2, // http://eslint.org/docs/rules/no-duplicate-case 53 | "no-empty": 2, // http://eslint.org/docs/rules/no-empty 54 | "no-ex-assign": 2, // http://eslint.org/docs/rules/no-ex-assign 55 | "no-extra-boolean-cast": 0, // http://eslint.org/docs/rules/no-extra-boolean-cast 56 | "no-extra-semi": 2, // http://eslint.org/docs/rules/no-extra-semi 57 | "no-func-assign": 2, // http://eslint.org/docs/rules/no-func-assign 58 | "no-inner-declarations": 2, // http://eslint.org/docs/rules/no-inner-declarations 59 | "no-invalid-regexp": 2, // http://eslint.org/docs/rules/no-invalid-regexp 60 | "no-irregular-whitespace": 2, // http://eslint.org/docs/rules/no-irregular-whitespace 61 | "no-obj-calls": 2, // http://eslint.org/docs/rules/no-obj-calls 62 | "no-sparse-arrays": 2, // http://eslint.org/docs/rules/no-sparse-arrays 63 | "no-unreachable": 2, // http://eslint.org/docs/rules/no-unreachable 64 | "use-isnan": 2, // http://eslint.org/docs/rules/use-isnan 65 | "block-scoped-var": 0, // http://eslint.org/docs/rules/block-scoped-var 66 | "no-undef": 2, 67 | 68 | /** 69 | * Best practices 70 | */ 71 | "consistent-return": 2, // http://eslint.org/docs/rules/consistent-return 72 | "curly": [2, "multi-line"], // http://eslint.org/docs/rules/curly 73 | "default-case": 2, // http://eslint.org/docs/rules/default-case 74 | "dot-notation": [2, { // http://eslint.org/docs/rules/dot-notation 75 | "allowKeywords": true 76 | }], 77 | "eqeqeq": 2, // http://eslint.org/docs/rules/eqeqeq 78 | "guard-for-in": 2, // http://eslint.org/docs/rules/guard-for-in 79 | "no-caller": 2, // http://eslint.org/docs/rules/no-caller 80 | "no-else-return": 2, // http://eslint.org/docs/rules/no-else-return 81 | "no-eq-null": 2, // http://eslint.org/docs/rules/no-eq-null 82 | "no-eval": 2, // http://eslint.org/docs/rules/no-eval 83 | "no-extend-native": 2, // http://eslint.org/docs/rules/no-extend-native 84 | "no-extra-bind": 2, // http://eslint.org/docs/rules/no-extra-bind 85 | "no-fallthrough": 2, // http://eslint.org/docs/rules/no-fallthrough 86 | "no-floating-decimal": 2, // http://eslint.org/docs/rules/no-floating-decimal 87 | "no-implied-eval": 2, // http://eslint.org/docs/rules/no-implied-eval 88 | "no-lone-blocks": 2, // http://eslint.org/docs/rules/no-lone-blocks 89 | "no-loop-func": 2, // http://eslint.org/docs/rules/no-loop-func 90 | "no-multi-str": 2, // http://eslint.org/docs/rules/no-multi-str 91 | "no-native-reassign": 2, // http://eslint.org/docs/rules/no-native-reassign 92 | "no-new": 2, // http://eslint.org/docs/rules/no-new 93 | "no-new-func": 2, // http://eslint.org/docs/rules/no-new-func 94 | "no-new-wrappers": 2, // http://eslint.org/docs/rules/no-new-wrappers 95 | "no-octal": 2, // http://eslint.org/docs/rules/no-octal 96 | "no-octal-escape": 2, // http://eslint.org/docs/rules/no-octal-escape 97 | "no-param-reassign": 0, // http://eslint.org/docs/rules/no-param-reassign 98 | "no-proto": 2, // http://eslint.org/docs/rules/no-proto 99 | "no-redeclare": 2, // http://eslint.org/docs/rules/no-redeclare 100 | "no-return-assign": 2, // http://eslint.org/docs/rules/no-return-assign 101 | "no-script-url": 2, // http://eslint.org/docs/rules/no-script-url 102 | "no-self-compare": 2, // http://eslint.org/docs/rules/no-self-compare 103 | "no-sequences": 2, // http://eslint.org/docs/rules/no-sequences 104 | "no-throw-literal": 2, // http://eslint.org/docs/rules/no-throw-literal 105 | "no-with": 2, // http://eslint.org/docs/rules/no-with 106 | "radix": 2, // http://eslint.org/docs/rules/radix 107 | "vars-on-top": 2, // http://eslint.org/docs/rules/vars-on-top 108 | "wrap-iife": [2, "any"], // http://eslint.org/docs/rules/wrap-iife 109 | "yoda": 2, // http://eslint.org/docs/rules/yoda 110 | 111 | /** 112 | * Style 113 | */ 114 | "indent": [2, 2], // http://eslint.org/docs/rules/ 115 | "brace-style": [2, // http://eslint.org/docs/rules/brace-style 116 | "1tbs", { 117 | "allowSingleLine": true 118 | }], 119 | "quotes": [ 120 | 2, "single", "avoid-escape" // http://eslint.org/docs/rules/quotes 121 | ], 122 | "camelcase": [0, { // http://eslint.org/docs/rules/camelcase 123 | "properties": "never" 124 | }], 125 | "comma-spacing": [2, { // http://eslint.org/docs/rules/comma-spacing 126 | "before": false, 127 | "after": true 128 | }], 129 | "comma-style": [2, "last"], // http://eslint.org/docs/rules/comma-style 130 | "eol-last": 2, // http://eslint.org/docs/rules/eol-last 131 | "key-spacing": [2, { // http://eslint.org/docs/rules/key-spacing 132 | "beforeColon": false, 133 | "afterColon": true 134 | }], 135 | "new-cap": [0, { // http://eslint.org/docs/rules/new-cap 136 | "newIsCap": false 137 | }], 138 | "no-multiple-empty-lines": [2, { // http://eslint.org/docs/rules/no-multiple-empty-lines 139 | "max": 5 140 | }], 141 | "no-nested-ternary": 2, // http://eslint.org/docs/rules/no-nested-ternary 142 | "no-new-object": 2, // http://eslint.org/docs/rules/no-new-object 143 | "no-spaced-func": 2, // http://eslint.org/docs/rules/no-spaced-func 144 | "no-trailing-spaces": 2, // http://eslint.org/docs/rules/no-trailing-spaces 145 | "no-extra-parens": 0, // http://eslint.org/docs/rules/no-wrap-func 146 | "no-underscore-dangle": 0, // http://eslint.org/docs/rules/no-underscore-dangle 147 | "one-var": 0, // http://eslint.org/docs/rules/one-var 148 | "semi": [2, "always"], // http://eslint.org/docs/rules/semi 149 | "semi-spacing": [2, { // http://eslint.org/docs/rules/semi-spacing 150 | "before": false, 151 | "after": true 152 | }], 153 | "space-before-blocks": 2, // http://eslint.org/docs/rules/space-before-blocks 154 | "space-before-function-paren": [2, "never"], // http://eslint.org/docs/rules/space-before-function-paren 155 | "space-infix-ops": 2, // http://eslint.org/docs/rules/space-infix-ops 156 | "keyword-spacing": 2, // http://eslint.org/docs/rules/keyword-spacing 157 | "no-path-concat": 0, 158 | 159 | /* react */ 160 | 161 | "react/jsx-curly-spacing": 1, 162 | "react/jsx-no-duplicate-props": 1, 163 | "react/jsx-no-undef": 1, 164 | "react/sort-prop-types": 1, 165 | "react/jsx-uses-react": 1, 166 | "react/jsx-uses-vars": 1, 167 | "react/no-danger": 1, 168 | "react/no-did-mount-set-state": 1, 169 | "react/no-did-update-set-state": 1, 170 | "react/no-direct-mutation-state": 1, 171 | "react/no-multi-comp": 1, 172 | "react/no-unknown-property": 1, 173 | "react/prop-types": 1, 174 | "react/react-in-jsx-scope": 1, 175 | "react/require-extension": 1, 176 | "react/self-closing-comp": 1, 177 | "react/sort-comp": 1, 178 | "react/wrap-multilines": 1 179 | 180 | }, 181 | "globals": { 182 | "React": false, 183 | "$": false, 184 | "axios": false 185 | } 186 | 187 | } 188 | -------------------------------------------------------------------------------- /gemrc: -------------------------------------------------------------------------------- 1 | install: --no-rdoc --no-ri 2 | update: --no-rdoc --no-ri 3 | -------------------------------------------------------------------------------- /gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Swapnil Singh 3 | email = mail@swapnilsingh.me 4 | [github] 5 | user = Swap 6 | [gpg] 7 | program = gpg 8 | [core] 9 | autocrlf = input 10 | whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol 11 | excludesfile = ~/.gitignore 12 | [branch] 13 | autosetupmerge = true 14 | [push] 15 | default = simple 16 | [fetch] 17 | prune = true 18 | [commit] 19 | gpgsign = false 20 | [help] 21 | autocorrect = 5 22 | [color] 23 | ui = auto 24 | [color "branch"] 25 | current = yellow reverse 26 | local = yellow 27 | remote = green 28 | [color "diff"] 29 | meta = cyan dim 30 | frag = magenta bold 31 | old = red dim 32 | new = green dim 33 | whitespace = red reverse 34 | [color "status"] 35 | added = yellow 36 | changed = green 37 | untracked = cyan 38 | [alias] 39 | st = status 40 | ci = commit -a 41 | br = branch 42 | co = checkout 43 | ds = diff --staged 44 | unstage = reset HEAD 45 | uncommit = reset --soft HEAD^ 46 | olog = log --oneline 47 | diffp = diff --color --patience 48 | diffi = diff --color --color-words --abbrev --ignore-all-space 49 | diffw = diff --color --color-words --abbrev 50 | diffwp = diff --color --color-words --abbrev --patience 51 | diffn = diff --color --name-status 52 | lp = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -p 53 | lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --name-status 54 | l = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit 55 | unpushed = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --branches --not --remotes 56 | sync = "remote update origin --prune" 57 | pl = "merge --ff-only @{u}" 58 | -------------------------------------------------------------------------------- /gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.swp 3 | *.swo 4 | .bundle 5 | .DS_Store 6 | .idea 7 | /*-TODO.md 8 | -------------------------------------------------------------------------------- /linux/.zshrc: -------------------------------------------------------------------------------- 1 | # If you come from bash you might have to change your $PATH. 2 | # export PATH=$HOME/bin:/usr/local/bin:$PATH 3 | 4 | # Path to your oh-my-zsh installation. 5 | export ZSH="/home/swapnils/.oh-my-zsh" 6 | 7 | # Set name of the theme to load --- if set to "random", it will 8 | # load a random theme each time oh-my-zsh is loaded, in which case, 9 | # to know which specific one was loaded, run: echo $RANDOM_THEME 10 | # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes 11 | ZSH_THEME="robbyrussell" 12 | 13 | # Set list of themes to pick from when loading at random 14 | # Setting this variable when ZSH_THEME=random will cause zsh to load 15 | # a theme from this variable instead of looking in ~/.oh-my-zsh/themes/ 16 | # If set to an empty array, this variable will have no effect. 17 | # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) 18 | 19 | # Uncomment the following line to use case-sensitive completion. 20 | # CASE_SENSITIVE="true" 21 | 22 | # Uncomment the following line to use hyphen-insensitive completion. 23 | # Case-sensitive completion must be off. _ and - will be interchangeable. 24 | # HYPHEN_INSENSITIVE="true" 25 | 26 | # Uncomment the following line to disable bi-weekly auto-update checks. 27 | # DISABLE_AUTO_UPDATE="true" 28 | 29 | # Uncomment the following line to automatically update without prompting. 30 | # DISABLE_UPDATE_PROMPT="true" 31 | 32 | # Uncomment the following line to change how often to auto-update (in days). 33 | # export UPDATE_ZSH_DAYS=13 34 | 35 | # Uncomment the following line if pasting URLs and other text is messed up. 36 | # DISABLE_MAGIC_FUNCTIONS=true 37 | 38 | # Uncomment the following line to disable colors in ls. 39 | # DISABLE_LS_COLORS="true" 40 | 41 | # Uncomment the following line to disable auto-setting terminal title. 42 | # DISABLE_AUTO_TITLE="true" 43 | 44 | # Uncomment the following line to enable command auto-correction. 45 | # ENABLE_CORRECTION="true" 46 | 47 | # Uncomment the following line to display red dots whilst waiting for completion. 48 | # COMPLETION_WAITING_DOTS="true" 49 | 50 | # Uncomment the following line if you want to disable marking untracked files 51 | # under VCS as dirty. This makes repository status check for large repositories 52 | # much, much faster. 53 | # DISABLE_UNTRACKED_FILES_DIRTY="true" 54 | 55 | # Uncomment the following line if you want to change the command execution time 56 | # stamp shown in the history command output. 57 | # You can set one of the optional three formats: 58 | # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" 59 | # or set a custom format using the strftime function format specifications, 60 | # see 'man strftime' for details. 61 | # HIST_STAMPS="mm/dd/yyyy" 62 | 63 | # Would you like to use another custom folder than $ZSH/custom? 64 | # ZSH_CUSTOM=/path/to/new-custom-folder 65 | 66 | # Which plugins would you like to load? 67 | # Standard plugins can be found in ~/.oh-my-zsh/plugins/* 68 | # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ 69 | # Example format: plugins=(rails git textmate ruby lighthouse) 70 | # Add wisely, as too many plugins slow down shell startup. 71 | plugins=(git) 72 | 73 | source $ZSH/oh-my-zsh.sh 74 | 75 | # User configuration 76 | 77 | # export MANPATH="/usr/local/man:$MANPATH" 78 | 79 | # You may need to manually set your language environment 80 | # export LANG=en_US.UTF-8 81 | 82 | # Preferred editor for local and remote sessions 83 | # if [[ -n $SSH_CONNECTION ]]; then 84 | # export EDITOR='vim' 85 | # else 86 | # export EDITOR='mvim' 87 | # fi 88 | 89 | # Compilation flags 90 | # export ARCHFLAGS="-arch x86_64" 91 | 92 | # Set personal aliases, overriding those provided by oh-my-zsh libs, 93 | # plugins, and themes. Aliases can be placed here, though oh-my-zsh 94 | # users are encouraged to define aliases within the ZSH_CUSTOM folder. 95 | # For a full list of active aliases, run `alias`. 96 | # 97 | # Example aliases 98 | # alias zshconfig="mate ~/.zshrc" 99 | # alias ohmyzsh="mate ~/.oh-my-zsh" 100 | 101 | bindkey -s "^[Op" "0" 102 | bindkey -s "^[Ol" "." 103 | bindkey -s "^[OM" "^M" 104 | # 1 2 3 105 | bindkey -s "^[Oq" "1" 106 | bindkey -s "^[Or" "2" 107 | bindkey -s "^[Os" "3" 108 | # 4 5 6 109 | bindkey -s "^[Ot" "4" 110 | bindkey -s "^[Ou" "5" 111 | bindkey -s "^[Ov" "6" 112 | # 7 8 9 113 | bindkey -s "^[Ow" "7" 114 | bindkey -s "^[Ox" "8" 115 | bindkey -s "^[Oy" "9" 116 | # + - * / 117 | bindkey -s "^[Ok" "+" 118 | bindkey -s "^[Om" "-" 119 | bindkey -s "^[Oj" "*" 120 | bindkey -s "^[Oo" "/" 121 | -------------------------------------------------------------------------------- /nvim/UltiSnips/all.snippets: -------------------------------------------------------------------------------- 1 | # Global snippets 2 | snippet date 3 | `strftime("%Y-%m-%d")` 4 | endsnippet 5 | 6 | snippet ddate 7 | `strftime("%B %d, %Y")` 8 | endsnippet 9 | 10 | snippet time 11 | `strftime("%H:%M")` 12 | endsnippet 13 | 14 | snippet datetime 15 | `strftime("%Y-%m-%d %H:%M")` 16 | endsnippet 17 | 18 | snippet lorem "Lorem ipsum" b 19 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer euismod ligula odio, at blandit orci facilisis in. Nam mollis odio a aliquam fringilla. Maecenas lacinia, ante quis facilisis tincidunt, libero felis laoreet est, a interdum magna justo sit amet libero. Sed purus justo, pellentesque eu lacus sit amet, iaculis dignissim felis. Curabitur euismod interdum turpis, id venenatis justo accumsan sit amet. Nulla scelerisque lectus vel justo venenatis, dictum pharetra tellus maximus. Praesent dui eros, rutrum in sapien non, luctus sollicitudin dolor. Morbi et ipsum lobortis, imperdiet orci maximus, fermentum turpis. Morbi dapibus convallis auctor. Aliquam dictum pretium varius. Cras est eros, mattis dapibus interdum quis, tempus quis odio. Praesent maximus lorem sed sem luctus porttitor at ac tellus. Mauris quis fermentum felis, lobortis placerat nibh. Sed pulvinar, quam auctor tempor commodo, turpis felis dictum neque, et gravida nunc diam eget turpis. Vestibulum et purus eget erat facilisis porta quis ut felis. Donec facilisis orci vel lectus consectetur, eget bibendum nisi suscipit. 20 | endsnippet 21 | 22 | snippet loremn "Lorem ipsum with newlines" b 23 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer euismod ligula 24 | odio, at blandit orci facilisis in. Nam mollis odio a aliquam fringilla. 25 | Maecenas lacinia, ante quis facilisis tincidunt, libero felis laoreet est, 26 | a interdum magna justo sit amet libero. Sed purus justo, pellentesque eu lacus 27 | sit amet, iaculis dignissim felis. Curabitur euismod interdum turpis, id venenatis 28 | justo accumsan sit amet. Nulla scelerisque lectus vel justo venenatis, dictum pharetra 29 | tellus maximus. Praesent dui eros, rutrum in sapien non, luctus sollicitudin dolor. 30 | Morbi et ipsum lobortis, imperdiet orci maximus, fermentum turpis. Morbi dapibus 31 | convallis auctor. Aliquam dictum pretium varius. Cras est eros, mattis dapibus interdum 32 | quis, tempus quis odio. Praesent maximus lorem sed sem luctus porttitor at ac tellus. 33 | Mauris quis fermentum felis, lobortis placerat nibh. Sed pulvinar, quam auctor tempor 34 | commodo, turpis felis dictum neque, et gravida nunc diam eget turpis. Vestibulum et 35 | purus eget erat facilisis porta quis ut felis. Donec facilisis orci vel lectus consectetur, 36 | eget bibendum nisi suscipit. 37 | endsnippet 38 | -------------------------------------------------------------------------------- /nvim/UltiSnips/css.snippets: -------------------------------------------------------------------------------- 1 | snippet var "Insert a CSS variable" 2 | var(--$1)$2 3 | endsnippet 4 | 5 | snippet rgb "Insert rgb value" 6 | rgb($1, $2, $3) 7 | endsnippet 8 | 9 | snippet rgba "insert rgba value" 10 | rgb($1, $2, $3, $4) 11 | endsnippet 12 | 13 | snippet hsl "Insert hsl value" 14 | hsl($1, $2, $3) 15 | endsnippet 16 | 17 | snippet hsla "Insert hsla value" 18 | hsla($1, $2, $3, $4) 19 | endsnippet 20 | -------------------------------------------------------------------------------- /nvim/UltiSnips/html.snippets: -------------------------------------------------------------------------------- 1 | snippet viewport 2 | 3 | endsnippet 4 | -------------------------------------------------------------------------------- /nvim/UltiSnips/javascript.snippets: -------------------------------------------------------------------------------- 1 | snippet iife 2 | (function () { 3 | $1 4 | })(); 5 | endsnippet 6 | 7 | snippet log "Insert cosole.log" 8 | console.debug($1); 9 | endsnippet 10 | snippet logc "Insert log with color" 11 | console.debug('%c$1', 'font-weight:bold;background-color:${2:green};color: white', ${3:''});$0 12 | endsnippet 13 | 14 | snippet doc "Doc Comment" b 15 | /** 16 | * $1 17 | */ 18 | endsnippet 19 | 20 | snippet esl "eslint disable line" 21 | // eslint-disable-line $1 22 | endsnippet 23 | 24 | snippet imp "import default from" b 25 | import $1 from '$2'; 26 | endsnippet 27 | 28 | snippet imd "import destructure" b 29 | import { $1 } from '$2'; 30 | endsnippet 31 | 32 | snippet ima "import * as " b 33 | import * as $1 from '$2' 34 | endsnippet 35 | -------------------------------------------------------------------------------- /nvim/UltiSnips/markdown.snippets: -------------------------------------------------------------------------------- 1 | snippet code "Insert code fense" b 2 | \`\`\`${1} 3 | \`\`\` 4 | endsnippet 5 | 6 | snippet a "Insert link" 7 | [${1:text}](${2:http://}) 8 | endsnippet 9 | 10 | snippet img "insert image" 11 | ![${1:alt}](${2:http://}) 12 | endsnippet 13 | -------------------------------------------------------------------------------- /nvim/UltiSnips/typescript.snippets: -------------------------------------------------------------------------------- 1 | snippet ref "TypeScript reference comment" b 2 | /// 3 | endsnippet 4 | 5 | snippet log 6 | console.log($1); 7 | endsnippet 8 | 9 | snippet logc 10 | console.log('%c$1', 'font-weight:bold;color:${2:green};'); 11 | endsnippet 12 | 13 | snippet des "Describe" b 14 | describe('$1', () => { 15 | $2 16 | }); 17 | endsnippet 18 | 19 | snippet it 20 | it('$1', () => { 21 | $2 22 | }); 23 | endsnippet 24 | 25 | snippet doc "Doc Comment" b 26 | /** 27 | * $1 28 | */ 29 | endsnippet 30 | 31 | snippet imp "import default from" b 32 | import $1 from '$2'; 33 | endsnippet 34 | 35 | snippet imd "import destructure" b 36 | import { $1 } from '$2'; 37 | endsnippet 38 | 39 | snippet ima "import * as " b 40 | import * as $1 from '$2' 41 | endsnippet 42 | -------------------------------------------------------------------------------- /nvim/autoload/applylocalsettings.vim: -------------------------------------------------------------------------------- 1 | " recursively search up from dirname, sourcing all .vimrc.local files along the way 2 | function! applylocalsettings#ApplyLocalSettings(dirname) 3 | " convert windows paths to unix style 4 | let l:curDir = substitute(a:dirname, '\\', '/', 'g') 5 | 6 | " walk to the top of the dir tree 7 | let l:parentDir = strpart(l:curDir, 0, strridx(l:curDir, '/')) 8 | if isdirectory(l:parentDir) 9 | call ApplyLocalSettings(l:parentDir) 10 | endif 11 | 12 | " now walk back down the path and source .vimsettings as you find them. 13 | " child directories can inherit from their parents 14 | let l:settingsFile = a:dirname . '/.vimrc.local' 15 | if filereadable(l:settingsFile) 16 | exec ':source' . l:settingsFile 17 | endif 18 | endfunction 19 | 20 | -------------------------------------------------------------------------------- /nvim/autoload/functions.vim: -------------------------------------------------------------------------------- 1 | " load vim-plug if it does not exist in the dotfiles 2 | let s:plugpath = expand(':p:h') . '/plug.vim' " this is relative to this file, which is in autoload 3 | function! functions#PlugLoad() 4 | if !filereadable(s:plugpath) 5 | if executable('curl') 6 | echom "Installing vim-plug at " . s:plugpath 7 | let plugurl = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' 8 | call system('curl -fLo ' . shellescape(s:plugpath) . ' --create-dirs ' . plugurl) 9 | if v:shell_error 10 | echom "Error downloading vim-plug. Please install it manually.\n" 11 | exit 12 | endif 13 | else 14 | echom "vim-plug not installed. Please install it manually or install curl.\n" 15 | exit 16 | endif 17 | endif 18 | endfunction 19 | 20 | " Window movement shortcuts 21 | " move to the window in the direction shown, or create a new window 22 | function! functions#WinMove(key) 23 | let t:curwin = winnr() 24 | exec "wincmd ".a:key 25 | if (t:curwin == winnr()) 26 | if (match(a:key,'[jk]')) 27 | wincmd v 28 | else 29 | wincmd s 30 | endif 31 | exec "wincmd ".a:key 32 | endif 33 | endfunction 34 | 35 | " smart tab completion 36 | function! functions#Smart_TabComplete() 37 | let line = getline('.') " current line 38 | 39 | let substr = strpart(line, -1, col('.')+1) " from the start of the current 40 | " line to one character right 41 | " of the cursor 42 | let substr = matchstr(substr, '[^ \t]*$') " word till cursor 43 | if (strlen(substr)==0) " nothing to match on empty string 44 | return '\' 45 | endif 46 | let has_period = match(substr, '\.') != -1 " position of period, if any 47 | let has_slash = match(substr, '\/') != -1 " position of slash, if any 48 | if (!has_period && !has_slash) 49 | return '\\' " existing text matching 50 | elseif ( has_slash ) 51 | return '\\' " file matching 52 | else 53 | return '\\' " plugin matching 54 | endif 55 | endfunction 56 | 57 | " execute a custom command 58 | function! functions#RunCustomCommand() 59 | up 60 | if g:silent_custom_command 61 | execute 'silent !' . s:customcommand 62 | else 63 | execute '!' . s:customcommand 64 | endif 65 | endfunction 66 | 67 | function! functions#SetCustomCommand() 68 | let s:customcommand = input('Enter Custom Command$ ') 69 | endfunction 70 | 71 | function! functions#TrimWhiteSpace() 72 | %s/\s\+$//e 73 | endfunction 74 | 75 | function! functions#HtmlUnEscape() 76 | silent s/<//eg 78 | silent s/&/\&/eg 79 | endfunction 80 | 81 | " delete the current buffer 82 | function! functions#Delete(...) 83 | if (exists('a:1')) 84 | let file=a:1 85 | elseif ( &ft == 'help' ) 86 | echohl Error 87 | echo "Cannod delete a help buffer!" 88 | echohl None 89 | return -1 90 | else 91 | let file=expand('%:p') 92 | endif 93 | let status=delete(file) 94 | if (status == 0) 95 | echo "Deleted " . file 96 | else 97 | echohl WarningMsg 98 | echo "Failed to delete " . file 99 | echohl None 100 | endif 101 | return status 102 | endfunction 103 | -------------------------------------------------------------------------------- /nvim/autoload/hiinterestingword.vim: -------------------------------------------------------------------------------- 1 | " Highlight Word 2 | " 3 | " This plugin is based on Steve Losh's vimrc 4 | " https://bitbucket.org/sjl/dotfiles/src/e6f6389e598f33a32e75069d7b3cfafb597a4d82/vim/vimrc?fileviewer=file-view-default#cl-2291 5 | " 6 | " This will create a match for the word under the cursor, which will highlight all 7 | " uses of the word in the file. If the match already exists, then the match is deleted, 8 | " allowing the highlight to be toggled. 9 | 10 | hi def InterestingWord1 guifg=#000000 ctermfg=16 guibg=#ffa724 ctermbg=214 11 | hi def InterestingWord2 guifg=#000000 ctermfg=16 guibg=#aeee00 ctermbg=154 12 | hi def InterestingWord3 guifg=#000000 ctermfg=16 guibg=#8cffba ctermbg=121 13 | hi def InterestingWord4 guifg=#000000 ctermfg=16 guibg=#b88853 ctermbg=137 14 | hi def InterestingWord5 guifg=#000000 ctermfg=16 guibg=#ff9eb8 ctermbg=211 15 | hi def InterestingWord6 guifg=#000000 ctermfg=16 guibg=#ff2c4b ctermbg=195 16 | 17 | let s:base_mid = 68750 18 | 19 | function! hiinterestingword#HiInterestingWord(n) 20 | " Save our location. 21 | normal! mz 22 | 23 | " Yank the current word into the z register. 24 | normal! "zyiw 25 | 26 | " Calculate an arbitrary match ID. Hopefully nothing else is using it. 27 | let mid = s:base_mid + a:n 28 | 29 | " Construct a literal pattern that has to match at boundaries. 30 | let pat = '\V\<' . escape(@z, '\') . '\>' 31 | 32 | try 33 | call matchadd("InterestingWord" . a:n, pat, 1, mid) 34 | catch 35 | silent! call matchdelete(mid) 36 | endtry 37 | 38 | " Move back to our original location. 39 | normal! `z 40 | endfunction 41 | -------------------------------------------------------------------------------- /nvim/ftdetect/html.vim: -------------------------------------------------------------------------------- 1 | autocmd BufRead *.ejs set filetype=html 2 | -------------------------------------------------------------------------------- /nvim/ftdetect/javascript.vim: -------------------------------------------------------------------------------- 1 | autocmd BufRead *.js.symlink set filetype=javascript 2 | autocmd BufRead *.es6 set filetype=javascript 3 | -------------------------------------------------------------------------------- /nvim/ftdetect/json.vim: -------------------------------------------------------------------------------- 1 | autocmd BufRead .jscsrc set filetype=json 2 | autocmd BufRead .jshintrc set filetype=json 3 | autocmd BufRead .bowerrc set filetype=json 4 | autocmd BufRead .babelrc set filetype=json 5 | autocmd BufRead .eslintrc set filetype=json 6 | autocmd BufRead .tslintrc set filetype=json 7 | autocmd BufRead .dojorc set filetype=json 8 | -------------------------------------------------------------------------------- /nvim/ftdetect/markdown.vim: -------------------------------------------------------------------------------- 1 | autocmd BufNewFile,BufReadPost *.md set filetype=markdown 2 | -------------------------------------------------------------------------------- /nvim/ftdetect/xml.vim: -------------------------------------------------------------------------------- 1 | autocmd BufNewFile,BufRead *.svg set filetype=xml 2 | -------------------------------------------------------------------------------- /nvim/ftplugin/git.vim: -------------------------------------------------------------------------------- 1 | map q :q 2 | -------------------------------------------------------------------------------- /nvim/ftplugin/help.vim: -------------------------------------------------------------------------------- 1 | map q :bd 2 | -------------------------------------------------------------------------------- /nvim/ftplugin/html.vim: -------------------------------------------------------------------------------- 1 | setlocal ts=4 sts=4 sw=4 noexpandtab indentkeys-=* 2 | -------------------------------------------------------------------------------- /nvim/ftplugin/javascript.vim: -------------------------------------------------------------------------------- 1 | setlocal textwidth=120 2 | 3 | let g:jsx_ext_required = 0 4 | let g:javascript_plugin_jsdoc = 1 5 | 6 | let javaScript_fold=1 7 | -------------------------------------------------------------------------------- /nvim/ftplugin/markdown.vim: -------------------------------------------------------------------------------- 1 | setlocal textwidth=0 wrapmargin=0 wrap spell 2 | let g:markdown_fenced_languages = ['css', 'javascript', 'js=javascript', 'json=javascript', 'stylus', 'html'] 3 | autocmd BufNewFile,BufRead,BufWrite *.md syntax match Comment /\%^---\_.\{-}---$/ 4 | -------------------------------------------------------------------------------- /nvim/ftplugin/ruby.vim: -------------------------------------------------------------------------------- 1 | setlocal ts=2 sts=2 sw=2 expandtab 2 | -------------------------------------------------------------------------------- /nvim/ftplugin/typescript.vim: -------------------------------------------------------------------------------- 1 | let javaScript_fold=1 2 | 3 | setlocal completeopt=menuone,noselect,noselect 4 | setlocal omnifunc=tsuquyomi#complete 5 | nmap d :TsuDefinition 6 | nmap u :TsuReferences 7 | nmap e :TsuGeterr 8 | nmap h : echo tsuquyomi#hint() 9 | -------------------------------------------------------------------------------- /nvim/ftplugin/vim.vim: -------------------------------------------------------------------------------- 1 | setlocal foldmethod=marker 2 | -------------------------------------------------------------------------------- /nvim/ftplugin/xml.vim: -------------------------------------------------------------------------------- 1 | exe ":silent %!xmllint --format --recover - 2>/dev/null" 2 | -------------------------------------------------------------------------------- /nvim/init.vim: -------------------------------------------------------------------------------- 1 | " 2 | " .vimrc / init.vim 3 | " The following vim/neovim configuration works for both Vim and NeoVim 4 | 5 | " ensure vim-plug is installed and then load it 6 | call functions#PlugLoad() 7 | call plug#begin('~/.config/nvim/plugged') 8 | 9 | " General {{{ 10 | " Abbreviations 11 | abbr funciton function 12 | abbr teh the 13 | abbr tempalte template 14 | abbr fitler filter 15 | abbr cosnt const 16 | abbr attribtue attribute 17 | abbr attribuet attribute 18 | 19 | set autoread " detect when a file is changed 20 | 21 | set history=5000 " change history to 1000 22 | set textwidth=140 23 | set colorcolumn=0 24 | set encoding=utf8 25 | set fillchars+=vert:│ 26 | set synmaxcol=200 " Faster syntax highlighting 27 | 28 | " More natural splits 29 | set splitbelow 30 | set splitright 31 | 32 | set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp 33 | set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp 34 | 35 | if (has('nvim')) 36 | " show results of substition as they're happening 37 | " but don't open a split 38 | set inccommand=nosplit 39 | endif 40 | 41 | set backspace=indent,eol,start " make backspace behave in a sane manner 42 | set clipboard=unnamed 43 | 44 | if has('mouse') 45 | set mouse=a 46 | endif 47 | 48 | " Searching 49 | set ignorecase " case insensitive searching 50 | set smartcase " case-sensitive if expresson contains a capital letter 51 | set hlsearch " highlight search results 52 | set incsearch " set incremental search, like modern browsers 53 | set lazyredraw " don't redraw while executing macros 54 | 55 | set magic " Set magic on, for regex 56 | 57 | " error bells 58 | set noerrorbells 59 | set visualbell 60 | set t_vb= 61 | set tm=500 62 | " }}} 63 | 64 | " Appearance {{{ 65 | set number relativenumber " show line numbers 66 | set wrap " turn on line wrapping 67 | set wrapmargin=8 " wrap lines when coming within n characters from side 68 | set linebreak " set soft wrapping 69 | set showbreak=… " show ellipsis at breaking 70 | set autoindent " automatically set indent of new line 71 | set ttyfast " faster redrawing 72 | set diffopt+=vertical 73 | set laststatus=2 " show the satus line all the time 74 | set so=7 " set 7 lines to the cursors - when moving vertical 75 | set wildmenu " enhanced command line completion 76 | set hidden " current buffer can be put into background 77 | set showcmd " show incomplete commands 78 | set noshowmode " don't show which mode disabled for PowerLine 79 | set wildmode=list:longest " complete files like a shell 80 | set scrolloff=3 " lines of text around cursor 81 | set shell=$SHELL 82 | set cmdheight=1 " command bar height 83 | set title " set terminal title 84 | set showmatch " show matching braces 85 | set mat=2 " how many tenths of a second to blink 86 | 87 | " Tab control 88 | set noexpandtab " insert tabs rather than spaces for 89 | set smarttab " tab respects 'tabstop', 'shiftwidth', and 'softtabstop' 90 | set tabstop=4 " the visible width of tabs 91 | set softtabstop=4 " edit as if the tabs are 4 characters wide 92 | set shiftwidth=4 " number of spaces to use for indent and unindent 93 | set shiftround " round indent to a multiple of 'shiftwidth' 94 | 95 | " code folding settings 96 | set foldmethod=syntax " fold based on indent 97 | set foldlevelstart=1 98 | set foldnestmax=10 " deepest fold is 10 levels 99 | set foldlevel=1 100 | 101 | " toggle invisible characters 102 | set nolist 103 | " set listchars=tab:→\ ,eol:¬,trail:⋅,extends:❯,precedes:❮ 104 | " set showbreak=↪ 105 | 106 | set t_Co=256 " Explicitly tell vim that the terminal supports 256 colors 107 | " switch cursor to line when in insert mode, and block when not 108 | set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50 109 | \,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor 110 | \,sm:block-blinkwait175-blinkoff150-blinkon175 111 | 112 | if &term =~ '256color' 113 | " disable background color erase 114 | set t_ut= 115 | endif 116 | 117 | " enable 24 bit color support if supported 118 | " if (has('mac') && empty($TMUX) && has("termguicolors")) 119 | set termguicolors 120 | " endif 121 | 122 | " highlight conflicts 123 | match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$' 124 | 125 | " Load colorschemes 126 | Plug 'chriskempson/base16-vim' 127 | 128 | 129 | let g:netrw_banner = 0 130 | let g:netrw_liststyle = 3 131 | let g:netrw_browse_split = 4 132 | let g:netrw_altv = 1 133 | let g:netrw_winsize = 25 134 | 135 | " LightLine {{{ 136 | Plug 'ryanoasis/vim-devicons' 137 | Plug 'itchyny/lightline.vim' 138 | " Plug 'nicknisi/vim-base16-lightline' 139 | Plug 'mike-hearn/base16-vim-lightline' 140 | Plug 'mgee/lightline-bufferline' 141 | " Plug 'felixjung/vim-base16-lightline' 142 | set showtabline=2 143 | let g:lightline = { 144 | \ 'colorscheme': 'base16_default_dark', 145 | \ 'active': { 146 | \ 'left': [ [ 'mode', 'paste' ], 147 | \ [ 'gitbranch' ], 148 | \ [ 'readonly', 'filetype', 'filename' ]], 149 | \ 'right': [ [ 'percent' ], [ 'lineinfo' ], 150 | \ [ 'fileformat', 'fileencoding' ], 151 | \ [ 'linter_errors', 'linter_warnings' ]] 152 | \ }, 153 | \ 'component_expand': { 154 | \ 'linter': 'LightlineLinter', 155 | \ 'linter_warnings': 'LightlineLinterWarnings', 156 | \ 'linter_errors': 'LightlineLinterErrors', 157 | \ 'linter_ok': 'LightlineLinterOk', 158 | \ 'buffers': 'lightline#bufferline#buffers' 159 | \ }, 160 | \ 'component_type': { 161 | \ 'readonly': 'error', 162 | \ 'linter_warnings': 'warning', 163 | \ 'linter_errors': 'error', 164 | \ 'buffers': 'tabsel', 165 | \ }, 166 | \ 'component_function': { 167 | \ 'fileencoding': 'LightlineFileEncoding', 168 | \ 'filename': 'LightlineFileName', 169 | \ 'fileformat': 'LightlineFileFormat', 170 | \ 'filetype': 'LightlineFileType', 171 | \ 'gitbranch': 'LightlineGitBranch' 172 | \ }, 173 | \ 'tabline': { 174 | \ 'left': [ [ 'buffers' ] ], 175 | \ 'right': [ [ 'close' ] ] 176 | \ }, 177 | \ 'tab': { 178 | \ 'active': [ 'filename', 'modified' ], 179 | \ 'inactive': [ 'filename', 'modified' ], 180 | \ }, 181 | \ 'separator': { 'left': '', 'right': '' }, 182 | \ 'subseparator': { 'left': '', 'right': '' } 183 | \ } 184 | 185 | function! LightlineFileName() abort 186 | let filename = winwidth(0) > 70 ? expand('%') : expand('%:t') 187 | if filename =~ 'NERD_tree' 188 | return '' 189 | endif 190 | let modified = &modified ? ' +' : '' 191 | return fnamemodify(filename, ":~:.") . modified 192 | endfunction 193 | 194 | function! LightlineFileEncoding() 195 | " only show the file encoding if it's not 'utf-8' 196 | return &fileencoding == 'utf-8' ? '' : &fileencoding 197 | endfunction 198 | 199 | function! LightlineFileFormat() 200 | " only show the file format if it's not 'unix' 201 | let format = &fileformat == 'unix' ? '' : &fileformat 202 | return winwidth(0) > 70 ? format . ' ' . WebDevIconsGetFileFormatSymbol() : '' 203 | endfunction 204 | 205 | function! LightlineFileType() 206 | return WebDevIconsGetFileTypeSymbol() 207 | " return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype . ' ' . WebDevIconsGetFileTypeSymbol() : 'no ft') : '' 208 | endfunction 209 | 210 | function! LightlineLinter() abort 211 | let l:counts = ale#statusline#Count(bufnr('')) 212 | return l:counts.total == 0 ? '' : printf('×%d', l:counts.total) 213 | endfunction 214 | 215 | function! LightlineLinterWarnings() abort 216 | let l:counts = ale#statusline#Count(bufnr('')) 217 | let l:all_errors = l:counts.error + l:counts.style_error 218 | let l:all_non_errors = l:counts.total - l:all_errors 219 | return l:counts.total == 0 ? '' : '⚠ ' . printf('%d', all_non_errors) 220 | endfunction 221 | 222 | function! LightlineLinterErrors() abort 223 | let l:counts = ale#statusline#Count(bufnr('')) 224 | let l:all_errors = l:counts.error + l:counts.style_error 225 | return l:counts.total == 0 ? '' : '✖ ' . printf('%d', all_errors) 226 | endfunction 227 | 228 | function! LightlineLinterOk() abort 229 | let l:counts = ale#statusline#Count(bufnr('')) 230 | return l:counts.total == 0 ? 'OK' : '' 231 | endfunction 232 | 233 | function! LightlineGitBranch() 234 | return '' . (exists('*fugitive#head') ? fugitive#head() : '') 235 | endfunction 236 | 237 | augroup alestatus 238 | autocmd User ALELint call lightline#update() 239 | augroup end 240 | " }}} 241 | " }}} 242 | 243 | " General Mappings {{{ 244 | " set a map leader for more key combos 245 | let mapleader = ',' 246 | 247 | " shortcut to save 248 | " nmap :w 249 | nmap , :w 250 | nnoremap ; : 251 | nnoremap ;; : 252 | " nmap h :set hlsearch! 253 | 254 | " Nerd tree like project explorer 255 | nmap k :Vexplore 256 | 257 | " nmap w 258 | map q :wincmd c 259 | 260 | nmap l :set list! 261 | 262 | nmap :%s/\s\+$ 263 | nmap :%s/\n\{2,}/\r\r/g 264 | 265 | 266 | " Textmate style indentation 267 | vmap [ ] >gv 269 | nmap [ << 270 | nmap ] >> 271 | 272 | " switch between current and last buffer 273 | nmap . 274 | 275 | 276 | nmap 1 lightline#bufferline#go(1) 277 | nmap 2 lightline#bufferline#go(2) 278 | nmap 3 lightline#bufferline#go(3) 279 | nmap 4 lightline#bufferline#go(4) 280 | nmap 5 lightline#bufferline#go(5) 281 | nmap 6 lightline#bufferline#go(6) 282 | nmap 7 lightline#bufferline#go(7) 283 | nmap 8 lightline#bufferline#go(8) 284 | nmap 9 lightline#bufferline#go(9) 285 | nmap 0 lightline#bufferline#go 286 | 287 | 288 | " remap esc 289 | inoremap jk 290 | inoremap jj 291 | 292 | " shortcut to play macro from q register 293 | nmap '' @q 294 | 295 | 296 | " set paste toggle 297 | set pastetoggle= 298 | 299 | " set foldlevel 300 | nnoremap z0 :set foldlevel=0 301 | nnoremap z1 :set foldlevel=1 302 | nnoremap z2 :set foldlevel=2 303 | nnoremap z3 :set foldlevel=3 304 | nnoremap z4 :set foldlevel=4 305 | nnoremap z5 :set foldlevel=5 306 | nnoremap z6 :set foldlevel=6 307 | nnoremap z7 :set foldlevel=7 308 | nnoremap z8 :set foldlevel=8 309 | nnoremap z9 :set foldlevel=99 310 | 311 | " Space to toggle folds. 312 | nnoremap za 313 | vnoremap za 314 | 315 | 316 | " edit gitconfig 317 | " map eg :e! ~/.gitconfig 318 | 319 | " activate spell-checking alternatives 320 | nmap ;s :set invspell spelllang=en 321 | 322 | " remove extra whitespace 323 | " enable . command in visual mode 324 | vnoremap . :normal . 325 | 326 | " Move between jumps from home row 327 | nnoremap 328 | nnoremap 329 | 330 | " map :call functions#WinMove('h') 331 | " map :call functions#WinMove('j') 332 | " map :call functions#WinMove('k') 333 | " map :call functions#WinMove('l') 334 | " move line mappings 335 | " ∆ is on macOS 336 | " ˚ is on macOS 337 | nnoremap ∆ :m .+1== 338 | nnoremap ˚ :m .-2== 339 | inoremap ∆ :m .+1==gi 340 | inoremap ˚ :m .-2==gi 341 | vnoremap ∆ :m '>+1gv=gv 342 | vnoremap ˚ :m '<-2gv=gv 343 | 344 | " toggle cursor line 345 | " nnoremap i :set cursorline! 346 | 347 | " scroll the viewport faster 348 | nnoremap 3 349 | nnoremap 3 350 | 351 | " moving up and down work as you would expect 352 | nnoremap j gj 353 | nnoremap k gk 354 | nnoremap ^ g^ 355 | nnoremap $ g$ 356 | 357 | " inoremap =Smart_TabComplete() 358 | 359 | " map s :call SetCustomCommand() 360 | let g:silent_custom_command = 0 361 | 362 | " nnoremap u :call functions#HtmlUnEscape() 363 | 364 | set showmode 365 | nnoremap :bn 366 | nnoremap :bp 367 | nnoremap :bd 368 | 369 | " }}} 370 | 371 | " AutoCmd functions {{{ 372 | 373 | function! s:blur_window() abort 374 | hi VertSplit guibg=NONE guifg=#585858 375 | endfunction 376 | 377 | function! s:focus_window() abort 378 | hi VertSplit guibg=NONE guifg=#a1b56c 379 | endfunction 380 | 381 | " }}} 382 | 383 | " AutoGroups {{{ 384 | " file type specific settings 385 | augroup configgroup 386 | autocmd! 387 | 388 | " automatically resize panes on resize 389 | autocmd VimResized * exe 'normal! \=' 390 | autocmd BufWritePost .vimrc,.vimrc.local,init.vim source % 391 | autocmd BufWritePost .vimrc.local source % 392 | 393 | " blur vertical split lines on leaving focus 394 | autocmd BufEnter,FocusGained,VimEnter,WinEnter * call s:focus_window() 395 | autocmd FocusLost,WinLeave * call s:blur_window() 396 | 397 | " automatically save file when leaving insert mode 398 | autocmd InsertLeave * write 399 | 400 | " save all files on focus lost, ignoring warnings about untitled buffers 401 | autocmd FocusLost * silent! wa 402 | 403 | " make quickfix windows take all the lower section of the screen 404 | " when there are multiple windows open 405 | autocmd FileType qf wincmd J 406 | autocmd FileType qf nmap q :q 407 | 408 | autocmd BufReadPost,BufNewFile *spec.js set filetype=jasmine.javascript syntax=jasmine 409 | autocmd BufReadPost,BufNewFile *_spec.js set filetype=jasmine.javascript syntax=jasmine 410 | autocmd BufReadPost,BufNewFile *Spec.js set filetype=jasmine.javascript syntax=jasmine 411 | 412 | augroup END 413 | " }}} 414 | 415 | " General Functionality {{{ 416 | " substitute, search, and abbreviate multiple variants of a word 417 | Plug 'tpope/vim-abolish' 418 | 419 | "" Vim-cool disables search highlighting when you are done searching 420 | Plug 'romainl/vim-cool' 421 | let g:CoolTotalMatches = 1 422 | 423 | " Cheat40 is a foldable extensible 40-column cheat sheet that you may open in Vim by pressing ? 424 | Plug 'lifepillar/vim-cheat40' 425 | 426 | " search inside files using ripgrep. This plugin provides an Ack command. 427 | Plug 'wincent/ferret' 428 | 429 | " insert or delete brackets, parens, quotes in pair 430 | Plug 'jiangmiao/auto-pairs' 431 | 432 | " A powerful grammar checker for Vim using LanguageTool. 433 | Plug 'rhysd/vim-grammarous' 434 | 435 | " easy commenting motions 436 | Plug 'tpope/vim-commentary' 437 | 438 | " mappings which are simply short normal mode aliases for commonly used ex commands 439 | Plug 'tpope/vim-unimpaired' 440 | 441 | " endings for html, xml, etc. - ehances surround 442 | Plug 'tpope/vim-ragtag' 443 | 444 | " mappings to easily delete, change and add such surroundings in pairs, such as quotes, parens, etc. 445 | Plug 'tpope/vim-surround' 446 | 447 | " tmux integration for vim 448 | Plug 'benmills/vimux' 449 | Plug 'tmux-plugins/vim-tmux-focus-events' 450 | 451 | " enables repeating other supported plugins with the . command 452 | Plug 'tpope/vim-repeat' 453 | 454 | " .editorconfig support 455 | Plug 'editorconfig/editorconfig-vim' 456 | 457 | " asynchronous build and test dispatcher 458 | Plug 'tpope/vim-dispatch' 459 | 460 | " netrw helper 461 | Plug 'tpope/vim-vinegar' 462 | 463 | " single/multi line code handler: gS - split one line into multiple, gJ - combine multiple lines into one 464 | Plug 'AndrewRadev/splitjoin.vim' 465 | 466 | " extended % matching 467 | Plug 'vim-scripts/matchit.zip' 468 | 469 | " add end, endif, etc. automatically 470 | Plug 'tpope/vim-endwise', { 'for': [ 'ruby', 'bash', 'zsh', 'sh', 'vim' ]} 471 | 472 | " detect indent style (tabs vs. spaces) 473 | Plug 'tpope/vim-sleuth' 474 | 475 | " Open selection in carbon.now.sh 476 | Plug 'kristijanhusak/vim-carbon-now-sh' 477 | " a simple tool for presenting slides in vim based on text files 478 | Plug 'sotte/presenting.vim', { 'for': 'markdown' } 479 | 480 | " Close buffers but keep splits 481 | Plug 'moll/vim-bbye' 482 | 483 | " Plug 'terryma/vim-multiple-cursors' 484 | " let g:multi_cursor_next_key='' 485 | " let g:multi_cursor_prev_key='' 486 | " let g:multi_cursor_skip_key='' 487 | " let g:multi_cursor_quit_key='' 488 | 489 | " Writing in vim {{{{ 490 | Plug 'junegunn/limelight.vim' 491 | Plug 'junegunn/goyo.vim' 492 | let g:limelight_conceal_ctermfg = 240 493 | " }}} 494 | 495 | " Fast Fold {{{ 496 | Plug 'Konfekt/FastFold' 497 | let g:fastfold_savehook = 1 498 | let g:fastfold_fold_command_suffixes = ['x','X','a','A','o','O','c','C', '0', '1', '2', 'r', 'R'] 499 | let g:fastfold_fold_movement_commands = [']z', '[z', 'zj', 'zk', 'zo', 'zc', 'zr', 'z0', 'z1', 'z2'] 500 | let g:markdown_folding = 1 501 | let g:tex_fold_enabled = 1 502 | let g:vimsyn_folding = 'af' 503 | let g:xml_syntax_folding = 1 504 | let g:javaScript_fold = 1 505 | let g:sh_fold_enabled= 7 506 | let g:ruby_fold = 1 507 | let g:perl_fold = 1 508 | let g:perl_fold_blocks = 1 509 | let g:r_syntax_folding = 1 510 | let g:rust_fold = 1 511 | let g:php_folding = 1 512 | let g:fastfold_savehook = 0 513 | let g:fastfold_force = 1 514 | " }}} 515 | 516 | " Vim-Stay {{{ 517 | Plug 'zhimsel/vim-stay' 518 | set viewoptions=cursor,folds,slash,unix 519 | " }}} 520 | 521 | 522 | " context-aware pasting 523 | Plug 'sickill/vim-pasta' 524 | 525 | " {{{ VimWiki 526 | 527 | Plug 'vimwiki/vimwiki' 528 | hi VimwikiHeader1 guifg=#FF0000 529 | hi VimwikiHeader2 guifg=#00FF00 530 | hi VimwikiHeader3 guifg=#0000FF 531 | hi VimwikiHeader4 guifg=#FF00FF 532 | hi VimwikiHeader5 guifg=#00FFFF 533 | hi VimwikiHeader6 guifg=#FFFF00 534 | 535 | let g:vimwiki_hl_cb_checked = 2 536 | let g:vimwiki_folding = 'list' 537 | " }}} 538 | 539 | " FZF {{{ 540 | Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' } 541 | Plug 'junegunn/fzf.vim' 542 | let g:fzf_layout = { 'down': '~25%' } 543 | 544 | if isdirectory(".git") 545 | " if in a git project, use :GFiles 546 | nmap e :GFiles --cached --others --exclude-standard 547 | " nmap :GFiles --cached --others --exclude-standard 548 | else 549 | " otherwise, use :FZF 550 | nmap e :FZF 551 | " nmap :FZF 552 | endif 553 | 554 | nmap :Ag 555 | " nmap r :Buffers 556 | " nmap :Buffers 557 | nmap (fzf-maps-n) 558 | xmap (fzf-maps-x) 559 | omap (fzf-maps-o) 560 | 561 | " Insert mode complete 562 | imap (fzf-complete-word) 563 | imap (fzf-complete-path) 564 | imap (fzf-complete-file-ag) 565 | imap (fzf-complete-line) 566 | 567 | nnoremap C :call fzf#run({ 568 | \ 'source': 569 | \ map(split(globpath(&rtp, "colors/*.vim"), "\n"), 570 | \ "substitute(fnamemodify(v:val, ':t'), '\\..\\{-}$', '', '')"), 571 | \ 'sink': 'colo', 572 | \ 'options': '+m', 573 | \ 'left': 30 574 | \ }) 575 | 576 | command! FZFMru call fzf#run({ 577 | \ 'source': v:oldfiles, 578 | \ 'sink': 'e', 579 | \ 'options': '-m -x +s', 580 | \ 'down': '40%'}) 581 | 582 | command! -bang -nargs=* Find call fzf#vim#grep( 583 | \ 'rg --column --line-number --no-heading --follow --color=always '., 1, 584 | \ 0 ? fzf#vim#with_preview('up:60%') : fzf#vim#with_preview('right:50%:hidden', '?'), 0) 585 | command! -bang -nargs=? -complete=dir Files 586 | \ call fzf#vim#files(, fzf#vim#with_preview('right:50%', '?'), 0) 587 | command! -bang -nargs=? -complete=dir GFiles 588 | \ call fzf#vim#gitfiles(, fzf#vim#with_preview('right:50%', '?'), 0) 589 | " }}} 590 | 591 | " Deoplete {{{ 592 | Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } 593 | Plug 'zchee/deoplete-jedi', { 'for' : 'python'} 594 | Plug 'carlitux/deoplete-ternjs', { 'do': 'npm install -g tern' } 595 | let g:deoplete#enable_at_startup = 1 596 | if !exists('g:deoplete#omni#input_patterns') 597 | let g:deoplete#omni#input_patterns = {} 598 | endif 599 | inoremap 600 | \ pumvisible() ? "\" : 601 | \ check_back_space() ? "\" : 602 | \ deoplete#mappings#manual_complete() 603 | function! s:check_back_space() abort "{{{ 604 | let col = col('.') - 1 605 | return !col || getline('.')[col - 1] =~ '\s' 606 | endfunction"}}} 607 | " }}} 608 | 609 | " {{{ " 610 | Plug 'kana/vim-operator-user' 611 | Plug 'haya14busa/vim-operator-flashy' 612 | map y (operator-flashy) 613 | nmap Y (operator-flashy)$ 614 | " }}} " 615 | 616 | " signify {{{ 617 | " Plug 'airblade/vim-gitgutter' 618 | Plug 'mhinz/vim-signify' 619 | let g:signify_vcs_list = [ 'git' ] 620 | let g:signify_sign_add = '+' 621 | let g:signify_sign_delete = '_' 622 | let g:signify_sign_delete_first_line = '‾' 623 | let g:signify_sign_change = '!' 624 | " }}} 625 | 626 | " vim-fugitive {{{ 627 | Plug 'tpope/vim-fugitive' 628 | Plug 'tpope/vim-rhubarb' " hub extension for fugitive 629 | nmap gs :Gstatus 630 | nmap gw :Gwrite 631 | nmap gc :Gcommit 632 | nmap gp :Gpush 633 | nmap ge :Gedit 634 | nmap gr :Gread 635 | nmap gb :Gblame 636 | " }}} 637 | 638 | " EasyAlign {{{ " 639 | " 🌻 A Vim alignment plugin 640 | Plug 'junegunn/vim-easy-align' 641 | " Start interactive EasyAlign in visual mode (e.g. vipga) 642 | xmap ga (EasyAlign) 643 | 644 | " Start interactive EasyAlign for a motion/text object (e.g. gaip) 645 | nmap ga (EasyAlign) 646 | 647 | " Istanbul {{{ 648 | Plug 'retorillo/istanbul.vim' 649 | " Toggle between line and branch coverage 650 | nnoremap cv :IstanbulMode 651 | " }}} 652 | 653 | " EasyMotion {{{ 654 | Plug 'easymotion/vim-easymotion' 655 | nmap ff (easymotion-prefix) 656 | " map / (easymotion-sn) 657 | " omap / (easymotion-tn) 658 | " map n (easymotion-next) 659 | " map N (easymotion-prev) 660 | "}}}" 661 | 662 | " ALE {{{ 663 | Plug 'w0rp/ale' " Asynchonous linting engine 664 | 665 | nmap n :ALENext 666 | let g:ale_change_sign_column_color = 0 667 | let g:ale_sign_column_always = 1 668 | let g:ale_sign_error = '✖' 669 | let g:ale_sign_warning = '⚠' 670 | 671 | let g:ale_linters = { 672 | \ 'javascript': ['eslint'], 673 | \ 'typescript': ['tsserver', 'tslint'], 674 | \ 'html': [] 675 | \} 676 | let g:ale_fixers = {} 677 | let g:ale_fixers['javascript'] = ['prettier', 'eslint'] 678 | let g:ale_javascript_prettier_use_local_config = 1 679 | let g:ale_fix_on_save = 0 680 | let g:ale_completion_enabled = 1 681 | " }}} 682 | 683 | " VimTest {{{ " 684 | Plug 'janko-m/vim-test' 685 | let test#strategy = "vimux" 686 | let g:test#runner_commands = ['Jest'] 687 | 688 | nmap t :TestNearest 689 | nmap f :TestFile 690 | nmap s :TestSuite 691 | " nmap tt :vs|TestVisit 692 | " }}} " 693 | 694 | " UltiSnips {{{ 695 | Plug 'honza/vim-snippets' 696 | Plug 'SirVer/ultisnips' " Snippets plugin 697 | Plug 'swapkats/vim-react-snippets' 698 | Plug 'alexbyk/vim-ultisnips-js-testing' 699 | let g:UltiSnipsExpandTrigger="" 700 | let g:ulti_expand_or_jump_res = 0 701 | " }}} 702 | " }}} 703 | 704 | " Language-Specific Configuration {{{ 705 | " html / templates {{{ 706 | " emmet support for vim - easily create markdup wth CSS-like syntax 707 | Plug 'mattn/emmet-vim', { 'for': ['html', 'javascript.jsx', 'eruby' ]} 708 | let g:user_emmet_settings = { 709 | \ 'javascript.jsx': { 710 | \ 'extends': 'jsx', 711 | \ }, 712 | \} 713 | 714 | " match tags in html, similar to paren support 715 | Plug 'gregsexton/MatchTag', { 'for': 'html' } 716 | 717 | " html5 support 718 | Plug 'othree/html5.vim', { 'for': 'html' } 719 | 720 | " mustache support 721 | Plug 'mustache/vim-mustache-handlebars' 722 | 723 | " pug / jade support 724 | Plug 'digitaltoad/vim-pug', { 'for': ['jade', 'pug'] } 725 | 726 | " Ruby / Ruby on Rails 727 | Plug 'tpope/vim-rails', { 'for': 'ruby' } 728 | " }}} 729 | 730 | " JavaScript {{{ 731 | Plug 'pangloss/vim-javascript', { 'for': ['javascript', 'javascript.jsx', 'html'] } 732 | Plug 'moll/vim-node', { 'for': 'javascript' } 733 | Plug 'mxw/vim-jsx', { 'for': ['javascript.jsx', 'javascript'] } 734 | " Plug 'maxmellon/vim-jsx-pretty' 735 | let g:xml_syntax_folding = 1 736 | " Fixes jsx end tag hightlight 737 | hi link xmlEndTag xmlTag 738 | " syn region xmlTagName matchgroup=xmlEndTag start=++ 739 | " Plug 'chemzqm/vim-jsx-improve' 740 | Plug 'styled-components/vim-styled-components', { 'branch': 'main' } 741 | Plug 'ternjs/tern_for_vim', { 'for': ['javascript', 'javascript.jsx'], 'do': 'npm install' } 742 | Plug 'prettier/vim-prettier', { 'do': 'yarn install' } 743 | Plug 'joaohkfaria/vim-jest-snippets' 744 | Plug 'glanotte/vim-jasmine' 745 | 746 | nmap p :Prettier 747 | let g:prettier#autoformat = 0 748 | let g:prettier#exec_cmd_async = 1 749 | let g:prettier#quickfix_enabled = 0 750 | let g:prettier#quickfix_auto_focus = 0 751 | let g:prettier#config#print_width = 140 752 | let g:prettier#config#single_quote = 'true' 753 | let g:prettier#config#trailing_comma = 'all' 754 | let g:prettier#config#bracket_spacing = 'true' 755 | let g:prettier#config#jsx_bracket_same_line = 'false' 756 | let g:jsx_ext_required = 0 757 | " }}} 758 | 759 | " TypeScript {{{ 760 | Plug 'leafgarland/typescript-vim', { 'for': 'typescript' } 761 | Plug 'Shougo/vimproc.vim', { 'do': 'make' } 762 | 763 | Plug 'Quramy/tsuquyomi', { 'for': 'typescript', 'do': 'npm install' } 764 | let g:tsuquyomi_completion_detail = 1 765 | let g:tsuquyomi_disable_default_mappings = 1 766 | let g:tsuquyomi_completion_detail = 1 767 | " }}} 768 | 769 | " Styles {{{ 770 | Plug 'wavded/vim-stylus', { 'for': ['stylus', 'markdown'] } 771 | Plug 'groenewege/vim-less', { 'for': 'less' } 772 | Plug 'hail2u/vim-css3-syntax', { 'for': 'css' } 773 | Plug 'cakebaker/scss-syntax.vim', { 'for': 'scss' } 774 | Plug 'gko/vim-coloresque' 775 | Plug 'stephenway/postcss.vim', { 'for': 'css' } 776 | " }}} 777 | 778 | " markdown {{{ 779 | Plug 'tpope/vim-markdown', { 'for': 'markdown' } 780 | 781 | Plug 'godlygeek/tabular' 782 | Plug 'plasticboy/vim-markdown' 783 | " }}} 784 | 785 | " JSON {{{ 786 | Plug 'elzr/vim-json', { 'for': 'json' } 787 | let g:vim_json_syntax_conceal = 0 788 | " }}} 789 | 790 | Plug 'fatih/vim-go', { 'for': 'go' } 791 | Plug 'timcharper/textile.vim', { 'for': 'textile' } 792 | Plug 'sheerun/vim-polyglot' 793 | Plug 'lambdatoast/elm.vim', { 'for': 'elm' } 794 | Plug 'tpope/vim-endwise', { 'for': [ 'ruby', 'bash', 'zsh', 'sh' ]} 795 | Plug 'kchmck/vim-coffee-script', { 'for': 'coffeescript' } 796 | " }}} 797 | 798 | call plug#end() 799 | 800 | let base16colorspace=256 " Access colors present in 256 colorspace 801 | colorscheme base16-default-dark 802 | set nocompatible 803 | syntax on 804 | filetype plugin indent on 805 | " make the highlighting of tabs and other non-text less annoying 806 | highlight SpecialKey ctermfg=236 807 | highlight NonText ctermfg=236 808 | 809 | " make comments and HTML attributes italic 810 | highlight Comment cterm=italic 811 | highlight htmlArg cterm=italic 812 | highlight xmlAttrib cterm=italic 813 | highlight Type cterm=italic 814 | highlight Normal ctermbg=none 815 | 816 | hi VertSplit guibg=NONE guifg=#a1b56c 817 | 818 | call deoplete#custom#source('ultisnips', 'matchers', ['matcher_fuzzy']) 819 | 820 | " }}} 821 | 822 | " vim:set foldmethod=marker foldlevel=0 823 | -------------------------------------------------------------------------------- /nvim/plugin/applylocalsettings.vim: -------------------------------------------------------------------------------- 1 | " source any .vimrc.local files in the cwd and recursively up 2 | call applylocalsettings#ApplyLocalSettings(expand('.')) 3 | -------------------------------------------------------------------------------- /nvim/plugin/hiinterestingword.vim: -------------------------------------------------------------------------------- 1 | nnoremap 0 :call hiinterestingword#ClearInterestingWord() 2 | nnoremap 1 :call hiinterestingword#HiInterestingWord(1) 3 | nnoremap 2 :call hiinterestingword#HiInterestingWord(2) 4 | nnoremap 3 :call hiinterestingword#HiInterestingWord(3) 5 | nnoremap 4 :call hiinterestingword#HiInterestingWord(4) 6 | nnoremap 5 :call hiinterestingword#HiInterestingWord(5) 7 | nnoremap 6 :call hiinterestingword#HiInterestingWord(6) 8 | -------------------------------------------------------------------------------- /nvim/syntax/markdown.vim: -------------------------------------------------------------------------------- 1 | syntax match Comment /\%^---\_.\{-}---$/ 2 | -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | scriptencoding utf-8 2 | "plug needs this 3 | set nocompatible 4 | filetype off 5 | 6 | let mapleader = "," 7 | let maplocalleader = "\\" 8 | map h :echo "mapleader is set to ','." 9 | 10 | 11 | 12 | " set F1 to esc 13 | map 14 | imap 15 | 16 | set lcs=tab:\ \ ,eol:$,trail:~,extends:>,precedes:< 17 | 18 | " Press F12 to see line endings etc 19 | set nolist 20 | nnoremap :set list! 21 | 22 | 23 | " Don't need a byte order mark in unicode 24 | set nobomb 25 | 26 | " Use 2 spaces and no tabs by default 27 | set ts=2 " Tabs are 2 spaces 28 | set bs=2 " Backspace over everything in insert mode 29 | set shiftwidth=2 " Tabs under smart indent 30 | set nocp incsearch 31 | 32 | set nobackup 33 | 34 | set ruler 35 | set history=5000 36 | 37 | call plug#begin() 38 | " Theme sets 39 | Plug 'qualiabyte/vim-colorstepper' 40 | nmap ColorstepPrev 41 | nmap ColorstepNext 42 | nmap ColorstepReload 43 | Plug 'tomasr/molokai' 44 | Plug 'w0ng/vim-hybrid' 45 | Plug 'kristijanhusak/vim-hybrid-material' 46 | Plug 'NLKNguyen/papercolor-theme' 47 | Plug 'nanotech/jellybeans.vim' 48 | Plug 'lifepillar/vim-solarized8' 49 | Plug 'ajmwagar/vim-deus' 50 | Plug 'romainl/Apprentice' 51 | Plug 'notpratheek/vim-luna' 52 | 53 | Plug 'vim-scripts/L9' 54 | Plug 'Shougo/vimproc.vim', { 'do': 'make' } 55 | Plug 'Valloric/YouCompleteMe', { 'do': './install.py --js-completer ' } 56 | 57 | Plug 'w0rp/ale' 58 | " let g:ale_fix_on_save = 1 59 | 60 | Plug 'vim-airline/vim-airline' 61 | Plug 'vim-airline/vim-airline-themes' 62 | let g:airline#extensions#tabline#enabled = 1 63 | let g:airline#extensions#ale#enabled = 1 64 | 65 | Plug 'terryma/vim-multiple-cursors' 66 | let g:multi_cursor_next_key='' 67 | let g:multi_cursor_prev_key='' 68 | let g:multi_cursor_skip_key='' 69 | let g:multi_cursor_quit_key='' 70 | 71 | Plug 'SirVer/ultisnips' 72 | Plug 'honza/vim-snippets' 73 | Plug 'epilande/vim-react-snippets' 74 | let g:UltiSnipsExpandTrigger="" 75 | let g:UltiSnipsExpandTrigger = "" 76 | let g:ulti_expand_or_jump_res = 0 77 | function ExpandSnippetOrCarriageReturn() 78 | let snippet = UltiSnips#ExpandSnippetOrJump() 79 | if g:ulti_expand_or_jump_res > 0 80 | return snippet 81 | else 82 | return "\" 83 | endif 84 | endfunction 85 | inoremap pumvisible() ? "=ExpandSnippetOrCarriageReturn()" : "\" 86 | 87 | Plug 'elixir-lang/vim-elixir' 88 | Plug 'vim-scripts/nginx.vim' 89 | Plug 'vim-scripts/cocoa.vim' 90 | Plug 'vim-scripts/applescript.vim' 91 | Plug 'vim-scripts/httplog' 92 | Plug 'vim-scripts/ScrollColors' 93 | Plug 'StanAngeloff/php.vim' 94 | 95 | Plug 'michaeljsmith/vim-indent-object' 96 | let g:indentobject_meaningful_indentation = ["haml", "sass", "python", "yaml", "markdown", "coffee"] 97 | 98 | Plug 'Twinside/vim-syntax-haskell-cabal' 99 | Plug 'lukerandall/haskellmode-vim' 100 | 101 | Plug 'vim-ruby/vim-ruby' 102 | Plug 'tpope/vim-rails' 103 | Plug 'kana/vim-textobj-user' 104 | Plug 'nelstrom/vim-textobj-rubyblock' 105 | Plug 'vim-scripts/gitignore' 106 | Plug 'kien/ctrlp.vim' 107 | let g:ctrlp_custom_ignore = { 108 | \ 'dir': '\v[\/](\.git|\.hg|\.svn|node_modules|bower_components|tmp|cache|\.tmp|plugins|platforms|build|ios|_build|deps|priv|public.packs)$', 109 | \ 'file': '\v\.(exe|so|dll)$', 110 | \ 'link': 'some_bad_symbolic_links', 111 | \ } 112 | 113 | Plug 'lunaru/vim-less' 114 | Plug 'tpope/vim-haml' 115 | Plug 'juvenn/mustache.vim' 116 | Plug 'tpope/vim-markdown' 117 | Plug 'slim-template/vim-slim' 118 | 119 | Plug 'zaiste/VimClojure' 120 | let vimclojure#HighlightBuiltins=1 121 | let vimclojure#ParenRainbow=0 122 | 123 | Plug 'elzr/vim-json' 124 | Plug 'alfredodeza/jacinto.vim' 125 | 126 | Plug 'ap/vim-css-color' 127 | Plug 'othree/html5.vim' 128 | Plug 'pangloss/vim-javascript' 129 | let g:used_javascript_libs = 'react' 130 | Plug 'mxw/vim-jsx' 131 | Plug 'othree/javascript-libraries-syntax.vim' 132 | Plug 'prettier/vim-prettier', { 'do': 'yarn install' } 133 | let g:prettier#autoformat = 0 134 | let g:prettier#exec_cmd_async = 1 135 | let g:prettier#quickfix_enabled = 0 136 | let g:prettier#quickfix_auto_focus = 0 137 | let g:prettier#config#print_width = 140 138 | let g:prettier#config#single_quote = 'true' 139 | let g:prettier#config#trailing_comma = 'all' 140 | let g:prettier#config#bracket_spacing = 'true' 141 | 142 | call plug#end() 143 | 144 | 145 | 146 | 147 | au BufNewFile,BufReadPost *.coffee setl shiftwidth=2 tabstop=2 softtabstop=2 expandtab 148 | autocmd BufNewFile,BufRead *.json call jacinto#syntax() 149 | au BufNewFile,BufReadPost *.coffee setl foldmethod=indent nofoldenable 150 | au BufNewFile,BufReadPost *.coffee setl tabstop=2 softtabstop=2 shiftwidth=2 expandtab 151 | 152 | 153 | 154 | au BufNewFile,BufReadPost *.json setl filetype=json 155 | au BufNewFile,BufReadPost *.rake setl filetype=ruby shiftwidth=2 tabstop=2 softtabstop=2 expandtab 156 | au BufNewFile,BufReadPost *.es6 setl filetype=javascript 157 | au BufNewFile,BufReadPost *.jade setl shiftwidth=2 tabstop=2 softtabstop=2 expandtab 158 | au BufNewFile,BufReadPost *.html setl expandtab foldmethod=indent 159 | au BufNewFile,BufReadPost *.slim setl filetype=slim shiftwidth=2 tabstop=2 softtabstop=2 expandtab foldmethod=indent 160 | au BufNewFile,BufReadPost *.html.erb setl filetype=html.eruby shiftwidth=2 tabstop=2 softtabstop=2 expandtab foldmethod=indent 161 | au BufNewFile,BufReadPost *.ex setl filetype=elixir shiftwidth=2 tabstop=2 softtabstop=2 expandtab 162 | au BufNewFile,BufReadPost *.exs setl filetype=elixir shiftwidth=2 tabstop=2 softtabstop=2 expandtab 163 | au BufNewFile,BufReadPost *.phtml setl filetype=php shiftwidth=2 tabstop=2 softtabstop=2 expandtab ff=dos ffs=dos 164 | 165 | 166 | autocmd FileType java set tw=80 ai sw=4 sts=4 et 167 | autocmd FileType ruby,eruby,yaml set tw=80 ai sw=2 sts=2 et 168 | autocmd User Rails set tabstop=2 shiftwidth=2 softtabstop=2 expandtab 169 | 170 | "Make git commit nicer 171 | autocmd FileType gitcommit set tw=68 spell 172 | 173 | 174 | au BufEnter *.hs compiler ghc 175 | 176 | let g:ghc = "/usr/local/bin/ghc" 177 | let g:haddock_browser = "open" 178 | 179 | 180 | filetype plugin indent on 181 | syntax enable 182 | syntax on 183 | 184 | set scrolloff=5 185 | match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$' 186 | 187 | map Y y$ 188 | vnoremap yo "*y 189 | nnoremap po "*p 190 | 191 | noremap / :nohls 192 | 193 | " better ESC 194 | inoremap jk 195 | 196 | nmap ; : 197 | 198 | set autoread 199 | set backspace=indent,eol,start 200 | set binary 201 | set cinoptions=:0,(s,u0,U1,g0,t0 202 | set completeopt=menuone,preview 203 | set encoding=utf-8 204 | set hidden 205 | set history=1000 206 | set incsearch 207 | set laststatus=2 208 | 209 | " Don't redraw while executing macros 210 | set nolazyredraw 211 | 212 | " Disable the macvim toolbar 213 | set guioptions-=T 214 | 215 | set listchars=tab:▸\ ,eol:¬,extends:❯,precedes:❮ 216 | set showbreak=↳ 217 | 218 | set notimeout 219 | set ttimeout 220 | set ttimeoutlen=10 221 | 222 | set noeol 223 | set numberwidth=4 224 | set number 225 | set ruler 226 | set showcmd 227 | 228 | set exrc 229 | set secure 230 | set matchtime=2 231 | 232 | set completeopt=longest,menuone,preview 233 | 234 | " White characters {{{ 235 | set autoindent 236 | set tabstop=2 237 | set softtabstop=2 238 | set textwidth=80 239 | set shiftwidth=2 240 | set expandtab 241 | set wrap 242 | set formatoptions=qrn1 243 | 244 | set novisualbell 245 | 246 | set wildignore=.svn,CVS,.git,.hg,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif,.DS_Store,*.aux,*.out,*.toc 247 | set wildmenu 248 | 249 | "set dictionary=/usr/share/dict/words 250 | augroup cline 251 | au! 252 | au WinLeave * set nocursorline 253 | au WinEnter * set nocursorline 254 | au InsertEnter * set nocursorline 255 | au InsertLeave * set nocursorline 256 | augroup END 257 | " Only shown when not in insert mode so I don't go insane. 258 | "augroup trailing 259 | " au! 260 | " au InsertEnter * :set listchars-=trail:⌴ 261 | " au InsertLeave * :set listchars+=trail:⌴ 262 | "augroup END 263 | 264 | " Remove trailing whitespaces when saving 265 | :command SS %s/\s\+$//e 266 | 267 | "nnoremap / /\v 268 | "vnoremap / /\v 269 | 270 | set smartcase 271 | set showmatch 272 | set hlsearch 273 | 274 | " clear search matching 275 | noremap :noh:call clearmatches() 276 | 277 | " Don't jump when using * for search 278 | nnoremap * * 279 | 280 | " Keep search matches in the middle of the window. 281 | nnoremap n nzzzv 282 | nnoremap N Nzzzv 283 | 284 | " Same when jumping around 285 | nnoremap g; g;zz 286 | nnoremap g, g,zz 287 | 288 | " Open a Quickfix window for the last search. 289 | " nnoremap ? :execute 'vimgrep /'.@/.'/g %':copen 290 | 291 | " Highlight word {{{ 292 | 293 | nnoremap hh :execute 'match InterestingWord1 /\<\>/' 294 | nnoremap h1 :execute 'match InterestingWord1 /\<\>/' 295 | nnoremap h2 :execute '2match InterestingWord2 /\<\>/' 296 | nnoremap h3 :execute '3match InterestingWord3 /\<\>/' 297 | 298 | 299 | " Begining & End of line in Normal mode 300 | noremap H ^ 301 | noremap L g_ 302 | 303 | " more natural movement with wrap on 304 | nnoremap j gj 305 | nnoremap k gk 306 | vnoremap j gj 307 | vnoremap k gk 308 | 309 | " Easy splitted window navigation 310 | noremap h 311 | noremap j 312 | noremap k 313 | noremap l 314 | 315 | " Easy buffer navigation 316 | noremap bp :bprevious 317 | noremap bn :bnext 318 | 319 | " Splits ,v and ,h to open new splits (vertical and horizontal) 320 | nnoremap v vl 321 | nnoremap s sj 322 | 323 | " Reselect visual block after indent/outdent 324 | vnoremap < >gv 326 | 327 | " Bubbling lines 328 | nmap [e 329 | nmap ]e 330 | vmap [egv 331 | vmap ]egv 332 | 333 | 334 | set foldlevelstart=1 335 | set foldmethod=syntax 336 | 337 | " Space to toggle folds. 338 | nnoremap za 339 | vnoremap za 340 | nnoremap z0 :set foldlevel=0 341 | nnoremap z1 :set foldlevel=1 342 | nnoremap z2 :set foldlevel=2 343 | nnoremap z3 :set foldlevel=3 344 | nnoremap z4 :set foldlevel=4 345 | nnoremap z5 :set foldlevel=5 346 | nnoremap z6 :set foldlevel=6 347 | nnoremap z7 :set foldlevel=7 348 | nnoremap z8 :set foldlevel=8 349 | nnoremap z9 :set foldlevel=99 350 | 351 | " Make zO recursively open whatever top level fold we're in, no matter where the 352 | " cursor happens to be. 353 | nnoremap zO zCzO 354 | 355 | " Use ,z to "focus" the current fold. 356 | nnoremap z zMzvzz 357 | 358 | function! MyFoldText() " {{{ 359 | let line = getline(v:foldstart) 360 | 361 | let nucolwidth = &fdc + &number * &numberwidth 362 | let windowwidth = winwidth(0) - nucolwidth - 3 363 | let foldedlinecount = v:foldend - v:foldstart 364 | 365 | " expand tabs into spaces 366 | let onetab = strpart(' ', 0, &tabstop) 367 | let line = substitute(line, '\t', onetab, 'g') 368 | 369 | let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount)) 370 | let fillcharcount = windowwidth - len(line) - len(foldedlinecount) 371 | return line . '…' . repeat(" ",fillcharcount) . foldedlinecount . '…' . ' ' 372 | endfunction " }}} 373 | set foldtext=MyFoldText() 374 | 375 | 376 | set ofu=syntaxcomplete#Complete 377 | let g:rubycomplete_buffer_loading = 0 378 | let g:rubycomplete_classes_in_global = 1 379 | 380 | " showmarks 381 | let g:showmarks_enable = 1 382 | hi! link ShowMarksHLl LineNr 383 | hi! link ShowMarksHLu LineNr 384 | hi! link ShowMarksHLo LineNr 385 | hi! link ShowMarksHLm LineNr 386 | 387 | augroup ft_vim 388 | au! 389 | 390 | au FileType vim setlocal foldmethod=marker 391 | au FileType help setlocal textwidth=78 392 | au BufWinEnter *.txt if &ft == 'help' | wincmd L | endif 393 | augroup END 394 | 395 | 396 | " Shortcut for [] motion 397 | onoremap ir i[ 398 | onoremap ar a[ 399 | vnoremap ir i[ 400 | vnoremap ar a[ 401 | 402 | " }}} 403 | 404 | " Buffer Handling {{{ 405 | " Visit http://vim.wikia.com/wiki/Deleting_a_buffer_without_closing_the_window 406 | " to learn more about :Bclose 407 | 408 | " Delete buffer while keeping window layout (don't close buffer's windows). 409 | " Version 2008-11-18 from http://vim.wikia.com/wiki/VimTip165 410 | if v:version < 700 || exists('loaded_bclose') || &cp 411 | finish 412 | endif 413 | let loaded_bclose = 1 414 | if !exists('bclose_multiple') 415 | let bclose_multiple = 1 416 | endif 417 | 418 | " Display an error message. 419 | function! s:Warn(msg) 420 | echohl ErrorMsg 421 | echomsg a:msg 422 | echohl NONE 423 | endfunction 424 | 425 | " Command ':Bclose' executes ':bd' to delete buffer in current window. 426 | " The window will show the alternate buffer (Ctrl-^) if it exists, 427 | " or the previous buffer (:bp), or a blank buffer if no previous. 428 | " Command ':Bclose!' is the same, but executes ':bd!' (discard changes). 429 | " An optional argument can specify which buffer to close (name or number). 430 | function! s:Bclose(bang, buffer) 431 | if empty(a:buffer) 432 | let btarget = bufnr('%') 433 | elseif a:buffer =~ '^\d\+$' 434 | let btarget = bufnr(str2nr(a:buffer)) 435 | else 436 | let btarget = bufnr(a:buffer) 437 | endif 438 | if btarget < 0 439 | call s:Warn('No matching buffer for '.a:buffer) 440 | return 441 | endif 442 | if empty(a:bang) && getbufvar(btarget, '&modified') 443 | call s:Warn('No write since last change for buffer '.btarget.' (use :Bclose!)') 444 | return 445 | endif 446 | " Numbers of windows that view target buffer which we will delete. 447 | let wnums = filter(range(1, winnr('$')), 'winbufnr(v:val) == btarget') 448 | if !g:bclose_multiple && len(wnums) > 1 449 | call s:Warn('Buffer is in multiple windows (use ":let bclose_multiple=1")') 450 | return 451 | endif 452 | let wcurrent = winnr() 453 | for w in wnums 454 | execute w.'wincmd w' 455 | let prevbuf = bufnr('#') 456 | if prevbuf > 0 && buflisted(prevbuf) && prevbuf != w 457 | buffer # 458 | else 459 | bprevious 460 | endif 461 | if btarget == bufnr('%') 462 | " Numbers of listed buffers which are not the target to be deleted. 463 | let blisted = filter(range(1, bufnr('$')), 'buflisted(v:val) && v:val != btarget') 464 | " Listed, not target, and not displayed. 465 | let bhidden = filter(copy(blisted), 'bufwinnr(v:val) < 0') 466 | " Take the first buffer, if any (could be more intelligent). 467 | let bjump = (bhidden + blisted + [-1])[0] 468 | if bjump > 0 469 | execute 'buffer '.bjump 470 | else 471 | execute 'enew'.a:bang 472 | endif 473 | endif 474 | endfor 475 | execute 'bdelete'.a:bang.' '.btarget 476 | execute wcurrent.'wincmd w' 477 | endfunction 478 | command! -bang -complete=buffer -nargs=? Bclose call s:Bclose('', '') 479 | nnoremap bd :Bclose 480 | 481 | "}}} 482 | 483 | 484 | let g:arrow_keys_are_enabled = 1 485 | 486 | function! NoArrowsKeysToggle() " {{{ 487 | if g:arrow_keys_are_enabled == 1 488 | let g:arrow_keys_are_enabled = 0 489 | noremap 490 | noremap 491 | noremap 492 | noremap 493 | else 494 | let g:arrow_keys_are_enabled = 1 495 | noremap h 496 | noremap k 497 | noremap j 498 | noremap l 499 | endif 500 | endfunction " }}} 501 | 502 | nmap :call NoArrowsKeysToggle() 503 | "call NoArrowsKeysToggle() 504 | 505 | 506 | autocmd InsertEnter * let w:last_fdm=&foldmethod | setlocal foldmethod=manual 507 | autocmd InsertLeave * let &l:foldmethod=w:last_fdm 508 | 509 | set viminfo='10,\"100,:20,%,n~/.viminfo 510 | function! ResCur() 511 | if line("'\"") <= line("$") 512 | normal! g`" 513 | return 1 514 | endif 515 | endfunction 516 | 517 | augroup resCur 518 | autocmd! 519 | autocmd BufWinEnter * call ResCur() 520 | augroup END 521 | 522 | "Show trailing whitespace 523 | match ErrorMsg '\s\+$' 524 | set incsearch 525 | 526 | nnoremap :set invpaste paste? 527 | set pastetoggle= 528 | set showmode 529 | nnoremap :bn 530 | nnoremap :bp 531 | nnoremap :bn 532 | nnoremap :bp 533 | nnoremap :bd 534 | 535 | highlight clear SpellBad 536 | highlight SpellBad term=standout ctermfg=1 term=underline cterm=underline 537 | highlight clear SpellCap 538 | highlight SpellCap term=underline cterm=underline 539 | highlight clear SpellRare 540 | highlight SpellRare term=underline cterm=underline 541 | highlight clear SpellLocal 542 | highlight SpellLocal term=underline cterm=underline 543 | 544 | set modelines=5 545 | set pastetoggle= 546 | 547 | set termguicolors 548 | set t_Co=256 549 | set background=dark 550 | colorscheme apprentice 551 | let g:airline_theme='hybridline' 552 | 553 | 554 | hi TermCursor gui=reverse guifg=#ffffff 555 | hi TermCursorNC gui=reverse guifg=#ffffff 556 | hi ParenMatch gui=underline guibg=#343941 557 | hi Folded gui=NONE cterm=NONE ctermbg=234 ctermfg=242 guibg=#444444 guifg=#acacac 558 | hi ALEWarning guibg=#916364 559 | 560 | 561 | source ~/.vimrc.local 562 | -------------------------------------------------------------------------------- /zshrc: -------------------------------------------------------------------------------- 1 | if [[ -f ~/.profile ]]; then 2 | source ~/.profile 3 | fi 4 | 5 | # Path to your oh-my-zsh installation. 6 | export ZSH=$HOME/.oh-my-zsh 7 | 8 | # Set name of the theme to load. 9 | # Look in ~/.oh-my-zsh/themes/ 10 | # Optionally, if you set this to "random", it'll load a random theme each 11 | # time that oh-my-zsh is loaded. 12 | if [[ -f ~/.zshrc.theme ]]; then 13 | ZSH_THEME=$(cat ~/.zshrc.theme) 14 | else 15 | ZSH_THEME="robbyrussell" 16 | fi 17 | 18 | 19 | # Uncomment the following line to use case-sensitive completion. 20 | # CASE_SENSITIVE="true" 21 | 22 | # Uncomment the following line to disable bi-weekly auto-update checks. 23 | # DISABLE_AUTO_UPDATE="true" 24 | 25 | # Uncomment the following line to change how often to auto-update (in days). 26 | # export UPDATE_ZSH_DAYS=13 27 | 28 | # Uncomment the following line to disable colors in ls. 29 | # DISABLE_LS_COLORS="true" 30 | 31 | # Uncomment the following line to disable auto-setting terminal title. 32 | # DISABLE_AUTO_TITLE="true" 33 | 34 | # Uncomment the following line to enable command auto-correction. 35 | # ENABLE_CORRECTION="true" 36 | 37 | # Uncomment the following line to display red dots whilst waiting for completion. 38 | # COMPLETION_WAITING_DOTS="true" 39 | 40 | # Uncomment the following line if you want to disable marking untracked files 41 | # under VCS as dirty. This makes repository status check for large repositories 42 | # much, much faster. 43 | # DISABLE_UNTRACKED_FILES_DIRTY="true" 44 | 45 | # Uncomment the following line if you want to change the command execution time 46 | # stamp shown in the history command output. 47 | # The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" 48 | # HIST_STAMPS="mm/dd/yyyy" 49 | 50 | # Would you like to use another custom folder than $ZSH/custom? 51 | # ZSH_CUSTOM=/path/to/new-custom-folder 52 | 53 | # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) 54 | # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ 55 | # Example format: plugins=(rails git textmate ruby lighthouse) 56 | # Add wisely, as too many plugins slow down shell startup. 57 | if [[ `uname` == 'Darwin' ]] then 58 | plugins=(brew compleat catimg gitfast sublime vagrant vi-mode autojump) 59 | else 60 | plugins=(compleat catimg gitfast sublime vagrant vi-mode autojump) 61 | fi 62 | 63 | source $ZSH/oh-my-zsh.sh 64 | 65 | 66 | # User configuration 67 | 68 | export PATH="./.bundle/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/lib/node_modules" 69 | if ! (command -v rvm >/dev/null 2>&1 ); then 70 | export PATH="${HOME}/.rbenv/bin:${PATH}" 71 | fi 72 | 73 | # export MANPATH="/usr/local/man:$MANPATH" 74 | 75 | # You may need to manually set your language environment 76 | # export LANG=en_US.UTF-8 77 | 78 | source $(brew --prefix nvm)/nvm.sh 79 | 80 | 81 | alias ..1='cd ..' 82 | alias ..2='cd ../..' 83 | alias ..3='cd ../../..' 84 | alias ..4='cd ../../../..' 85 | alias ..5='cd ../../../../..' 86 | alias l='ls -CF' 87 | if (command exa -v >/dev/null 2>&1 ); then 88 | alias ls='exa' 89 | fi 90 | alias -- +='pushd .' 91 | alias -- -=popd 92 | alias .f='cd ~/.bin/dotfiles' 93 | alias c='cd ~/_code' 94 | 95 | if (command bat -v >/dev/null 2>&1 ); then 96 | alias cat='bat' # bat is cat command on steroids https://github.com/sharkdp/bat 97 | fi 98 | 99 | alias be='bundle exec' 100 | if (command -v rvm >/dev/null 2>&1 ); then 101 | alias bi='bundle check --path=.bundle || bundle install --path=.bundle --binstubs .bundle/bin --jobs=4 --retry=3' 102 | alias bu='bundle update --path .bundle --verbose --binstubs .bundle/bin' 103 | else 104 | alias bi='bundle check --path=.bundle || bundle install --path=.bundle --binstubs .bundle/bin --jobs=4 --retry=3; rbenv rehash' 105 | alias bu='bundle update --path .bundle --verbose --binstubs .bundle/bin; rbenv rehash' 106 | fi 107 | 108 | alias esli='eslint' 109 | alias eslintfix='eslint --fix' 110 | alias git=hub 111 | alias brucop='bundle exec rubocop -a -D $(git diff --cached --name-only --diff-filter=d HEAD | egrep ".(rb|rake)$" | egrep -v "db\/schema.rb" | egrep -v "lib\/pb") Gemfile' 112 | alias bife='bundle exec knife' 113 | alias bagrant='bundle exec vagrant' 114 | alias brake='bundle exec foreman run rake' 115 | alias brails='bundle exec foreman run rails' 116 | alias brespec='SHOW_COUNTS=on bundle exec rspec --color --drb' 117 | alias boreman='reset && bundle exec foreman start' 118 | alias bap='bundle exec cap' 119 | alias laptop_pg_create_user='createuser -d -s -P' 120 | alias npmlist='npm list -g --depth 0' 121 | alias x='exit' 122 | 123 | alias rscp="rsync --partial --progress --rsh=ssh" 124 | alias convim='vim -u /usr/share/vim/vimrc' 125 | 126 | alias ios_log='tail -f ~/Library/Logs/CoreSimulator/*/system.log' 127 | 128 | export RSPEC=true 129 | export EDITOR=nvim 130 | 131 | function cdbundle() { 132 | TARGET=$@ 133 | if [ "x$TARGET" == "x" ]; then 134 | echo "Usage: cdbundle " 135 | fi 136 | dir=`bundle show "$@"` 137 | echo $dir 138 | cd $dir 139 | } 140 | 141 | function laptop_mysql_create_user() { 142 | if [ "x$1" == "x" ]; then 143 | echo "No username or password given. Usage: laptop_mysql_create_user " 144 | exit 1 145 | fi 146 | if [ "x$2" == "x" ]; then 147 | echo "No password given. Setting it to blank" 148 | fi 149 | mysql -uroot -p --password="" -e "GRANT ALL PRIVILEGES ON *.* TO '$1'@'localhost' IDENTIFIED BY '$2'" 150 | } 151 | 152 | function laptop_mysql_drop_user() { 153 | if [ "x$1" == "x" ]; then 154 | echo "No username given. Usage: laptop_mysql_drop_user " 155 | exit 1 156 | fi 157 | mysql -uroot -p --password="" -e "DROP USER '$1'@'localhost'" 158 | } 159 | 160 | 161 | if ! (command -v rvm >/dev/null 2>&1 ); then 162 | eval "$(rbenv init - --no-rehash zsh)" 163 | fi 164 | 165 | set -o vi 166 | bindkey -v 167 | bindkey '^R' history-incremental-search-backward 168 | 169 | CDPATH=.:$HOME:$HOME/_code 170 | 171 | export PATH="$HOME/.bin:$PATH" 172 | export PATH="$HOME/.bin.local:$PATH" 173 | 174 | 175 | export PATH="/usr/local/sbin:$PATH" 176 | export PATH="$PATH:./node_modules/.bin:./vendor/node_modules/.bin" 177 | export PATH="/usr/local/anaconda3/bin:$PATH" 178 | if [[ -f ~/.zshrc.local ]]; then 179 | source ~/.zshrc.local 180 | fi 181 | export JRUBY_OPTS='--dev' 182 | 183 | if (command -v docker-machine >/dev/null 2>&1 ); then 184 | #eval $(docker-machine env default) 185 | fi 186 | 187 | ###-tns-completion-start-### 188 | if [ -f /Users/anshul/.tnsrc ]; then 189 | source /Users/anshul/.tnsrc 190 | fi 191 | ###-tns-completion-end-### 192 | export PATH="/usr/local/opt/libxml2/bin:$PATH" 193 | 194 | BASE16_SHELL="$HOME/.config/base16-shell/" 195 | [ -n "$PS1" ] && \ 196 | [ -s "$BASE16_SHELL/profile_helper.sh" ] && \ 197 | eval "$("$BASE16_SHELL/profile_helper.sh")" 198 | -------------------------------------------------------------------------------- /zshrc.theme: -------------------------------------------------------------------------------- 1 | robbyrussell 2 | --------------------------------------------------------------------------------