import random
import vim


# Jumps to a random line inside the current buffer. Helpful if you have lots of
# testcases inside a single file and you want to minimize conflicts, i.e. just
# appending tests to the end of the file is a bad strategy.
def main():
    # Add an entry to the jump list.
    vim.command("normal! m'")

    # Jump to a line.
    line = random.choice(range(len(vim.current.buffer)))
    # cursor() is 1-based.
    vim.eval("cursor(" + str(line + 1) + ", 1)")

    # Move the cursor to the center of the screen.
    vim.command("normal! zz")

if __name__ == '__main__':
    main()

# vim: set shiftwidth=4 softtabstop=4 expandtab:

1decfdeb52e35a84cdb8885aff0e69bb7f71dc89
<mask token>

<mask token>


def main():
    vim.command("normal! m'")
    line = random.choice(range(len(vim.current.buffer)))
    vim.eval('cursor(' + str(line + 1) + ', 1)')
    vim.command('normal! zz')


<mask token>

<mask token>


def main():
    vim.command("normal! m'")
    line = random.choice(range(len(vim.current.buffer)))
    vim.eval('cursor(' + str(line + 1) + ', 1)')
    vim.command('normal! zz')


if __name__ == '__main__':
    main()

import random
import vim


def main():
    vim.command("normal! m'")
    line = random.choice(range(len(vim.current.buffer)))
    vim.eval('cursor(' + str(line + 1) + ', 1)')
    vim.command('normal! zz')


if __name__ == '__main__':
    main()

import random
import vim


# Jumps to a random line inside the current buffer. Helpful if you have lots of
# testcases inside a single file and you want to minimize conflicts, i.e. just
# appending tests to the end of the file is a bad strategy.
def main():
    # Add an entry to the jump list.
    vim.command("normal! m'")

    # Jump to a line.
    line = random.choice(range(len(vim.current.buffer)))
    # cursor() is 1-based.
    vim.eval("cursor(" + str(line + 1) + ", 1)")

    # Move the cursor to the center of the screen.
    vim.command("normal! zz")

if __name__ == '__main__':
    main()

# vim: set shiftwidth=4 softtabstop=4 expandtab:
