Vim Tips Wiki
No edit summary
 
m (Useful Occurences under cursor and with prompt moved to List lines with keyword and prompt for jump: Page moved by JohnBot to improve title)

Revision as of 09:38, 18 October 2007

Previous TipNext Tip

Tip: #563 - List lines with keyword and prompt for jump

Created: September 24, 2003 21:28 Complexity: basic Author: lechee Version: 6.0 Karma: 3/2 Imported from: Tip#563

[I is very useful display all lines that contain the keyword under the cursor

so following are two function for selection contain in two way under cursor or prompt find


a big thanx Yegappan give me the hint for ijump



function! s:UnderOccurences()

exe "normal [I" 
let nr = input("Which one: ") 
if nr == "" 
return 
endif 
exe "normal " . nr . "[\t" 

endfunction!


function! s:FindOccurences()

let pattern = input("Prompt Find: ") 
if pattern == "" 
return 
endif 
exe "ilist " . pattern 
let nr = input("Which one: ") 
if nr == "" 
return 
endif 
exe "ijump " . nr . pattern 

endfunction

Comments