On 09Nov17 21:32, Peng Yu wrote: > John Beckett wrote: > > Peng Yu wrote: > > > $ grep -H -n if /etc/profile>/tmp/grep_output.txt $ cat > > > /tmp/grep_output.txt /etc/profile:4:if [ -d /etc/profile.d ]; then > > > /etc/profile:6: if [ -r $i ]; then > > > /etc/profile:13:if [ "$PS1" ]; then > > > /etc/profile:14: if [ "$BASH" ]; then > > > /etc/profile:16: if [ -f /etc/bash.bashrc ]; then > > > /etc/profile:20: if [ "`id -u`" -eq 0 ]; then > > > $ gvim /tmp/grep_output.txt > > > > > > Now, I want to double click a line in 'grep_output.txt' so > > > that gvim will automatically bring me the corresponding file > > > and line. I'm wondering how to do so. > > > > You should use the -q option: > > > > gvim -q /tmp/grep_output.txt > > Suppose that there are more than one files in the grep results. It > seems that 'gvim -q' only allow me to go to the first one. Right?
You can use ":cn" to go to the next hit, or ":cp" to go to the previous hit. With ":cl" you can list all hits. Also read ":help quickfix" for more informations. -- mfg Dipl.-Ing.(FH) Markus Koch Mail: [email protected] Jabber: [email protected] --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
