Auto-convert tab to 4 spaces in TextWrangler? - tabs

Is there a preference in Textwrangler to redefine a tab as 4 spaces? In Vim this is set expandtab in the vimrc, but I don't know how to set it in TW besides clicking "Detab" when I'm done editing the document.
Thanks,
Kevin

Go to "Preferences" -> "Editor Defaults" -> "Auto-expand tabs," and then set tabs to 4 spaces. Then restart TextWrangler for changes to take place.

For docs that already exist you have to hit the "Text Options" button in the top of the editor window of the open document. In older versions, it's the button that looks like a "T" with a light switch next to it; with newer versions, it's a gear "⚙" icon. In that drop down there is the "auto-expand tabs" as well.

in version 4.5.5, there is 'Text -> Detab...', which pops up a requester for how many space per tab, preset for 4.

Go to Edit -> Text Options and tick Auto-expand tabs. This will make all the new tabs to change to spaces.
To change all current tabs to spaces as well, go to Text -> Detab and hit Detab.
Hope that helps!

For Mac, another easy way to check and enable "Auto-expand tabs" is to hit the gear button on top left.

You can also use "Normalize Options..." to set the text options of an already-open document to whatever you have set in your Preferences. This is useful for dealing with pre-existing code.

There are two places you need to set the settings for this to work. One is for previously opened documents, and the other for all documents to be opened or created in the future.
The Settings
set "Auto-expand tabs" to checked
set "Tab width" to 4
Previously Opened Documents
Click the "Text Options" button. It is in the top left of the editor window directly above the document view of the open document. In newer versions it's a gear "⚙" icon. And in older versions it is a "T" and light switch.
New Documents
go to preferences menu: BBEdit -> Preferences
choose "Editor Defaults" from the side-bar in Preferences

Related

How can I move focus from any other tool window to text editor in PhpStorm?

For an example after I go to the Project tab with Alt+1 shortcut and open specific file with pressing Enter I then want to go and edit content with single shortcut. Is there any way to do it?
There is couple of things that I can use, but neither does exactly what I want:
Ctrl+Tab - that opens the switcher and selects next file in switcher instead of allowing me to edit file with single Ctrl+Tab
Ctrl+E or Ctrl+Shift+E do different things but basically the result is simmilar as above
What I want is to simply edit the file after opening it with keyboard from Projects tab (without using mouse).
How can I move focus from any other tool window to text editor in PhpStorm?
Just press Esc key.
Works in every tool window. For built-in Terminal though you can (may have to) configure different shortcut for such action (as Esc can be needed there).
For an example after I go to the Project tab with Alt+1 shortcut and open specific file with pressing Enter I then want to go and edit content with single shortcut. Is there any way to do it?
Use F4 for that (action is available in context menu and called Jump to Source).
Ctrl+Tab - that opens the switcher and selects next file in switcher instead of allowing me to edit file with single Ctrl+Tab
Just press and release it quickly: it works just like Alt + Tab on Windows. If you keep modifier key pressed (Ctrl in this particular case) it will keep the Switcher window opened.

PyCharm to open new file in the tab right next to the right of current-active tab?

Currently with PyCharm 2016.03, when I open new file, the tab opened at the end of the tab pane.
I google and see one old post about this - it was a open right next feature in the past and changed to open at the end now.
So if you know, if possible, how to switch tab-opening mode in PyCharm, please share!
That config is no longer available (at least in the 5.0.5 Pro version). You still have tabs appearance and closing policy configs under Editor -> General -> Editor Tabs menu, but no opening policy.
As a workaround you can left-click and drag a tab in whichever position you like.

PhpStorm single click preview like Sublime Text

At my new job I have to work with PhpStorm. I come from Sublime Text, and what bothers me most about PhpStorm is the lack of a single click preview of the files. In stead, it opens the files for editing and adds them to active tab, leaving me with A LOT of useless tabs.
I searched here on StackOverflow and Google, but I seem to be the only one who is annoyed by this. In Sublime it goes to edit mode only after a double click. Is there a setting or plugin to have it like in Sublime?
It's a native feature these days:
Settings... / Editor / General / Editor Tabs / Opening Policy > check "Enable preview tab"
on version PhpStorm 2022.3.2
Single Click To Open File
By default to open a file in phpstorm you have to double click it. I found this to be very annoying. Luckily you can change this to be a single click.
Steps:
Click the gear icon.
Make sure 'Autoscroll to Source' is checked
Make sure 'Autoscroll from Sourcce' is checked
http://www.ryanwright.me/cookbook/phpstorm/single-click-open-file
There is no such functionality currently available. I may only suggest to use View | Quick Definition to preview files.
Other than that: https://youtrack.jetbrains.com/issue/IDEA-130918 -- watch this ticket (star/vote/comment) to get notified on progress.
Welcome in late 2019 - we got a plugin for this now:
Plugin: https://plugins.jetbrains.com/plugin/12778-quick-file-preview
Plugin Source: https://github.com/SeeSharpSoft/intellij-file-preview
IntelliJ Issue: https://youtrack.jetbrains.com/issue/IDEA-130918
Don't forget to disable the "Autoscroll to Source" Feature, to get the full advantage of the plugin!
The closest you'll get right now is to enable 'Scroll To Source', however this will actually open the file in another tab, it will not be a preview.
Open the Project, Favorites, etc. side bar (cmd + 1 or ctrl + 1)
Click the gear in the top right
Select 'Scroll to Source'
Note 'Scroll to Source' can be enabled at the same as 'Scroll from Source', just make sure if you click on one file you wait until the sidebar catches up to click another, otherwise the sidebar will autoscroll back and forth between the two. You'll have to click one of them to break that loop.
Read more on JetBrains' website
This is now available as a native feature in the latest version: 2020.3!
See this comment on the YouTrack link someone posted above https://youtrack.jetbrains.com/issue/IDEA-130918#focus=Comments-27-4500169.0-0
Also on the 2020.3 feature list under User Experience there's a mention of "preview tab" here https://blog.jetbrains.com/idea/2020/12/intellij-idea-2020-3/

Sublime Text 2 + Emmet - not expanding correctly

I have installed emmet for Sublime Text 2...
And it works - kind a strange way
When I enter d it starts showing possibilities, but as soon as I press: : emmet shows completely different tip:
b (bottom)
So I need to press esc to close fuzzysearch box and press tab to allow Emmet do what it is used to do.
Dow, if I don't press esc before the tab key the resould is: d:bottom:, is I press esc, it desoults in correct: display:block.
Do you have an idea how can i fix that?
This happens because Emmet tries to respect default ST completions and due to lack of API support to properly handle built-in snippets: https://github.com/sergeche/emmet-sublime#tab-key-handler
By default, Emmet will not expand abbreviations by Tab if there’s autocomplete popup visible to allow users to work with default ST completions and snippets. You can override this behavior:
Go to Preferences > Settings — User
Add "disable_tab_abbreviations_on_auto_complete": false option. Make sure this file contains valid JSON.
After that everything should work fine, but you’ll no longer able to complete items from autocomplete popup with Tab key, use Enter key instead.
I had a similar issue but my fix was different to that of the accepted answer.
I had to go to Preferences > Settings — User and remove "emmet" from the ignored packages and everything started working again!

How does one set the tab width in Komodo Edit?

This is a rather simple done in Emacs or NEdit, but I could not find how to setup tab width in Komodo Edit (I use 7.1).
Komodo has a bug in the setting "Allow file contents to override tab settings". Here is the fix:
Go to: Preferences → Editor → Indentation. From this screen, turn off "Allow file contents to override tab settings" as this is very buggy and can cause Komodo to override your settings (hence the need to change the per-file-setting in other people's solutions)
From this screen, check all other tab settings, and check the per-language settings in the drop down.
Now close all files and after reopening them the settings should now take effect permanently. This is a better solution as you will no longer have to go to each file and constantly reset the per-file indent settings.
Go to the preferences page.
Depending on your display style - GTK style I think, the plus sign or what it is in front of the entry "editor" might be unvisible.
Either double click on "editor" to show the subtree, click into the free space in front of it (like sinking submarines), or search for indent or tab in the search bar.
There you will find the indentation setup details.