On Saturday, June 1, 2019 at 1:58:16 PM UTC-7, Gary Johnson wrote: > On 2019-06-01, Edward Peschko wrote: > > All, > > > > I was playing around with map and nested autocommands for > > splitting on buffers, and noticed that when I actually do a split > > via a map, ie: > > > > map ,, :split <cfile><CR> > > > > it actually goes through the whole setup process via starting the > > shell, loading the associated rc file, etc etc. > > I tried reproducing this and found no evidence that a shell was run. > I executed the following, > > $ strace -f -t -o strace.out vim -N -u NONE -i NONE > > then within that vim defined you map and executed it. The window > split, as expected. I then exited vim and opened the strace.out > file in vim. There was no line containing "bash" in that file. > > The version of vim I was using was 8.1.497 because it's what I had > handy. It's possible that the behavior you're seeing was introduced > since then. > > Why do you think that vim spawns a shell when executing your map?
Gary, I basically did the same thing ie: used strace to get the output and it shows the opens for the shell. It also shows this in an error on the console. I think the reason a shell opened was because of the filetype I split on - namely a perl module file, which opened up ftplugin.vim, which opens the shell. Note that this only happens to me if I have 'ftplugin on' set in my vimrc. So you are basically at the mercy of any of your plugins as to whether or not they are going to do this. The issue with 'set shell' for me is that it has an unpleasant side effect. At least in my setup, when you do 'vi file' it interrupts the load of the file with a 'press <enter> to continue'. I'm setting it as follows: set shell '/bin/tcsh -f' which is the equivalent of what you did with bash. Remove the set shell, and this goes away. Ed -- -- You received this message from the "vim_dev" 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_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/6491ce61-f33e-473e-aede-2d0ed3ec5281%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
