On 18.04.25 00:08, Eli the Bearded handed down much to be considered: > I use autocommands like:
> > " Set up macros for Rnmail > autocmd BufRead .letter.* :so ~eli/.lettervimrc That is not just a neat makefile target alternative for my simple case, but can set up several key mappings ... and I will find patterns once I've produced more than two sourcefiles. ... > If you can identify which makeprg you want for a file based on > a glob, then that's an easy fix. That'll evolve, I'm sure. You've put me on a profitable path now, toward a more consistent solution. > > It's tedious that a modeline can't do an nmap either, as that would be > > even more directly effective. > > I've done some research into modeline security holes in the past, and > "drive a truck through" is a good description of how they used to be. > If you can nmap on the sly, you can own the user. Consider editing > any untrusted content, like a reply to a message on a mailing list. > Is there some nasty modeline lurking in the .sig? As I'm doing now. Your argument is succinctly powerful, not least as I took the question for general conjecture until I got there. > > It might be necessary to find a vimscript primer, as executing a :nmap > > from a tagged line read from the file is beyond my current ken. My take > > is that there would be no delay risk - the tag is found or not, the :nmap > > is executed or not - instantly? > > Yes, nmap is instant. Let me suggest my simple but powerful solution, a > mapping that can turn a line in a file into a command. > > :map * "yyy@y > > That makes "*" run the line currently under the cursor. In my own files, > for my own use, I embed vi commands all the time. I'm a bit slow - had to read the mapping twice to get it. It automates my current practice of manually copying that line, at end of file, onto the ex commandline once, then using a couple of up-arrows for repeats. ... > > I'll look for processing commonality, as I extend the workflow. Then it may > > well be OK to typify the source files by extension, and allow one common > > cross-task makefile to differentiate processing. That is (for me) a high > > level of organisation in an exploratory phase, where I'm still > > assembling / building the toolset and forging the workflow. But using > > filename > > extension might be best in the long run. Then we're back to make - nice and > > simple. > > You could create a script for makeprg that examines the file and then > builds a command line for the makeprg you want. Now that is tempting - hive off to awk, and avoid the vimscript learning curve, which has scared me off for decades. Many thanks, Elijah, for the lesson. It'll help me make order out of the chaos of a new workflow. Erik -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_use/834a4273-fc94-4e7f-83d3-1daf695374b1%40localhost.