Re: CmdLineLeave: Distinguish canceled (Esc/Ctrl-C) command/search?

2018-04-21 Fir de Conversatie Ivan Brennan
The TextYankPost autocommand carries some additional info in the v:event dictionary. It seems like this approach would make sense for CmdlineLeave, as a way to indicate what caused the command line to be left. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type y

CmdLineLeave: Distinguish canceled (Esc/Ctrl-C) command/search?

2018-04-20 Fir de Conversatie Ivan Brennan
Using autocommands, you can make search highlighting transient, activating when you enter a search, and deactivating on your next cursor movement: set incsearch nohlsearch augroup hl_init au! CmdlineEnter [/\?] call InitHighlight() augroup END func! InitHighlight() s

Re: Problematic doautocmd behavior

2018-04-14 Fir de Conversatie Ivan Brennan
That's a good point. Given the choice between: a) unintentionally silencing messages that a hook tried to display and b) failing to trigger an autocommand because it was defined using a pattern construct that exists() fails to recognize I'll opt for (a). I'm curious how difficult it would

Problematic doautocmd behavior

2018-04-14 Fir de Conversatie Ivan Brennan
When your plugin wants to provide an event the user can hook into, it could broadcast a User autocommand: function! foo#do_it() call s:do_thing() doautocmd User FooDidIt endfunction If the user's vimrc contains, augroup MyGroup autocmd! autocmd User FooDidIt

syntax/sh.vim patch

2017-07-20 Fir de Conversatie Ivan Brennan
I have a proposed patch for the sh.vim syntax file. I emailed it to the maintainer a little over two weeks ago but have not heard back, so thought I'd reach out here. I recently discovered this sort of construct in shell-scripting: { # Prevent execution if this script was only partially downl

Netrw double-loading

2017-07-15 Fir de Conversatie Ivan Brennan
After noticing lag when opening a directory in Netrw, I put the following in my ~/.vim/ftplugin/netrw.vim to see if it was loading multiple times: if !exists('s:count') let s:count = 0 endif let s:count += 1 func! Count() return s:count endf I started vim: v