├── .gitignore ├── README.md ├── data ├── cheatsheet.png ├── cheatsheet2.pdf └── screenshots │ ├── hybrid.png │ ├── iceberg.png │ └── tender.png ├── git ├── gitconfig └── gitignore ├── install.sh ├── js ├── flowconfig ├── npmrc └── tern-project ├── linters ├── eslintrc.json ├── haml-lint.yml ├── mdlrc └── rubocop.yml ├── neovim ├── UltiSnips │ ├── all.snippets │ ├── elixir.snippets │ ├── elixir_definitions.snippets │ ├── elixir_docs.snippets │ ├── eruby.snippets │ ├── eruby_blocks.snippets │ ├── html_react.snippets │ ├── javascript.snippets │ ├── javascript_es6.snippets │ ├── javascript_flow.snippets │ ├── javascript_jsx.snippets │ ├── javascript_libraries_eslint.snippets │ ├── javascript_libraries_react.snippets │ ├── javascript_libraries_redux.snippets │ ├── javascript_libraries_saga.snippets │ ├── rails_controllers.snippets │ ├── rails_migrations.snippets │ ├── rails_models.snippets │ ├── rails_other.snippets │ ├── ruby.snippets │ ├── ruby_blocks.snippets │ ├── ruby_commons.snippets │ ├── ruby_conditionals.snippets │ ├── ruby_definitions.snippets │ ├── ruby_tests.snippets │ ├── scss.snippets │ ├── sh.snippets │ ├── snippets.snippets │ ├── vim.snippets │ └── yaml.snippets ├── autoload │ └── utils.vim ├── init.vim ├── other │ ├── ideavimrc │ └── wasavi.vim └── spell │ └── dictionary.utf-8.add ├── other ├── .finicky.js ├── Xmodmap ├── agignore ├── cpu_usage.sh ├── devilspie2 │ └── settings.lua ├── diff_wrapper ├── info │ └── npm-deps.txt └── starscope.json ├── ruby ├── gemrc ├── irbrc ├── pryrc └── rdebugrc ├── shell ├── Xresources ├── colors │ ├── brogrammer.xrdb │ ├── monokai.xrdb │ └── spacegray.xrdb ├── martinus.zsh-theme └── zshrc └── tmux └── tmux.conf /.gitignore: -------------------------------------------------------------------------------- 1 | private/* 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Well documented, terminal centric web developer's dot files 2 | 3 | Hey everybody. I am Martin, a software developer with an obsession for workflow improvement. 4 | Below I present the most interesting parts of my config files. **Feel free to be inspired**. 5 | 6 | | [Credits](#credits) | [License](#license) | 7 | 8 | ## What's included 9 | 10 | * [Neovim](#neovim) ([source](./neovim/init.vim)) 11 | * [ZSH](#zsh) ([source](./shell/zshrc)) 12 | * [Tmux](#tmux) ([source](./tmux/tmux.conf)) 13 | * [Git](#git) ([source](./git/gitconfig)) 14 | * [Xterm](#xterm) ([source](./shell/Xresources)) 15 | * [Ruby utilities (pry, gem, IRB)](#pry-gem-irb) 16 | * [Other utilities (Ag search, Devilspie2)](#ag-devilspie2) 17 | 18 | ## Neovim 19 | 20 | I am using [Neovim](http://neovim.org/) which is a **Vim** fork focused on maintainability. 21 | Below are the most interesting parts of my Neovim configuration. 22 | 23 | ### Show me the end result first 24 | 25 | Here you go. 26 | 27 | ![Neovim + Tender](./data/screenshots/tender.png) 28 | 29 | Want more? Scroll down to the appropriate [section](#screenshots-and-cheatsheets). 30 | 31 | ### Plugins 32 | 33 | I use the excellent [vim-plug](https://github.com/junegunn/vim-plug) package manager. 34 | It supports parallel fetching, lazy loading, after install hooks, etc. You should consider using it :) 35 | 36 | And which plugins I use? Currently I use about **75** plugins. Some of the most interesting are: 37 | 38 | * [Neomake](https://github.com/benekastah/neomake) - Linter integration (Syntastic alternative) with asynchronous support. 39 | * [Unite](https://github.com/Shougo/unite.vim) - Search and display information from arbitrary sources. 40 | * [Deoplete](https://github.com/Shougo/deoplete.nvim) - Autocomplete with Neovim asynchronous support. 41 | * [Lightline](https://github.com/itchyny/lightline.vim) - Lightweight but extensible and configurable status line. 42 | * [Lexima](https://github.com/cohama/lexima.vim) - Auto-closing (,",' and some language constructs (ruby blocks). Dot repeat supported. 43 | 44 | For a complete list, look [here](./neovim/init.vim#L24). 45 | 46 | ### Utility scripts 47 | 48 | In the code snippets below I ofter call `utils#xxx()` functions. Those are just simple multiple lines long 49 | vimscript functions (often inspired by other people). You can find them [here](./neovim/autoload/utils.vim). 50 | 51 | ### Vim defaults overriding (improving) 52 | 53 | ```VimL 54 | " Easier window switching 55 | nmap :call utils#intelligentCycling() 56 | nnoremap h 57 | nnoremap j 58 | nnoremap k 59 | nnoremap l 60 | 61 | " Visual linewise up and down by default (and use gj gk to go quicker) 62 | nnoremap j gj 63 | nnoremap k gk 64 | nnoremap gj 5j 65 | nnoremap gk 5k 66 | vnoremap j gj 67 | vnoremap k gk 68 | vnoremap gj 5j 69 | vnoremap gk 5k 70 | 71 | " When jump to next match also center screen 72 | nnoremap n nzz 73 | nnoremap N Nzz 74 | vnoremap n nzz 75 | vnoremap N Nzz 76 | 77 | " Same when moving up and down 78 | nnoremap zz 79 | nnoremap zz 80 | nnoremap zz 81 | nnoremap zz 82 | vnoremap zz 83 | vnoremap zz 84 | vnoremap zz 85 | vnoremap zz 86 | 87 | " Remap H and L (top, bottom of screen to left and right end of line) 88 | nnoremap H ^ 89 | nnoremap L $ 90 | vnoremap H ^ 91 | vnoremap L g_ 92 | 93 | " More logical Y (default was alias for yy) 94 | nnoremap Y y$ 95 | 96 | " Quick replay q macro 97 | nnoremap Q @q 98 | 99 | " Don't yank to default register when changing something 100 | nnoremap c "xc 101 | xnoremap c "xc 102 | 103 | " After block yank and paste, move cursor to the end of operated text 104 | " Also, don't copy over-pasted text in visual mode 105 | vnoremap y y`] 106 | vnoremap p "_dP`] 107 | nnoremap p p`] 108 | 109 | " Use camel-case motion instead of default motions 110 | map w CamelCaseMotion_w 111 | map b CamelCaseMotion_b 112 | map e CamelCaseMotion_e 113 | map ge CamelCaseMotion_ge 114 | sunmap w 115 | sunmap b 116 | sunmap e 117 | sunmap ge 118 | 119 | " Fix the cw at the end of line bug default Vim has special treatment (:help cw) 120 | nmap cw ce 121 | nmap dw de 122 | 123 | " Uppercase word in insert mode 124 | inoremap mzgUiw`za 125 | 126 | " Matching brackets with TAB (using matchit) (Breaks the jump) 127 | map % 128 | silent! unmap [% 129 | silent! unmap ]% 130 | 131 | " Don't cancel visual select when shifting 132 | xnoremap < >gv 134 | 135 | " Cancel terminal mode with ,escape 136 | if has('nvim') 137 | tnoremap 138 | tnoremap , 139 | endif 140 | 141 | " Stay down after creating fold 142 | vnoremap zf mzzf`zzz 143 | ``` 144 | 145 | ### Common tasks 146 | 147 | ```VimL 148 | " Quick save and close buffer 149 | nnoremap ,w :w 150 | nnoremap ,c :Sayonara! 151 | nnoremap ,q :Sayonara 152 | 153 | " Yank and paste from clipboard 154 | nnoremap ,y "+y 155 | vnoremap ,y "+y 156 | nnoremap ,yy "+yy 157 | nnoremap ,p "+p 158 | 159 | " Move visual block 160 | vnoremap J :m '>+1gv=gv 161 | vnoremap K :m '<-2gv=gv 162 | 163 | " Ctags navigation (:tselect to select from menu) 164 | nnoremap ]t :tn 165 | nnoremap [t :tp 166 | 167 | " Quick-fix window navigation 168 | nnoremap ]q :cnext 169 | nnoremap [q :cprevious 170 | 171 | " Location list navigation 172 | nnoremap ]l :lnext 173 | nnoremap [l :lprevious 174 | 175 | " Error mnemonic (Neomake uses location list) 176 | nnoremap ]e :lnext 177 | nnoremap [e :lprevious 178 | 179 | " Reselect last-pasted text 180 | nnoremap gp `[v`] 181 | 182 | " Keep the cursor in place while joining lines 183 | nnoremap J mzJ`z 184 | 185 | " Split line (sister to Join lines) S is covered by cc. 186 | nnoremap S mzi`z 187 | 188 | " Easier fold toggling 189 | nnoremap ,z za 190 | 191 | " Start substitute on current word under the cursor 192 | nnoremap ,s :%s///gc 193 | ``` 194 | 195 | ### Buffer management 196 | 197 | ```VimL 198 | " Intelligent windows resizing using Ctrl + arrow keys 199 | nnoremap :call utils#intelligentVerticalResize('right') 200 | nnoremap :call utils#intelligentVerticalResize('left') 201 | nnoremap :resize +1 202 | nnoremap :resize -1 203 | 204 | " Buffers navigation and management 205 | nnoremap + :bn 206 | nnoremap _ :bp 207 | ``` 208 | 209 | ### Autocomplete (Deoplete + Ctags) 210 | 211 | ```VimL 212 | let g:deoplete#enable_at_startup=1 213 | let g:deoplete#auto_completion_start_length=2 214 | 215 | let g:deoplete#sources={} 216 | let g:deoplete#sources._ = ['buffer', 'file', 'ultisnips'] 217 | let g:deoplete#sources.ruby = ['buffer', 'member', 'file', 'ultisnips'] 218 | let g:deoplete#sources.vim = ['buffer', 'member', 'file', 'ultisnips'] 219 | let g:deoplete#sources.css = ['buffer', 'member', 'file', 'omni', 'ultisnips'] 220 | let g:deoplete#sources.scss = ['buffer', 'member', 'file', 'omni', 'ultisnips'] 221 | 222 | " Insert or select next match 223 | inoremap utils#tabComplete() 224 | 225 | " Manually trigger tag autocomplete 226 | inoremap utils#manualTagComplete() 227 | 228 | " , : close popup and delete previous char 229 | inoremap deolete#mappings#smart_close_popup()."\" 230 | inoremap deoplete#mappings#smart_close_popup()."\" 231 | ``` 232 | 233 | ### Browser and fuzzy searcher for multiple sources ([Unite](https://github.com/Shougo/unite.vim)) 234 | 235 | ```VimL 236 | " Matcher settings 237 | call unite#filters#matcher_default#use(['matcher_fuzzy', 'matcher_hide_current_file']) 238 | call unite#filters#sorter_default#use(['sorter_rank']) 239 | 240 | " Use Ag if available 241 | if executable('ag') 242 | let g:unite_source_grep_command='ag' 243 | let g:unite_source_grep_default_opts='--nocolor --line-numbers --nogroup -S -C0' 244 | let g:unite_source_grep_recursive_opt='' 245 | 246 | " Set rec source command 247 | let g:unite_source_rec_async_command = ['ag', '--follow', '--nocolor', '--nogroup', '--hidden', '-g', ''] 248 | endif 249 | 250 | " Custom profile 251 | call unite#custom#profile('default', 'context', { 252 | \ 'prompt': '» ', 253 | \ 'winheight': 15, 254 | \ }) 255 | 256 | " Add syntax highlighting 257 | let g:unite_source_line_enable_highlight=1 258 | 259 | " Don't override status line 260 | let g:unite_force_overwrite_statusline=0 261 | ``` 262 | 263 | #### Unite buffer mappings 264 | 265 | ```VimL 266 | " Custom mappings for the unite buffer 267 | autocmd FileType unite call s:unite_settings() 268 | function! s:unite_settings() 269 | " Enable navigation with and in insert mode 270 | imap (unite_select_next_line) 271 | imap (unite_select_previous_line) 272 | " Runs 'splits' action by and 273 | imap unite#do_action('split') 274 | imap unite#do_action('vsplit') 275 | " Exit with escape 276 | nmap (unite_exit) 277 | " Mark candidates 278 | vmap m (unite_toggle_mark_selected_candidates) 279 | nmap m (unite_toggle_mark_current_candidate) 280 | endfunction 281 | ``` 282 | 283 | ### Improved status line ([Lightline](https://github.com/itchyny/lightline.vim)) 284 | 285 | ```VimL 286 | let g:lightline = { 287 | \ 'colorscheme': 'powerline', 288 | \ 'tab': { 289 | \ 'active': [ 'filename' ], 290 | \ 'inactive': [ 'filename' ] 291 | \ }, 292 | \ 'active': { 293 | \ 'left': [ [ 'mode', 'paste' ], [ 'readonly', 'filename' ] ], 294 | \ 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'filetype', 'fileencoding', 'fileformat' ] ] 295 | \ }, 296 | \ 'component': { 297 | \ 'readonly': '%{&filetype=="help"?"HELP":&readonly?"RO":""}' 298 | \ }, 299 | \ 'component_function': { 300 | \ 'mode': 'utils#lightLineMode', 301 | \ 'filename': 'utils#lightLineFilename', 302 | \ 'filetype': 'utils#lightLineFiletype', 303 | \ 'fileformat': 'utils#lightLineFileformat', 304 | \ 'fileencoding': 'utils#lightLineFileencoding' 305 | \ }, 306 | \ 'component_visible_condition': { 307 | \ 'readonly': '(&readonly)' 308 | \ }, 309 | \ 'separator': { 'left': '', 'right': '' }, 310 | \ 'subseparator': { 'left': '', 'right': '' } 311 | \ } 312 | ``` 313 | 314 | ### Snippets support ([UltiSnips](https://github.com/SirVer/ultisnips)) 315 | 316 | ```VimL 317 | " Disable built-in to be able to go backward 318 | inoremap 319 | let g:UltiSnipsExpandTrigger='' 320 | let g:UltiSnipsListSnippets='' 321 | let g:UltiSnipsJumpForwardTrigger='' 322 | let g:UltiSnipsJumpBackwardTrigger='' 323 | ``` 324 | 325 | ### Color settings based on time 326 | 327 | ```viml 328 | " Syntax highlighting 329 | syntax on 330 | 331 | " Color scheme based on time 332 | if strftime("%H") < 16 333 | let g:rehash256 = 1 334 | colorscheme molokai 335 | else 336 | colorscheme jellybeans 337 | endif 338 | 339 | " Highlight VCS conflict markers 340 | match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$' 341 | 342 | " Highlight term cursor differently 343 | highlight TermCursor ctermfg=green guifg=green 344 | 345 | " Remove underline in folded lines 346 | hi! Folded term=NONE cterm=NONE gui=NONE ctermbg=NONE 347 | 348 | " List chars highlighting 349 | highlight NonText ctermfg=235 guifg=gray 350 | highlight SpecialKey ctermfg=235 guifg=gray 351 | 352 | " Link highlight groups to improve buffer tab line colors 353 | hi! link BufTabLineCurrent Identifier 354 | hi! link BufTabLineActive Comment 355 | hi! link BufTabLineHidden Comment 356 | hi! link BufTabLineFill Comment 357 | ``` 358 | 359 | ### Screenshots and Cheatsheets 360 | 361 | [Iceberg](./data/screenshots/iceberg.png) 362 | 363 | [Hybrid](./data/screenshots/hybrid.png) 364 | 365 | [Image cheatsheet](./data/cheatsheet.png) 366 | 367 | [PDF cheatsheet](./data/cheatsheet2.pdf) 368 | 369 | ## Zsh 370 | 371 | My shell interpreter of choice. Here are some options to improve the behavior to my taste. 372 | 373 | ```zsh 374 | # Disable control flow ( / ) 375 | stty stop '' -ixoff -ixon 376 | 377 | # Set spelling correction 378 | setopt correct 379 | 380 | # Don't raise errors when regex nomatch fires 381 | unsetopt nomatch 382 | ``` 383 | 384 | I am also using the excellent [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) framework. 385 | 386 | ```zsh 387 | # Path to your oh-my-zsh installation. 388 | export ZSH=$HOME/.oh-my-zsh 389 | 390 | # Set name of the theme to load. 391 | ZSH_THEME="martinus" 392 | 393 | # Disable auto title setting 394 | DISABLE_AUTO_TITLE="true" 395 | 396 | # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) 397 | plugins=(adb bgnotify bower bundler common-aliases docker extract gem gitfast gulp heroku httpie jsontools meteor mix 398 | npm rails rbenv redis-cli rsync tmux tmuxinator vagrant zsh-syntax-highlighting) 399 | 400 | source $ZSH/oh-my-zsh.sh 401 | source $ZSH/plugins/history-substring-search/history-substring-search.zsh 402 | 403 | # History substring search plugin binding 404 | bindkey '^[[A' history-substring-search-up 405 | bindkey '^[[B' history-substring-search-down 406 | ``` 407 | 408 | ## Tmux 409 | 410 | I am a heavy user of tmux. I am using the [tpm](https://github.com/tmux-plugins/tpm) package manager 411 | and mainly it's [tmux resurrect](https://github.com/tmux-plugins/tmux-resurrect) plugin which allows me 412 | to persist sessions on the disk. 413 | 414 | I am also using the [tmuxinator](https://github.com/tmuxinator/tmuxinator) gem to 415 | quickly bootstrap new tmux sessions. Below are the most interesting settings in my tmux config file: 416 | 417 | ### Settings 418 | 419 | ```tmux 420 | # Unset ruby version so it respects .ruby-version files 421 | set-environment -gu RBENV_VERSION 422 | 423 | # UTF-8 settings 424 | set -g status-utf8 on 425 | set -g utf8 on 426 | 427 | # Fastest command sequences (http://superuser.com/a/252717/65504) 428 | set -s escape-time 0 429 | 430 | # For nice colors 431 | set -g default-terminal "screen-256color" 432 | 433 | # XTerm compatibility 434 | set -g xterm-keys on 435 | 436 | # Vi keys in copy mode 437 | set -g mode-keys vi 438 | 439 | # History boost 440 | set -g history-limit 50000 441 | 442 | # Enable mouse 443 | set -g mode-mouse on 444 | set -g mouse-select-pane on 445 | set -g mouse-resize-pane on 446 | set -g mouse-select-window on 447 | 448 | # Emacs key bindings in command prompt (prefix + :) are better than vi keys, even for vim users 449 | set -g status-keys emacs 450 | 451 | # Focus events enabled for terminals that support them 452 | set -g focus-events on 453 | 454 | # Super useful when using "grouped sessions" and multi-monitor setup 455 | setw -g aggressive-resize on 456 | 457 | # Messages are displayed for 3 seconds 458 | set -g display-time 3000 459 | ``` 460 | 461 | ### Key bindings 462 | 463 | ```tmux 464 | # Backtick as Prefix 465 | unbind C-b 466 | set -g prefix ` 467 | bind-key ` send-prefix 468 | 469 | # Reload the file with Prefix r 470 | bind R source-file ~/.tmux.conf \; display "Sourced tmux.conf" 471 | 472 | # Next and prev window like in vim 473 | bind -r - previous-window 474 | bind -r = next-window 475 | 476 | # New windows and panes in the same dir 477 | bind-key n new-window -c "#{pane_current_path}" 478 | bind-key i split-window -h -c "#{pane_current_path}" 479 | bind-key v split-window -c "#{pane_current_path}" 480 | 481 | # Pane switching 482 | bind-key h select-pane -L 483 | bind-key j select-pane -D 484 | bind-key k select-pane -U 485 | bind-key l select-pane -R 486 | bind-key \ select-pane -l 487 | 488 | # Resize panes with arrows 489 | bind-key -r Left resize-pane -L 1 490 | bind-key -r Down resize-pane -D 1 491 | bind-key -r Up resize-pane -U 1 492 | bind-key -r Right resize-pane -R 1 493 | 494 | # r to rename window 495 | bind-key r command-prompt 'rename-window %%' 496 | 497 | # p to paste buffer 498 | unbind p 499 | bind p paste-buffer 500 | 501 | # P to choose which buffer to paste 502 | bind P choose-buffer 503 | ``` 504 | 505 | ### Plugins 506 | 507 | ```zsh 508 | # List of plugins 509 | set -g @plugin 'tmux-plugins/tpm' 510 | set -g @plugin 'tmux-plugins/tmux-yank' # yanking helpers 511 | set -g @plugin 'tmux-plugins/tmux-sessionist' # session helpers prefix + C (new session) 512 | set -g @plugin 'tmux-plugins/tmux-resurrect' # prefix + save, restore 513 | set -g @plugin 'tmux-plugins/tmux-battery' # Batter percentage 514 | set -g @plugin 'tmux-plugins/tmux-online-status' # Online status 515 | 516 | # Initialize plugin manager (keep this line at the very bottom of tmux.conf) 517 | run '~/.tmux/plugins/tpm/tpm' 518 | ``` 519 | 520 | ## Git 521 | 522 | What about my git config? Maybe some useful aliases: 523 | 524 | ```git 525 | [alias] 526 | a = add 527 | aa = add --all 528 | di = diff 529 | ds = diff --staged 530 | dt = difftool --no-prompt 531 | ci = commit --verbose 532 | amend = commit --amend --verbose 533 | co = checkout 534 | pl = pull 535 | ps = push 536 | pom = push origin master 537 | pod = push origin develop 538 | rb = rebase -i HEAD~10 539 | st = status -sb 540 | br = branch 541 | lo = log --oneline -n 15 542 | lg = log --pretty=format:'%h | %cd | %an | %s' -n 15 543 | ls = log --stat -n 5 544 | lol = log --oneline --graph --all --decorate 545 | g1 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%cr)%C(reset) %C(white)%s%C(reset) %C(bold white)— %cn%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative 546 | g2 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%cD%C(reset) %C(bold green)(%cr)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %cn%C(reset)' --abbrev-commit 547 | wc = whatchanged -p --abbrev-commit --pretty=medium 548 | unstage = reset HEAD -- 549 | edit = "!nvim `git ls-files -m`" 550 | ``` 551 | 552 | ## Xterm 553 | 554 | My terminal emulator of choice. Below are some interesting settings I use: 555 | 556 | ```xdefaults 557 | ! Unicode support 558 | xterm*utf8: 1 559 | 560 | ! Color support 561 | xterm*customization: -color 562 | xterm*termName: xterm-256color 563 | 564 | ! Font settings 565 | xterm*faceName: Droid Sans Mono for Powerline:Bold 566 | xterm*faceSize: 9 567 | xterm*allowBoldFonts: false 568 | 569 | ! For inclusion of all necessary environment variables 570 | xterm*loginShell: true 571 | 572 | ! Scrollback setting 573 | xterm*savelines: 10000 574 | 575 | ! Disable right scrollbar 576 | xterm*ScrollBar: false 577 | 578 | ! Stop output to terminal from jumping down to bottom of scroll again 579 | xterm*scrollTtyOutput: false 580 | 581 | ! Save selections to clipboard 582 | xterm*selectToClipboard: true 583 | ``` 584 | 585 | ## Pry, Gem, IRB 586 | 587 | Don't install RI docs when installing gems (put into your gemrc): 588 | 589 | ```bash 590 | gem: --no-ri --no-rdoc 591 | ``` 592 | 593 | Use editor to edit bigger blocks of code when in pry (put into your pryrc): 594 | 595 | ```bash 596 | # === EDITOR === 597 | Pry.config.editor = 'nvim' 598 | ``` 599 | 600 | Require Rubygems in *irbrc* to have access while in IRB session (I recommend using Pry): 601 | 602 | ```ruby 603 | require 'rubygems' 604 | ``` 605 | 606 | ## Ag, Devilspie2 607 | 608 | [Ag](http://geoff.greer.fm/ag/) is a popular and blazingly fast find on steroids optimized for developers. 609 | I recommend to create *agignore* to specify extra path to ignore. While Ag is pretty intelligent most of things 610 | are already ignored. 611 | 612 | ```bash 613 | *.log 614 | tmp/* 615 | ``` 616 | 617 | [Devilspie2](http://www.gusnan.se/devilspie2/) is a window matching utility, allowing the user to perform 618 | scripted actions on windows as they are created. I use it mainly to move application to their reserved 619 | workspace and to make them go full screen automatically. 620 | 621 | Below is an example of such script: 622 | 623 | ```lua 624 | -- XTerm 625 | if (get_application_name()=="xterm") then 626 | set_window_workspace(2); 627 | maximize(); 628 | end 629 | ``` 630 | 631 | # Credits 632 | 633 | Very big portion of these configuration files was inspired and often even copied 634 | from other people, plugin authors, blog writers, etc. I want to say **Thank You** to all of them. 635 | 636 | Especially, I want to mention these guys: 637 | 638 | * [tpope](https://github.com/tpope) 639 | * [garybernhardt](https://github.com/garybernhardt) 640 | * [Shougo](https://github.com/Shougo) 641 | 642 | For their contribution to Vim and Neovim ecosystem. Speaking of [Neovim](https://github.com/neovim/neovim), 643 | the whole [team](https://github.com/neovim/neovim/graphs/contributors) should be mentioned for their great work. 644 | 645 | # License 646 | 647 | Well documented, terminal centric web developer's dot files. 648 | Copyright (C) Martin Toma 649 | 650 | Permission is hereby granted, free of charge, to any person obtaining 651 | a copy of this software and associated documentation files (the "Software"), 652 | to deal in the Software without restriction, including without limitation 653 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 654 | and/or sell copies of the Software, and to permit persons to whom the 655 | Software is furnished to do so, subject to the following conditions: 656 | 657 | The above copyright notice and this permission notice shall be included 658 | in all copies or substantial portions of the Software. 659 | 660 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 661 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 662 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 663 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 664 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 665 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 666 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 667 | -------------------------------------------------------------------------------- /data/cheatsheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martin-svk/dot-files/60d961ffc05f5f61ea5613ca16e80f7fc9f53d32/data/cheatsheet.png -------------------------------------------------------------------------------- /data/cheatsheet2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martin-svk/dot-files/60d961ffc05f5f61ea5613ca16e80f7fc9f53d32/data/cheatsheet2.pdf -------------------------------------------------------------------------------- /data/screenshots/hybrid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martin-svk/dot-files/60d961ffc05f5f61ea5613ca16e80f7fc9f53d32/data/screenshots/hybrid.png -------------------------------------------------------------------------------- /data/screenshots/iceberg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martin-svk/dot-files/60d961ffc05f5f61ea5613ca16e80f7fc9f53d32/data/screenshots/iceberg.png -------------------------------------------------------------------------------- /data/screenshots/tender.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martin-svk/dot-files/60d961ffc05f5f61ea5613ca16e80f7fc9f53d32/data/screenshots/tender.png -------------------------------------------------------------------------------- /git/gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Martin Toma 3 | email = martin@itrinity.com 4 | [credential] 5 | helper = cache --timeout=3600 6 | [core] 7 | excludesfile = /Users/martin/.gitignore 8 | [push] 9 | default = simple 10 | [color] 11 | status = always 12 | ui = true 13 | [core] 14 | editor = nvim 15 | [alias] 16 | a = add 17 | aa = add --all 18 | ap = add --patch 19 | di = diff 20 | ds = diff --staged 21 | dt = difftool --no-prompt 22 | ci = commit --verbose 23 | cim = commit --verbose --reedit-message=HEAD --reset-author 24 | amend = commit --amend --verbose 25 | co = checkout 26 | pl = pull 27 | ps = push 28 | pom = push origin master 29 | pbm = push backup master 30 | pod = push origin develop 31 | pbd = push backup develop 32 | rb = rebase -i HEAD~10 33 | st = status -sb 34 | br = branch 35 | lo = log --oneline -n 15 36 | lg = log --pretty=format:'%h | %cd | %an | %s' -n 15 37 | ls = log --stat -n 5 38 | lol = log --oneline --graph --all --decorate 39 | g1 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%cr)%C(reset) %C(white)%s%C(reset) %C(bold white)— %cn%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative 40 | g2 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%cD%C(reset) %C(bold green)(%cr)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %cn%C(reset)' --abbrev-commit 41 | wc = whatchanged -p --abbrev-commit --pretty=medium 42 | unstage = reset HEAD -- 43 | edit = "!nvim `git ls-files -m`" 44 | [github] 45 | user = martin-svk 46 | [branch] 47 | autosetuprebase = always 48 | [diff] 49 | tool = nvimdiff 50 | [difftool "nvimdiff"] 51 | cmd = diff_wrapper "$LOCAL" "$REMOTE" 52 | [difftool "sourcetree"] 53 | cmd = opendiff \"$LOCAL\" \"$REMOTE\" 54 | path = 55 | [mergetool "sourcetree"] 56 | cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" 57 | trustExitCode = true 58 | [commit] 59 | template = /Users/martin/.stCommitMsg 60 | -------------------------------------------------------------------------------- /git/gitignore: -------------------------------------------------------------------------------- 1 | # Compiled sources 2 | # =========================== 3 | 4 | *.com 5 | *.class 6 | *.dll 7 | *.exe 8 | *.o 9 | *.so 10 | 11 | # Packages 12 | # =========================== 13 | 14 | *.7z 15 | *.dmg 16 | *.gz 17 | *.iso 18 | *.jar 19 | *.rar 20 | *.tar 21 | *.zip 22 | 23 | # Logs and databases 24 | # =========================== 25 | 26 | *.log 27 | *.sql 28 | *.sqlite 29 | 30 | # OS generated files 31 | # =========================== 32 | 33 | .DS_Store 34 | .DS_Store? 35 | ._* 36 | .Trashes 37 | ehthumbs.db 38 | Thumbs.db 39 | 40 | # Codekits 41 | # =========================== 42 | 43 | .sass-cache/ 44 | .codekit-config.json 45 | config.codekit 46 | 47 | # Editors 48 | # =========================== 49 | 50 | # VIM 51 | Session.vim 52 | .*.swo 53 | .*.swp 54 | *~ 55 | 56 | # Idea 57 | .idea/ 58 | 59 | # Sublime 60 | *.sublime-project 61 | *.sublime-workspace 62 | 63 | # Other 64 | # =========================== 65 | 66 | .rake_tasks 67 | .meteor/ 68 | .tags 69 | tags 70 | .starscope.db 71 | default-gems 72 | .tern-project 73 | .tern-port 74 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #---------------------------------------------------------------------------------------- 4 | # Well documented, terminal centric web developer's dot files. 5 | # Debian/ubuntu based distros installer. 6 | # @author Martin Toma 7 | # 8 | # @version 6.0 9 | # @updated Sat Nov 7 22:38:01 CET 2015 10 | # @created Fri Nov 15 13:13:22 CET 2013 11 | #---------------------------------------------------------------------------------------- 12 | 13 | # Dont continue on error 14 | set -e 15 | 16 | # Existing files won't be replaced 17 | REPLACE_FILES=false 18 | 19 | #----------------------------------------------------- 20 | # Functions and variables 21 | #----------------------------------------------------- 22 | current_path=$(pwd) 23 | 24 | command_exists() { 25 | type "$1" &>/dev/null 26 | } 27 | 28 | install_oh_my_zsh() { 29 | curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh 30 | ln -sf $current_path/shell/martinus.zsh-theme ~/.oh-my-zsh/themes/martinus.zsh-theme 31 | echo " Change your default shell to zsh" 32 | sudo chsh 33 | } 34 | 35 | install_plug_nvim() { 36 | curl -fLo ~/.config/nvim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 37 | } 38 | 39 | install_nvim_folder() { 40 | mkdir -p ~/.config/nvim/autoload 41 | install_plug_nvim 42 | ln -sf $current_path/neovim/spell/dictionary.utf-8.add ~/.config/nvim/dictionary.utf-8.add 43 | ln -sf $current_path/neovim/UltiSnips ~/.config/nvim/UltiSnips 44 | ln -sf $current_path/neovim/init.vim ~/.config/nvim/init.vim 45 | } 46 | 47 | #----------------------------------------------------- 48 | # Basic requirements check 49 | #----------------------------------------------------- 50 | 51 | if ! command_exists apt-get; then 52 | echo "This istaller is only comaptible with debian/ubuntu based Linux distributrions." 53 | echo "Please install configuration files manually." 54 | exit 55 | fi 56 | 57 | if ! command_exists curl; then 58 | sudo apt-get install -y curl 59 | fi 60 | 61 | if ! command_exists git; then 62 | sudo apt-get install -y git 63 | fi 64 | 65 | #----------------------------------------------------- 66 | # ZSH installation 67 | #----------------------------------------------------- 68 | echo -n "[ zshrc ]" 69 | 70 | if [ ! -f ~/.zshrc ]; then 71 | echo " Creating zshrc!" 72 | ln -sf $current_path/shell/zshrc ~/.zshrc 73 | elif $REPLACE_FILES; then 74 | echo " Deleting old zshrc!" 75 | rm ~/.zshrc 76 | ln -sf $current_path/shell/zshrc ~/.zshrc 77 | else 78 | echo " Keeping existing zshrc!" 79 | fi 80 | 81 | echo -n "[ oh-my-zsh ]" 82 | 83 | if command_exists zsh; then 84 | if [ ! -d ~/.oh-my-zsh ]; then 85 | echo " Installing Oh my zsh" 86 | install_oh_my_zsh 87 | fi 88 | else 89 | echo " Installing ZSH." 90 | sudo apt-get install zsh -y 91 | install_oh_my_zsh 92 | fi 93 | 94 | #----------------------------------------------------- 95 | # Git (config, ignore) 96 | #----------------------------------------------------- 97 | echo -n "[ gitconfig ]" 98 | 99 | if [ ! -f ~/.gitconfig ]; then 100 | echo " Creating gitconfig!" 101 | ln -sf $current_path/git/gitconfig ~/.gitconfig 102 | elif $REPLACE_FILES; then 103 | echo " Deleting old gitconfig!" 104 | rm ~/.gitconfig 105 | ln -sf $current_path/git/gitconfig ~/.gitconfig 106 | else 107 | echo " Keeping existing gitconfig!" 108 | fi 109 | 110 | echo -n "[ gitignore ]" 111 | 112 | if [ ! -f ~/.gitignore ]; then 113 | echo " Creating gitignore!" 114 | ln -sf $current_path/git/gitignore ~/.gitignore 115 | elif $REPLACE_FILES; then 116 | echo " Deleting old gitignore!" 117 | rm ~/.gitignore 118 | ln -sf $current_path/git/gitignore ~/.gitignore 119 | else 120 | echo " Keeping existing gitignore!" 121 | fi 122 | 123 | #----------------------------------------------------- 124 | # Neovim, dictionary, ultisnips 125 | #----------------------------------------------------- 126 | echo -n "[ Neovim ]" 127 | 128 | if ! command_exists nvim; then 129 | echo " Installing Neovim!" 130 | sudo add-apt-repository ppa:neovim-ppa/unstable 131 | sudo apt-get update 132 | sudo apt-get install -y neovim 133 | fi 134 | 135 | echo -n "[ Neovim config ]" 136 | 137 | if [ ! -d ~/.config/nvim ]; then 138 | echo " Creating nvim folder!" 139 | mkdir ~/.config/nvim 140 | install_nvim_folder 141 | elif $REPLACE_FILES; then 142 | echo " Deleting old nvim folder!" 143 | rm -rf ~/.config/nvim 144 | install_nvim_folder 145 | else 146 | echo " Keeping existing nvim folder!" 147 | fi 148 | 149 | #----------------------------------------------------- 150 | # Installing tmux 151 | #----------------------------------------------------- 152 | echo -n "[ tmux.conf ]" 153 | 154 | if ! command_exists tmux; then 155 | sudo apt-get install tmux -y 156 | fi 157 | 158 | if [ ! -f ~/.tmux.conf ]; then 159 | echo " Creating tmux.conf!" 160 | ln -sf $current_path/tmux/tmux.conf ~/.tmux.conf 161 | elif $REPLACE_FILES; then 162 | echo " Deleting old tmux.conf!" 163 | rm ~/.tmux.conf 164 | ln -sf $current_path/tmux/tmux.conf ~/.tmux.conf 165 | else 166 | echo " Keeping existing tmux.conf!" 167 | fi 168 | 169 | #----------------------------------------------------- 170 | # Installing Xresources 171 | #----------------------------------------------------- 172 | echo -n "[ Xresources ]" 173 | 174 | if ! command_exists xterm; then 175 | sudo apt-get install xterm -y 176 | fi 177 | 178 | if [ ! -f ~/.Xresources ]; then 179 | echo " Creating Xresources!" 180 | ln -sf $current_path/shell/Xresources ~/.Xresources 181 | xrdb -merge ~/.Xresources 182 | elif $REPLACE_FILES; then 183 | echo " Deleting old Xresources!" 184 | rm ~/.Xresources 185 | ln -sf $current_path/shell/Xresources ~/.Xresources 186 | xrdb -merge ~/.Xresources 187 | else 188 | echo " Keeping existing Xresources!" 189 | fi 190 | 191 | #----------------------------------------------------- 192 | # Installing Ruby utilities 193 | #----------------------------------------------------- 194 | echo -n "[ Ruby (rbenv) and utilities (gemrc, irbrc, rdebugrc) ]" 195 | 196 | if command_exists ruby; then 197 | if [ ! -f ~/.gemrc ]; then 198 | echo " Creating gemrc, irbrc, rdebugrc!" 199 | ln -sf $current_path/ruby/gemrc ~/.gemrc 200 | ln -sf $current_path/ruby/irbrc ~/.irbrc 201 | ln -sf $current_path/ruby/rdebugrc ~/.rdebugrc 202 | else 203 | echo " Keeping existing gemrc, irbrc, rdebugrc!" 204 | fi 205 | 206 | if command_exists pry; then 207 | if [ ! -f ~/.pryrc ]; then 208 | echo " Creating pryrc!" 209 | ln -sf $current_path/ruby/pryrc ~/.pryrc 210 | else 211 | echo " Keeping existing pryrc!" 212 | fi 213 | else 214 | echo " Installing pry!" 215 | gem install pry 216 | echo " Creating pryrc!" 217 | ln -sf $current_path/ruby/pryrc ~/.pryrc 218 | fi 219 | else 220 | echo " Installing, rbenv and rubybuild." 221 | git clone https://github.com/sstephenson/rbenv.git ~/.rbenv 222 | git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build 223 | echo " Restart your shell and install ruby by rbenv install ruby-version" 224 | echo " Then run this script again." 225 | exit 226 | fi 227 | 228 | #----------------------------------------------------- 229 | # Installing Ag 230 | #----------------------------------------------------- 231 | echo -n "[ Ag ]" 232 | 233 | if command_exists ag; then 234 | if [ ! -f ~/.agignore ]; then 235 | echo " Creating agignore!" 236 | ln -sf $current_path/other/agignore ~/.agignore 237 | else 238 | echo " Keeping existing agignore!" 239 | fi 240 | else 241 | echo " Installing Ag!" 242 | sudo apt-get install -y silversearcher-ag 243 | echo " Creating agignore!" 244 | ln -sf $current_path/other/agignore ~/.agignore 245 | fi 246 | 247 | #----------------------------------------------------- 248 | # Installing linters 249 | #----------------------------------------------------- 250 | echo -n "[ Rubocop ]" 251 | 252 | if [ ! -d ~/dev ]; then 253 | mkdir ~/dev 254 | fi 255 | 256 | if command_exists rubocop; then 257 | ln -sf $current_path/linters/rubocop.yml ~/dev/.rubocop.yml 258 | else 259 | echo " Installing rubocop!" 260 | gem install rubocop 261 | ln -sf $current_path/linters/rubocop.yml ~/dev/.rubocop.yml 262 | fi 263 | 264 | echo -n "[ Eslint ]" 265 | 266 | if command_exists eslint; then 267 | ln -sf $current_path/linters/eslintrc ~/dev/.eslintrc 268 | else 269 | if command_exists npm; then 270 | npm install -g eslint 271 | ln -sf $current_path/linters/eslintrc ~/dev/.eslintrc 272 | else 273 | echo " Install node and npm, then rerun script again!" 274 | exit 275 | fi 276 | fi 277 | 278 | #----------------------------------------------------- 279 | # Installing Other stuff 280 | #----------------------------------------------------- 281 | -------------------------------------------------------------------------------- /js/flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ./node_modules 3 | 4 | [include] 5 | ./src/ 6 | 7 | [libs] 8 | module.name_mapper='^.*\.css$' -> 'empty/object' 9 | module.name_mapper='^.*\.scss$' -> 'empty/object' 10 | module.name_mapper='^.*\.less$' -> 'empty/object' 11 | module.name_mapper='^.*\.svg$' -> 'empty/object' 12 | module.name_mapper='^.*\.png$' -> 'empty/object' 13 | 14 | module.name_mapper='^actions\/\(.*\)$' -> './src/actions/\1' 15 | module.name_mapper='^actions$' -> './src/actions' 16 | module.name_mapper='^constants\/\(.*\)$' -> './src/constants/\1' 17 | module.name_mapper='^constants$' -> './src/constants' 18 | 19 | [options] 20 | -------------------------------------------------------------------------------- /js/npmrc: -------------------------------------------------------------------------------- 1 | progress=false 2 | -------------------------------------------------------------------------------- /js/tern-project: -------------------------------------------------------------------------------- 1 | # vim: ft=json 2 | { 3 | "libs": [ 4 | "browser", 5 | "ecma5", 6 | "ecma6" 7 | ], 8 | "plugins": { 9 | "es_modules": {}, 10 | "requirejs": { 11 | "baseURL": "./", 12 | "paths": {} 13 | }, 14 | "webpack": {} 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /linters/eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "node": true 5 | }, 6 | "extends": [ 7 | "airbnb" 8 | ], 9 | "globals": { 10 | "$": true, 11 | "fetch": true, 12 | "module": true, 13 | "require": true 14 | }, 15 | "parser": "babel-eslint", 16 | "plugins": [], 17 | "rules": { 18 | "arrow-parens": 0, 19 | "class-methods-use-this": 0, 20 | "comma-dangle": 0, 21 | "function-paren-newline": 0, 22 | "global-require": 0, 23 | "import/extensions": 0, 24 | "import/no-extraneous-dependencies": 0, 25 | "import/no-unresolved": 0, 26 | "import/prefer-default-export": 0, 27 | "indent": [ 28 | 2, 29 | 4, 30 | { 31 | "SwitchCase": 1 32 | } 33 | ], 34 | "jsx-a11y/anchor-is-valid": 1, 35 | "jsx-a11y/click-events-have-key-events": 0, 36 | "jsx-a11y/no-static-element-interactions": 0, 37 | "max-len": [ 38 | 2, 39 | 120, 40 | 2, 41 | { 42 | "ignoreComments": false, 43 | "ignoreUrls": true 44 | } 45 | ], 46 | "new-cap": [ 47 | 2, 48 | { 49 | "capIsNew": false, 50 | "newIsCap": true 51 | } 52 | ], 53 | "newline-per-chained-call": 0, 54 | "no-class-assign": 0, 55 | "no-else-return": 0, 56 | "no-return-assign": 0, 57 | "no-unused-vars": [ 58 | 2, 59 | { 60 | "args": "all", 61 | "argsIgnorePattern": "^_", 62 | "vars": "local", 63 | "varsIgnorePattern": "^_" 64 | } 65 | ], 66 | "object-curly-newline": 0, 67 | "prefer-destructuring": 1, 68 | "react/button-has-type": [2, { 69 | "button": true, 70 | "submit": true, 71 | "reset": true 72 | }], 73 | "react/destructuring-assignment": 0, 74 | "react/jsx-filename-extension": 0, 75 | "react/jsx-one-expression-per-line": 0, 76 | "react/jsx-indent": [ 77 | 2, 78 | 4 79 | ], 80 | "react/jsx-indent-props": [ 81 | 2, 82 | 4 83 | ], 84 | "react/jsx-no-target-blank": 0, 85 | "react/no-typos": 0, 86 | "react/require-default-props": 0, 87 | "space-before-function-paren": [ 88 | 2, 89 | "never" 90 | ] 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /linters/haml-lint.yml: -------------------------------------------------------------------------------- 1 | linters: 2 | LineLength: 3 | max: 120 4 | -------------------------------------------------------------------------------- /linters/mdlrc: -------------------------------------------------------------------------------- 1 | style "relaxed" 2 | -------------------------------------------------------------------------------- /linters/rubocop.yml: -------------------------------------------------------------------------------- 1 | # gem install rubocop 2 | # gem install rubocop-rails 3 | # gem install rubocop-rspec 4 | 5 | require: rubocop-rails 6 | 7 | Layout/MultilineOperationIndentation: 8 | EnforcedStyle: indented 9 | Layout/LineLength: 10 | Max: 120 11 | Style/FrozenStringLiteralComment: 12 | Enabled: false 13 | Rails: 14 | Enabled: true 15 | AllCops: 16 | TargetRubyVersion: 2.3 17 | Include: 18 | - '**/*.rb' 19 | - '**/*.gemspec' 20 | - '**/*.podspec' 21 | - '**/*.jbuilder' 22 | - '**/*.rake' 23 | - '**/*.opal' 24 | - '**/config.ru' 25 | - '**/Gemfile' 26 | - '**/Rakefile' 27 | - '**/Capfile' 28 | - '**/Guardfile' 29 | - '**/Podfile' 30 | - '**/Thorfile' 31 | - '**/Vagrantfile' 32 | - '**/Berksfile' 33 | - '**/Cheffile' 34 | - '**/Vagabondfile' 35 | Exclude: 36 | - 'db/**/*' 37 | - 'config/**/*' 38 | - 'script/**/*' 39 | - 'vendor/**/*' 40 | -------------------------------------------------------------------------------- /neovim/UltiSnips/all.snippets: -------------------------------------------------------------------------------- 1 | # Global snippets 2 | snippet todo "todo note" w 3 | TODO: $0 4 | endsnippet 5 | 6 | snippet note "note note" w 7 | NOTE: $0 8 | endsnippet 9 | 10 | snippet date "current date" 11 | `strftime("%Y-%m-%d")` 12 | endsnippet 13 | 14 | snippet datetime "current date and time" 15 | `strftime("%Y-%m-%d %H:%M")` 16 | endsnippet 17 | 18 | snippet sign "my signature" 19 | Ing. Martin Toma, CEng. 20 | endsnippet 21 | 22 | snippet lorem "lorem ipsum" 23 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, 24 | sed do eiusmod tempor incididunt ut labore et dolore magna 25 | aliqua. Ut enim ad minim veniam, quis nostrud exercitation 26 | ullamco laboris nisi ut aliquip ex ea commodo consequat. 27 | endsnippet 28 | -------------------------------------------------------------------------------- /neovim/UltiSnips/elixir.snippets: -------------------------------------------------------------------------------- 1 | # -------------------------------- 2 | # Elixir lang basic snippets 3 | # -------------------------------- 4 | snippet req "require statement" 5 | require $0 6 | endsnippet 7 | 8 | snippet p "pipe" 9 | |> $0 10 | endsnippet 11 | 12 | snippet test "test block" 13 | test "${1:test description}" do 14 | ${2:assert 1 == 1} 15 | end 16 | endsnippet 17 | -------------------------------------------------------------------------------- /neovim/UltiSnips/elixir_definitions.snippets: -------------------------------------------------------------------------------- 1 | # -------------------------------- 2 | # Methods, modules, declarations 3 | # -------------------------------- 4 | snippet def "function definition" 5 | def $1 do 6 | $2 7 | end 8 | endsnippet 9 | 10 | snippet defi "inline function definition" 11 | def $1, do: $2 12 | endsnippet 13 | 14 | snippet defm "module definition" 15 | defmodule $1 do 16 | $2 17 | end 18 | endsnippet 19 | 20 | snippet defp "private function definition" 21 | defp $1 do 22 | $2 23 | end 24 | endsnippet 25 | 26 | snippet defpi "inline private function definition" 27 | defp $1, do: $2 28 | endsnippet 29 | -------------------------------------------------------------------------------- /neovim/UltiSnips/elixir_docs.snippets: -------------------------------------------------------------------------------- 1 | # -------------------------------- 2 | # Elixir docs snippets 3 | # -------------------------------- 4 | snippet doc "documentation block" 5 | @doc ~S""" 6 | ${1:Function description. Use `backtics` for 7 | highlight.} 8 | 9 | ## Examples 10 | 11 | iex> ${2:Module.function(parameter)} 12 | ${3:return value} 13 | 14 | """ 15 | endsnippet 16 | 17 | snippet spec "spec block" 18 | @spec ${1:function}(${2:input_type}) :: ${3:return_type} 19 | endsnippet 20 | -------------------------------------------------------------------------------- /neovim/UltiSnips/eruby.snippets: -------------------------------------------------------------------------------- 1 | snippet % "eruby tag" 2 | <% $0 %> 3 | endsnippet 4 | 5 | snippet = "eruby printing tag" 6 | <%= $0 %> 7 | endsnippet 8 | -------------------------------------------------------------------------------- /neovim/UltiSnips/eruby_blocks.snippets: -------------------------------------------------------------------------------- 1 | snippet each "each block" 2 | <% @$1s.each do |$1| %> 3 | $2 4 | <% end %> 5 | endsnippet 6 | -------------------------------------------------------------------------------- /neovim/UltiSnips/html_react.snippets: -------------------------------------------------------------------------------- 1 | snippet rhtml "react html skeleton" 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | $1 10 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | endsnippet 24 | -------------------------------------------------------------------------------- /neovim/UltiSnips/javascript.snippets: -------------------------------------------------------------------------------- 1 | # =============================================== 2 | # Declarations 3 | # =============================================== 4 | snippet fun "function" b 5 | function $1($2) { 6 | $3 7 | } 8 | endsnippet 9 | 10 | # =============================================== 11 | # Control flow 12 | # =============================================== 13 | snippet if "if block" b 14 | if ($1) { 15 | $2 16 | } 17 | endsnippet 18 | 19 | snippet ife "if/esle block" b 20 | if ($1) { 21 | $2 22 | } else { 23 | $3 24 | } 25 | endsnippet 26 | 27 | snippet ifef "if/else if/else block" b 28 | if ($1) { 29 | $2 30 | } else if ($3) { 31 | $4 32 | } else { 33 | $5 34 | } 35 | endsnippet 36 | 37 | snippet switch "switch case statement" b 38 | switch (${1:variable}) { 39 | case ${2:value}: { 40 | $3 41 | break; 42 | } 43 | default: { 44 | return; 45 | } 46 | } 47 | endsnippet 48 | 49 | # =============================================== 50 | # Common functions and constructs 51 | # =============================================== 52 | snippet log "console log" w 53 | console.log('${1:message}'); 54 | endsnippet 55 | 56 | snippet bt "bind this" w 57 | bind(this); 58 | endsnippet 59 | 60 | snippet req "require statement" b 61 | require('$1'); 62 | endsnippet 63 | 64 | snippet ret "return" 65 | return $1; 66 | endsnippet 67 | 68 | snippet dbg "debugger" b 69 | debugger; 70 | endsnippet 71 | -------------------------------------------------------------------------------- /neovim/UltiSnips/javascript_es6.snippets: -------------------------------------------------------------------------------- 1 | # =============================================== 2 | # Classes, imports, exports 3 | # =============================================== 4 | snippet class "es6 class" b 5 | class $1 { 6 | constructor() { 7 | $2 8 | } 9 | } 10 | endsnippet 11 | 12 | snippet im "import statement" b 13 | import $1 from '$2'; 14 | endsnippet 15 | 16 | snippet imd "import destructor statement" b 17 | import { $1 } from '$2'; 18 | endsnippet 19 | 20 | snippet ex "export statement" b 21 | export default $1; 22 | endsnippet 23 | 24 | # =============================================== 25 | # Variables 26 | # =============================================== 27 | snippet con "constant declaration" b 28 | const ${1:name} = ${2:value}; 29 | endsnippet 30 | 31 | snippet let "block scoped variable declaration" b 32 | let ${1:name} = ${2:value}; 33 | endsnippet 34 | 35 | # =============================================== 36 | # Functions 37 | # =============================================== 38 | snippet map "builtin map function" w 39 | map((${1:item}) => $2); 40 | endsnippet 41 | 42 | snippet filter "builtin filter function" w 43 | filter((${1:item}) => $2); 44 | endsnippet 45 | 46 | # =============================================== 47 | # Misc 48 | # =============================================== 49 | snippet fbt "Function bind this" 50 | this.${1:functionName} = this.$1.bind(this);$0 51 | endsnippet 52 | -------------------------------------------------------------------------------- /neovim/UltiSnips/javascript_flow.snippets: -------------------------------------------------------------------------------- 1 | # =============================================== 2 | # Flow helpers 3 | # =============================================== 4 | snippet @fl "flow declaration" 5 | /* @flow */ 6 | endsnippet 7 | 8 | snippet @flw "flow weak declaration" 9 | /* @flow weak */ 10 | endsnippet 11 | -------------------------------------------------------------------------------- /neovim/UltiSnips/javascript_jsx.snippets: -------------------------------------------------------------------------------- 1 | # =============================================== 2 | # JSX helpers 3 | # =============================================== 4 | snippet del "JSX DOM element" w 5 | <${1:div} ${2:className='$3'}> 6 | $4 7 | 8 | endsnippet 9 | 10 | snippet cel "JSX Component element" w 11 | <${1:Component} ${2:${3:property}={${4:value}}} /> 12 | endsnippet 13 | 14 | snippet nbsp " " w 15 |   16 | endsnippet 17 | 18 | snippet apos " " w 19 | ' 20 | endsnippet 21 | -------------------------------------------------------------------------------- /neovim/UltiSnips/javascript_libraries_eslint.snippets: -------------------------------------------------------------------------------- 1 | # =============================================== 2 | # ESLINT 3 | # =============================================== 4 | snippet edr "eslint disable rule comment" 5 | /* eslint-disable ${1:rule-name} */ 6 | endsnippet 7 | 8 | snippet edn "eslint disable next-line rule comment" 9 | /* eslint-disable-next-line ${1:rule-name} */ 10 | endsnippet 11 | 12 | snippet eer "eslint enable rule comment" 13 | /* eslint-enable ${1:rule-name} */ 14 | endsnippet 15 | 16 | snippet edl "eslint disable line rule comment" 17 | // eslint-disable-line ${1:rule-name} 18 | endsnippet 19 | 20 | snippet edml "eslint disable max-len" 21 | /* eslint-disable max-len */ 22 | /* eslint-enable max-len */ 23 | endsnippet 24 | -------------------------------------------------------------------------------- /neovim/UltiSnips/javascript_libraries_react.snippets: -------------------------------------------------------------------------------- 1 | # =============================================== 2 | # Components declarations 3 | # =============================================== 4 | snippet comp "React component" b 5 | import React, { Component } from 'react'; 6 | 7 | class $1 extends Component { 8 | constructor() { 9 | super();$2 10 | } 11 | 12 | render() { 13 | return ( 14 | ${3:
Hello World
} 15 | ); 16 | } 17 | } 18 | 19 | $1.propTypes = {}; 20 | 21 | export default $1; 22 | endsnippet 23 | 24 | snippet fcomp "React stateless, functional component" b 25 | import React from 'react'; 26 | 27 | function ${1:Component}(props) { 28 | return ( 29 | ${2:
Hello
} 30 | ); 31 | } 32 | 33 | $1.propTypes = {}; 34 | 35 | export default $1; 36 | endsnippet 37 | 38 | # =============================================== 39 | # Prop types and default props, context 40 | # =============================================== 41 | snippet imp "import prop-types" b 42 | import { ${1:func} } from 'prop-types'; 43 | endsnippet 44 | 45 | snippet propt "prop types definition" w 46 | propTypes = { 47 | ${1:prop}: ${2:value} 48 | }; 49 | endsnippet 50 | 51 | snippet dpropt "default prop values" w 52 | defaultProps = { 53 | ${1:prop}: ${2:value} 54 | }; 55 | endsnippet 56 | 57 | snippet contt "context types definition" w 58 | contextTypes = { 59 | ${1:prop}: ${2:value} 60 | }; 61 | endsnippet 62 | 63 | snippet prop "one prop type definition" w 64 | ${1:number}${2:.isRequired} 65 | endsnippet 66 | 67 | # =============================================== 68 | # Component lifecycle functions 69 | # =============================================== 70 | snippet cwm "Component will mount method" b 71 | componentWillMount() { 72 | $1 73 | } 74 | endsnippet 75 | 76 | snippet cdm "Component did mount method" b 77 | componentDidMount() { 78 | $1 79 | } 80 | endsnippet 81 | 82 | snippet cwrp "Component will receive props" b 83 | componentWillReceiveProps(newProps) { 84 | $1 85 | } 86 | endsnippet 87 | 88 | snippet scu "Should Component update" b 89 | shouldComponentUpdate(newProps, newState) { 90 | // import shallowCompare from 'react-addons-shallow-compare'; 91 | return shallowCompare(this, newProps, newState);$1 92 | } 93 | 94 | endsnippet 95 | 96 | snippet cwup "Component will update method" b 97 | componentWillUpdate(newProps, newState) { 98 | $1 99 | } 100 | endsnippet 101 | 102 | snippet cdu "Component did update method" b 103 | componentDidUpdate(prevProps, prevState) { 104 | $1 105 | } 106 | endsnippet 107 | 108 | snippet cwu "Component will unmount method" b 109 | componentWillUnmount() { 110 | $1 111 | } 112 | endsnippet 113 | 114 | # =============================================== 115 | # Misc 116 | # =============================================== 117 | snippet pp "props" w 118 | props.${1:property} 119 | endsnippet 120 | 121 | snippet tp "this.props." w 122 | this.props.${1:property} 123 | endsnippet 124 | 125 | snippet ts "this.state." w 126 | this.state.${1:property} 127 | endsnippet 128 | 129 | snippet tss "this.setState" w 130 | this.setState({ 131 | ${1:property}: ${2:value}$0 132 | }); 133 | endsnippet 134 | 135 | snippet epd "prevent default on event" w 136 | e.preventDefault(); 137 | endsnippet 138 | 139 | snippet esp "stop propagation on event" w 140 | e.stopPropagation(); 141 | endsnippet 142 | 143 | # =============================================== 144 | # Classnames library snippets 145 | # =============================================== 146 | snippet cx "classnames (cx) definition" 147 | const ${1:div}Classes = classnames({ 148 | '${2:class}': ${3:condition} 149 | }); 150 | endsnippet 151 | -------------------------------------------------------------------------------- /neovim/UltiSnips/javascript_libraries_redux.snippets: -------------------------------------------------------------------------------- 1 | # =============================================== 2 | # Containers declarations 3 | # =============================================== 4 | snippet cont "React (Redux) container component" b 5 | import React, { Component, PropTypes } from 'react'; 6 | import { connect } from 'react-redux'; 7 | 8 | class $1 extends Component { 9 | constructor() { 10 | super(); 11 | } 12 | 13 | render() { 14 | return ( 15 | ${3:} 16 | ); 17 | } 18 | } 19 | 20 | const mapStateToProps = state => ({ 21 | data: state.data 22 | }); 23 | 24 | const mapDispatchToProps = (dispatch, _ownProps) => ({ 25 | onEvent(param) { 26 | return dispatch(requestedEventAction(param)); 27 | } 28 | }); 29 | 30 | $1.propTypes = {}; 31 | 32 | export default connect(mapStateToProps, mapDispatchToProps)($1); 33 | endsnippet 34 | 35 | snippet fcont "React (Redux) stateless, function container" b 36 | import React, { PropTypes } from 'react'; 37 | import { connect } from 'react-redux'; 38 | 39 | function ${1:Component}(props) { 40 | const { ${2:prop} } = props.$2; 41 | return ( 42 | ${3:} 43 | ); 44 | } 45 | 46 | const mapStateToProps = state => ({ 47 | data: state.data 48 | }); 49 | 50 | const mapDispatchToProps = (dispatch, _ownProps) => ({ 51 | onEvent(param) { 52 | return dispatch(requestedEventAction(param)); 53 | } 54 | }); 55 | 56 | $1.propTypes = {}; 57 | 58 | export default connect(mapStateToProps, mapDispatchToProps)($1); 59 | endsnippet 60 | 61 | # =============================================== 62 | # Action creators/types 63 | # =============================================== 64 | snippet acp "Redux action creator (w/payload)" 65 | export const ${1:actionName} = ($2) => ({ 66 | type: ActionTypes.${3:ACTION_TYPE}, 67 | error: false, 68 | payload: $2 69 | }); 70 | endsnippet 71 | 72 | snippet acs "Redux action creator (simple)" 73 | export const ${1:actionName} = () => ({ 74 | type: ActionTypes.${3:ACTION_TYPE} 75 | }); 76 | endsnippet 77 | 78 | snippet at "Action type" b 79 | ${1:KEY}: '$1' 80 | endsnippet 81 | 82 | # =============================================== 83 | # Reducers 84 | # =============================================== 85 | snippet rred "Redux root reducer" 86 | import { combineReducers } from 'redux'; 87 | import { routerReducer } from 'react-router-redux'; 88 | import dataReducer from './dataReducer'; 89 | 90 | const rootReducer = combineReducers({ 91 | data: dataReducer 92 | }); 93 | 94 | export default rootReducer; 95 | endsnippet 96 | 97 | snippet red "Redux reducer" 98 | import ActionTypes from 'constants/ActionTypes'; 99 | 100 | const initialState = { 101 | data: [], 102 | fetching: false 103 | }; 104 | 105 | const ${1:dataReducer} = (state = initialState, action) => { 106 | switch (action.type) { 107 | case ActionTypes.${2:ACTION_TYPE}: { 108 | return state; 109 | } 110 | default: { 111 | return state; 112 | } 113 | } 114 | }; 115 | 116 | export default $1; 117 | endsnippet 118 | 119 | # =============================================== 120 | # Selectors 121 | # =============================================== 122 | snippet sel "Redux state selector" 123 | ${1:export} const ${2:selectorName} = state => state.$3; 124 | endsnippet 125 | 126 | snippet rsel "Redux computed state re-selector (using reselect)" 127 | export const ${1:computedSelectorName} = createSelector( 128 | [ ${2:usedSelector}, ${3:usedSelector2} ], 129 | ($2, $3) => { 130 | $4 131 | } 132 | ); 133 | endsnippet 134 | 135 | # =============================================== 136 | # Misc 137 | # =============================================== 138 | snippet mstp "Map state to props (Redux)" 139 | const mapStateToProps = (state, _ownProps) => ({ 140 | ${1:prop}: state.prop 141 | }); 142 | endsnippet 143 | 144 | snippet mdtp "Map dispatch to props (Redux)" 145 | const mapDispatchToProps = (dispatch, _ownProps) => ({ 146 | onEvent() { 147 | dispatch(${1:action()}); 148 | } 149 | }); 150 | endsnippet 151 | -------------------------------------------------------------------------------- /neovim/UltiSnips/javascript_libraries_saga.snippets: -------------------------------------------------------------------------------- 1 | # =============================================== 2 | # Generator declarations 3 | # =============================================== 4 | 5 | snippet gfun "generator function declaration" b 6 | export function* ${1:name}(${2:args}) { 7 | yield ${3:true}; 8 | } 9 | endsnippet 10 | 11 | snippet watcher "watcher generator function declaration" b 12 | export function* ${1:watch}() { 13 | yield fork(${2:worker}); 14 | } 15 | endsnippet 16 | 17 | snippet worker "worker generator function declaration" b 18 | export function* ${1:fetch}() { 19 | yield call(${2:function}); 20 | } 21 | endsnippet 22 | 23 | # =============================================== 24 | # Effects 25 | # =============================================== 26 | 27 | snippet put "saga put effect" b 28 | yield put(${1:ActionTypes}.${2:ACTION_TYPE}); 29 | endsnippet 30 | 31 | snippet call "saga call effect" b 32 | const ${1:returnValue} = yield call(${2:function}, ${3:args}); 33 | endsnippet 34 | 35 | snippet select "saga select effect" b 36 | const ${1:returnValue} = yield select(${2:selector}); 37 | endsnippet 38 | 39 | snippet fork "saga fork effect" b 40 | ${1:const task = }yield fork(${2:saga}); 41 | endsnippet 42 | 43 | snippet race "saga race effect" b 44 | const { result, _timeout } = yield race({ 45 | result: call($1), 46 | _timeout: call(delay, ${2:Defaults.MAX_REQUEST_TIMEOUT}) 47 | }); 48 | endsnippet 49 | -------------------------------------------------------------------------------- /neovim/UltiSnips/rails_controllers.snippets: -------------------------------------------------------------------------------- 1 | # =============================================== 2 | # Rails controller snippets 3 | # =============================================== 4 | snippet baf "before action filter" 5 | before_action :${1:method} 6 | endsnippet 7 | -------------------------------------------------------------------------------- /neovim/UltiSnips/rails_migrations.snippets: -------------------------------------------------------------------------------- 1 | # -------------------------------- 2 | # Basics 3 | # -------------------------------- 4 | snippet rmcm "remove_column migration" 5 | remove_column :${1:table_name}, :${2:column_name} 6 | endsnippet 7 | 8 | snippet acm "add_column migration" 9 | add_column :${1:table_name}, :${2:column_name}, :${3:type} 10 | endsnippet 11 | 12 | snippet ccm "change_column migration" 13 | change_column :${1:table_name}, :${2:column_name}, :${3:new_new_type} 14 | endsnippet 15 | 16 | snippet rncm "rename_column migration" 17 | rename_column :${1:table_name}, :${2:old_column_name}, :${3:new_column_name} 18 | endsnippet 19 | 20 | snippet aim "add_index migration" 21 | add_index :${1:table_name}, :${2:column_name} 22 | endsnippet 23 | -------------------------------------------------------------------------------- /neovim/UltiSnips/rails_models.snippets: -------------------------------------------------------------------------------- 1 | # =============================================== 2 | # Active record models snippets 3 | # =============================================== 4 | 5 | # -------------------------------- 6 | # Relations 7 | # -------------------------------- 8 | snippet btr "belongs_to relation" 9 | belongs_to :$0 10 | endsnippet 11 | 12 | snippet hmr "has_many relation" 13 | has_many :$0s 14 | endsnippet 15 | 16 | snippet hmtr "has_many trough relation" 17 | has_many :$1s, through: :$2s 18 | endsnippet 19 | 20 | # -------------------------------- 21 | # Validations 22 | # -------------------------------- 23 | snippet val "validates" 24 | validates :$0 25 | endsnippet 26 | 27 | snippet vap "validates presence" 28 | validates :$1, presence: true$2 29 | endsnippet 30 | 31 | snippet vau "validates uniqueness" 32 | validates :$1, uniqueness: ${3:true} 33 | endsnippet 34 | 35 | # -------------------------------- 36 | # Scopes 37 | # -------------------------------- 38 | snippet scope "scope with arguments" 39 | scope :${1:name}, -> (${2:args}) { where($3) } 40 | endsnippet 41 | 42 | # -------------------------------- 43 | # Filters 44 | # -------------------------------- 45 | snippet bsf "before save hook" 46 | before_save :${1:method_name} 47 | endsnippet 48 | 49 | snippet acf "after create hook" 50 | after_create :${1:method_name} 51 | endsnippet 52 | -------------------------------------------------------------------------------- /neovim/UltiSnips/rails_other.snippets: -------------------------------------------------------------------------------- 1 | # =============================================== 2 | # Rails routes snippets 3 | # =============================================== 4 | snippet res "resources routes" 5 | resources :$1 6 | endsnippet 7 | -------------------------------------------------------------------------------- /neovim/UltiSnips/ruby.snippets: -------------------------------------------------------------------------------- 1 | # -------------------------------- 2 | # Other ruby snippets 3 | # -------------------------------- 4 | snippet pry "binding pry" 5 | binding.pry 6 | endsnippet 7 | 8 | snippet req "require" 9 | require '${0}' 10 | endsnippet 11 | 12 | snippet LP "Load path" 13 | $LOAD_PATH.unshift(File.expand_path("${1:..}", __FILE__)) 14 | endsnippet 15 | 16 | snippet # "hash rocket marker" 17 | # => 18 | endsnippet 19 | 20 | snippet ## "comment line separator" 21 | # -------------------------------- 22 | endsnippet 23 | 24 | # -------------------------------- 25 | # Attributes 26 | # -------------------------------- 27 | snippet atta "attribute accessor" 28 | attr_accessor :${1:attribute} 29 | endsnippet 30 | 31 | snippet attr "attribute reader" 32 | attr_reader :${1:attribute} 33 | endsnippet 34 | 35 | snippet attw "attribute writer" 36 | attr_writer :${1:attribute} 37 | endsnippet 38 | -------------------------------------------------------------------------------- /neovim/UltiSnips/ruby_blocks.snippets: -------------------------------------------------------------------------------- 1 | # -------------------------------- 2 | # Blocks 3 | # -------------------------------- 4 | snippet do "do block" 5 | do |$1| 6 | $2 7 | end 8 | endsnippet 9 | 10 | snippet each "each block" 11 | each do |$1| 12 | $2 13 | end 14 | endsnippet 15 | 16 | snippet map "map inline block" w 17 | map(&:${1:method})$0 18 | endsnippet 19 | 20 | snippet red "reduce inline block" w 21 | reduce(&:${1:+})$0 22 | endsnippet 23 | -------------------------------------------------------------------------------- /neovim/UltiSnips/ruby_commons.snippets: -------------------------------------------------------------------------------- 1 | # -------------------------------- 2 | # Common methods 3 | # -------------------------------- 4 | snippet fe ".fetch('key')" w 5 | fetch(${1:key}${2:, default}) 6 | endsnippet 7 | -------------------------------------------------------------------------------- /neovim/UltiSnips/ruby_conditionals.snippets: -------------------------------------------------------------------------------- 1 | # -------------------------------- 2 | # If, while, etc. 3 | # -------------------------------- 4 | snippet if "if construct" 5 | if $1 6 | $2 7 | end 8 | endsnippet 9 | 10 | snippet ife "if else construct" 11 | if $1 12 | $2 13 | else 14 | $3 15 | end 16 | endsnippet 17 | 18 | snippet ifel "if else construct" 19 | if $1 20 | $2 21 | elsif $3 22 | $4 23 | else 24 | $5 25 | end 26 | endsnippet 27 | -------------------------------------------------------------------------------- /neovim/UltiSnips/ruby_definitions.snippets: -------------------------------------------------------------------------------- 1 | # -------------------------------- 2 | # Methods, modules, declarations 3 | # -------------------------------- 4 | snippet def "method definition" 5 | def $1 6 | $2 7 | end 8 | endsnippet 9 | 10 | snippet defs "self method definition" 11 | def self.$1 12 | $2 13 | end 14 | endsnippet 15 | 16 | snippet defi "intialize definition" 17 | def initialize($1) 18 | $2 19 | end 20 | endsnippet 21 | 22 | snippet cla "class definition" 23 | class $1 24 | $2 25 | end 26 | endsnippet 27 | 28 | snippet dcl "derived class definition" 29 | class $1 < $2 30 | $3 31 | end 32 | endsnippet 33 | 34 | snippet mod "module definition" 35 | module $1 36 | ${2:${VISUAL}} 37 | end 38 | endsnippet 39 | -------------------------------------------------------------------------------- /neovim/UltiSnips/ruby_tests.snippets: -------------------------------------------------------------------------------- 1 | # -------------------------------- 2 | # Basics 3 | # -------------------------------- 4 | snippet test "test block" 5 | test '${1:test description}' do 6 | $2 7 | end 8 | endsnippet 9 | 10 | # -------------------------------- 11 | # Asserts 12 | # -------------------------------- 13 | snippet ass "assert" 14 | assert ${1:expected}, message: '${2:message}' 15 | endsnippet 16 | 17 | snippet ref "refute" 18 | refute ${1:expected}, message: '${2:message}' 19 | endsnippet 20 | 21 | snippet ase "assert_equal" 22 | assert_equal ${1:expected}, ${2:actual} 23 | endsnippet 24 | 25 | snippet asm "assert_match" 26 | assert_match ${1:expected}, ${2:actual} 27 | endsnippet 28 | 29 | snippet asnn "assert_not_nil" 30 | assert_not_nil ${1:value} 31 | endsnippet 32 | 33 | # -------------------------------- 34 | # RSpec 35 | # -------------------------------- 36 | 37 | snippet desc "describe block" 38 | describe '${1:something}' do 39 | $2 40 | end 41 | endsnippet 42 | 43 | snippet cont "context block" 44 | context '${1:error case}' do 45 | $2 46 | end 47 | endsnippet 48 | 49 | snippet it "it block" 50 | it '${1}' do 51 | $2 52 | end 53 | endsnippet 54 | 55 | snippet exp "expect to" 56 | expect(${1:expression}).to $2 57 | endsnippet 58 | 59 | snippet expn "expect not to" 60 | expect(${1:expression}).not_to $2 61 | endsnippet 62 | -------------------------------------------------------------------------------- /neovim/UltiSnips/scss.snippets: -------------------------------------------------------------------------------- 1 | snippet mt "margin-top" 2 | margin-top: $0px; 3 | endsnippet 4 | 5 | snippet mb "margin-bottom" 6 | margin-bottom: $0px; 7 | endsnippet 8 | 9 | snippet mr "margin-right" 10 | margin-right: $0px; 11 | endsnippet 12 | 13 | snippet ml "margin-left" 14 | margin-left: $0px; 15 | endsnippet 16 | 17 | snippet ma "margin all" 18 | margin: $1px $2px $3px $4px; 19 | endsnippet 20 | 21 | snippet wi "width" 22 | width: $0px; 23 | endsnippet 24 | -------------------------------------------------------------------------------- /neovim/UltiSnips/sh.snippets: -------------------------------------------------------------------------------- 1 | snippet #! "sha bang" 2 | #!/bin/bash 3 | endsnippet 4 | 5 | snippet e "echo" 6 | echo "$0" 7 | endsnippet 8 | -------------------------------------------------------------------------------- /neovim/UltiSnips/snippets.snippets: -------------------------------------------------------------------------------- 1 | snippet s "snippet for snippets whooa" 2 | snippet ${1:trigger} "${2:description}" b 3 | $3 4 | ${0:endsnippet} 5 | endsnippet 6 | -------------------------------------------------------------------------------- /neovim/UltiSnips/vim.snippets: -------------------------------------------------------------------------------- 1 | snippet plug "vim-plug plugin definition" b 2 | " ${1:Plugin description} 3 | Plug '$2' 4 | endsnippet 5 | 6 | snippet pl "plugize github url or just entry one" 7 | Plug '${0:${VISUAL:ghrepo}}' 8 | endsnippet 9 | 10 | snippet nn "normal mode map coomand" b 11 | nnoremap ${1:key} ${2:command} 12 | endsnippet 13 | 14 | snippet in "insert mode map coomand" b 15 | inoremap ${1:key} ${2:command} 16 | endsnippet 17 | 18 | snippet vn "visual mode map coomand" b 19 | vnoremap ${1:key} ${2:command} 20 | endsnippet 21 | 22 | snippet if "if statement" b 23 | if $1 24 | $2 25 | endif 26 | endsnippet 27 | 28 | snippet ife "if ... else statement" b 29 | if $1 30 | $2 31 | else 32 | $3 33 | endsnippet 34 | 35 | snippet fun "function! definition" b 36 | function! ${1:FunctionName}() 37 | $2 38 | endfunction 39 | endsnippet 40 | 41 | snippet "== "commented separator" b 42 | " ====================================================================================================================== 43 | endsnippet 44 | -------------------------------------------------------------------------------- /neovim/UltiSnips/yaml.snippets: -------------------------------------------------------------------------------- 1 | snippet < "erb interpolation" 2 | <%= $1 %> 3 | endsnippet 4 | -------------------------------------------------------------------------------- /neovim/autoload/utils.vim: -------------------------------------------------------------------------------- 1 | " Informative echo line 2 | function! g:utils#showToggles() abort 3 | echom ' NERDTree | Free | Free | Spellcheck | Reload rc | Search HL |' . 4 | \' Whitechars | Built-in terminal | Free | Free | Free |' . 5 | \' This message' 6 | endfunction 7 | 8 | " Copy and paste function using xclip 9 | function! g:utils#clipboardYank() abort 10 | call system('xclip -i -selection clipboard', @@) 11 | endfunction 12 | 13 | function! g:utils#clipboardPaste() abort 14 | let @@ = system('xclip -o -selection clipboard') 15 | endfunction 16 | 17 | " Profile neovim and save results to profile.log 18 | function! g:utils#profile() abort 19 | execute 'profile start profile.log' 20 | execute 'profile func *' 21 | execute 'profile file *' 22 | echom 'Profiling started (will last until you quit neovim).' 23 | endfunction 24 | 25 | " When cycling ignore NERDTree and Tagbar 26 | function! g:utils#intelligentCycling() abort 27 | " Cycle firstly 28 | wincmd w 29 | " Handle where you are now 30 | if &filetype ==# 'nerdtree' 31 | call g:utils#intelligentCycling() 32 | endif 33 | " If in terminal buffer start insert 34 | if &buftype ==# 'terminal' 35 | startinsert! 36 | endif 37 | endfunction 38 | 39 | " Be aware of whether you are right or left vertical split 40 | " so you can use arrows more naturally. 41 | " Inspired by https://github.com/ethagnawl. 42 | function! g:utils#intelligentVerticalResize(direction) abort 43 | let l:window_resize_count = 5 44 | let l:current_window_is_last_window = (winnr() == winnr('$')) 45 | 46 | if (a:direction ==# 'left') 47 | let [l:modifier_1, l:modifier_2] = ['+', '-'] 48 | else 49 | let [l:modifier_1, l:modifier_2] = ['-', '+'] 50 | endif 51 | 52 | let l:modifier = l:current_window_is_last_window ? l:modifier_1 : l:modifier_2 53 | let l:command = 'vertical resize ' . l:modifier . l:window_resize_count . '' 54 | execute l:command 55 | endfunction 56 | 57 | " Run NERDTreeFind or Toggle based on current buffer 58 | function! g:utils#nerdWrapper() abort 59 | if &filetype ==# '' " Empty buffer 60 | :NERDTreeToggle 61 | elseif expand('%:t') =~? 'NERD_tree' " In NERD_tree buffer 62 | wincmd w 63 | else " Normal file buffer 64 | :NERDTreeFind 65 | endif 66 | endfunction 67 | 68 | " Strip trailing spaces 69 | function! g:utils#stripTrailingWhitespaces() abort 70 | " Preparation: save last search, and cursor position. 71 | let l:lastSearch = @/ 72 | let l:line = line('.') 73 | let l:col = col('.') 74 | 75 | " Do the business: 76 | execute '%s/\s\+$//e' 77 | 78 | " Clean up: restore previous search history, and cursor position 79 | let @/ = l:lastSearch 80 | call cursor(l:line, l:col) 81 | endfunction 82 | 83 | " Set SK keyboard layout with qwerty 84 | function! g:utils#setSKKBLayout() abort 85 | silent !setxkbmap sk -variant qwerty 86 | endfunction 87 | 88 | " Set US keyboard layout with qwerty 89 | function! g:utils#setUSKBLayout() abort 90 | silent !setxkbmap us 91 | endfunction 92 | 93 | " Generate ctags and put them into tags directory 94 | " gem install starscope 95 | function! g:utils#generateCtags() abort 96 | silent execute '!starscope -x node_modules/ -e ctags' 97 | echom 'Tags generated into tags file!' 98 | endfunction 99 | 100 | " Tab wrapper 101 | function! g:utils#tabComplete() abort 102 | let l:col = col('.') - 1 103 | 104 | if pumvisible() 105 | return "\" 106 | else 107 | if !l:col || getline('.')[l:col - 1] !~# '\k' 108 | return "\" 109 | else 110 | return "\" 111 | endif 112 | endif 113 | endfunction 114 | 115 | " Manual Tag complete 116 | function! g:utils#manualTagComplete() abort 117 | if pumvisible() 118 | return g:deoplete#mappings#close_popup() 119 | else 120 | return g:deoplete#mappings#manual_complete('tag') 121 | endif 122 | endfunction 123 | 124 | " Use omni complete source as default 125 | function! g:utils#useOmniTabWrapper() abort 126 | inoremap utils#insertTabOmniWrapper() 127 | endfunction 128 | 129 | " Format function 130 | " Needs: `npm install js-beautify`, `gem install ruby-beautify`, `python` 131 | function! g:utils#formatFile() abort 132 | let l:line = line('.') 133 | let l:col = col('.') 134 | let l:command_prefix = '%!' 135 | 136 | if &filetype ==? 'javascript.jsx' 137 | let l:command = 'js-beautify -X -f -' 138 | elseif &filetype ==? 'html' 139 | let l:command = 'html-beautify -f -' 140 | elseif &filetype ==? 'css' 141 | let l:command = 'css-beautify -f -' 142 | elseif &filetype ==? 'json' 143 | let l:command = 'python -m json.tool' 144 | elseif &filetype ==? 'ruby' 145 | let l:command = 'ruby-beautify -c 2 -s' 146 | else 147 | " Basic vim format fallback 148 | normal! gg=G 149 | endif 150 | 151 | if exists('l:command') 152 | execute l:command_prefix . l:command 153 | endif 154 | 155 | " Return back to where cursor was 156 | call cursor(l:line, l:col) 157 | endfunction 158 | 159 | " NOTE: npm install -g eslint 160 | function! g:utils#eslintFixFile() abort 161 | let l:line = line('.') 162 | let l:col = col('.') 163 | let l:command_prefix = '!' 164 | 165 | if &filetype ==? 'javascript.jsx' 166 | let l:command = 'eslint --fix %:p' 167 | endif 168 | 169 | if exists('l:command') 170 | execute l:command_prefix . l:command 171 | else 172 | echom 'Only .js files are supported.' 173 | endif 174 | 175 | " Return back to where cursor was 176 | call cursor(l:line, l:col) 177 | endfunction 178 | 179 | " Mode function for Lightline statusline 180 | function! g:utils#lightLineMode() abort 181 | let l:fname = expand('%:t') 182 | return l:fname =~? 'NERD_tree' ? 'NT' : 183 | \ winwidth(0) > 70 ? g:lightline#mode() : '' 184 | endfunction 185 | 186 | " File format function for Lightline statusline 187 | function! g:utils#lightLineFileformat() abort 188 | return winwidth(0) > 70 ? &fileformat : '' 189 | endfunction 190 | 191 | " Filetype function for Lightline statusline 192 | function! g:utils#lightLineFiletype() abort 193 | return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : '' 194 | endfunction 195 | 196 | " File encoding function for Lightline statusline 197 | function! g:utils#lightLineFileencoding() abort 198 | return winwidth(0) > 70 ? (strlen(&fileencoding) ? &fileencoding : &encoding) : '' 199 | endfunction 200 | 201 | " File name function for Lightline statusline 202 | function! g:utils#lightLineFilename() abort 203 | let l:fname = expand('%:t') 204 | return l:fname =~? 'NERD_tree' ? 'NERDTree' : 205 | \ ('' !=# l:fname ? l:fname : '[No Name]') 206 | endfunction 207 | 208 | " Search current word with CtrlSF 209 | " Inspired by github.com/zenbro 210 | function! g:utils#searchCurrentWordWithAg() abort 211 | execute 'CtrlSF' expand('') 212 | endfunction 213 | 214 | " Reset tabs to 4 spaces 215 | function! g:utils#retabToFourSpaces() abort 216 | setlocal tabstop=4 shiftwidth=4 expandtab 217 | retab 218 | endfunction 219 | 220 | " Reset tabs to 2 spaces 221 | function! g:utils#retabToTwoSpaces() abort 222 | setlocal tabstop=2 shiftwidth=2 expandtab 223 | retab 224 | endfunction 225 | 226 | " Nice block heading 227 | " Source: http://vi.stackexchange.com/a/418 228 | function! g:utils#blockHeading(width, word) abort 229 | let l:char = '=' 230 | let l:inserted_word = ' ' . a:word . ' ' 231 | let l:word_width = strlen(l:inserted_word) 232 | let l:length_before = (a:width - l:word_width) / 2 233 | let l:hashes_before = repeat(l:char, l:length_before) 234 | let l:hashes_after = repeat(l:char, a:width - (l:word_width + l:length_before)) 235 | let l:comment_line = repeat(l:char, a:width) 236 | let l:word_line = l:hashes_before . l:inserted_word . l:hashes_after 237 | 238 | :put =l:comment_line 239 | :put =l:word_line 240 | :put =l:comment_line 241 | endfunction 242 | -------------------------------------------------------------------------------- /neovim/init.vim: -------------------------------------------------------------------------------- 1 | " ###################################################################################################################### 2 | " ### Author : Martin Toma ### 3 | " ###################################################################################################################### 4 | " ### Neovim Configuration focused on Web development ### 5 | " ### Neovimmer since : Tue Oct 14 2014 ### 6 | " ### Vimmer since : Tue Nov 12 2013 ### 7 | " ###################################################################################################################### 8 | 9 | " ====================================================================================================================== 10 | " 1.0 Plugin manager (Plug) settings 11 | " ====================================================================================================================== 12 | "{{{ 13 | 14 | " Autoinstall {{{ 15 | if empty(glob('~/.config/nvim/autoload/plug.vim')) 16 | silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs 17 | \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 18 | augroup plug_install 19 | autocmd VimEnter * PlugInstall 20 | augroup END 21 | endif 22 | " }}} 23 | call plug#begin('~/.config/nvim/plugged') 24 | 25 | " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 26 | " 1.1 Plugin list 27 | " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 28 | 29 | " --------------------------------------------------------------------------------------------------------------------- 30 | " Language agnostic plugins {{{ 31 | " --------------------------------------------------------------------------------------------------------------------- 32 | 33 | " Asynchronous maker and linter (needs linters to work) 34 | Plug 'benekastah/neomake', { 'on': ['Neomake'] } 35 | " Autocomplete 36 | Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } 37 | " Automatically closing pair stuff 38 | Plug 'cohama/lexima.vim' 39 | " Snippet support (C-j) 40 | Plug 'SirVer/ultisnips' 41 | " Commenting support (gc) 42 | Plug 'tpope/vim-commentary' 43 | " CamelCase and snake_case motions 44 | Plug 'bkad/CamelCaseMotion' 45 | " Heuristically set indent settings 46 | Plug 'tpope/vim-sleuth' 47 | "}}} 48 | 49 | " --------------------------------------------------------------------------------------------------------------------- 50 | " Ruby/Rails {{{ 51 | " --------------------------------------------------------------------------------------------------------------------- 52 | 53 | " Ruby support (plays nicely with tpope/rbenv-ctags) 54 | Plug 'vim-ruby/vim-ruby' 55 | " Slim syntax 56 | Plug 'slim-template/vim-slim' 57 | " Haml syntax 58 | Plug 'tpope/vim-haml' 59 | " Minitest syntax 60 | Plug 'sunaku/vim-ruby-minitest' 61 | " Rails support (:A, :R, :Rmigration, :Rextract) 62 | Plug 'tpope/vim-rails', { 'for': ['ruby', 'eruby', 'haml', 'slim'] } 63 | " Bundler support (plays nicely with tpope/gem-ctags) 64 | Plug 'tpope/vim-bundler', { 'for': ['ruby', 'eruby', 'haml', 'slim'] } 65 | "}}} 66 | 67 | " --------------------------------------------------------------------------------------------------------------------- 68 | " JS (ES6, React) {{{ 69 | " --------------------------------------------------------------------------------------------------------------------- 70 | 71 | " Modern JS support (indent, syntax, etc) 72 | Plug 'pangloss/vim-javascript' 73 | " JSX syntax 74 | Plug 'mxw/vim-jsx', { 'for': ['javascript.jsx'] } 75 | " Typescript syntax 76 | Plug 'HerringtonDarkholme/yats.vim' 77 | " JSON syntax 78 | Plug 'sheerun/vim-json' 79 | " JS Documentation comments 80 | Plug 'heavenshell/vim-jsdoc', { 'on': ['JsDoc'] } 81 | "}}} 82 | 83 | " --------------------------------------------------------------------------------------------------------------------- 84 | " HTML/CSS {{{ 85 | " --------------------------------------------------------------------------------------------------------------------- 86 | 87 | " HTML5 syntax 88 | Plug 'othree/html5.vim' 89 | " SCSS syntax 90 | Plug 'cakebaker/scss-syntax.vim' 91 | " Color highlighter 92 | Plug 'lilydjwg/colorizer', { 'for': ['css', 'sass', 'scss', 'less', 'html', 'xdefaults', 'javascript', 'javascript.jsx'] } 93 | " Handlebars 94 | Plug 'mustache/vim-mustache-handlebars' 95 | "}}} 96 | 97 | " --------------------------------------------------------------------------------------------------------------------- 98 | " Other languages {{{ 99 | " --------------------------------------------------------------------------------------------------------------------- 100 | 101 | " Elixir syntax 102 | Plug 'elixir-lang/vim-elixir' 103 | " Elm support 104 | Plug 'ElmCast/elm-vim' 105 | " Yaml indentation 106 | Plug 'martin-svk/vim-yaml' 107 | " Markdown syntax 108 | Plug 'tpope/vim-markdown' 109 | " Git syntax 110 | Plug 'tpope/vim-git' 111 | " Tmux syntax 112 | Plug 'keith/tmux.vim' 113 | " Dockerfile 114 | Plug 'honza/dockerfile.vim' 115 | "}}} 116 | 117 | " --------------------------------------------------------------------------------------------------------------------- 118 | " Interface improving {{{ 119 | " --------------------------------------------------------------------------------------------------------------------- 120 | 121 | " Nerdtree file browser 122 | Plug 'scrooloose/nerdtree', { 'on': ['NERDTreeFind', 'NERDTreeToggle'] } 123 | " Lightline (simple status line) 124 | Plug 'itchyny/lightline.vim' 125 | " Buffers tabline 126 | Plug 'ap/vim-buftabline' 127 | "}}} 128 | 129 | " --------------------------------------------------------------------------------------------------------------------- 130 | " External tools integration plugins {{{ 131 | " --------------------------------------------------------------------------------------------------------------------- 132 | 133 | " Fuzzy searching/replacing/etc 134 | Plug '/usr/local/opt/fzf' | Plug 'junegunn/fzf.vim' 135 | " Ag wrapper search and edit 136 | Plug 'dyng/ctrlsf.vim', { 'on': ['CtrlSF', 'CtrlSFToggle'] } 137 | " Git swiss-army knife 138 | Plug 'tpope/vim-fugitive' 139 | " Git changes showed on line numbers 140 | Plug 'airblade/vim-gitgutter' 141 | " Color picker 142 | Plug 'KabbAmine/vCoolor.vim', { 'on': ['VCoolor', 'VCase'] } 143 | "}}} 144 | 145 | " --------------------------------------------------------------------------------------------------------------------- 146 | " Text insertion/manipulation {{{ 147 | " --------------------------------------------------------------------------------------------------------------------- 148 | 149 | " Surround (cs"') 150 | Plug 'tpope/vim-surround' 151 | " Easy alignment 152 | Plug 'godlygeek/tabular', { 'on': 'Tabularize' } 153 | " Safely editing in isolation 154 | Plug 'ferranpm/vim-isolate', { 'on': ['Isolate', 'UnIsolate'] } 155 | " Cycling related words via C-a C-x (i.e. true/false) 156 | Plug 'zef/vim-cycle' 157 | " Titlecase motion (gt) 158 | Plug 'christoomey/vim-titlecase' 159 | " Show content of registers when pasting 160 | Plug 'junegunn/vim-peekaboo' 161 | "}}} 162 | 163 | " --------------------------------------------------------------------------------------------------------------------- 164 | " Extra text objects {{{ 165 | " --------------------------------------------------------------------------------------------------------------------- 166 | 167 | " Custom text objects creation (dependency for the latter) 168 | Plug 'kana/vim-textobj-user' 169 | " Argument text object (via, >a) 170 | Plug 'PeterRincker/vim-argumentative' 171 | " Indent text object (vii) 172 | Plug 'kana/vim-textobj-indent' 173 | " Line text object (vil) 174 | Plug 'kana/vim-textobj-line' 175 | " Entire buffer text object (vae) 176 | Plug 'kana/vim-textobj-entire' 177 | " Comment text object (vac) 178 | Plug 'glts/vim-textobj-comment' 179 | " XML attribute 180 | Plug 'whatyouhide/vim-textobj-xmlattr' 181 | " Improved targets line cin) next parens 182 | Plug 'wellle/targets.vim' 183 | "}}} 184 | 185 | " --------------------------------------------------------------------------------------------------------------------- 186 | " Colorschemes {{{ 187 | " --------------------------------------------------------------------------------------------------------------------- 188 | 189 | " Hybrid 190 | Plug 'w0ng/vim-hybrid' 191 | " Badwolf 192 | Plug 'sjl/badwolf' 193 | " Molokai 194 | Plug 'tomasr/molokai' 195 | " Iceberg 196 | Plug 'cocopon/iceberg.vim' 197 | " Tender 198 | Plug 'jacoborus/tender.vim' 199 | "}}} 200 | 201 | " --------------------------------------------------------------------------------------------------------------------- 202 | " Other {{{ 203 | " --------------------------------------------------------------------------------------------------------------------- 204 | 205 | " Easily expand selected region 206 | Plug 'terryma/vim-expand-region' 207 | " Search for highlighted word with * 208 | Plug 'thinca/vim-visualstar' 209 | " Improve star by not jumping immediately 210 | Plug 'ironhouzi/vim-stim' 211 | " Intelligent buffer closing 212 | Plug 'mhinz/vim-sayonara', { 'on': 'Sayonara' } 213 | " Iabbrev auto-correction library 214 | Plug 'chip/vim-fat-finger' 215 | " Matchit enhances jump motions 216 | Plug 'tmhedberg/matchit' 217 | " More . repeat functionality 218 | Plug 'tpope/vim-repeat' 219 | " Delete all but current buffer 220 | Plug 'vim-scripts/BufOnly.vim', { 'on': 'Bonly' } 221 | " Did you mean file open 222 | Plug 'EinfachToll/DidYouMean' 223 | "}}} 224 | 225 | " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 226 | " 1.2 End of plugin declaration 227 | " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 228 | call plug#end() 229 | "}}} 230 | 231 | " ====================================================================================================================== 232 | " 2.0 Basic settings (Neovim defaults: https://neovim.io/doc/user/vim_diff.html#nvim-option-defaults) {{{ 233 | " ====================================================================================================================== 234 | "{{{ 235 | 236 | set encoding=utf-8 " The encoding displayed. 237 | set fileencoding=utf-8 " The encoding written to file. 238 | scriptencoding utf-8 " Set utf-8 as default script encoding 239 | 240 | set shell=/bin/zsh " Setting shell to zsh 241 | set number " Line numbers on 242 | set showmode " Always show mode 243 | set showcmd " Show commands as you type them 244 | set textwidth=120 " Text width is 120 characters 245 | set cmdheight=1 " Command line height 246 | set pumheight=10 " Completion window max size 247 | set noswapfile " New buffers will be loaded without creating a swapfile 248 | set hidden " Enables to switch between unsaved buffers and keep undo history 249 | set clipboard+=unnamed " Allow to use system clipboard 250 | set lazyredraw " Don't redraw while executing macros (better performance) 251 | set showmatch " Show matching brackets when text indicator is over them 252 | set matchtime=2 " How many tenths of a second to blink when matching brackets 253 | set nostartofline " Prevent cursor from moving to beginning of line when switching buffers 254 | set virtualedit=block " To be able to select past EOL in visual block mode 255 | set nojoinspaces " No extra space when joining a line which ends with . ? ! 256 | set scrolloff=5 " Scroll when closing to top or bottom of the screen 257 | set updatetime=1000 " Update time used to create swap file or other things 258 | set suffixesadd+=.js,.rb " Add js and ruby files to suffixes 259 | set synmaxcol=2000 " Don't try to syntax highlight minified files 260 | "}}} 261 | 262 | " --------------------------------------------------------------------------------------------------------------------- 263 | " 2.1 Split settings (more natural) {{{ 264 | " --------------------------------------------------------------------------------------------------------------------- 265 | set splitbelow " Splitting a window will put the new window below the current 266 | set splitright " Splitting a window will put the new window right of the current 267 | "}}} 268 | 269 | " --------------------------------------------------------------------------------------------------------------------- 270 | " 2.2 Timeout settings {{{ 271 | " --------------------------------------------------------------------------------------------------------------------- 272 | " Time out on key codes but not mappings. Basically this makes terminal Vim work sanely. (by Steve Losh) 273 | set notimeout 274 | set ttimeout 275 | set ttimeoutlen=10 276 | "}}} 277 | 278 | " --------------------------------------------------------------------------------------------------------------------- 279 | " 2.3 Spelling settings {{{ 280 | " --------------------------------------------------------------------------------------------------------------------- 281 | set spellfile=~/.config/nvim/dictionary.utf-8.add 282 | set spelllang=en_us " Set language to US English 283 | set nospell " Disable checking by default (use to toggle) 284 | "}}} 285 | 286 | " --------------------------------------------------------------------------------------------------------------------- 287 | " 2.4 Search settings {{{ 288 | " --------------------------------------------------------------------------------------------------------------------- 289 | set ignorecase " Ignore case by default 290 | set smartcase " Make search case sensitive only if it contains uppercase letters 291 | set wrapscan " Search again from top when reached the bottom 292 | set nohlsearch " Don't highlight after search 293 | "}}} 294 | 295 | " --------------------------------------------------------------------------------------------------------------------- 296 | " 2.5 Persistent undo settings {{{ 297 | " --------------------------------------------------------------------------------------------------------------------- 298 | " if has('persistent_undo') 299 | " set undofile 300 | " set undodir=~/.config/nvim/tmp/undo// 301 | " endif 302 | "}}} 303 | 304 | " --------------------------------------------------------------------------------------------------------------------- 305 | " 2.6 White characters settings {{{ 306 | " --------------------------------------------------------------------------------------------------------------------- 307 | set list " Show listchars by default 308 | set listchars=tab:▸\ ,eol:¬,extends:❯,precedes:❮,trail:·,nbsp:· 309 | set showbreak=↪ 310 | "}}} 311 | 312 | " --------------------------------------------------------------------------------------------------------------------- 313 | " 2.7 Filetype settings {{{ 314 | " --------------------------------------------------------------------------------------------------------------------- 315 | filetype plugin on 316 | filetype indent on 317 | "}}} 318 | 319 | " --------------------------------------------------------------------------------------------------------------------- 320 | " 2.8 Folding settings {{{ 321 | " --------------------------------------------------------------------------------------------------------------------- 322 | set foldmethod=marker " Markers are used to specify folds. 323 | set foldlevel=2 " Start folding automatically from level 2 324 | set fillchars="fold: " " Characters to fill the statuslines and vertical separators 325 | "}}} 326 | 327 | " --------------------------------------------------------------------------------------------------------------------- 328 | " 2.9 Omni completion settings {{{ 329 | " --------------------------------------------------------------------------------------------------------------------- 330 | set completeopt-=preview " Don't show preview scratch buffers 331 | set wildignore=*.o,*.obj,*~ 332 | set wildignore+=*vim/backups* 333 | set wildignore+=*sass-cache* 334 | set wildignore+=*DS_Store* 335 | set wildignore+=*.gem 336 | set wildignore+=tmp/** 337 | "}}} 338 | 339 | " --------------------------------------------------------------------------------------------------------------------- 340 | " 2.10 Neovim specific settings {{{ 341 | " --------------------------------------------------------------------------------------------------------------------- 342 | if has('nvim') 343 | let g:loaded_python_provider=1 " Disable python 2 interface 344 | let g:python_host_skip_check=1 " Skip python 2 host check 345 | let g:python3_host_prog='/usr/local/bin/python3' " Set python 3 host program 346 | set inccommand=nosplit " Live preview of substitutes and other similar commands 347 | endif 348 | "}}} 349 | 350 | " ----------------------------------------------------- 351 | " 2.11 Ctags settings {{{ 352 | " ----------------------------------------------------- 353 | " For Ruby STD ctags use tpope/rbenv-ctags + vim-ruby 354 | " For gem ctags use tpope/gem-ctags + vim-bundler 355 | " For project tags generation use gem install starscope 356 | " ----------------------------------------------------- 357 | "}}} 358 | 359 | " ----------------------------------------------------- 360 | " 2.12 True colors settings {{{ 361 | " ----------------------------------------------------- 362 | if has('termguicolors') 363 | set termguicolors " Turn on true colors support 364 | endif 365 | "}}} 366 | 367 | " ----------------------------------------------------- 368 | " 2.13 Language settings {{{ 369 | " ----------------------------------------------------- 370 | let $LANG = 'en_US' 371 | "}}} 372 | 373 | "}}} 374 | 375 | " ====================================================================================================================== 376 | " 3.0 Mapping settings 377 | " ====================================================================================================================== 378 | "{{{ 379 | 380 | " ----------------------------------------------------- 381 | " 3.1 Setting leader {{{ 382 | " ----------------------------------------------------- 383 | let g:mapleader="\" 384 | "}}} 385 | 386 | " ----------------------------------------------------- 387 | " 3.2 Disabling arrow keys, space key, exmode enter {{{ 388 | " with Q key, help with F1, etc. 389 | " ----------------------------------------------------- 390 | nnoremap 391 | nnoremap 392 | nnoremap 393 | nnoremap 394 | nnoremap 395 | nnoremap 396 | inoremap 397 | inoremap 398 | inoremap 399 | inoremap 400 | nnoremap 401 | inoremap 402 | nnoremap 403 | nnoremap Q 404 | "}}} 405 | 406 | " ----------------------------------------------------- 407 | " 3.3 Vim defaults overriding {{{ 408 | " ----------------------------------------------------- 409 | 410 | " Easier window switching 411 | nmap :call utils#intelligentCycling() 412 | nnoremap h 413 | nnoremap j 414 | nnoremap k 415 | nnoremap l 416 | 417 | " Visual linewise up and down by default (and use gj gk to go quicker) 418 | nnoremap j gj 419 | nnoremap k gk 420 | nnoremap gj 5j 421 | nnoremap gk 5k 422 | vnoremap j gj 423 | vnoremap k gk 424 | vnoremap gj 5j 425 | vnoremap gk 5k 426 | 427 | " When jump to next match also center screen 428 | " Note: Use :norm! to make it count as one command. (i.e. for i_CTRL-o) 429 | nnoremap n :norm! nzz 430 | nnoremap N :norm! Nzz 431 | vnoremap n :norm! nzz 432 | vnoremap N :norm! Nzz 433 | 434 | " Same when moving up and down 435 | nnoremap zz 436 | nnoremap zz 437 | nnoremap zz 438 | nnoremap zz 439 | vnoremap zz 440 | vnoremap zz 441 | vnoremap zz 442 | vnoremap zz 443 | 444 | " Remap H and L (top, bottom of screen to left and right end of line) 445 | nnoremap H ^ 446 | nnoremap L $ 447 | vnoremap H ^ 448 | vnoremap L g_ 449 | 450 | " More logical Y (default was alias for yy) 451 | nnoremap Y y$ 452 | 453 | " Quick replay 'q' macro 454 | nnoremap Q @q 455 | 456 | " Don't yank to default register when changing something 457 | nnoremap c "xc 458 | xnoremap c "xc 459 | 460 | " After block yank and paste, move cursor to the end of operated text and don't override register 461 | vnoremap y y`] 462 | vnoremap p "_dP`] 463 | nnoremap p p`] 464 | 465 | " Use CamelCaseMotion instead of default motions 466 | map w CamelCaseMotion_w 467 | map b CamelCaseMotion_b 468 | map e CamelCaseMotion_e 469 | map ge CamelCaseMotion_ge 470 | sunmap w 471 | sunmap b 472 | sunmap e 473 | sunmap ge 474 | 475 | " Fix the cw at the end of line bug default vim has special treatment (:help cw) 476 | nmap cw ce 477 | nmap dw de 478 | 479 | " Uppercase word in insert mode 480 | inoremap mzgUiw`za 481 | 482 | " Matching brackets with TAB (using matchit) (Breaks the jump) 483 | map % 484 | silent! unmap [% 485 | silent! unmap ]% 486 | 487 | " Don't cancel visual select when shifting 488 | xnoremap < >gv 490 | 491 | " Stay down after creating fold 492 | vnoremap zf mzzf`zzz 493 | 494 | " Make . work with visually selected lines 495 | xnoremap . :norm. 496 | "}}} 497 | 498 | " ----------------------------------------------------- 499 | " 3.4 Common tasks {{{ 500 | " ----------------------------------------------------- 501 | 502 | " Quick save and close buffer 503 | nnoremap ,w :w 504 | nnoremap ,c :Sayonara! 505 | nnoremap ,q :Sayonara 506 | 507 | " Yank and paste from clipboard 508 | nnoremap ,y "+y 509 | vnoremap ,y "+y 510 | nnoremap ,yy "+yy 511 | nnoremap ,p "+p 512 | 513 | " Move visual block 514 | vnoremap J :m '>+1gv=gv 515 | vnoremap K :m '<-2gv=gv 516 | 517 | " CTags generation / navigation (:tselect to select from menu) 518 | nnoremap ]t :tn 519 | nnoremap [t :tp 520 | nnoremap ,ts :ts 521 | nnoremap ,tg :GTags 522 | 523 | " QuickFix navigation 524 | nnoremap ]q :cnext 525 | nnoremap [q :cprevious 526 | 527 | " Location list navigation 528 | nnoremap ]l :lnext 529 | nnoremap [l :lprevious 530 | 531 | " Error mnemonic (Neomake uses location list) 532 | nnoremap ]e :lnext 533 | nnoremap [e :lprevious 534 | 535 | " Reselect last-pasted text 536 | nnoremap gp `[v`] 537 | 538 | " Keep the cursor in place while joining lines 539 | nnoremap J mzJ`z 540 | 541 | " [S]plit line (sister to [J]oin lines) S is covered by cc. 542 | nnoremap S mzi`z 543 | 544 | " Easier fold toggling 545 | nnoremap ,z za 546 | 547 | " Start substitute on current word under the cursor 548 | nnoremap ,s :%s///gc 549 | 550 | " Start search on current word under the cursor 551 | nnoremap ,/ / 552 | 553 | " Start reverse search on current word under the cursor 554 | nnoremap ,? ? 555 | 556 | " Faster sort 557 | vnoremap ,s :!sort 558 | 559 | " Fix spelling error on the go 560 | inoremap u[s1z=`]au 561 | "}}} 562 | 563 | " ----------------------------------------------------- 564 | " 3.5 F-key actions {{{ 565 | " ----------------------------------------------------- 566 | 567 | " NERDTree wrapper 568 | nnoremap :call utils#nerdWrapper() 569 | " Free 570 | " nnoremap 571 | " Free 572 | " nnoremap 573 | " Toggle spelling 574 | nnoremap :set spell! :set spell? 575 | " Source (reload configuration) 576 | nnoremap :source $MYNVIMRC 577 | " Toggle search highlight 578 | nnoremap :set nohlsearch! :set nohlsearch? 579 | " Toggle white characters visibility 580 | nnoremap :set list! :set list? 581 | " New term buffer 582 | nnoremap :terminal 583 | " Fire REST Request 584 | nnoremap :call VrcQuery() 585 | " Free 586 | " nnoremap 587 | " Free 588 | " nnoremap 589 | " Informative echo 590 | nnoremap :call utils#showToggles() 591 | "}}} 592 | 593 | " ----------------------------------------------------- 594 | " 3.6 Window / Buffer management {{{ 595 | " ----------------------------------------------------- 596 | 597 | " Intelligent windows resizing using ctrl + arrow keys 598 | nnoremap :call utils#intelligentVerticalResize('right') 599 | nnoremap :call utils#intelligentVerticalResize('left') 600 | nnoremap :resize +1 601 | nnoremap :resize -1 602 | 603 | " Buffers navigation and management 604 | nnoremap + :bn 605 | nnoremap _ :bp 606 | "}}} 607 | 608 | " ----------------------------------------------------- 609 | " 3.7 Command abbreviations and mappings {{{ 610 | " ----------------------------------------------------- 611 | 612 | " Quiting and saving all 613 | cnoremap ww wqall 614 | cnoremap qq qall 615 | "}}} 616 | 617 | " ----------------------------------------------------- 618 | " 3.8 Custom commands and functions {{{ 619 | " ----------------------------------------------------- 620 | 621 | " Generate tags definitions 622 | command! GTags :call utils#generateCtags() 623 | 624 | " Reformat whole or selection from file 625 | command! Format :call utils#formatFile() 626 | nnoremap ,f :Format 627 | 628 | " Eslint fix current file 629 | command! ESFix :call utils#eslintFixFile() 630 | 631 | " Profile 632 | command! Profile :call utils#profile() 633 | 634 | " Retab 635 | command! Retab :call utils#retabToFourSpaces() 636 | command! Retab2 :call utils#retabToTwoSpaces() 637 | "}}} 638 | 639 | "}}} 640 | 641 | " ====================================================================================================================== 642 | " 4.0 Plugins settings 643 | " ====================================================================================================================== 644 | "{{{ 645 | 646 | " ----------------------------------------------------- 647 | " 4.1 Auto-switch sk -> en keyboard layouts {{{ 648 | " ----------------------------------------------------- 649 | let g:utils_autoswitch_kb_layout=0 650 | "}}} 651 | 652 | " ----------------------------------------------------- 653 | " 4.2 FZF {{{ 654 | " ----------------------------------------------------- 655 | let $FZF_DEFAULT_OPTS='--reverse' 656 | let $FZF_DEFAULT_COMMAND='ag --skip-vcs-ignores -g ""' 657 | let g:fzf_layout = { 'window': 'enew' } 658 | "}}} 659 | 660 | " ----------------------------------------------------- 661 | " 4.3 NERDTree {{{ 662 | " ----------------------------------------------------- 663 | let g:NERDTreeMinimalUI=1 664 | let g:NERDTreeWinSize=60 665 | let g:NERDTreeAutoDeleteBuffer=1 666 | let g:NERDTreeShowHidden=1 667 | let g:NERDTreeHighlightCursorline=0 668 | let g:NERDTreeRespectWildIgnore=1 669 | "}}} 670 | 671 | " ----------------------------------------------------- 672 | " 4.4 Ultisnips settings {{{ 673 | " ----------------------------------------------------- 674 | let g:UltiSnipsUsePythonVersion=3 675 | "}}} 676 | 677 | " ----------------------------------------------------- 678 | " 4.5 Gitgutter settings {{{ 679 | " ----------------------------------------------------- 680 | let g:gitgutter_map_keys=0 681 | let g:gitgutter_max_signs=9999 682 | let g:gitgutter_sign_added='+' 683 | let g:gitgutter_sign_modified='~' 684 | let g:gitgutter_sign_removed='-' 685 | let g:gitgutter_sign_modified_removed='~' 686 | let g:gitgutter_sign_removed_first_line='-' 687 | "}}} 688 | 689 | " ----------------------------------------------------- 690 | " 4.6 Vim JSX highlighting settings {{{ 691 | " ----------------------------------------------------- 692 | let g:jsx_ext_required=0 693 | "}}} 694 | 695 | " ----------------------------------------------------- 696 | " 4.7 Lightline settings {{{ 697 | " ----------------------------------------------------- 698 | let g:lightline = { 699 | \ 'colorscheme': 'powerline', 700 | \ 'tab': { 701 | \ 'active': [ 'filename' ], 702 | \ 'inactive': [ 'filename' ] 703 | \ }, 704 | \ 'active': { 705 | \ 'left': [ [ 'mode', 'paste' ], [ 'readonly', 'filename' ] ], 706 | \ 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'filetype', 'fileencoding', 'fileformat' ] ] 707 | \ }, 708 | \ 'component': { 709 | \ 'readonly': '%{&filetype=="help"?"HELP":&readonly?"RO":""}' 710 | \ }, 711 | \ 'component_function': { 712 | \ 'mode': 'utils#lightLineMode', 713 | \ 'filename': 'utils#lightLineFilename', 714 | \ 'filetype': 'utils#lightLineFiletype', 715 | \ 'fileformat': 'utils#lightLineFileformat', 716 | \ 'fileencoding': 'utils#lightLineFileencoding' 717 | \ }, 718 | \ 'component_visible_condition': { 719 | \ 'readonly': '(&readonly)' 720 | \ }, 721 | \ 'separator': { 'left': '', 'right': '' }, 722 | \ 'subseparator': { 'left': '', 'right': '' } 723 | \ } 724 | "}}} 725 | 726 | " ----------------------------------------------------- 727 | " 4.8 Neomake settings {{{ 728 | " ----------------------------------------------------- 729 | let g:neomake_verbose=0 730 | let g:neomake_warning_sign = { 731 | \ 'text': '❯', 732 | \ 'texthl': 'WarningMsg', 733 | \ } 734 | let g:neomake_error_sign = { 735 | \ 'text': '❯', 736 | \ 'texthl': 'ErrorMsg', 737 | \ } 738 | "}}} 739 | 740 | " ----------------------------------------------------- 741 | " 4.9 Vim Markdown settings {{{ 742 | " ----------------------------------------------------- 743 | let g:vim_markdown_no_default_key_mappings=1 744 | let g:vim_markdown_folding_disabled=1 745 | "}}} 746 | 747 | " ----------------------------------------------------- 748 | " 4.10 Deoplete autocomplete settings {{{ 749 | " ----------------------------------------------------- 750 | " let g:deoplete#enable_at_startup=1 751 | " let g:deoplete#enable_refresh_always=0 752 | " let g:deoplete#enable_smart_case=1 753 | " let g:deoplete#file#enable_buffer_path=1 754 | 755 | let g:deoplete#sources={} 756 | let g:deoplete#sources._ = ['around', 'buffer', 'file', 'ultisnips'] 757 | let g:deoplete#sources.ruby = ['around', 'buffer', 'member', 'file', 'ultisnips'] 758 | let g:deoplete#sources.vim = ['around', 'buffer', 'member', 'file', 'ultisnips'] 759 | let g:deoplete#sources['javascript.jsx'] = ['around', 'buffer', 'file', 'ultisnips'] 760 | let g:deoplete#sources.css = ['around', 'buffer', 'member', 'file', 'omni', 'ultisnips'] 761 | let g:deoplete#sources.scss = ['around', 'buffer', 'member', 'file', 'omni', 'ultisnips'] 762 | let g:deoplete#sources.html = ['around', 'buffer', 'member', 'file', 'omni', 'ultisnips'] 763 | "}}} 764 | 765 | " ----------------------------------------------------- 766 | " 4.11 Ctrl-SF settings {{{ 767 | " ----------------------------------------------------- 768 | let g:ctrlsf_default_root='project' 769 | let g:ctrlsf_populate_qflist=0 770 | let g:ctrlsf_position='bottom' 771 | let g:ctrlsf_winsize = '30%' 772 | let g:ctrlsf_auto_close=0 773 | let g:ctrlsf_regex_pattern=0 774 | "}}} 775 | 776 | " ----------------------------------------------------- 777 | " 4.12 Plug settings {{{ 778 | " ----------------------------------------------------- 779 | let g:plug_timeout=20 780 | "}}} 781 | 782 | " ----------------------------------------------------- 783 | " 4.13 Vim-markdown settings {{{ 784 | " ----------------------------------------------------- 785 | let g:markdown_fenced_languages=[ 786 | \'bash=sh', 787 | \'git=gitconfig', 788 | \'javascript', 789 | \'lua', 790 | \'ruby', 791 | \'tmux', 792 | \'viml=vim', 793 | \'xdefaults', 794 | \'zsh'] 795 | "}}} 796 | 797 | " ----------------------------------------------------- 798 | " 4.14 Colorizer settings {{{ 799 | " ----------------------------------------------------- 800 | let g:colorizer_nomap=1 801 | "}}} 802 | 803 | " ----------------------------------------------------- 804 | " 4.15 Elm-vim settings {{{ 805 | " ----------------------------------------------------- 806 | let g:elm_format_autosave=0 807 | let g:elm_setup_keybindings=0 808 | "}}} 809 | 810 | " ----------------------------------------------------- 811 | " 4.16 JsDoc settings {{{ 812 | " ----------------------------------------------------- 813 | let g:jsdoc_allow_input_prompt=1 814 | let g:jsdoc_input_description=1 815 | let g:jsdoc_enable_es6=1 816 | "}}} 817 | 818 | "" ----------------------------------------------------- 819 | "" 4.17 vim-javascript settings {{{ 820 | "" ----------------------------------------------------- 821 | let g:javascript_plugin_jsdoc=1 822 | let g:javascript_plugin_flow=1 823 | ""}}} 824 | 825 | "" ----------------------------------------------------- 826 | "" 4.18 vCoolor settings {{{ 827 | "" ----------------------------------------------------- 828 | let g:vcoolor_disable_mappings=1 829 | let g:vcoolor_lowercase=1 830 | ""}}} 831 | 832 | "" ----------------------------------------------------- 833 | "" 4.19 YankRing settings {{{ 834 | "" ------------------------------------------------------ 835 | let g:yankring_window_height=15 836 | ""}}} 837 | 838 | "}}} 839 | 840 | " ====================================================================================================================== 841 | " 5.0 Plugin mappings 842 | " ====================================================================================================================== 843 | "{{{ 844 | " ----------------------------------------------------- 845 | " 5.1 FZF {{{ 846 | " ----------------------------------------------------- 847 | 848 | " Search files recursively ([o]pen file) 849 | nnoremap o :Files 850 | " Search git status (edited) [f]iles 851 | nnoremap f :GFiles? 852 | " Search in local buffer [c]ommits 853 | nnoremap c :BCommits 854 | " Search in all the project [C]ommits 855 | nnoremap C :Commits 856 | " Search between open files - [b]uffers 857 | nnoremap b :Buffers 858 | " Search in [l]ines on current buffer 859 | nnoremap l :BLines 860 | " Search in all the opened buffers [L]ines 861 | nnoremap L :Lines 862 | " Search in ultisnips [s]nippets 863 | nnoremap s :Snippets 864 | " Search in [m]arks 865 | nnoremap m :Marks 866 | " Search in edited files [h]istory 867 | nnoremap h :History 868 | " Search in search [/] history 869 | nnoremap / :History/ 870 | " Search in ag search 871 | nnoremap a :Ag 872 | "}}} 873 | 874 | " ----------------------------------------------------- 875 | " 5.2 Ultisnips {{{ 876 | " ----------------------------------------------------- 877 | " Disable built-in cx-ck to be able to go backward 878 | inoremap 879 | let g:UltiSnipsExpandTrigger='' 880 | let g:UltiSnipsListSnippets='' 881 | let g:UltiSnipsJumpForwardTrigger='' 882 | let g:UltiSnipsJumpBackwardTrigger='' 883 | "}}} 884 | 885 | " ----------------------------------------------------- 886 | " 5.3 Isolate {{{ 887 | " ----------------------------------------------------- 888 | vnoremap ,i :Isolate 889 | nnoremap ,u :UnIsolate 890 | "}}} 891 | 892 | " ----------------------------------------------------- 893 | " 5.4 Gitgutter {{{ 894 | " ----------------------------------------------------- 895 | nnoremap [h :GitGutterPrevHunk 896 | nnoremap ]h :GitGutterNextHunk 897 | nnoremap ,hs :GitGutterStageHunk 898 | nnoremap ,hr :GitGutterRevertHunk 899 | "}}} 900 | 901 | " ----------------------------------------------------- 902 | " 5.5 Expand region {{{ 903 | " ----------------------------------------------------- 904 | vmap v (expand_region_expand) 905 | vmap (expand_region_shrink) 906 | "}}} 907 | 908 | " ----------------------------------------------------- 909 | " 5.6 Vim Markdown {{{ 910 | " ----------------------------------------------------- 911 | nmap [[ Markdown_MoveToPreviousHeader 912 | nmap ]] Markdown_MoveToNextHeader 913 | "}}} 914 | 915 | " ----------------------------------------------------- 916 | " 5.7 Argumentative (use a instead of ,) {{{ 917 | " ----------------------------------------------------- 918 | xmap ia Argumentative_InnerTextObject 919 | xmap aa Argumentative_OuterTextObject 920 | omap ia Argumentative_OpPendingInnerTextObject 921 | omap aa Argumentative_OpPendingOuterTextObject 922 | nmap [a Argumentative_Prev 923 | nmap ]a Argumentative_Next 924 | xmap [a Argumentative_XPrev 925 | xmap ]a Argumentative_XNext 926 | nmap Argumentative_MoveLeft 927 | nmap >a Argumentative_MoveRight 928 | "}}} 929 | 930 | " ----------------------------------------------------- 931 | " 5.8 Deoplete autocomplete {{{ 932 | " ----------------------------------------------------- 933 | " Insert or select next match 934 | inoremap utils#tabComplete() 935 | 936 | " Manually trigger tag autocomplete 937 | inoremap utils#manualTagComplete() 938 | 939 | " , : close popup and delete backword char 940 | inoremap deolete#mappings#smart_close_popup()."\" 941 | inoremap deoplete#mappings#smart_close_popup()."\" 942 | "}}} 943 | 944 | " ----------------------------------------------------- 945 | " 5.9 CtrlSF {{{ 946 | " ----------------------------------------------------- 947 | nnoremap g :CtrlSF 948 | nnoremap G :CtrlSFToggle 949 | "}}} 950 | 951 | " ----------------------------------------------------- 952 | " 5.10 Vim-Plug {{{ 953 | " ----------------------------------------------------- 954 | nnoremap pi :PlugInstall 955 | nnoremap pu :PlugUpdate 956 | nnoremap pU :PlugUpgrade 957 | nnoremap pc :PlugClean 958 | "}}} 959 | 960 | " ----------------------------------------------------- 961 | " 5.11 Ctrl-SF {{{ 962 | " ----------------------------------------------------- 963 | let g:ctrlsf_mapping = { 964 | \ 'next' : 'n', 965 | \ 'prev' : 'N', 966 | \ 'quit' : 'q', 967 | \ 'openb' : '', 968 | \ 'split' : 's', 969 | \ 'tab' : '', 970 | \ 'tabb' : '', 971 | \ 'popen' : '', 972 | \ 'pquit' : '', 973 | \ 'loclist' : '', 974 | \ } 975 | 976 | nnoremap ,g :call utils#searchCurrentWordWithAg() 977 | "}}} 978 | 979 | " ----------------------------------------------------- 980 | " 5.12 BufOnly -> [C]lose all {{{ 981 | " ----------------------------------------------------- 982 | nnoremap ,C :Bonly 983 | "}}} 984 | 985 | " ----------------------------------------------------- 986 | " 5.13 Tabularize -> [a]lign {{ 987 | " ----------------------------------------------------- 988 | vnoremap ,a :Tabularize / 989 | "}}} 990 | 991 | " ----------------------------------------------------- 992 | " 5.14 JsDoc {{ 993 | " ----------------------------------------------------- 994 | nnoremap ,d :JsDoc 995 | "}}} 996 | 997 | " ----------------------------------------------------- 998 | " 5.15 YankRing {{ 999 | " ----------------------------------------------------- 1000 | nnoremap y :YRShow 1001 | "}}} 1002 | 1003 | "}}} 1004 | 1005 | " ====================================================================================================================== 1006 | " 6.0 Color and highlighting settings 1007 | " ====================================================================================================================== 1008 | "{{{ 1009 | " Syntax highlighting {{{ 1010 | syntax on 1011 | "}}} 1012 | 1013 | " Color scheme {{{ 1014 | set background=dark 1015 | colorscheme tender 1016 | " colorscheme hybrid 1017 | "}}} 1018 | 1019 | " Highlight VCS conflict markers {{{ 1020 | match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$' 1021 | "}}} 1022 | 1023 | " Highlight term cursor differently {{{ 1024 | highlight TermCursor ctermfg=green guifg=green 1025 | "}}} 1026 | 1027 | " Remove underline in folded lines {{{ 1028 | hi! Folded term=NONE cterm=NONE gui=NONE ctermbg=NONE 1029 | "}}} 1030 | 1031 | " Link highlight groups to improve buftabline colors {{{ 1032 | hi! link BufTabLineCurrent Identifier 1033 | hi! link BufTabLineActive Comment 1034 | hi! link BufTabLineHidden Comment 1035 | hi! link BufTabLineFill Comment 1036 | "}}} 1037 | 1038 | "}}} 1039 | 1040 | " ====================================================================================================================== 1041 | " 7.0 Autocommands 1042 | " ====================================================================================================================== 1043 | "{{{ 1044 | 1045 | " Keywordprg settings {{{ 1046 | augroup vim_man 1047 | autocmd FileType vim setlocal keywordprg=:help 1048 | augroup END 1049 | "}}} 1050 | 1051 | " Turn spellcheck on for markdown files {{{ 1052 | augroup auto_spellcheck 1053 | autocmd BufNewFile,BufRead *.md setlocal spell 1054 | augroup END 1055 | "}}} 1056 | 1057 | " Remove trailing whitespaces automatically before save {{{ 1058 | augroup strip_ws 1059 | autocmd BufWritePre * call utils#stripTrailingWhitespaces() 1060 | augroup END 1061 | "}}} 1062 | 1063 | " Resize splits when the window is resized {{{ 1064 | augroup resize_improvements 1065 | autocmd VimResized * :wincmd = 1066 | augroup END 1067 | "}}} 1068 | 1069 | " Make sure Vim returns to the same line when you reopen a file. Thanks, Amit and Steve Losh. {{{ 1070 | augroup line_return 1071 | au! 1072 | au BufReadPost * 1073 | \ if line("'\"") > 0 && line("'\"") <= line("$") | 1074 | \ execute 'normal! g`"zvzz' | 1075 | \ endif 1076 | augroup END 1077 | "}}} 1078 | 1079 | " Keyboard layout switching {{{ 1080 | if g:utils_autoswitch_kb_layout == 1 1081 | augroup auto_kb_switch 1082 | autocmd InsertEnter * call utils#setSKKBLayout() 1083 | autocmd InsertLeave * call utils#setUSKBLayout() 1084 | augroup END 1085 | end 1086 | "}}} 1087 | 1088 | " Run checktime in buffers, but avoiding the "Command Line" (q:) window 1089 | augroup prevent_q_colon 1090 | autocmd CursorHold * if getcmdwintype() == '' | checktime | endif 1091 | augroup END 1092 | 1093 | " ----------------------------------------------------- 1094 | " 7.1 Run linters after save {{{ 1095 | " ----------------------------------------------------- 1096 | 1097 | " augroup linters 1098 | " " npm install -g eslint 1099 | " autocmd BufWritePost *.js Neomake eslint 1100 | " " npm install -g jsonlint 1101 | " autocmd BufWritePost *.json Neomake jsonlint 1102 | " " npm install -g typescript 1103 | " autocmd BufWritePost *.ts Neomake tsc 1104 | " " gem install rubocop 1105 | " autocmd BufWritePost *.rb Neomake rubocop 1106 | " " sudo apt-get install elixir 1107 | " autocmd BufWritePost *.ex Neomake elixir 1108 | " " apt-get install tidy 1109 | " autocmd BufWritePost *.html Neomake tidy 1110 | " " gem install haml_lint 1111 | " autocmd BufWritePost *.haml Neomake hamllint 1112 | " " gem install scss-lint 1113 | " autocmd BufWritePost *.scss Neomake sasslint 1114 | " " gem install mdl 1115 | " autocmd BufWritePost *.md Neomake mdl 1116 | " " apt-get install shellcheck 1117 | " autocmd BufWritePost *.sh Neomake shellcheck 1118 | " " pip3 install vim-vint 1119 | " autocmd BufWritePost *.vim Neomake vint 1120 | " augroup END 1121 | "}}} 1122 | 1123 | "}}} 1124 | 1125 | " ====================================================================================================================== 1126 | " 8.0 Todo, Notes 1127 | " ====================================================================================================================== 1128 | "{{{ 1129 | 1130 | " ----------------------------------------------------- 1131 | " 8.1 Todo {{{ 1132 | " ----------------------------------------------------- 1133 | " 1. Update README file. 1134 | "}}} 1135 | 1136 | " ----------------------------------------------------- 1137 | " 8.2 Notes {{{ 1138 | " ----------------------------------------------------- 1139 | "}}} 1140 | 1141 | "}}} 1142 | -------------------------------------------------------------------------------- /neovim/other/ideavimrc: -------------------------------------------------------------------------------- 1 | " ###################################################################################################################### 2 | " ### Author : Martin Toma ### 3 | " ###################################################################################################################### 4 | " ### Ideavim Configuration focused on Android developemnt ### 5 | " ### Date created : Tue May 26 12:58:42 CEST 2015 6 | " ###################################################################################################################### 7 | 8 | " ====================================================================================================================== 9 | " 1.0 Basic settings 10 | " ====================================================================================================================== 11 | "{{{ 12 | 13 | set ignorecase " Ignore case by default 14 | set smartcase " Make search case sensitive only if it contains uppercase letters 15 | set textwidth=120 " Text width is 120 chars 16 | set iskeyword-=_ " Set underscore as a word separator 17 | set iskeyword-=- " Set dash as a word separator 18 | set incsearch " Incremental search 19 | set history=1024 " Number of things to remember in history 20 | set nohlsearch " Don't highlight after search 21 | set magic " For regular expressions turn magic on 22 | set showmatch " Show matching brackets when text indicator is over them 23 | set nospell " Set spelling off by default 24 | set nostartofline " Prevent cursor from moving to beginning of line when switching buffers 25 | set virtualedit=block " To be able to select past EOL in visual block mode 26 | set nojoinspaces " No extra space when joining a line which ends with . ? ! 27 | set startofline " When doing thing like gg or G, will move cursor to start of line 28 | set wrapscan " Search again from top when reached the bottom 29 | set showcmd " Show incomplete commands 30 | set scrolloff=5 " Scroll when closing to top or bottom of the screen 31 | 32 | " ----------------------------------------------------- 33 | " 1.1 Intendation settings (2 spaces tabs) 34 | " ----------------------------------------------------- 35 | set autoindent 36 | set expandtab 37 | set shiftwidth=2 38 | set softtabstop=2 39 | 40 | " ----------------------------------------------------- 41 | " 1.2 Split settings (more natural). 42 | " ----------------------------------------------------- 43 | set splitbelow 44 | set splitright 45 | "}}} 46 | 47 | " ====================================================================================================================== 48 | " 2.0 Mapping settings 49 | " ====================================================================================================================== 50 | "{{{ 51 | 52 | " ----------------------------------------------------- 53 | " 2.1 Disabling arrow keys, space key, exmode enter 54 | " with Q key, help with F1, etc. 55 | " ----------------------------------------------------- 56 | nnoremap 57 | nnoremap 58 | nnoremap 59 | nnoremap 60 | nnoremap 61 | nnoremap 62 | inoremap 63 | inoremap 64 | inoremap 65 | inoremap 66 | nnoremap 67 | inoremap 68 | nnoremap 69 | nnoremap Q 70 | 71 | " ----------------------------------------------------- 72 | " 2.2 Vim defaults overriding 73 | " ----------------------------------------------------- 74 | 75 | " Visual linewise up and down by default 76 | noremap j gj 77 | noremap k gk 78 | 79 | " When jump to next match also center screen 80 | noremap n nzz 81 | noremap N Nzz 82 | 83 | " Same when moving up and down 84 | noremap zz 85 | noremap zz 86 | 87 | " Remap H and L (top, bottom of screen to left and right end of line) 88 | nnoremap H ^ 89 | nnoremap L $ 90 | vnoremap H ^ 91 | vnoremap L g_ 92 | 93 | " More logical Y (defaul was alias for yy) 94 | nnoremap Y y$ 95 | 96 | " Quick replay q macro 97 | nnoremap Q @q 98 | 99 | " Automatically reselect and yank overpasted text in visual mode 100 | xnoremap p pgvy 101 | 102 | " ----------------------------------------------------- 103 | " 2.3 Common tasks 104 | " ----------------------------------------------------- 105 | 106 | " Quick save and quit / delete buffers intelligently 107 | nnoremap ,w :w 108 | nnoremap ,d :q 109 | 110 | " Yank and paste from clipboard 111 | nnoremap ,y "+y 112 | nnoremap ,yy "+yy 113 | nnoremap ,p "+p 114 | 115 | " Reformat whole file 116 | nnoremap ,f :action ReformatCode 117 | 118 | " ----------------------------------------------------- 119 | " 2.4 Window / Buffer management 120 | " ----------------------------------------------------- 121 | 122 | " Buffers navigation and management 123 | nnoremap + :action NextTab 124 | nnoremap _ :action PreviousTab 125 | 126 | " ----------------------------------------------------- 127 | " 2.5 Goto mappings 128 | " ----------------------------------------------------- 129 | 130 | nnoremap o :action GotoFile 131 | nnoremap p :action GotoClass 132 | nnoremap t :action GotoSymbol 133 | nnoremap a :action GotoAction 134 | nnoremap :action SearchEverywhere 135 | "}}} 136 | -------------------------------------------------------------------------------- /neovim/other/wasavi.vim: -------------------------------------------------------------------------------- 1 | " ###################################################################################################################### 2 | " ### Author : Martin Toma ### 3 | " ###################################################################################################################### 4 | " ### Wasavi Configuration 5 | " ### Date created : Fri Nov 13 10:36:17 CET 2015 6 | " ###################################################################################################################### 7 | 8 | " ====================================================================================================================== 9 | " 1.0 Basic settings 10 | " ====================================================================================================================== 11 | "{{{ 12 | 13 | set number " Show line numbers 14 | set ignorecase " Ignore case by default 15 | set smartcase " Make search case sensitive only if it contains uppercase letters 16 | set textwidth=120 " Text width is 120 chars 17 | set history=1024 " Number of things to remember in history 18 | set magic " For regular expressions turn magic on 19 | set showmatch " Show matching brackets when text indicator is over them 20 | set wrapscan " Search again from top when reached the bottom 21 | set showmode " Show current mode 22 | 23 | " ----------------------------------------------------- 24 | " 1.1 Intendation settings (2 spaces tabs) 25 | " ----------------------------------------------------- 26 | set autoindent 27 | set expandtab 28 | set shiftwidth=2 29 | set tabstop=2 30 | 31 | " ----------------------------------------------------- 32 | " 1.2 Wasavi specific 33 | " ----------------------------------------------------- 34 | set nocursorblink 35 | "}}} 36 | 37 | " ====================================================================================================================== 38 | " 2.0 Mapping settings 39 | " ====================================================================================================================== 40 | "{{{ 41 | 42 | " ----------------------------------------------------- 43 | " 2.1 Disabling arrow keys, space key, exmode enter 44 | " with Q key, help with F1, etc. 45 | " ----------------------------------------------------- 46 | map 47 | map 48 | map 49 | map 50 | map 51 | map 52 | map 53 | map 54 | map 55 | map 56 | map 57 | map 58 | map 59 | map Q 60 | 61 | " ----------------------------------------------------- 62 | " 2.2 Vim defaults overriding 63 | " ----------------------------------------------------- 64 | 65 | " Visual linewise up and down by default 66 | map j gj 67 | map k gk 68 | 69 | " When jump to next match also center screen 70 | map n nzz 71 | map N Nzz 72 | 73 | " Same when moving up and down 74 | map zz 75 | map zz 76 | 77 | " Remap H and L (top, bottom of screen to left and right end of line) 78 | map H ^ 79 | map L $ 80 | 81 | " More logical Y (defaul was alias for yy) 82 | map Y y$ 83 | 84 | " Quick replay q macro 85 | map Q @q 86 | 87 | " ----------------------------------------------------- 88 | " 2.3 Common tasks 89 | " ----------------------------------------------------- 90 | 91 | " Quick save and quit / delete buffers intelligently 92 | map ,w :w 93 | map ,d :q 94 | 95 | " Yank and paste from clipboard 96 | map ,y "+y 97 | map ,yy "+yy 98 | map ,p "+p 99 | "}}} 100 | -------------------------------------------------------------------------------- /neovim/spell/dictionary.utf-8.add: -------------------------------------------------------------------------------- 1 | Refactor 2 | CET 3 | VIMRC 4 | vimrc 5 | Plugin 6 | plugins 7 | plugin 8 | vim 9 | templating 10 | JSON 11 | HAML 12 | Coffeescript 13 | javascript 14 | CSS 15 | js 16 | html 17 | ESC 18 | Intendation 19 | whitespaces 20 | Filetype 21 | SCSS 22 | cheatsheat 23 | NoSQL 24 | MongoDB 25 | MySQL 26 | PostgreSQL 27 | Redis 28 | toma 29 | svk 30 | gmail 31 | blog 32 | RoR 33 | ERB 34 | minitest 35 | BDD 36 | blogpost 37 | autorun 38 | JQuery 39 | UJS 40 | toptal 41 | codility 42 | Tabrec 43 | admin 44 | json 45 | internet 46 | namespace 47 | NVIMRC 48 | Vimmer 49 | https 50 | github 51 | linters 52 | UTF 53 | EOL 54 | TabRec 55 | angl 56 | v 57 | o 58 | s 59 | a 60 | z 61 | k 62 | prediktívneho 63 | Markovovské 64 | inkrementálneho 65 | inkrementálnych 66 | predspracovania 67 | používateľsko 68 | serverových 69 | definujúcich 70 | trénovacej 71 | Markovovych 72 | Markove 73 | Markovych 74 | trénovacou 75 | trénovacie 76 | Markoveho 77 | Markovov 78 | iniciálnom 79 | GSP 80 | subsekvencia 81 | odporúčacími 82 | zahltenie 83 | adaptívneho 84 | odporúčací 85 | serverová 86 | personalizované 87 | serverovej 88 | najčastejších 89 | b 90 | workflow 91 | config 92 | adaptívny 93 | adaptívnych 94 | hypermédií 95 | persistenciu 96 | serverovú 97 | odporúčacích 98 | deaktivovalo 99 | Google 100 | dominancia 101 | najčastejším 102 | inkrementálne 103 | odporúčacieho 104 | najdiskutovanejšia 105 | odporúčacím 106 | definovanými 107 | preprocesor 108 | notifikujú 109 | prekompilujeme 110 | skompilovať 111 | iniciálnymi 112 | definovaným 113 | Deaktivácia 114 | deaktiváciou 115 | definovaných 116 | Chrome 117 | hashovanie 118 | API 119 | deaktivované 120 | ES6 121 | HTML5 122 | CSS3 123 | Linkedin 124 | lifecycle 125 | plugins 126 | autocomplete 127 | tmux 128 | zsh 129 | Neovim 130 | workflow 131 | cheatsheets 132 | cheatsheet 133 | Screenshots 134 | namespaced 135 | vimscript 136 | todo 137 | YAML 138 | sublicense 139 | NONINFRINGEMENT 140 | IRB 141 | Devilspie2 142 | Neomake 143 | Syntastic 144 | Deoplete 145 | QuickScope 146 | Lightline 147 | Lexima 148 | linewise 149 | matchit 150 | Ctags 151 | Ctrl 152 | popup 153 | j 154 | UltiSnips 155 | VCS 156 | PDF 157 | regex 158 | nomatch 159 | q 160 | tmuxinator 161 | r 162 | Online 163 | conf 164 | Scrollback 165 | gemrc 166 | pryrc 167 | nvim 168 | Rubygems 169 | XTerm 170 | param 171 | transpiler 172 | memoization 173 | stylesheets 174 | subfolder 175 | SERP 176 | MOZ 177 | SEO 178 | -------------------------------------------------------------------------------- /other/.finicky.js: -------------------------------------------------------------------------------- 1 | // Use https://finicky-kickstart.now.sh to generate basic configuration 2 | // Learn more about configuration options: https://github.com/johnste/finicky/wiki/Configuration 3 | 4 | module.exports = { 5 | defaultBrowser: "Safari", 6 | /* 7 | handlers: [ 8 | { 9 | // Open google.com and *.google.com urls in Google Chrome 10 | match: [ 11 | "google.com*", // match google.com urls 12 | finicky.matchDomains(/.*\.google.com/) // use helper function to match on domain only 13 | ], 14 | browser: "Google Chrome" 15 | } 16 | ] 17 | */ 18 | } 19 | -------------------------------------------------------------------------------- /other/Xmodmap: -------------------------------------------------------------------------------- 1 | ! 2 | ! Change capslock to control 3 | ! 4 | remove Lock = Caps_Lock 5 | keysym Caps_Lock = Control_L 6 | add Control = Control_L 7 | -------------------------------------------------------------------------------- /other/agignore: -------------------------------------------------------------------------------- 1 | *.log 2 | tmp/** 3 | dist/ 4 | node_modules/** 5 | bower_components/** 6 | .git 7 | .svn 8 | .bzr 9 | .hg 10 | -------------------------------------------------------------------------------- /other/cpu_usage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is used in my tmux status line. 4 | # Make sure it is located in your PATH variable. 5 | 6 | if [[ "$OSTYPE" == "linux-gnu" ]]; then 7 | # Linux 8 | cat <(grep 'cpu ' /proc/stat) <(sleep 1 && grep 'cpu ' /proc/stat) | 9 | awk -v RS="" '{ printf "%3.2f", ($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5) }' 10 | elif [[ "$OSTYPE" == "darwin"* ]]; then 11 | # Mac OSX 12 | ps -A -o %cpu | awk '{s+=$1} END {print s "%"}' 13 | fi 14 | 15 | -------------------------------------------------------------------------------- /other/devilspie2/settings.lua: -------------------------------------------------------------------------------- 1 | -- the debug_print command does only print anything to stdout 2 | -- if devilspie2 is run using the --debug option 3 | debug_print("Application name: " .. get_application_name()) 4 | 5 | -- Handling program default workspaces 6 | 7 | -- Chromium 8 | if (string.find(get_application_name(), "Google Chrome")) then 9 | set_window_workspace(1); 10 | -- XTerm 11 | elseif (get_application_name()=="xterm") then 12 | set_window_workspace(2); 13 | maximize(); 14 | -- Music 15 | elseif (string.find(get_application_name(), "Spotify") or get_application_name()=="VLC media player") then 16 | set_window_workspace(4); 17 | set_window_size(1600, 900); 18 | -- Mail 19 | elseif (get_application_name()=="Mail") then 20 | set_window_workspace(5); 21 | maximize(); 22 | -- Slack 23 | elseif string.find(get_application_name(), "Slack") then 24 | set_window_workspace(6); 25 | maximize(); 26 | -- Steam 27 | elseif (get_application_name()=="Steam") then 28 | set_window_workspace(7); 29 | end 30 | -------------------------------------------------------------------------------- /other/diff_wrapper: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | nvim -d "$1" "$2" 4 | -------------------------------------------------------------------------------- /other/info/npm-deps.txt: -------------------------------------------------------------------------------- 1 | /usr/local/lib 2 | ├── babel-eslint@7.1.0 3 | ├── brunch@2.9.1 4 | ├── create-react-app@0.6.0 5 | ├── elm@0.17.1 6 | ├── elm-oracle@1.1.1 7 | ├── eslint@3.9.0 8 | ├── eslint-config-airbnb@12.0.0 9 | ├── eslint-plugin-import@1.16.0 10 | ├── eslint-plugin-jsx-a11y@2.2.3 11 | ├── eslint-plugin-react@6.4.1 12 | ├── feathers-cli@1.2.7 13 | ├── flow-bin@0.34.0 14 | ├── gulp@3.9.1 15 | ├── htmlhint@0.9.13 16 | ├── http-server@0.9.0 17 | ├── js-beautify@1.6.4 18 | ├── jsctags@5.1.0 19 | ├── jsonlint@1.6.2 20 | ├── n@2.1.4 21 | ├── npm@3.10.9 22 | ├── remark-lint@5.1.0 23 | ├── sass-lint@1.9.1 24 | ├── tern@0.20.0 25 | ├── tldr@1.7.0 26 | ├── yarn@0.16.1 27 | └── yo@1.8.5 28 | 29 | -------------------------------------------------------------------------------- /other/starscope.json: -------------------------------------------------------------------------------- 1 | { 2 | "excludes": [ 3 | ".meteor", 4 | "bower_components", 5 | "node_modules", 6 | "coverage", 7 | "dist", 8 | "app/assets", 9 | "db", 10 | "logs", 11 | "public", 12 | "tmp", 13 | "vendor" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /ruby/gemrc: -------------------------------------------------------------------------------- 1 | --- 2 | :update_sources: true 3 | :sources: 4 | - http://rubygems.org 5 | :benchmark: false 6 | :bulk_threshold: 1000 7 | :backtrace: false 8 | :verbose: true 9 | gem: --no-ri --no-rdoc 10 | 11 | -------------------------------------------------------------------------------- /ruby/irbrc: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | -------------------------------------------------------------------------------- /ruby/pryrc: -------------------------------------------------------------------------------- 1 | # vim: ft=ruby 2 | # === EDITOR === 3 | Pry.config.editor = 'nvim' 4 | 5 | # == Pry-Nav - Using pry as a debugger == 6 | Pry.commands.alias_command 'c', 'continue' rescue nil 7 | Pry.commands.alias_command 's', 'step' rescue nil 8 | Pry.commands.alias_command 'n', 'next' rescue nil 9 | 10 | # === CUSTOM PROMPT === 11 | # This prompt shows the ruby version (useful for RVM) 12 | Pry.prompt = [proc { |obj, nest_level, _| "#{RUBY_VERSION} (#{obj}):#{nest_level} > " }, 13 | proc { |obj, nest_level, _| "#{RUBY_VERSION} (#{obj}):#{nest_level} * " }] 14 | 15 | # === Listing config === 16 | # Better colors - by default the headings for methods are too 17 | # similar to method name colors leading to a "soup" 18 | # These colors are optimized for use with Solarized scheme 19 | # for your terminal 20 | Pry.config.ls.separator = "\n" # new lines between methods 21 | Pry.config.ls.heading_color = :magenta 22 | Pry.config.ls.public_method_color = :green 23 | Pry.config.ls.protected_method_color = :yellow 24 | Pry.config.ls.private_method_color = :bright_black 25 | -------------------------------------------------------------------------------- /ruby/rdebugrc: -------------------------------------------------------------------------------- 1 | set autolist 2 | set autoeval 3 | set autoreload 4 | set forcestep 5 | -------------------------------------------------------------------------------- /shell/Xresources: -------------------------------------------------------------------------------- 1 | ! ============================================================================= 2 | ! ============================== XTERM CONFIG ================================= 3 | ! ============================================================================= 4 | 5 | ! Unicode support 6 | xterm*utf8: 1 7 | 8 | ! Color support 9 | xterm*customization: -color 10 | xterm*termName: xterm-256color 11 | 12 | ! Font settings 13 | xterm*allowBoldFonts: false 14 | xterm*faceName: Meslo LG S DZ for Powerline:Bold 15 | 16 | ! Font size 17 | xterm*faceSize: 10 18 | 19 | ! For inclusion of all necessary environment variables 20 | xterm*loginShell: true 21 | 22 | ! Scrollback setting 23 | xterm*savelines: 10000 24 | 25 | ! Disable right scrollbar 26 | xterm*ScrollBar: false 27 | 28 | ! Stop output to terminal from jumping down to bottom of scroll again 29 | xterm*scrollTtyOutput: false 30 | 31 | ! Save selections to clipboard 32 | xterm*selectToClipboard: true 33 | 34 | ! Include color scheme 35 | #include "/Users/martin/dotfiles/shell/colors/spacegray.xrdb" 36 | 37 | ! Apply included colors 38 | xterm*color0: Ansi_0_Color 39 | xterm*color1: Ansi_1_Color 40 | xterm*color2: Ansi_2_Color 41 | xterm*color3: Ansi_3_Color 42 | xterm*color4: Ansi_4_Color 43 | xterm*color5: Ansi_5_Color 44 | xterm*color6: Ansi_6_Color 45 | xterm*color7: Ansi_7_Color 46 | xterm*color8: Ansi_8_Color 47 | xterm*color9: Ansi_9_Color 48 | xterm*color10: Ansi_10_Color 49 | xterm*color11: Ansi_11_Color 50 | xterm*color12: Ansi_12_Color 51 | xterm*color13: Ansi_13_Color 52 | xterm*color14: Ansi_14_Color 53 | xterm*color15: Ansi_15_Color 54 | xterm*colorBD: Bold_Color 55 | xterm*colorIT: Italic_Color 56 | xterm*colorUL: Underline_Color 57 | xterm*foreground: Foreground_Color 58 | xterm*background: Background_Color 59 | xterm*cursorColor: Cursor_Color 60 | -------------------------------------------------------------------------------- /shell/colors/brogrammer.xrdb: -------------------------------------------------------------------------------- 1 | ! vim: ft=xdefaults 2 | ! ----------------------------------------------------------------------------- 3 | ! BROGRAMMER 4 | ! ----------------------------------------------------------------------------- 5 | 6 | #define Ansi_0_Color #1f1f1f 7 | #define Ansi_1_Color #f81118 8 | #define Ansi_10_Color #1dd361 9 | #define Ansi_11_Color #f3bd09 10 | #define Ansi_12_Color #1081d6 11 | #define Ansi_13_Color #5350b9 12 | #define Ansi_14_Color #0f7ddb 13 | #define Ansi_15_Color #ffffff 14 | #define Ansi_2_Color #2dc55e 15 | #define Ansi_3_Color #ecba0f 16 | #define Ansi_4_Color #2a84d2 17 | #define Ansi_5_Color #4e5ab7 18 | #define Ansi_6_Color #1081d6 19 | #define Ansi_7_Color #d6dbe5 20 | #define Ansi_8_Color #d6dbe5 21 | #define Ansi_9_Color #de352e 22 | #define Background_Color #131313 23 | #define Badge_Color #ff0000 24 | #define Bold_Color #d6dbe5 25 | /* #define Cursor_Color #b9b9b9 */ 26 | #define Cursor_Color #ffffff 27 | #define Cursor_Guide_Color #a6e8ff 28 | #define Cursor_Text_Color #101010 29 | #define Foreground_Color #d6dbe5 30 | #define Link_Color #0645ad 31 | #define Selected_Text_Color #d6dbe5 32 | #define Selection_Color #3a3a3a 33 | #define Tab_Color #000000 34 | -------------------------------------------------------------------------------- /shell/colors/monokai.xrdb: -------------------------------------------------------------------------------- 1 | ! vim: ft=xdefaults 2 | ! ----------------------------------------------------------------------------- 3 | ! MONOKAI 4 | ! ----------------------------------------------------------------------------- 5 | 6 | #define Ansi_0_Color #1a1a1a 7 | #define Ansi_1_Color #f4005f 8 | #define Ansi_10_Color #98e024 9 | #define Ansi_11_Color #e0d561 10 | #define Ansi_12_Color #9d65ff 11 | #define Ansi_13_Color #f4005f 12 | #define Ansi_14_Color #58d1eb 13 | #define Ansi_15_Color #f6f6ef 14 | #define Ansi_2_Color #98e024 15 | #define Ansi_3_Color #fa8419 16 | #define Ansi_4_Color #9d65ff 17 | #define Ansi_5_Color #f4005f 18 | #define Ansi_6_Color #58d1eb 19 | #define Ansi_7_Color #c4c5b5 20 | #define Ansi_8_Color #625e4c 21 | #define Ansi_9_Color #f4005f 22 | #define Background_Color #1a1a1a 23 | #define Bold_Color #c4c5b5 24 | /* #define Cursor_Color #f6f7ec */ 25 | /* #define Cursor_Text_Color #c4c5b5 */ 26 | #define Cursor_Color #ffffff 27 | #define Cursor_Text_Color #1a1a1a 28 | #define Foreground_Color #c4c5b5 29 | #define Selected_Text_Color #c4c5b5 30 | #define Selection_Color #343434 31 | -------------------------------------------------------------------------------- /shell/colors/spacegray.xrdb: -------------------------------------------------------------------------------- 1 | ! vim: ft=xdefaults 2 | ! ----------------------------------------------------------------------------- 3 | ! SPACEGRAY (customized black color) 4 | ! ----------------------------------------------------------------------------- 5 | 6 | #define Ansi_0_Color #353D50 7 | #define Ansi_1_Color #b04b57 8 | #define Ansi_10_Color #87b379 9 | #define Ansi_11_Color #e5c179 10 | #define Ansi_12_Color #7d8fa4 11 | #define Ansi_13_Color #a47996 12 | #define Ansi_14_Color #85a7a5 13 | #define Ansi_15_Color #ffffff 14 | #define Ansi_2_Color #87b379 15 | #define Ansi_3_Color #e5c179 16 | #define Ansi_4_Color #7d8fa4 17 | #define Ansi_5_Color #a47996 18 | #define Ansi_6_Color #85a7a5 19 | #define Ansi_7_Color #b3b8c3 20 | #define Ansi_8_Color #353D50 21 | #define Ansi_9_Color #b04b57 22 | #define Background_Color #20242d 23 | #define Bold_Color #b3b8c3 24 | /* #define Cursor_Color #b3b8c3 */ 25 | #define Cursor_Color #ffffff 26 | #define Cursor_Text_Color #1d1f21 27 | #define Foreground_Color #b3b8c3 28 | #define Selected_Text_Color #b3b8c3 29 | #define Selection_Color #16181e 30 | -------------------------------------------------------------------------------- /shell/martinus.zsh-theme: -------------------------------------------------------------------------------- 1 | # ===================================================================================================================== 2 | # ZSH ruby and git centric prompt 3 | # Made by Martin T. 4 | # ===================================================================================================================== 5 | 6 | # Directory info. 7 | local current_dir='${PWD/#$HOME/~}' 8 | 9 | # rbenv info 10 | local ruby_info=' (%{$fg[red]%}ruby-$(rbenv_prompt_info)%{$reset_color%})' 11 | local node_info=' (%{$fg[red]%}node-$(node -v)%{$reset_color%})' 12 | 13 | # Git info 14 | local git_info='$(git_prompt_info)' 15 | ZSH_THEME_GIT_PROMPT_PREFIX=" [%{$fg[cyan]%}" 16 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}]" 17 | ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[cyan]%}+" 18 | 19 | # Prompt 20 | PROMPT="%{$fg[green]%}${current_dir}%{$reset_color%}\ 21 | ${ruby_info}\ 22 | ${node_info}\ 23 | ${git_info} \ 24 | %{$ %{$reset_color%}" 25 | -------------------------------------------------------------------------------- /shell/zshrc: -------------------------------------------------------------------------------- 1 | # ===================================================================================================================== 2 | # General zsh settings 3 | # ===================================================================================================================== 4 | 5 | # Disable control flow (ctrl-s / ctrl-q) 6 | stty stop '' -ixoff -ixon 7 | 8 | # Set spelling correction 9 | setopt correct 10 | 11 | # Dont raise errors when regex nomatch fires 12 | unsetopt nomatch 13 | 14 | # ===================================================================================================================== 15 | # Oh my zsh settings 16 | # ===================================================================================================================== 17 | 18 | # Path to your oh-my-zsh installation. 19 | export ZSH=$HOME/.oh-my-zsh 20 | 21 | # Set name of the theme to load. 22 | ZSH_THEME="martinus" 23 | 24 | # Disable auto title setting 25 | DISABLE_AUTO_TITLE="true" 26 | 27 | # Uncomment the following line if you want to disable marking untracked files 28 | # under VCS as dirty. This makes repository status check for large repositories 29 | # much, much faster. 30 | DISABLE_UNTRACKED_FILES_DIRTY="true" 31 | 32 | # Disable permission checks 33 | ZSH_DISABLE_COMPFIX="true" 34 | 35 | # ===================================================================================================================== 36 | # Plugins declaration 37 | # ===================================================================================================================== 38 | 39 | # zsh-syntax-highlighting -> https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md 40 | # zsh-autosuggestions -> https://github.com/zsh-users/zsh-autosuggestions 41 | 42 | # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) 43 | # zsh-syntax-highlighting zsh-autosuggestions is installed via homebrew 44 | plugins=(common-aliases docker extract gitfast jsontools npm rbenv redis-cli) 45 | 46 | # ===================================================================================================================== 47 | # Plugins settings 48 | # ===================================================================================================================== 49 | 50 | # ===================================================================================================================== 51 | # Sourcing 52 | # ===================================================================================================================== 53 | 54 | # Oh my zsh 55 | source $ZSH/oh-my-zsh.sh 56 | # source $ZSH/plugins/history-substring-search/history-substring-search.zsh 57 | 58 | # ===================================================================================================================== 59 | # Plugin bindings 60 | # ===================================================================================================================== 61 | 62 | # History substring search plugin binding 63 | # bindkey '^[[A' history-substring-search-up 64 | # bindkey '^[[B' history-substring-search-down 65 | 66 | # Autosuggestions + Substring search config 67 | # ZSH_AUTOSUGGEST_CLEAR_WIDGETS=("${(@)ZSH_AUTOSUGGEST_CLEAR_WIDGETS:#(up|down)-line-or-history}") 68 | # ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(history-substring-search-up history-substring-search-down) 69 | 70 | # ===================================================================================================================== 71 | # My additional aliases 72 | # ===================================================================================================================== 73 | 74 | # ------------------------------------------ 75 | # APT 76 | # ------------------------------------------ 77 | alias autoremove='sudo apt autoremove' 78 | alias dist-upgrade='sudo apt full-upgrade' 79 | alias install='sudo apt install' 80 | alias remove='sudo apt remove' 81 | alias update='sudo apt update' 82 | alias upgrade='sudo apt upgrade' 83 | alias up='sudo apt update && sudo apt upgrade -y' 84 | 85 | # ------------------------------------------ 86 | # Services 87 | # ------------------------------------------ 88 | alias ss='sudo service' 89 | alias ssmysql='sudo service mysql start' 90 | alias sspgsql='sudo service postgresql start' 91 | alias ssredis='sudo service redis-server start' 92 | alias sselastic='sudo service elasticsearch start' 93 | 94 | # ------------------------------------------ 95 | # Applications 96 | # ------------------------------------------ 97 | alias d='docker' 98 | alias v='nvim' 99 | alias g='git' 100 | alias ta='tmux attach -t main || tmux new -s main' 101 | alias td='tmux detach' 102 | alias msql='mysql -uroot -p' 103 | # npm install -g http-server 104 | # alias ws='http-server -c-1 -p 3333 -o' 105 | 106 | # ------------------------------------------ 107 | # Language specific 108 | # ------------------------------------------ 109 | alias rb='ruby' 110 | alias js='node' 111 | # alias composer="php /usr/local/bin/composer.phar" 112 | 113 | # ------------------------------------------ 114 | # Apple M1 115 | # ------------------------------------------ 116 | # alias intel='arch -x86_64' 117 | # alias brew='arch -x86_64 brew' 118 | # alias rbenv='arch -x86_64 rbenv' 119 | 120 | # ------------------------------------------ 121 | # Other 122 | # ------------------------------------------ 123 | alias q='exit' 124 | alias topdu='du -a | sort -nr | head -50' 125 | alias fsize='du -s' 126 | alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' 127 | 128 | # Loading private aliases 129 | source $HOME/dotfiles/private/aliases 130 | 131 | function crypt() { 132 | openssl des3 -in "$1" -out "$2" 133 | } 134 | 135 | function decrypt() { 136 | openssl des3 -d -in "$1" -out "$2" 137 | } 138 | 139 | # ===================================================================================================================== 140 | # Exports 141 | # ===================================================================================================================== 142 | 143 | # 256 color support 144 | export TERM=screen-256color 145 | 146 | # Setting default editor 147 | export EDITOR='nvim' 148 | export MYNVIMRC='~/.config/nvim/init.vim' 149 | 150 | # SSH 151 | export SSH_KEY_PATH="~/.ssh/dsa_id" 152 | 153 | # Add android sdk to path if it exists 154 | # if [ -d $HOME/lib/android-sdk-linux ]; then 155 | # export PATH=$HOME/lib/android-sdk-linux/tools:$PATH 156 | # export ANDROID_HOME='~/lib/android-sdk-linux' 157 | # if [ -d $HOME/lib/android-sdk-linux/platform-tools ]; then 158 | # export PATH=$HOME/lib/android-sdk-linux/platform-tools:$PATH 159 | # fi 160 | # fi 161 | 162 | # Add elixir bin into PATH if exists 163 | # if [ -d $HOME/lib/elixir/bin ]; then 164 | # export PATH=$HOME/lib/elixir/bin:$PATH 165 | # fi 166 | 167 | # Add my bin folders to PATH 168 | export PATH=$HOME/bin:/usr/local/bin:$PATH 169 | 170 | # Add brew used folder to PATH 171 | export PATH="/usr/local/sbin:$PATH" 172 | 173 | # YARN package manager bin 174 | export PATH="$PATH:`yarn global bin`" 175 | 176 | # node 20 177 | export PATH="/usr/local/opt/node@20/bin:$PATH" 178 | 179 | # ZHS autosuggestions 180 | # if [ -d $HOME/.zsh/zsh-autosuggestions ]; then 181 | # source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh 182 | # fi 183 | 184 | # ZHS syntax highlighting 185 | # if [ -d $HOME/.zsh/zsh-syntax-highlighting ]; then 186 | # source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 187 | # fi 188 | 189 | # Iterm2 shell integrations 190 | test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh" 191 | 192 | # Git extras 193 | if [ -d $HOME/vendor/git-extras ]; then 194 | source $HOME/vendor/git-extras/etc/git-extras-completion.zsh 195 | fi 196 | -------------------------------------------------------------------------------- /tmux/tmux.conf: -------------------------------------------------------------------------------- 1 | # ====================================================================================================================== 2 | # Basic config 3 | # ====================================================================================================================== 4 | 5 | # Unset ruby version so it respects .ruby-version files 6 | set-environment -gu RBENV_VERSION 7 | 8 | # Fastest command sequences (http://superuser.com/a/252717/65504) 9 | set -s escape-time 0 10 | 11 | # For nice colors 12 | set -g default-terminal "screen-256color" 13 | 14 | # Prevent user namespace problems 15 | set-option -g default-command "reattach-to-user-namespace -l zsh" 16 | 17 | # XTerm compatibility 18 | set -g xterm-keys on 19 | 20 | # Vi keys in copy mode 21 | set -g mode-keys vi 22 | 23 | # History boost 24 | set -g history-limit 50000 25 | 26 | # Enable mouse 27 | set -g mouse on 28 | 29 | # Emacs key bindings in command prompt (prefix + :) are better than vi keys, even for vim users 30 | set -g status-keys emacs 31 | 32 | # Focus events enabled for terminals that support them 33 | set -g focus-events on 34 | 35 | # Super useful when using "grouped sessions" and multi-monitor setup 36 | setw -g aggressive-resize on 37 | 38 | # Messages are displayed for 3 seconds 39 | set -g display-time 3000 40 | 41 | # Color setting as recommended by neovim's :checkhealth command 42 | # set-option -sa terminal-overrides ',screen-256color:RGB' 43 | set-option -ga terminal-overrides ',screen-256color:Tc' 44 | 45 | # ====================================================================================================================== 46 | # Key bindings and mappings 47 | # ====================================================================================================================== 48 | 49 | # Prefix 50 | unbind C-b 51 | set -g prefix § 52 | bind-key § send-prefix 53 | 54 | # Reload the file with Prefix r 55 | bind R source-file ~/.tmux.conf \; display "Sourced tmux.conf" 56 | 57 | # Next and prev window like in vim 58 | bind -r - previous-window 59 | bind -r = next-window 60 | 61 | # New windows and panes in the same dir 62 | bind-key n new-window -c "#{pane_current_path}" 63 | bind-key i split-window -h -c "#{pane_current_path}" 64 | bind-key v split-window -c "#{pane_current_path}" 65 | 66 | # Pane switching 67 | bind-key h select-pane -L 68 | bind-key j select-pane -D 69 | bind-key k select-pane -U 70 | bind-key l select-pane -R 71 | 72 | # Resize panes with arrows 73 | bind-key -r Left resize-pane -L 1 74 | bind-key -r Down resize-pane -D 1 75 | bind-key -r Up resize-pane -U 1 76 | bind-key -r Right resize-pane -R 1 77 | 78 | # r to rename window 79 | bind-key r command-prompt 'rename-window %%' 80 | 81 | # p to paste buffer 82 | unbind p 83 | bind p paste-buffer 84 | 85 | # P to choose which buffer to paste 86 | bind P choose-buffer 87 | 88 | # ====================================================================================================================== 89 | # Status bar settings 90 | # ====================================================================================================================== 91 | 92 | # Set status position 93 | set-option -g status-position bottom 94 | 95 | # Set the base index for windows and panes to 1 instead of 0 96 | set -g base-index 1 97 | setw -g pane-base-index 1 98 | 99 | # Renumber when window is closed 100 | set -g renumber-windows on 101 | 102 | # Activity monitoring 103 | setw -g monitor-activity on 104 | 105 | # Default statusbar colors 106 | set -g status-style bg=black 107 | 108 | # Default window title colors 109 | setw -g window-status-style fg=white,bg=default 110 | 111 | # Active window title colors 112 | setw -g window-status-current-style fg=white,bg=default 113 | 114 | # Pane border 115 | set -g pane-border-style fg=white,bg=default 116 | set -g pane-active-border-style fg=white,bg=default 117 | 118 | # Command line/message text 119 | set -g message-style bg=black,fg=yellow 120 | 121 | # Pane number display 122 | set -g display-panes-active-colour cyan 123 | set -g display-panes-colour brightblue 124 | 125 | # Status settings 126 | set -g status on 127 | set -g status-interval 15 128 | set -g status-justify centre 129 | 130 | # Status line left side 131 | set -g status-left-length 70 132 | set -g @online_icon "yes" 133 | set -g @offline_icon "no" 134 | set -g status-left "#[fg=white] #S" 135 | 136 | # Status line right side 137 | set -g status-right-length 70 138 | set -g status-right "#[fg=white] %d %b %R" 139 | 140 | # Activity 141 | set-option -gw window-status-activity-style fg=white,bg=default 142 | 143 | # ====================================================================================================================== 144 | # Plugins settings 145 | # ====================================================================================================================== 146 | 147 | # List of plugins 148 | set -g @plugin 'tmux-plugins/tpm' 149 | set -g @plugin 'tmux-plugins/tmux-yank' # yanking helpers 150 | set -g @plugin 'tmux-plugins/tmux-sessionist' # session helpers prexif + C (new session) 151 | set -g @plugin 'tmux-plugins/tmux-resurrect' # prefix + C-s save, C-r restore 152 | 153 | # Initialize plugin manager (keep this line at the very bottom of tmux.conf) 154 | run '~/.tmux/plugins/tpm/tpm' 155 | --------------------------------------------------------------------------------