Skip to content

Instantly share code, notes, and snippets.

View Fransz's full-sized avatar

Frans Jaspers Fransz

View GitHub Profile
@vpetro
vpetro / gist:1204166
Created September 8, 2011 18:17
add docstring for python function in vim
function! WriteParams()
python << endpython
import re
import vim
# get the function definition line
line = vim.eval("getline(line('.'))")
# get the number of spaces to add to the start of the line
num_spaces = 4 + len(line) - len(line.lstrip())
# get the line number wher to do the insertion