Vimjas / vim-python-pep8-indent

A nicer Python indentation style for vim.
Creative Commons Zero v1.0 Universal
790 stars 69 forks source link

readme on configuration very unclear #75

Closed jimbasquiat closed 6 years ago

jimbasquiat commented 7 years ago

Hi,

I have been trying to make use of this plugin - however the readme supposed to explain the configuration is very unclear. Could you expand a little bot on how to use this plugin - maybe fr instance showing 1 or 2 examples of the most common config you would recommand?

blueyed commented 7 years ago

@jimbasquiat I am using just the default settings myself.

A PR with improved doc would be nice, if you can figure something out etc.

jimbasquiat commented 7 years ago

Well as per the docs: You can configure the initial indentation of multiline strings using g:python_pep8_indent_multiline_string (which can also be set per buffer). *This defaults to *0, which means that multiline strings are not indented.

So I understand that by default the indentation is deactivated? As a matter of fact when I tried the plugin (ie git cloning it into my pathogen vim/bundle folder, the indentation was not functioning. Any hints?

2017-05-20 16:59 GMT+01:00 Daniel Hahler notifications@github.com:

@jimbasquiat https://github.com/jimbasquiat I am using just the default settings myself.

A PR with improved doc would be nice, if you can figure something out etc.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Vimjas/vim-python-pep8-indent/issues/75#issuecomment-302881895, or mute the thread https://github.com/notifications/unsubscribe-auth/AS26JoMpni--2LzU3vAjQ-mD-WUOc5xsks5r7w3ugaJpZM4NhTr8 .

blueyed commented 7 years ago

What does :verb set indentexpr? give you? It should be indentexpr=GetPythonPEPIndent(v:lnum). Make sure the filetype is python.

jimbasquiat commented 7 years ago

it gives me indentexpr=

how do i fix that? why did it not set itself up correctly by default?

2017-05-20 17:33 GMT+01:00 Daniel Hahler notifications@github.com:

What does :verb set indentexpr? give you? It should be indentexpr=GetPythonPEPIndent(v:lnum). Make sure the filetype is python.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Vimjas/vim-python-pep8-indent/issues/75#issuecomment-302883925, or mute the thread https://github.com/notifications/unsubscribe-auth/AS26Ji0ykxhTyV_k4CbLTIp-fBJneSQyks5r7xX0gaJpZM4NhTr8 .

blueyed commented 7 years ago

It should do so, via ftplugin indent - so it depends on how you load it. I recommend using a plugin manager like vim-plug.

jimbasquiat commented 7 years ago

so there should be a "indent" file in the ftplugin directory? i am using pathogen for plugin manager

2017-05-20 20:03 GMT+01:00 Daniel Hahler notifications@github.com:

It should do so, via ftplugin indent - so it depends on how you load it. I recommend using a plugin manager like vim-plug.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Vimjas/vim-python-pep8-indent/issues/75#issuecomment-302892335, or mute the thread https://github.com/notifications/unsubscribe-auth/AS26JoHW0zd7ij8Kh_UU_XXi7VIxHRL-ks5r7zkYgaJpZM4NhTr8 .

blueyed commented 7 years ago

Sorry, I've meant filetype indent on, see :h :filetype-indent-on.

pathogen is quite basic, so make sure to follow its documentation regarding those :filetype calls.

https://github.com/Vimjas/vim-python-pep8-indent/blob/master/indent/python.vim is the file that should get loaded for ft=python.

blueyed commented 7 years ago

See https://github.com/tpope/vim-pathogen#runtime-path-manipulation.

jimbasquiat commented 7 years ago

This is completely confusing.... Why do i need to read and digest all the details of pathogen to have your plugin to work? Concretely, what action do i need to perform once i did "git clone https://github.com/Vimjas/vim-python-pep8-indent.git", in the .vim/bundle directory, using pathogen ? Thank you

blueyed commented 7 years ago

It's more about having your pathogen setup correctly after all.

It's not just about this plugin, but plugins in general.

Using a more sophisticated plugin manager like vim-plug helps you with that, but if you want to use pathogen, you have to use it correctly.. :)

jimbasquiat commented 7 years ago

my pathogen setup has worked well with all plugins except yours. While asking for a simple help on a setup with yours you werent able to explain it in simpler terms (albeit you managed to come back with even more confused explanations) and then give me this passive agressive crap. No need to pretend to be maintaining this package or even to reply to the issue thread if its to throw stuff like that at people.

blueyed commented 7 years ago

What is passive-aggressive from my side? I'm trying to help you while I am pretty certain that your pathogen setup is not working correctly (and told you at least twice). You have not shown your vimrc for example, nor a minimal vimrc which shows that it fails there. There are dozens or hundreds of users (according to the GH stars) where setup is not an issue.

blueyed commented 7 years ago

my pathogen setup has worked well with all plugins except yours.

Do you use other indent plugins?

blueyed commented 7 years ago

And it is pretty clear that your initial issue was about configuration of the plugin, while it only turned out later that it is not loading/working for your in general.

jimbasquiat commented 7 years ago

no i am not using any other indent plugin

blueyed commented 7 years ago

You can try using a minimal.vimrc (from this plugin's directory) via vim -Nu minimal.vimrc:

let &runtimepath=$PWD.','.&rtp
filetype plugin indent on

This should load the plugin.

As for using pathogen, it should work when properly configured, i.e. following https://github.com/tpope/vim-pathogen#runtime-path-manipulation.

jimbasquiat commented 7 years ago

So the .vimrc had to be modified? How are users supposed to guess that? Beside I tried your suggestion but it doesn't work. But I give up. I don't doubt your good faith in trying to provide a solution or your coder's skills, but you just seem unable to express yourself in a way that's clear.

redNixon commented 7 years ago

"filetype plugin indent on" is disabled by default on Ubuntu(possibly others to make it more vi like), that is probably what the issue is. Even with autoindent and smartindent enabled this plugin does not activate, it is not an obvious fix unless you know the internals of vim.

Quick blindfix for you is probably: echo "filetype plugin indent on" >> ~/.vimrc

If you added anything else in vimrc while debugging this I would take it out(not sure what setting the runtimepath could affect).

blueyed commented 7 years ago

@redNixon Thanks!

@jimbasquiat In case you want to give it another try, please let us know if that fixes it for you.

I think we should update the README to include this note then anyway. Strictly speaking only the filetype indent on would be required, right?

redNixon commented 7 years ago

Correct, I tested using Ubuntu 16.04 and a vimrc file with only filetype enabled and seemed to worked fine.

blueyed commented 6 years ago

Added a Troubleshooting section.