Tag Info

Hot answers tagged

39

Assuming that the variable python-indent is 4: M-x python-shift-right (C-c >) M-x python-shift-left (C-c <)


12

You can use the Edit / Line / Reindent from the edit menu. Or you could try adding this to your keybindings - Default file from preferences. { "keys": ["f12"], "command": "reindent"} Add a comma at the end of the code if you use the Default file instead of the users. Don't forget to select what you want indented. You could potentially just use Visual ...


9

indent-rigidly takes a prefix argument indicating how much to indent by, so C-u 42 C-x TAB indents by 42 columns, and since the default prefix argument is 4, C-u C-x TAB indents by 4 columns. If you want to select the region again, do C-x C-x afterwards.


9

An answer to this question on Stack Overflow indicates that 'cc' will replace the contents of the current line and enter insert mode at the correct indentation


5

Use the indent-rigidly command with a numeric prefix. C-u 4 M-x indent-rigidly to indent the region by four spaces, C-u -4 M-x indent-rigidly to remove four spaces.


4

Use the FileType autocommand event. See :h autocmd.txt for details. au Filetype python source ~/.vim/scripts/python.vim


4

You'll have to use two styles for this. For example you could change the "standard" style adding an indentation for the first line as described in the Microsoft Office Online help. Basically you'll have to go in "Indents and Spacing" and under "Indentation" click "First line" from the Special list. In the "By" box, set the amount of indentation. Then, ...


4

Emacs can do that: load the file into Emacs press Ctrl-space at the top of the file move the cursor to the bottom of the file press Alt-x and type untabify then return press Alt-x and type indent-region then return This will get rid of tabs and indent everything properly. If you need to do this more often and do not use Emacs as your editor, you might ...


4

Try the key binding C-x TAB (aka C-x C-i) which is bound to indent-rigidly, which indents a region by a single space. So, you'd indent by two by pressing that twice setting the region around the code you want to indent and typing: C-x C-i C-x C-i Or, you can pass a numeric prefix with C-u 2 C-x C-i To get 4 spaces, do a prefix with 4 C-u 4 C-x C-i ...


4

Press Ctrl+Shift+P, then I, and the option "Indentation : Reindent Lines" should come first. Press Enter and it's done.


3

It's not part of the language definitions. TextMate simply remembers the setting you last selected for documents of a given language setting. This setting is at the bottom of each window: The preferences are stored in ~/Library/Preferences/com.macromates.textmate.plist, in the arrays OakTextViewScopedTabSize (tab size) and OakTextViewScopedSoftTabs ...


3

While your well-intentioned search for a "command-line tool" is perfectly fine, unfortunately I think any truly viable solution to this problem is going to involve writing some code yourself, or at least leveraging existing code (such as an XML parser/generator). In the comments, have posted a few things you can try that may or may not get you the exact ...


3

Normally, the tab key inserts a tab character (character 9) into the document, which means that the insertion point is moved to the next tab stop. As you probably know, you can add/remove/adjust tab stops manually using the horizontal ruler. Among other things, you can make tab stops aligned in different ways. For instance, by default, in the header/footer, ...


3

If you use Vim there is Super Shell Indent : Improved indentation for shell scripts.


2

See this hint on the vim wiki for how to have correct indention even for empty lines. If you just want to keep the previous indent (ignoring what vim calculated as the correct indent) use let ind = indent(prevnonblank(v:lnum - 1)) like explained in a comment under the same wiki entry.


2

I've got this in my .vimrc: set comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-,fb:[+],fb:[x],fb:[-] If I remember correct, add this line in your .vimrc and the job will be done: set comments +=fb:- For a detailed explanation try: :help comments


2

If you have the n flag set in formatoptions (e.g. with set fo+=n), Vim already knows how to format lists with numeric bullets. formatlistpat (short name flp) is the regex Vim uses to match this, so what you need is to enhance that regular expression. This should do the trick for you (but only adds support for - bullets): set ...


2

You can also use Rectangles. Mark the beginning of the region with C-Space, go to then end of the region and then type C-xrtRET. Example: v----------------------- cursor position blabla bla bla bla bla bla bla bla bla bla C-SpaceC-nC-n blabla bla bla bla bla bla bla bla bla bla ^----------------------- cursor position C-xrtM-2RET blabla bla bla ...


2

Take a look at vim-indent-object.


2

C-x C-x mark the code and then M-x indent-for-tab-mode That's the save if you have pressed tab for every line.


2

Removing "set softtabstop=4" will also give you the backspace behavior you want, although it may break other behaviors you're used to.


2

in the menu bar, click LaTeX -> Customize AuCTeX -> Browse options. In there, go to the TeX Indentation group node and follow it. Within the group, activate the Latex Indentation node to make the options visible. Change the Latex Indent Level variable from 2 to 8; set for current session (to avoid messing thing up if they don't turn out how you hope, give ...


2

You can try Indent Guides, an open source plugin for Visual Studio 2010 that just adds vertical lines at each indent level. Edit : for VS2013, the Productivity Power Tools from Microsoft do the job perfectly !


2

What is the output of C-h k <backspace>? My guess is that you are running in a terminal and you can't actually type <backspace>, since it gets changed by the terminal to DEL. Running in a GUI, or binding py-electric-backspace to DEL should fix it.


2

One option is to use :set formatoptions+=n in conjunction with a custom formatlistpat. The n option reformats numbered lists, prepending the equivalent number of spaces on wrapped lines. It can be adapted for use in this case by defining an appropriate list leader: set fo+=n let &flp='\w\+> ' To illustrate the effects, consider the following ...


2

Check your ruler, it looks like the Hanging Indent (bottom triangular) marker is to the right of the First Line Indent (top triangular) marker


2

Okay, yes this is possible! First things first, go to your Pivot Table Tools - Options - Actions - Select and make sure Enable Selection is enabled. Next, go into your pivot table. When you move between fields you'll have a white plus sign type cursor and sometimes you'll get a black down arrow. When you get the arrow above the field you want to wrap, you ...


2

Yes it would be possible, you said you want these settings to only apply to the *.module and *.inc file then I would modify your configuration block to look like this: if has("autocmd") " Drupal *.module and *.install files. augroup module autocmd BufRead,BufNewFile *.module set filetype=php autocmd BufRead,BufNewFile *.install set filetype=php ...


1

Notepad++ Select the lines you want to "unindent" and press shift+tab Geany Select the lines you want to "unindent" and press shift+tab or ctrl+u gedit Select the lines you want to "unindent" and press shift+tab Codeblocks Select the lines you want to "unindent" and press shift+tab


1

It looks like Adobe Brackets has an extension called Beautify which can be found at https://brackets-registry.aboutweb.com/ and their GitHub location is https://github.com/drewhamlett/brackets-beautify



Only top voted, non community-wiki answers of a minimum length are eligible