indentation

Indenting in VIM with all the files in Folder

最后都变了- 提交于 2019-11-27 02:50:59
I have a folder containing hundreds of TTL (TeraTermLanguage) files. Now I wanted indent all these files. I have created teraterm.vim for indentation and I open a file using VIM and do "gg=G" and whole file gets indented properly. But is there any way, where I can indent all the files in folder. I wanted to do with help of Shell. But in VIM I couldnt pass file indent command as the argument to VIM. Please suggest which is the best way I can do indentation to all the files in VIM. Much simpler than scripting vim from the bash command line is to use vimscript from inside of vim (or perhaps a

Set 4 Space Indent in Emacs in Text Mode

放肆的年华 提交于 2019-11-27 02:25:24
I've been unsuccessful in getting Emacs to switch from 8 space tabs to 4 space tabs when pressing the TAB in buffers with the major mode text-mode . I've added the following to my .emacs : (setq-default indent-tabs-mode nil) (setq-default tab-width 4) ;;; And I have tried (setq indent-tabs-mode nil) (setq tab-width 4) No matter how I change my .emacs file (or my buffer's local variables) the TAB button always does the same thing. If there is no text above, indent 8 spaces If there is text on the previous line, indent to the beginning of the second word As much as I love Emacs this is getting

How do I force Sublime Text to indent two spaces per tab?

谁说胖子不能爱 提交于 2019-11-27 02:20:23
Is there a way to force Sublime Text 2 to always indent two spaces per tab when working with Ruby files? I know that indentation can be set under the view -> indentation menu option, but it does not stick. Every time I open a new file and hit tab, it reverts back to four spaces. DGM If you want it for all files, go to Preferences -> Settings - Default/User . But as several comments below indicate, Syntax Specific settings can limit it to just the languages you choose. To limit this configuration to Ruby files, first open up a Ruby file in the editor, and then go to Preferences -> Settings -

How do you auto format code in Visual Studio?

冷暖自知 提交于 2019-11-27 02:20:16
I know Visual Studio can auto format to make my methods and loops indented properly, but I cannot find the setting. Bogdan Verbenets To format a selection: Ctrl + K , Ctrl + F To format a document: Ctrl + K , Ctrl + D See the pre-defined keyboard shortcuts . (These two are Edit.FormatSelection and Edit.FormatDocument .) For Visual Studio 2010/2013/2015/2017 Format Document ( Ctrl+K , Ctrl+D ) so type Ctrl+K , AND THEN Ctrl+D as it is a sequence Format Selection ( Ctrl+K , Ctrl+F ) Toolbar Edit -> Advanced (If you can't see Advanced , select a code file in solution explorer and try again) Your

What indentation is required for a case statement within a let statement?

不想你离开。 提交于 2019-11-27 02:09:28
Working in haskell, found odd behavior, stripped it down to bare bones This Works a :: Bool a = case True of True -> True False -> False But when I try b :: IO Bool b = do let b' = case True of True -> True False -> False return b' I get ghci>:l test.hs [1 of 1] Compiling Main ( test.hs, interpreted ) test.hs:16:14: parse error on input ‘->’ Failed, modules loaded: none. So I try c :: IO Bool c = do let c' = case True of True -> True False -> False return c' And this works. What? Why? Why do I need an extra indent in this case? I can't find anything on this, probably because these keyword are

Hitting Tab in Visual Studio selects block instead of adding indentation

只愿长相守 提交于 2019-11-27 02:06:59
问题 I am using Visual Studio 2015 and ReSharper 2016.2 and I have this strange behavior, that I probably activated (accidentally). When having the cursor in a line before the first word, hitting the Tab-key indents the line correctly: When the cursor is inside of any word inside the line, hitting the Tab-key selects the word or block. But the desired behavior would be to indent at the cursor (e.g. split a word into two words, if the cursor was inside of the word Stream after the letter r): Does

Python's interpretation of tabs and spaces to indent

霸气de小男生 提交于 2019-11-27 01:55:56
I decided, that I learn a bit of Python. The first introduction says that it uses indentation to group statements. While the best habit is clearly to use just one of these what happens if I interchange them? How many spaces will be considered equal to one tab? Or will it fail to work at all if tabs and spaces are mixed? Jonathan Leffler Spaces are not treated as equivalent to tab. A line indented with a tab is at a different indentation from a line indented with 1, 2, 4 or 8 spaces. Proof by counter-example ( erroneous, or, at best, limited - tab != 4 spaces ): x = 1 if x == 1: ^Iprint "fff\n"

Android Studio “This file is indented with tabs instead of 4 spaces”

蹲街弑〆低调 提交于 2019-11-27 01:46:19
问题 I keep getting a message popping up in Android Studio whenever I edit a file. It says, "This file is indented with tabs instead of 4 spaces." I can click "OK" or "Indent with 4 spaces" and I know there are ways to change to tabs (see this question), but it is a little annoying to have this message pop up all the time. I even tried clicking "Show Settings" and then "Use tab character" but I still got the message popping up. Why does it always come up? What can I do about it? Note: My Java

How to indent multiple levels of select optgroup with CSS?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 01:37:45
Just trying to indent optgroup blocks by nesting depth really, I've tried a general margin-left rule, nested elements then trying to apply the same rule, tried padding-left ... is indenting like this possible? It seems elementary :P In the example below, the optgroup labelled 'client2_a' should be indented more than the others, because it is nested inside 'client2'. http://jsfiddle.net/Tb5Rc/5/ eliel 8/29/2016 Edit The original answer below is no longer functional in modern browsers. For those who still need to use a tag instead of doing magic with HTML lists, a better solution was found on

How to set HTML Auto Indent format on Sublime Text 3?

那年仲夏 提交于 2019-11-27 01:18:56
问题 I have a question while I'm writing HTML code on Sublime Text 3. I just want to set auto indent format of HTML. For example, when I write p tag like under code, the indentation works like that. <p> Hello world! </p> But I want to write like under code instead of above. <p> Hello world! </p> And not only p tag also ul, ol and etc. How can I set auto indent format of HTML on Sublime Text 3? 回答1: One option is to type [command] + [shift] + [p] (or the equivalent) and then type 'indentation'. The