:GB
:7,13GB
:,+5GB
" gq wrapper that: | |
" - tries its best at keeping the cursor in place | |
" - tries to handle formatter errors | |
function! Format(type, ...) | |
normal! '[v']gq | |
if v:shell_error > 0 | |
silent undo | |
redraw | |
echomsg 'formatprg "' . &formatprg . '" exited with status ' . v:shell_error | |
endif |
https://haskell-miso.org/ | |
a web framework inspired by Elm, uses GHCJS | |
http://blog.vmchale.com/article/haskell-frontend | |
a quick Miso tutorial | |
https://dc25.github.io/myBlog/2017/11/26/minesweepers-written-using-elm-reflex-miso.html |
FOREWORDS
I don't mean the snippet at the bottom of this gist to be a generic plug-n-play solution to your search needs. It is very likely to not work for you or even break things, and it certainly is not as extensively tested and genericised as your regular third-party plugin.
My goal, here and in most of my posts, is to show how Vim's features can be leveraged to build your own high-level, low-maintenance, workflows without systematically jumping on the plugins bandwagon or twisting Vim's arm.
/* | |
Pros: - intuitive syntax | |
- portable | |
Cons: - always exits with 0, non-blocking | |
- legibility/alignment issues | |
*/ | |
const testedFunction = (param) => { | |
return param * 2; | |
}; |
function! Sort(type, ...) | |
'[,']sort | |
endfunction | |
nmap <silent> <key> :set opfunc=Sort<CR>g@ | |
" usage: | |
" <key>ip | |
" <key>G |
function! Multivide(divide) | |
let cnt = v:count1 | |
let old_reg = getreg("v") | |
call search('\d\([^0-9\.]\|$\)', 'cW') | |
normal v | |
call search('\(^\|[^0-9\.]\d\)', 'becW') | |
normal "vygv | |
if a:divide == 1 | |
execute 'normal "_c' . @v / cnt | |
else |