How do I treat spaces as tabs in SublimeText? - editor

I want my files to be saved as 4 spaces per tab. However, when navigating through the file, I want 4 spaces to be navigated over as if it was a tab. How do I do that?

Set tab_size equal to 4.
// The number of spaces a tab is considered equal to
"tab_size": 4,`
and set to true
// Set to true to insert spaces when tab is pressed
"translate_tabs_to_spaces": false,

I think there's no way to do that without plugins.
I personally use custom binding for navigation and almost never use the arrows, and use command/ctrl/alt + left/right arrows to navigate by words, when you'll get used to this, you'll become very productive. You can then ctrl+right arrow to get from the beginning of the line to the first indented character.

Related

Tab replaced to space automatically in Delphi11

I'm using delphi 11.0(28.0.42600.6491).
Typing some tabs in code editor, and after a short pause, typing any character.
Then, I found tabs are replaced to space automatically.
And it seems to be happened when input character after already exists line.
My problem is like GIF image(animated).
I don't want that. tabs must be tabs strictly.
Is there any setting or way to do that?
The IDE Settings "Use tab character" and "Keep trailing blanks". Note you would also need to uncheck "Cursor through tabs" to see the cursor jump otherwise it will go space by space through tabs.
The "Keep trailing blanks" setting is really "Keep trailing whitespace" and deletes any tabs and spaces at the end of lines after a short delay. The cursor stays past the end of the line so if you type something it then puts in spaces.
This is a bug (in my opinion) that started in 10.4. I have reported it as RSP-36776: https://quality.embarcadero.com/browse/RSP-36776

How to change TAB to SPACEs and set their amount in Brackets editor?

I'm using Brackets editor http://brackets.io/ and I'd like to change behavior when I click TAB key it will put 4 SPACEs instead and also I'd like to change amount of spaces added.
Is it possible to do this adjustment?
In the lower right corner of the editor, you'll see text saying Spaces: 4 or the like.
You can click Spaces (or Tab) to toggle between those and click the number to change it.

Codemirror tabs to spaces

I'm using Codemirror in an app. Has anyone found a way to make it uses spaces when using tab? When I press enter to go to a new line it uses spaces. However, if I backspace to the beginning of the line, and use a tab instead, it inserts it as a tab instead of 2 or 4 spaces or whatever I have it set to. Then, when I view the rendered view, my code has like 8 spaces for indentations in the areas where I used the tab key. Is there some option or way to convert actual tabs to spaces in Codemirror?
I'm also using the codemirror-rails gem, which may not be as up-to-date as the actual Codemirror version.
I would override the default tab key functionality and replace it with this function.
Add this to your Codemirror configurations.
extraKeys: {
"Tab": function(cm){
cm.replaceSelection(" " , "end");
}
}
Demo jsfiddle

Alignment of the TabBarControls in a TabSet

we're using smartGWT for our web application. An the main page is a tabset that shows different tabs. What I want to do is do a button to the tab set with the setTabBarControls method which then is alligned to the left instead to the right. So it would somewhat look like the current Firefox version.
Is there a possibility to change the allignment of the TabBarControls? I couldn't find any.
If you want to create something like the Firefox corner button, just use TabSet.addChild(). That will place the button at the upper left, and you can use setLeft/setTop to move it elsewhere. If you want the control to appear to the left of the tabs, set a layoutStartMargin on the TabBar to leave space for it.

read-only Textbox

The form window(chat window) that i am creating for a lan messenger is similar to the one in google talk with two textboxes. What i need to do is to transfer characters typed in the lower textbox(textbox2) to the upper textbox(textbox1 which is read-only) when i click the submit button without showing that textbox1 is read-only because the characters are appearing in grey.please help with code if possible.
Use a label for this instead of a textbox. If the only thing it is doing is display the characters and not a direct edit, you won't lose any functionality and the text would not be greyed out...
If you're going to use a Texbox, set it to Locked. That shouldn't gray the characters out. Otherwise in KeyDown/KeyUp events, set the e.Handled property to true (which will tell the box that you want to handle the input yourself and don't want the message to filter down).
That oughta do it for you.

Resources