Remap Sublime Keymap in EmacsProEssentials - sublimetext3

The EmacsProEssentials Sublime Text 3 package has a bug in the keybindings:
{"keys": ["ctrl+\\"], "command": "undo"}
Undo is not ctrl+\ in Emacs it is ctrl+/.
The developer is aware of the issue, but I'd like to remap the key in the meantime.
How do I remap the key in a package in Sublime Text 3?

When Sublime loads package resource files, it loads similarly named files from all packages and combines them together. This is done in a specific order, and in that order the User package is always last so that your customizations take precedence.
So the easiest thing to do would be to just use Preferences > Key Bindings (this is under Sublime Text if you're on MacOS) and put the fixed binding in your custom key bindings.
Once you do that, your version of the binding will be active (as will the old one from the package), so things will work the way that you expect.
When the upstream author updates the package you can remove your customized binding, although presumably this is not vital if you're both going to make the same change.
The more involved version of the fix involves using PackageResourceViewer to find and open the packaged version of the sublime-keymap and modify it there, thus overriding it and fixing it at the source.
However if you do that, when the author updates the file your change will still take precedence without any notification otherwise, so you'll be effectively locking yourself into your modified version, which could conceivably cause troubles down the line.
You can mitigate that by also installing OverrideAudit, which will tell you when this sort of thing is happening, but fixing it in your User package is probably the better way regardless.

Related

VSCode Vim multiple cursors

I have looked everywhere and I am still unable to switch off this 'feature'!
I've been using vi and, later, vim, since the 80's and I have never had need of multiple cursors, nor can I see a use for them.
:<range>s/search/replace/ does everything I need so this new feature is infuriating beyond words, especially as I've no idea how to switch it off when it seemingly-randomly appears.
Would someone be wonderful enough as to tell me how to banish, remove, consign-to-history the multiple cursors feature in VSCode Vim 1.12.4, please?
I believe this issue is specific to the plugin. I experienced it with the HTML plugin recently, and I'm assuming you have the same problem with HTML files, but the same principle should apply to other plugins as well. You just have to find the setting.
In the VS Code settings, there is an option that reads:
HTML: Mirror Cursor On Matching Tag
You can uncheck the box there to disable the feature. Or you can go to the settings.json in your local repo (inside the .vscode directory), or the equivalent global file, and add/modify the following field like so:
"html.mirrorCursorOnMatchingTag": false
That should take care of it for you.

Coqide Key Bindings Bug(?)

I'm having a bit of an odd problem... recently I've been having some odd situations arising whilst using CoqIDE, namely:
I can't type the letter "v" without holding down the windows/super key.
Pressing backspace moves the focus to the previous tab if multiple windows are open, I can't delete things with it. CTRL+backspace works for deleting chunks though.
The first of the two (may have) happened after I changed my keymap from US to GB but switching back and forth hasn't solved the problem.
Running ARCH linux, everything is up to date and no other applications are affected, I don't have sticky keys on.
Thanks for any suggestions!
EDIT: Tried a reinstall, didn't help...
Solved Edit: Yep, you're completely right I seem to have done some super-fast rebind without noticing. I also learnt that package manager will essentially never touch .config files as they're generated by the app and so aren't under the manager's jurisdiction. Solved!
CoqIDE key bindings and other preferences are stored in .coq/ or .config/coq. They are not deleted on uninstall and are shared if you have various versions of Coq installed at the same time (and this may be a problem).
If you are not worried about losing any specific preferences that you configured, I would advise to just delete this directory and let CoqIDE create it fresh again.
If you are worried, then just have a look at the files (quite long but also quite readable). For instance:
cat .config/coq/coqide.keys | grep "tab"
yields the following on my machine:
; (gtk_accel_path "<Actions>/View/Previous tab" "<Alt>Left")
; (gtk_accel_path "<Actions>/View/Next tab" "<Alt>Right")
PS: your problem might have arisen because key bindings are so easy to redefine in CoqIDE that you can do it without noticing: just open a menu (example: View), hover some option (for instance: Previous tab), type something on the keyboard (for instance v) and voilĂ  v is now a shortcut for Previous tab.

Sublime 3 autocomplete recommends vague internal functions in Julia

So I'm using Sublime Text 3 w/ Julia, and I have mixed feelings about the autocomplete. A lot of the time it recommends these vague internal functions that aren't even close to the word I'm typing in. For example:
http://puu.sh/iWyrB/7293a9928f.png
Even if I've used dict_t as a variable before, I have to type in most of the word before it recommends dict_t; it seems to happen once it runs out of internal functions to recommend.
So it seems like this is coming from the IJulia package. I like using that package, but moments like the picture above are frustrating. Any advice?
Edit:
To disable "insert completion on tab" add this to you User Preferences:
// By default, auto complete will commit the current completion on enter.
// This setting can be used to make it complete on tab instead.
// Completing on tab is generally a superior option, as it removes
// ambiguity between committing the completion and inserting a newline.
"auto_complete_commit_on_tab": false,
To disable the auto-complete popup (but still be able to insert completion on tab):
// Enable auto complete to be triggered automatically when typing.
"auto_complete": true,
I'm afraid you cannot remove only the completions coming from Sublime-IJulia and keeping all default completions without changing any code in the Sublime-IJulia package.
If what you need is genera Julia support for sublime (syntax highlighting, auto-indent etc), I recommend switching from Sublime-IJulia to Julia-sublime. Sublime-IJulia had it's last commit in January 2015 while Julia-sublime is actively maintained. Most notably in this case, Julia-sublime does not give autocomplete for all standard functions.
Note that Julia-sublime, like other syntax packages in sublime, does not not strive to be an IDE substitute. These features should be separated, not all users wants both.
For running Julia code from within Sublime with IDE-like functionality there is currently no good alternative, the packages I've found are outdated and have quite a few issues.
When it comes to developing and testing code, I like keep a REPL open in the terminal and just re-include() my code in there. I find this to be flexible and efficient. More on this in the Julia FAQ: http://docs.julialang.org/en/release-0.4/manual/faq/#how-can-i-modify-the-declaration-of-a-type-immutable-in-my-session).
Disclosure: I am the maintainer of Julia-sublime. If you encounter issues or feel that something can be improved, I encourage you open an issue.

Sublime Text: disable all packages

I'm using Sublime Text 3083.
When I load a file with several thousand lines and try to edit it, it gets amazingly un-responsive to the point that adding/removing even one character takes it seconds.
I have > 20 packages installed and I need a way to disable all of them at once, to check if this issue is package related or o not.
I've searched around and I know that you can disable packages one by one but that's not good when lots of packages are installed. According to this post in the sublime forum, there is no way to do this but the post is rather old (and also not an official statement)
So, is there a way to do this? Perhaps with a package or a --no-packages flag or some other trick?
BTW: for the sake of completeness, after applying the solution I found that there were two packages responsible for the lag: GitGutter and WordHighlight.
The best thing I can think of is to keep a list of the package names that you can copy and paste into your preferences file in the "ignored packages" section. If you have any sort of linter or code intel that might be the culprit if it's several thousand lines.
"ignored_packages":
[
"SublimeCodeIntel",
"Vintage"
]
Another thing to try would be to just make a copy of your Packages/Users/Package Control.sublime-settings file, then edit the original and delete all the listed packages there and restart ST3. Definitely make that copy first in case it screws up.
Gabriel reports he ultimately solved the issue by copying the list of installed packages out of the Packages/Users/Package Control.sublime-settings file and paste them into the ignored_packages section of his preferences file.
Packages can be simply disabled as follows
Press Ctrl+Shift+P to open Command Palette
Type disable, select Package Control: Disable Package
This will give the list of all the Installed Packages, click on the one which you want to disable.
That's it. And you can enable disabled package anytime, just type enable in step:2.

Why is AngularJS package for Sublime Text blocking default buffer words in completion?

I am using Sublime Text 3, and I installed the very useful angularJs package which gives great code completion for both JavaScript and HTML files, and I really don't want to disable it, but it stops the default word completion of Sublime Text.
In Preference->Package Settings->AngularJs I set the disable_default_js_completions option to false in both user and default settings, but it still messes with the word completion.
Found other people with the same issue :
https://github.com/angular-ui/AngularJS-sublime-package/issues/69
The only fix seems to be to install a TernJs package for auto-completion to replace the default functionality.
The issue is reported, and you have a temporary solution, i.e., TernJS package installation. I had to install that too in order to see buffer words and such appear in the autocomplete list, it wasn't folding them in even at the lower priority. The completions that show in Show Completions now appear after installing TernJS. I don't think there is a known hotfix, I've contributed to the report, we'll need to wait on a bug fix, or just keep using TernJS. You probably want to install Emmet and Better Completion packages if you haven't already, as well. Between those, AngularJS and TernJS packages, you're pretty covered, minus any specialities you require.

Resources