Unintentionally Sublime-text different setting for two file - sublimetext2

I have problem with sublime tab indent.
I have to file: reply.php and view.php
==============================================
view.php:
Tab indents is replaced with spaces.
One tab equals with 2 space.
==============================================
reply.php:
Tabs is not replaced with spaces
One tab equals 4 spaces.
==============================================
Why? I want reply.php indent and setting. How I can fix this?

Go to View -> Indentation and make sure that Tab Width is set to 4, then click on Convert Indentation to Tabs. Double-check the other options there to make sure nothing is set that you don't want, such as Indent Using Spaces.
To make sure that PHP files are always displayed with tabs, save the following as Packages/User/PHP.sublime-settings:
{
"tab_size": 4,
"translate_tabs_to_spaces": false
}

Related

turning off auto completion of matching brackets in Adobe Brackets

I have only just started using Adobe Brackets for HTML development. As a programming newcomer, I am still not savvy enough to look in all the right places to change defaults. When I type a beginning tag in Brackets (HTML) like < p >, the editor automatically adds the ending tag < /p >, assuming that I will enter text between the two tags. So I get < p > < /p >. Often I want to put the tags around existing text and do not want the auto completion of the end tag upon entering the beginning tag. How do I change the default in Adobe Brackets so that I do not get the auto-completion of the end tag?
You can do this by setting the dontCloseTags option in the Brackets preferences file.
Go to the Debug menu and select Open Preferences File. You will see a side-by-side view of defaultPreferences.json on the left and brackets.json on the right. These are Brackets' default settings and your settings file, respectively. defaultPreferences.json lists all the possible options that can be set and their default values, but the file itself can't be modified.
Look at the comments in defaultPreferences.json for closeTags. What we care about is dontCloseTags.
Set dontCloseTags inside of closeTags. For example, my defaultPreferences.json file looks like this:
{
"fonts.fontSize": "12px",
"fonts.fontFamily": "'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace",
"themes.theme": "dark-theme",
"useTabChar": true,
"tabSize": 5
}
And so I would set it up like this, adding a comma after the last entry before starting a new one below:
{
"fonts.fontSize": "12px",
"fonts.fontFamily": "'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace",
"themes.theme": "dark-theme",
"useTabChar": true,
"tabSize": 5,
"closeTags": {
"dontCloseTags": ["p", "img"],
"whenOpening": true
}
}
I set whenOpening to true because I found that sometimes Brackets won't autocomplete any tags without me asserting that value, even though it's the default.
Press Ctrl + S to save your preferences and then close the two files.
Click on the icon next to the settings icon next to the Left heading in the sidebar, then select No Split. This will remove the two columns.
I hope this helps, and have fun looking at the other settings in defaultPreferences.json, since Brackets won't add a front-end for those settings for a while (it's in the works). Just make sure to match the syntax exactly as it is in defaultPreferences.json (except for the comments). JSON also wants commas between stuff inside {} and [], but do not add a trailing comma after the last item in each grouping. If the option you want is inside another option (for example, dontCloseTags is inside of closeTags{}), you need to include the main option and its grouping symbol thing.
Just use a boolean "false" for the value of the field name(s) if you want to shut that object to not function at all
"closeTags": {
"whenOpening": false,
"whenClosing": false
}
This sets the value of the closeTag field with Boolean defined values of two more objects which results with all auto-completing, closing tags to stop working.
After saving your changes, be sure the new file is loaded by restarting the application. All save does is saves your edits, any changes will not be seen until you restart the application.

Disable Marks Column from Sublime Text 2 Gutter

Is there a way to disable the marks column in the gutter on the left side of Sublime Text 2?
I was able to disable the fold_buttons using the following setting in the settings file:
"fold_buttons": false
In case it isn't clear, I'm talking about the whitespace reserved for the mark (dot) shown below:
Find "Settings - User" from Sublime Text 2 menus (its location depending on the platform). When you click it, it will open a new, empty or almost empty file. Here is a sample portion of it:
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"gutter": true
}
The setting you are asking for is the "gutter". Make it false and you will achieve what you asked for.
Things to note:
The curly braces at the beginning and end are important.
Each setting has a comma after it. Except the last one.

sublime text2 text replace pattern in all files except one or more files

I want to find and replace a particular word in all my project files except one or more files in sublime text. I am not sure how to specify that.
SO basically I want to exclude
/Uses/project_name/css/my_file.css
/Uses/project_name/css/my_file2.css
Menu: Find-> Find in Files...
Sublime is gonna open a new panel at the bottom, you just need to fill the fields.
Find: the_word_you_are_looking_for
Where: your_project_directory
Replace: the_word_that_is_going_to_replace_the_old_one
Then click on the button ... located on the right side of the field Where:, and after click in the option Add Exclude Filter; replace the -*.txt with my_file?.css or my_file*.css

Shortcut to paste multiple lines - Sublime Text 2

I am using Windows 8 OS
I have some projects where I repeatedly add the same tags to different types of elements, but the format of how the elements are presented through code always stays the same. I'm looking for shortcuts that will help me do these tasks quickly. Is there a shortcut that lets you add the same tag for multiple lines that you specify? I know you can do (CTR + F3) To select clone tags and change all of them, but I want to add tags to elements that previously had no tag. Is there a way you can make your own shortcuts for your tags, like if I type in "li" It will automatically put in "" and all I have to do is hit enter?
Here is an example of the elements and tags I added:
<ul>
<li type="square">Extra Grip
<li type="square">Made of Titanium
<li type="square">Built in Selsoft Processor
<li type="square">Portable</ul>
<b>MBS:</b> 44 kN (10000 lbf)<br>
<b>Weight:</b> 1 lbs 13.2 oz (828 g)<br>
<b>Length:</b> 14.40" (36.6 cm)<br>
<b>Width:</b> 3.75" (9.5 cm)<br>
<b>Height:</b> 1.00" (2.5 cm)<br>
<b>Material:</b> Titanium
Ctrl+C, Ctrl+X and Ctrl+V let you copy/cut/paste lines if you don't select anything. So, Ctrl+X doesn't "delete" a line, it cuts it. To delete a line, the default shortcut is Ctrl+Shift+K :)
Highlighting a bunch of lines then hitting Cmd (Ctrl?) +Shift+L gives you multi-cursors on each line. I do that, followed by Cmd + Right arrow (End?) to get easily get a cursor at the end of a series of lines to simultaneously type something after each.
Ctrl+Shift+J expands the selection to the indentation level of the current line. So if you want to select a block of code with the same indentation it's really useful.
Alt + F3 select all occurrences of current word for multiple editing. Very useful.
A few written about in more detail: http://whiletruecode.com/post/7-handy-text-manipulation-tricks-sublime-text-2
Have you tried to make your own snippets? It may not be exactly what you are asking for, but could be another way to do it.
Try the New Snippet command in the Tools-menu and add the following and save it:
<snippet>
<content><![CDATA[
<li type="square">${1:Item} ${2:}
]]></content>
<tabTrigger>li</tabTrigger>
</snippet>
This will enter an <li>-tag in the current file if you type li and then press Tab.
You can also add a <scope> tag to limit it to HTML-files.

Sublime text 2 - zen coding change key binding

I need the TAB to switch between highlights in my css snippets.
I'm using css snippets and #FFF+tab =>
I want to change zen-coding key biding from tab to CTRL+, (comma)
I've changed (the last line in default.sublime-keymap) from "tab" to "ctrl+,"
The new command works (ctrl+,) but I still have the tab transforming #FFF to a div.
HOW to completely remove the tab from zen-coding without affecting the TAB from Sublime?
Thanks
(I don't know what I've did wrong the first time but now it works)
so do change the key biding to zen-coding in sublime text 2 just change the last line in Preference > ZenCoding > Bidings > default.sublime-keymap
from
"keys": ["tab"]
to
"keys": ["ctrl+,"]
(or whatever new key you want)