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

Indentation is lost (ipython) #18

Closed
kprimice opened this issue Mar 9, 2017 · 8 comments
Closed

Indentation is lost (ipython) #18

kprimice opened this issue Mar 9, 2017 · 8 comments

Comments

@kprimice
Copy link
Contributor

kprimice commented Mar 9, 2017

Hi,

Thank you for this plugin, I am already an heavy Nvim-R user. Wanted to try this one for python.

My problem is when I try to send this code:
2017-03-09-07 49 39

It fails because of the indentation:
2017-03-09-07 49 46

I tried to use an external terminal (with tmux) or the nvim buffer. But it fails everytime.

Thank you for you help

@jalvesaq
Copy link
Owner

jalvesaq commented Mar 9, 2017

Perhaps this is a problem with 'expandtab'. Did you set this option in your vimrc? Anyway, some people have reported incompatibility between vimcmdline and ipython.

@kprimice
Copy link
Contributor Author

Yes, here are the options I use:

au BufNewFile,BufRead *.py \ set tabstop=4 | \ set softtabstop=4 | \ set shiftwidth=4 | \ set textwidth=79 | \ set expandtab | \ set autoindent | \ set fileformat=unix

I just checked: Indeed it is an ipython related bug.

@jalvesaq jalvesaq changed the title Indentation is lost Indentation is lost (ipython) Mar 10, 2017
@jalvesaq
Copy link
Owner

Thanks for the feedback. I am going to add a warning when cmdline_app["python"] value is "ipython".

@jalvesaq
Copy link
Owner

The solution for the indentation issue is:

let g:cmdline_app = {"python": "ipython --no-autoindent"}

But I noted other issues:

  • ipython starts in a state similar to Vim's Normal mode, and I have to press either i or a to go to insert mode before sending lines from Neovim to ipython.
  • Neovim terminal does not auto scroll when lines are sent.

@smilesun
Copy link

@jalvesaq , when I set this cmdline_app, I got

Error detected while processing function VimCmdLineStartApp[18]..VimCmdLineStart_Tmux:                                                    
line   23:                                                                                                                                
E121: Undefined variable: usage                                                                                                           
E15: Invalid expression: usage: split-window [-dhvP] [-c start-directory] [-F format] [-p percentage|-l size] [-t target-pane] [command]^@

@jalvesaq
Copy link
Owner

@kprimice is the author of #27

@smilesun
Copy link

well, even if I delete the definition of cmdline_app, there is no complain from vim side, but still, the indentation is wrong when I leader+space a python function

@smilesun
Copy link

I am using python-mode/pythonmode and vim-scripts/indentpython.vim

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

No branches or pull requests

3 participants