"Returns the visually selected text function! vebugger#util#get_visual_selection() "Shamefully stolen from http://stackoverflow.com/a/6271254/794380 " Why is this not a built-in Vim script function?! let [lnum1, col1] = getpos("'<")[1:2] let [lnum2, col2] = getpos("'>")[1:2] let lines = getline(lnum1, lnum2) let lines[-1] = lines[-1][: col2 - (&selection == 'inclusive' ? 1 : 2)] let lines[0] = lines[0][col1 - 1:] return join(lines, "\n") endfunction "Prompts the user with a filtered list of process, and returns the process id "the user selects function! vebugger#util#selectProcessOfFile(ofFile) let l:fileName=fnamemodify(a:ofFile,':t') let l:resultLines=split(vimproc#system('ps -o pid,user,comm,start,state,tt -C '.fnameescape(l:fileName)),'\r\n\|\n\|\r') if len(l:resultLines)<=1 throw 'No matching process found' endif if &lines