Vim search and highlighting control from a script
问题 I'm writing a script in which I want to control searches programmatically, and get them highlighted. The search() function results are not highlighted (I think), so using that function is not of use to me. What I want to do is use the 'normal /' command to search for a variable, but that doesn't seem to be straightforward. I can script the command: execute 'normal /' . my_variable . '\<CR>' (or other variations as suggested in the vim tip here: http://vim.wikia.com/wiki/Using_normal_command