The bash shell provides the RANDOM environment variable that gives a random integer from 0 to 32767 inclusive, on many Linux systems. Since 0G jumps to the last line, this variable provides line numbers effectively from 1 to 32768 inclusive, and if the number of lines in the buffer is 32768 or less, the following can be used to define a command such that :RandomLine will jump to a random line in the buffer: :command! RandomLine execute 'normal! '.(system('/bin/bash -c "echo -n $RANDOM"') % line('$')).'G'
Identifier (URI) | Rank |
---|---|
dbkwik:resource/YJd_WbUWF1624CBXEmNltA== | 5.88129e-14 |