【问题标题】:Folding body of functions in python with vim使用vim在python中折叠函数体
【发布时间】:2015-05-21 01:23:55
【问题描述】:

例如,如果我有这个功能:

def foo():

    a = 5
    print a
    ...

如果我折叠它,我会得到这个:

def foo():

+-- 123 lines: a = 5 ---------------------------------------------

但我真正想要的是这样的:

def foo():
+-- 124 lines: ---------------------------------------------

使用python-mode 插件,我的.vimrc 中有let g:pymode = 1let g:pymode_folding = 1。这可能吗?我错过了什么吗?谢谢。

【问题讨论】:

    标签: python vim python-mode


    【解决方案1】:

    我也在使用 pymode,幸运的是我没有遇到你的问题。这是我在 .vimrc 中的设置。希望它对你有用。

    let g:pymode_rope = 1
    let g:pymode_doc = 1 "Documentation
    let g:pymode_doc_key = 'K'
    let g:pymode_lint = 1 "Linting
    let g:pymode_lint_checker = "pyflakes,pep8"
    let g:pymode_lint_write = 1 "Auto check on save
    let g:pymode_virtualenv = 1 "Support virtualenv
    let g:pymode_breakpoint = 1 " Enable breakpoints plugin
    let g:pymode_breakpoint_bind = '<leader>b'
    let g:pymode_syntax = 1 "syntax highlightin
    let g:pymode_syntax_all = 1
    let g:pymode_syntax_indent_errors = g:pymode_syntax_all
    let g:pymode_syntax_space_errors = g:pymode_syntax_all
    let g:pymode_folding = 1 "0:Don't autofold code 1:enable python folding
    

    【讨论】:

      猜你喜欢
      • 2011-11-17
      • 2010-09-29
      • 1970-01-01
      • 2011-07-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-16
      • 2010-12-17
      相关资源
      最近更新 更多