Questions tagged [autoindent]

34 questions
23
votes
4 answers

Is there an HTML auto-indentation feature or plugin for Sublime Text (aka prettify/beautify/format)?

For example, something to change:

to:

...that works on full pages and snippets. The built in Edit > Line > Reindent…
22
votes
2 answers

How can I indent the wrapped text in Notepad++?

How can I change Notepad++ setting so that wrapped lines gets indented automatically? Right now I have something like this: some text that wraps to next line some indented text that also wraps What I want to get is: some text that wraps…
mythealias
  • 390
  • 1
  • 2
  • 9
19
votes
4 answers

Autoindentation in Sublime 2 text editor

Is there an auto indentation option in Sublime 2? In Visual Studio I can press Ctrl+K+D to indent everything so the code is structured nicely. Is there a shortcut in Sublime 2 to do the same?
Kim
  • 191
8
votes
3 answers

How do I make vim's autoindent not drop trailing spaces?

In some text editors (e.g. Kate, gedit), when auto indent is enabled, pressing return twice will leave a trailing whitespace (which I want): if (code) { .... ....| } While others cater to the coding standard where trailing spaces (even in blank…
Joey Adams
  • 2,318
7
votes
1 answer

How to improve Adobe Brackets auto indentation

I'm looking for a way to auto-indent my html code using Adobe Brackets. Currently when I selected the whole code (Ctrl+A) and use the inbuilt indent option using Ctrl+], The entire text moves a tab forward. What I'm looking for is to properly auto…
T J
  • 172
6
votes
3 answers

Autoformat for Perl in Vim

I've got a piece of badly formatted Perl code: if ($a==1){ &err_report("$a"); while($b!=1){ &err_ok(); } } I want to reformat it in Vim. After using the command gg=G, the code is formatted as: if…
Marslo
  • 1,241
4
votes
1 answer

eclipse indent tabs with spaces not working

I have the settings for this done correctly. However for certain cases, like when I declare or initialize an anonymous class, and eclipse puts out auto-generated code, all of that is still tab-spaced. Is there a workaround to this?
deostroll
  • 1,895
4
votes
2 answers

Change
  • autoindent options in VIM
  • By default Vim seems to not want to indent the contents inside of
  • tags, though it autoindents properly for most other HTML tags. For example, if I start with this code:
    • foo
    • bar
    and have vim autoindent it I…
  • Herms
    • 9,992
    4
    votes
    1 answer

    AUCTeX and tabs

    I've been tinkering for hours and I'm becoming desperate. I want tabs! I like tabs, I see no advantage in using spaces and therefore I ident with tabs (alignment is done with spaces though). But I can't get AUCTeX (or LaTeX-mode for that matter) to…
    Surma
    • 43
    4
    votes
    1 answer

    Visual Studio Code always converting to Spaces

    I'm trying to get my VS code to always indent with tabs. I use a .eslintrc.json file with the rule indent: ["warn", "tab"], this works for some files. I also have a .editorconfig file with indent_style = tabs. In my user settings, I have…
    3
    votes
    2 answers

    Disable automatic alignment for Python code in emacs

    Right now, in emacs' python-mode line continuations are aligned to the end of the previous line, as follows: this_is_a_list_of_django_urls = ('', url(r'^admin/?', include(admin.site.urls)), …
    quanticle
    • 896
    3
    votes
    2 answers

    vim: remove previous code indentation and convert to another

    I have a c project with multiple files (more than 100), the codes are written in Whitesmiths style, but I want to change them into K&R style indentation. Is it possible to do using vim in an automated way ? For example I have a emacs-lisp script to…
    ramgorur
    • 209
    3
    votes
    3 answers

    How to configure backspace to delete 1 char with ts,sw,sts & et configured in vim

    I have the following in my vimrc: set tabstop=8 set shiftwidth=4 set softtabstop=4 set expandtab set backspace=indent,eol,start set autoindent This does what I want: insert spaces only, never tab characters; pressing tab inserts 4 spaces;…
    Lewis
    • 31
    • 2
    2
    votes
    1 answer

    How to cut and paste tabbed lines with auto indent set to on in vi

    Not sure which stack exchange group this question goes so please move to the correct one if this is the wrong one. What's happening is if I highlight something with tabs/indents from one window/browser and want to paste it into vi, the formatting…
    2
    votes
    1 answer

    Notepad++ XML Auto Indent + Tag Closing

    I'm migrating a question I posted on stackoverflow to here as it may be more relevant. Here is the question: I'm looking for a way to code XML (mxml, specifically) in Notepad++ such that it follows the behavior of the "Indent by Fold" plugin -…
    funseiki
    • 339
    1
    2 3