Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should merging of #183 necessary? #202

Open
yuex opened this issue Aug 11, 2015 · 4 comments
Open

should merging of #183 necessary? #202

yuex opened this issue Aug 11, 2015 · 4 comments
Labels

Comments

@yuex
Copy link

yuex commented Aug 11, 2015

Right, according to pep8, we need #<space> instead of #. But this kind of behavior can be implemented by let g:NERDSpaceDelims = 1. Actually, isn't it necessary to add a space between the comment delimiter of any language to make it clean? The requirement of pep8 should not make python a special case. Or at least the committer should take into account of g:NERDSpaceDelims. Someone argues that #183 makes it simpler for python commenting from the start. But before the merging I just need to config

let g:NERDSpaceDelims = 1

now I have to config

let g:NERDSpaceDelims = 1
let g:NERDCustomDelimiters = {'python': {'left': '#'}}

besides two hours wasted on locating the reason why <Leader>cc only cause comments in python two spaces instead of one.

@cherrot
Copy link

cherrot commented Feb 3, 2016

Agree.
Now I have to config for python specifically. It is annoying, really.

@ryneeverett
Copy link

Is making NERDSpaceDelims=1 the default a potential option? That would be pep8-compliant by default and avoid making python a special case. And as pointed out above:

Actually, isn't it necessary to add a space between the comment delimiter of any language to make it clean?

@ryneeverett
Copy link

ryneeverett commented May 25, 2016

On a somewhat tangential note, the current "fix" doesn't seem to even address pep8 block requirements:

Block comments generally apply to some (or all) code that follows them, and are indented to the same level as that code. Each line of a block comment starts with a # and a single space (unless it is indented text inside the comment).

Emphasis mine. The current implementation yields:

# some_block = {
    # 'a': 1,
    # 'b': 2}

in which pep8/pycodestyle tool correctly identifies "unexpected indentation", rather than:

# some_block = {
#     'a': 1,
#     'b': 2}

@kalq
Copy link

kalq commented Nov 3, 2017

I think you can meet Pep8 requirements with:

let NERDDefaultAlign="left"

Put it inside .vim/after/ftplugin/python.vim to avoid changing the setting for other filetypes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants