Tag Info

Hot answers tagged

37

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


11

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

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


8

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.


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

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

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


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 ...


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

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


3

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


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, ...


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

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

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

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 ...


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

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

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

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 ...


1

HTML tidy will do this. It produced <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="generator" content= "HTML Tidy for Linux/x86 (vers 11 February 2007), see www.w3.org" /> ...


1

In Emacs' Javascript mode, the character } is bound to function js-insert-and-indent. You can bind it to just insert itself by putting this code into your .emacs startup file: (defun my-js-mode-hook () "My personal Javascript mode hook." (local-set-key (kbd "TAB") 'tab-to-tab-stop) (local-set-key (kbd "RET") '(lambda () (interactive) (newline 1))) ...


1

To find out the syntax in use, you want to know the value of the variable b:current_syntax. Type the following Ex. command :echo b:current_syntax b:current_syntax says what syntax vim loaded for the file. If you set the syntax manually, such as with the command :ownsyntax cpp which sets the syntax to c++ syntax, then you want to know the value of ...


1

Find the file, normal.dotx on your computer and right click to open (not new). This will open the template Word uses when creating new documents. Insert a numbered list. Right click and go to adjust list indents. Select the indent spacing you like. Delete the numbered list and save the changes to normal.dotx. My normal document is stored in this ...



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