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
Related
I have a project where my files are in "lisp-case" (hyphen delimited) and I would like to use the filename as a variable in a live template, but it must be converted to CamelCase first.
I found out that you can set the expression fileNameWithoutExtension() under "Edit Template Variables" and there is also a function called camelCase() which should be able to turn my filenames into CamelCase. But I cannot figure out how to combine those two. I tried doing camelCase(fileNameWithoutExtension()) but that does not work, unfortunately.
Is it possible to achieve this some other way?
camelCase(fileNameWithoutExtension())
It's a correct syntax.
Is it possible to achieve this some other way?
Please ensure that Skip if defined checkbox is checked for this variable.
If I try to wrap fileNameWithoutExtension() inside camelCase() and press enter to save the entry the window is closed but the change is not saved
It's an IDE bug (https://youtrack.jetbrains.com/issue/IDEA-132965 -- supposed to be fixed in current 2017.1.x version).
In any case: either press Enter before leaving the field ... or click on OK button straight away (you may then reopen this window to do further changes).
Also, when editing the field it's rendered like a select box which is kind of weird. Maybe it's a bug in this specific version. I'm on PhpStorm 10.0.4 for Mac.
Not a Mac user here .. but it is an editable drop-down box indeed (it lists all possible functions).
i'd like to ask a question about SublimeText configuration. Somehow i managed to disable the dots line matching two brackets or code block.
This is what i mean link
I'd like to know how to enable it again.
Switch the parameter draw_indent_guides to true in the user settings. It should be the default value though, maybe one of your plugins managed to disable it?
Sublime Text 2 allows me to autocomplete the class or id attribute, but it is not adding the ="" automatically when I start typing class=" ".
I want to type in <div c and at the moment the c is typed the autocomplete should show the option class="" not just class but also the equal and the quotes. The same goes for id="" and style="".
I am sure this is fairly simple to do; just installed the software today.
Thanks
First, install the Sublime package manager Package Control to allow for the easy installation, removal, upgrading, and otherwise managing third-party plugins and packages. Next, after restarting Sublime, hit CtrlShiftP (Windows/Linux) or ⌘ShiftP (OS X) to bring up the Command Palette. Type pci to get to Package Control: Install. Hit Enter, then start typing in HTMLAttributes until it shows up. Hit Enter again to install it. You'll now have a much greater selection of auto-completions, including the class, id, and style elements you were looking for. So, inside a tag start typing class and when the autocomplete appears, hit Tab. The rest of the word class will complete, along with an equals sign and a pair of double quotes. Your cursor will automatically be positioned inside the quotes, and when you're done entering the value(s) you want just hit Tab again and your cursor will jump outside the quotes, ready to close the tag or enter the next attribute.
To see what sort of completions are available to you, check out the source here or go to Preferences -> Browse Packages... to open up your system's file explorer, then enter the HTMLAttributes directory and open the HTMLAttributes.sublime-completions as a JSON file in Sublime. If a trigger contains a \t (tabstop) character, the part before it is the completion, and the part after it is what appears in the autocomplete menu on the right. In contents, $1, $2, and so on are successive places where hitting Tab will land your cursor. $0 is the exit point. Something like ${1:form_id} gives a default value, and something like "draggable=\"$1${1/(t$)|(f$)|(a$)|.*/?1:rue:?2:alse:?3:uto/i}\"$0" is an autocomplete regex, so that if you type t inside the field, it autocompletes to true, if you backspace and hit f it becomes false, and a becomes auto.
This package is really great at supplementing the standard HTML autocomplete that ships with Sublime, but unfortunately it doesn't necessarily play nicely with Emmet, formerly known as Zen Coding, as some of the completions may clash with Emmet's abbreviations. Of course, as always, YMMV.
Good luck!
How do I disable the multiple cursor feature in Sublime text 2? I googled, but found only videos on how to use it, not how to not use it..
If you have multiple cursors just press ESC to return to a single one.
#starwed - how did you accidentally enable it?
Open your preferences/keymap and
search for split_selection_into_lines, find_under_expand and find_under_expand_skip (these are the main methods to enable multiple cursors)
then assign a key combination that you are unlikely to press by accident.
According to this link on sublime forum, you can't directly but you can disable the keys that trigger it.
ctrl-shift-l (that's el)
and ctrl-left click
To disable ctrl-shift-l I don't know whether it's possible in the user file(the keymap/bindings file in the user directory), but you can in the default bindings file(the keymap/bindings file in the default directory) .. either removing the line or rewriting it e.g. adding +u
preferences..packages
C:\Users\user\AppData\Roaming\Sublime Text 2\Packages\Default\Default (Windows).sublime-keymap
Change this line adding a +u so it'd get triggered by ctrl+shift+l+u rather than ctrl+shift+l. I doubt you would accidentally do ctrl+shift+l+u or at least not as often as you might accidentally do ctrl+shift+l !
{ "keys": ["ctrl+shift+l+u"], "command": "split_selection_into_lines" },
Also, to disable the ctrl-left click, that link suggests doing this, and I tried it and it works. (though I I like the feature and the binding!)
Preferences..browse packages..User
C:\Users\user\AppData\Roaming\Sublime Text 2\Packages\user
Create this file there, in the form Default (<your OS>).sublime-mousemap
Default (Windows).sublime-mousemap
it corresponds to the file of the same name in the default directory. but is in the user directory and takes precedence, overwriting settings in the default directory one.
(settings in the user directory one will take precedence and overwrite settings in the one in the Default directory) C:\Users\user\AppData\Roaming\Sublime Text 2\Packages\Default (Windows).sublime-mousemap )
So, in C:\Users\user\AppData\Roaming\Sublime Text 2\Packages\user\Default (Windows).sublime-mousemap
paste
[
{
"button": "button1", "count": 1, "modifiers": ["ctrl"],
"press_command": "drag_select"
}
]
that disables ctrl-left click trigger of multiple selection.
Note- I use ctrl and left click, and don't recall if I have triggered it accidentally, but perhaps your thumb is touching the touchpad sometimes(making a left click) when you hit ctrl.
in your config Preferences -> Settings - User add line "multi_select": false
In the end your config should look smth like this:
{
"color_scheme": "Packages/Color Scheme - Default/railscasts.tmTheme",
"detect_indentation": false,
"font_face": "Droid Sans Mono",
"font_size": 14,
"ignored_packages":
[
"Vintage"
],
"scroll_past_end": false,
"tab_size": 2,
"run_on_save": true,
"save_on_focus_lost": true,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"word_wrap": true,
"multi_select": false
}
I was looking how to disable that feature myself... found nothing, and just thought to play around with config... on linux it worked!
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/