Sublime text 2 forces uppercase Ll' in comments - sublimetext2

This is really strange. In my EmberJS code, I have comments for the properties. For whatever reason all the l's in all my comments in every *.js files are uppercase. If I try to change them to lowercase, I get upper case. If I remove the comment wrapper, the 'l' becomes lower case. If I restore the comment wrapper, it automagically becomes upper case again. This does not happen on my colleagues installation of Sublime. I have version 2.0.2 build 2221. If I copy the text into Notepad, the l's are lower case. Here's an example:
This is the property that determines if the textarea is disabLed
#property disabLed
#type booLean
#default false
disabled: false,
Remove the comment wrapper:
This is the property that determines if the textarea is disabled
#property disabled
#type boolean
#default false
disabled: false
Its not a camelcase issue from what I can see, as I have some comments where there are multiple l's and they're all uppercase, for example ceLL. It only happens with the l's.
Does anyone know what's going on? Where is the setting that says, Don't change the case of my l's?

I met strange Sublime's behaviours as well. It might be really tricky to define the causes.
I think it would be better not to spend too much time on it and just reset ST to default settings:
https://www.sublimetext.com/docs/revert.html
GL!

Related

How to make VS Code's auto-complete more strict?

I love Visual Studio Code, but its Intellisense auto-complete drives me crazy and I make more typos with it than it helps. So I feel I must be using it wrong.
The problem is very hard to explain, so I have a screenshot below:
I typed in thi. I would hope/expect/want that autocomplete would only look for anything to autocomplete that contains thi in consecutive order. But it does not. Instead it looks for anything with the letters t, h, and i in them. They needn't be next to each other, nor does the thing of interest even need to start with t.
I would like to "tame" auto-complete to only find consecutive letters. Is there a way to do this? (I use Python, Javascript, and SQL for most of my work, but I'm hoping the config is cross-language.)
Ideally, I would like the auto-complete to (a) require all letters be consecutive, (b) not require the thing of interest to start with those letters, and (c) ignore upper/lower case. But by far the most important issue to me is resolving (a).
The issue you are having is a feature added in November 2017 update. There is currently no way to turn off fuzzy autocomplete, but the issue is currently open on GitHub and the setting to change this behavior will be added.
In the meantime you can tweak your autocomplete with these settings:
"editor.wordBasedSuggestions": false,
"javascript.nameSuggestions": false,
"editor.snippetSuggestions": "bottom" / inline, none
"editor.suggestSelection: "recentlyUsedByPrefix"
From official docs:
When using the last option, recentlyUsedByPrefix, VS Code remembers which item was selected for a specific prefix (partial text). For example, if you typed co and then selected console, the next time you typed co, the suggestion console would be pre-selected.
This lets you quickly map various prefixes to different suggestions,
for example:
co -> console and con -> const.
And maybe:
"editor.quickSuggestions": {
"other": false,
"comments": false,
"strings": false
},
It doesn't solve your problem completely, but it's the closest you can get without digging through VS Code source and creating an extension.

How to disable Auto Complete in Sublime Text (2&3)

I understand there are a few questions surrounding the auto_complete function in Sublime Text.
However, I have not been able to disable the auto_complete function in the Sublime Text settings (I've tried both Sublime Text 2&3). I just get the "Error trying to parse settings: Unexpected trailing characters in Packages/User/Preferences.sublime-settings:5:1" error when inputting the {"auto_complete": false,} command in user settings.
Would love to turn off the setting, but can't find a way to. Any help much appreciated!
Put , after font-size:17 like:
{
"font_size":17, //note a comma here after 17
"auto_complete": false,
}
This is the first result that pops up when Googling "Sublime Text disable autocomplete", and none of the answers answered my question completely, so I'd just like to add to the existing answers that if you are setting auto_complete to false and still having problems with Sublime Text auto-closing parentheses and brackets, then you also need to set auto_match_enabled to false. This should solve the problem. So as a whole, here is what I have:
{
"auto_complete": false,
"auto_complete_commit_on_tab": false,
"auto_close_tags":false,
"auto_match_enabled": false
}
There are two options:
1: In Preference --> User, Check if TernJS plugin is Installed. If Yes, Unistall it from your editor (i.e. Sublime Text Editor).
2: In Preferences --> User, check for the auto_complete and change it to false
"auto_complete": false,
Restart Your Editor(Sublime Text)
This should be the option.
{
"auto_close_tags":false
}
My solution to this problem was to change "auto_complete_commit_on_tab" from true
to false. This way you aren't turning off autocomplete altogether, but the autocompletion is ignored unless you hit the tab key.
In preferences, user settings, add:
{
"auto_complete_commit_on_tab": false
}
I came here looking for a Python-related solution, where autocompletion worked well for variable names etc. but was quite slow for methods etc.
So, to disable Python syntax autocomplete:
open the command palette with ctrl + shift + P
enter Package Control: Remove Package and select it
enter Jedi and remove the Jedi autocomplete package

Flex 4 ColorPicker not editable

I've got an application with several ColorPickers in them - they're just used as-is, no data provider-derived colours or anything - with editable = true. However, the textfield used to display/input the hex code for the selected colour is greyed out and uneditable. I can't find any help for this, only a plethora of tutorials telling me to set editable as true, which obviously doesn't work.
Have also tried binding to data array of colours, but this does nothing except stop the field from being greyed out (though no text appears or can be edited inside it).
Does anyone know how I can stop this happening? Thanks in advance.
It works for me just fine in Flex 3.6A and 4.6.0. Is there maybe something else your doing that is non standard? What theme are you using? Can you produce a test case that demonstrates the issue? (PS: sorry, I can't add comments yet)
Works for me with Flex 4.10.0 (can edit the text field):
<mx:ColorPicker id="_bgPicker" showTextField="true" />
Appears a dodgy font (set as the default for the entire application) was not showing up in the hex panel - forcing it to Arial did the trick. Probably more a result of the crazy set of fonts we have to use than anything but worth doing if anyone else gets a problem like this!

How do I configure Emacs html-mode to behave like TextMate's default HTML bundle?

A friend of mine is considering switching to Emacs from TextMate. He is used to TextMate's default HTML editing mode which has 4-space tab stops and inserts tab characters (i.e. it does no auto-indenting by default). It also allows completion of open HTML tags with "Cmd-Shift->". Any ideas?
I think these settings should do the trick:
(defun my-html-mode-hook ()
(setq tab-width 4)
(setq indent-tabs-mode t)
(define-key html-mode-map (kbd "<tab>") 'my-insert-tab)
(define-key html-mode-map (kbd "C->") 'sgml-close-tag))
(defun my-insert-tab (&optional arg)
(interactive "P")
(insert-tab arg))
(add-hook 'html-mode-hook 'my-html-mode-hook)
An explanation of the settings in 'my-html-mode-hook is as follows:
set the tab width to 4
force tabs to be inserted (as opposed to spaces)
force the TAB key to insert a tab (by default it is bound to do indentation, not just insertion of tabs
'sgml-close-tag is the command that inserts a close tag for you, and this setting gets you the keybinding you want
I'm having a bit of a brain freeze and couldn't figure out the simple way to have the TAB key insert a TAB character, so I wrote my own. I don't know why a binding to 'self-insert-command didn't work (that's what normal keys are bound to).
The last line just adds the setup function to the 'html-mode-hook. The key bindings really only need to be run once (as opposed to every time html-mode is enabled), but this is a little easier to read than using 'eval-after-load. It's use is left as an exercise to the reader.
I don't know about emacs's HTML modes specifically, but I can answer about general editing:
by default, Emacs doesn't autoindent, so nothing to do here.
Emacs preserves tab characters, unless you explicitely ask them changed (check out tabify and untabify). Their width is determined by the buffer-local tab-width variable. M-x set-variable, (setq...), customize at will.
you should be able to get the behavior you want with the tab key by setting indent-line-function to tab-to-tab-stop, setting tab-stop-list to (4 8 12 16...) and indent-tabs-mode to t.
Setting indent-tabs-mode allows Emacs to insert tab characters when indenting. The tab-to-tab-stop is a form of indentation that only goes to specific positions in the line, which we set to match the expected behavior of the tab characters by setting tab-stop-list to the multiples of 4.
About completion, the only thing my muscle memory tells me is "C-c C-e", but I don't remember for sure which major mode it's supposed to go with. The closest I see in the list is sgml-close-tag, bound to C-c /
A bit of politics: don't use tab characters, especially if you use widths not equal to 8. It only results in unpredictable results

How do you default to Soft Tabs while programming in Textmate?

My "Soft Tabs" setting in TextMate is not sticky. After I restart TextMate, I often have to set the option again for the same file. How can I make this setting the sticky default across all files?
For Textmate 1
After doing some research, I found that you can set TextMate 1 to default to using Soft tabs.
In the "Shell Variables" area of the Advanced preferences pane, add a new entry with the name TM_SOFT_TABS and a value of YES.
From that point on, TextMate should default to Soft tabs, though for at least one or two languages, I had to specify the number of tabs. After I did that, it seemed to stick for everything I did.
For Textmate 2
To set the options in TextMate 2 add following settings to your ~/.tm_properties file:
softWrap = true
tabSize = 4
softTabs = true
Check these links for more information:
FAQ: https://github.com/textmate/textmate/wiki/FAQ
Settings: http://wiki.macromates.com/Reference/Settings
From the documentation:
4.11 Using Spaces Instead of Tabs
TextMate can use spaces instead of tab
characters. This is done by clicking
the “Tab Size” pop-up in the status
bar and enabling Soft Tabs.
This setting will only affect the
current language and all languages
with a common root that do not have
the option set yet. The same applies
to the state of spell checking, soft
wrap and the actual tab size.
When soft tabs are enabled, TextMate
will for the most part act exactly as
if you were using hard tabs but the
document does indeed contain spaces.
Looks like Textmate sets it for the current language, but I think Textmate analyzes the files you open and adjust its settings to match the files. You can convert the tabs in your files to spaces and vice versa in the "Text" menu.
You don't need anything special. You just need to adjust your Python bundle.
Go into the 'bundle editor' and find Python. Open its caret, and scroll down and find the 'miscellaneous' preferences. It should read something like:
{ decreaseIndentPattern = '^\s*(elif|else|except|finally)\b.*:';
increaseIndentPattern = '^\s*(class|def|elif|else|except|finally|for|if|try|with|while)\b.*:\s*$';
shellVariables = (
{ name = 'TM_COMMENT_START';
value = '# ';
},
{ name = 'TM_LINE_TERMINATOR';
value = ':';
},
);
}
These are the environmental variables. What you want is the environmental variable TM_SOFT_TABS to be set to 'YES'. Simple enough, Just insert a new assignment like so:
{ name = 'TM_SOFT_TABS';
value = 'YES';
},
...and voilà! Your tabs will be soft every time you use Textmate in Python mode.
For all the different enviornmental variables you can set, check out the manual here:
http://manual.macromates.com/en/environment_variables.html
... in addition to #Ivan Sviatenko's answer
For Textmate 2, language specific softTabs default
edit ~/.tm_properties, for example:
# Default editing configuration
#
tabSize = 2
softTabs = true
softWrap = true
# Defaults for c
#
[ source.c ]
softTabs = true
tabSize = 8
# Defaults for python
#
[ source.python ]
softTabs = true
tabSize = 4
There is also a drop down menu at the bottom of TextMate, which allows you to set your Tab Size value and whether to use Soft Tabs, and it is sticky.
Create an alias icon for TextMate on the desktop.
Drag the file to be opened to the icon.
The file should now be opened in TextMate.
Set the soft tab with the status bar options.
Close TextMate.
Repeat step 2 - 5 for each file type you want the soft tab settings to be remembered.
Every time you want to open a file type with TextMate drag that file to that desktop icon.
Do not open more than one file type at the same time, the second file type opened will get its soft tab settings erased.
This is the only way I've been able to get a consistant behavior on the soft tabs settings.
I found a popular TextMate plugin called "TabMate," which has solved this issue for me. While it requires me to add a tabline to every file, TextMate adjusts my tab settings to be whatever is described in the tabline.
Also, technically gs's answer above should work but for some reason it isn't working for me and I found no other way to set SoftTabs is the default setting for ALL languages forever.
TabMate: http://konstochvanligasaker.se/tabmate/