" Add ability to save named files when vim loses focus. if exists("g:loaded_plugin_blursave") finish endif let g:loaded_plugin_blursave = 1 let s:active = 0 function BlurSaveAutocmdHook() if s:active silent! wa endif endfunction autocmd FocusLost * call BlurSaveAutocmdHook() command BlurSaveOn let s:active = 1 command BlurSaveOff let s:active = 0
vimfiles\plugin\blursave.vimfor Windows) and you now have a
:BlurSaveOncommand: every time your gvim (or Windows console vim) loses focus, named buffers will be saved.
My plan here is to develop a Mojolicious app in Windows gvim, with the files in a folder shared with a VirtualBox VM. With blursave, when I Alt+Tab to the browser, vim saves and morbo reloads.
2. Graceful FallbackThe vim function
exists()can test just about anything. I now have this stanza in my
Now, whenever I'm writing a new blog post for propaganda, I don't have to remember to run
" Engage UniCycle plugin, if loaded if exists(":UniCycleOn") UniCycleOn endif
3. Extension remappingDue to the disagreement on various systems as to what markdown should be called (Nocs for iOS offers just about every option except .mkd, while that happens to be the preferred extension for the syntax file I have for it—actually named mkd.vim), I also link
.mdto the mkd syntax in
This lets me make Nocs-friendly Markdown files and still have vim highlight them.
" .md => markdown autocmd BufRead,BufNewFile *.md setlocal filetype=mkd
Post a Comment