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

tabs/indenting #586

Closed
j-fu opened this issue Oct 18, 2020 · 10 comments
Closed

tabs/indenting #586

j-fu opened this issue Oct 18, 2020 · 10 comments
Labels
one day Closed because we won't work on it soon, will be opened again later.

Comments

@j-fu
Copy link
Contributor

j-fu commented Oct 18, 2020

Hi, two issues with tabs:

currently, the tab key inserts a tab character (which in the editing widget seems to be equivalent
to 4 spaces).

  • I am a "spaces" guy in the tabs vs spaces flamewar. So I would prefer to have spaces instead of tabs for indenting. Kind of supported also by https://github.com/invenia/BlueStyle .

  • Once this is settled ;) there is the question of the role of the tab key. In emacs (yes, on that side of the emacs-vs-vi debate :) ), the tab key just indents in the right way according to the surrounding code. Super cool for python, but very nice for all languages. Would this be possible here ?

I understand that these are very personal taste preferences, so there may be reasons that in Pluto preferences should be different from mine. But at least it would be good to support some automatic indenting of code. May be it is possible to have a hotkey (like C-m for toggling markdown) which fixes code indenting in a cell.

@pbouffard
Copy link
Contributor

Maybe https://github.com/domluna/JuliaFormatter.jl could be useful?

I for one would happily allow such a tool to auto-format everything.

@fonsp
Copy link
Owner

fonsp commented Oct 22, 2020

I don't want to implement a formatter yet (maybe in 6 months), but codemirror has built in auto-indent and you could add a shortcut for that.

@pbouffard
Copy link
Contributor

I don't want to implement a formatter yet (maybe in 6 months), but codemirror has built in auto-indent and you could add a shortcut for that.

Just added #599 🙂

@fonsp
Copy link
Owner

fonsp commented Oct 28, 2020

We will revisit this later - we don't do any customization right now.

@fonsp fonsp closed this as completed Oct 28, 2020
@fonsp fonsp added the one day Closed because we won't work on it soon, will be opened again later. label Oct 28, 2020
@SimonEnsemble
Copy link

following up on this, would be awesome to convert tabs to spaces!
every time I paste a worked out function from Pluto into terminal (vim), then push to github, the spacing is messed up! 👁️

@clarkevans
Copy link

It'd be nice to let Pluto know to use 4 spaces instead of TAB character.

@s-celles
Copy link

s-celles commented Mar 1, 2024

Same problem here. Copy/paste code from VS Code or directly from Github to Pluto.jl ends up bith spaces/tabs mixed up. Issue opened #2831

@ederag
Copy link

ederag commented Mar 5, 2024

That would not solve the copy/paste from various sources issue, but
as there is no consensus over tab vs space (I like the current defaults),
it might be nice to honor .editorconfig if possible
(and as most standalone editors support it, it would make concurrent editing in both Pluto and the editor smoother).

@mbauman
Copy link

mbauman commented Jul 9, 2024

It'd be great if we could revisit this default — pretty much every single Julia style guide recommends spaces over tabs.

@j-fu
Copy link
Contributor Author

j-fu commented Sep 23, 2024

bump :)

This also would be helpful when editing "in parallel", i.e. having the notebook open in the browser and at the same time in the editor (which works great with emacs...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
one day Closed because we won't work on it soon, will be opened again later.
Projects
None yet
Development

No branches or pull requests

8 participants