The demo: [asciinema][1]
This workflow is in thanks to [a Reddit post by romainl][2].
Sometimes, you just want to know where a string is found. In these cases, a simple
| watchdir() { | |
| inotifywait -rme modify --format '%w%f' "$1" | |
| } |
| function! TemplateReplace() abort | |
| if expand('%') =~ glob2regpat('*.js') | |
| " do JS-specific replacement | |
| elseif expand('%') =~ glob2regpat('*.sh') | |
| " do sh-specific replacement | |
| endif | |
| endfunction | |
| augroup TemplateLite | |
| autocmd! |
| augroup IncSearch | |
| autocmd! | |
| autocmd CmdLineEnter [/\?] set nohlsearch | |
| autocmd CmdLineLeave [/\?] set hlsearch | |
| augroup END |
| #!/usr/bin/env bash | |
| # Depends on inotifywait, from inotify-tools | |
| # Usage: watchrun dir... -- command... | |
| # e.g. watchrun src -- ctags -a | |
| dirs=() | |
| until [[ $1 == -- ]]; do | |
| dirs+=("$1") |
Did you know Vim has a few builtin features designed to help with the "Jump to Definition" action you see in most IDEs?
Since Vim is a "dumb" editor (that is, it doesn't do any static analysis on your text), you'd expect a "Jump to Definition" feature that relies on a simple text search.
| { | |
| "lint": { | |
| "compiler": "eslint" | |
| }, | |
| "build": { | |
| "makeprg": "adb shell input keyevent 82" | |
| }, | |
| "tags": { | |
| "makeprg": "es-ctags -R src" | |
| } |
| aur() { | |
| aurget "$@" && aurinstall "$@" | |
| } | |
| aurdeps() { | |
| aurget "$@" && aurinstall --asdeps "$@" | |
| } | |
| reaur() { | |
| aurupdate "$@" && aurinstall "$@" |
| #compdef aurclean | |
| _files -W "${AUR_DIR:-$HOME/.aur}" |