Skip to content

Instantly share code, notes, and snippets.

@heavenshell
Created January 2, 2012 16:37
Show Gist options
  • Save heavenshell/1551321 to your computer and use it in GitHub Desktop.
Save heavenshell/1551321 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
def bar():
pass
# -*- coding: utf-8 -*-
class Foo(object):
pass
autocmd FileType python setlocal includeexpr=FormatPyImport(v:fname) | setlocal path+=;/
function! FormatPyImport(str)
return substitute(substitute(substitute(a:str, '^from \|^import ', '', ''), 'import \a\+', '', ''), '\.', '\/', 'g')
endfunction
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import bar
from foo import Foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment