Keybinding overview for SublimeText 2? - sublimetext2

I think the SublimeText 2 editor has a lot of potential, but I'm struggling to learn the keyboard shortcuts, because unlike Vim it doesn't have comprehensive documentation, or a command to show you what each key combination is bound to.
It's frustrating going through the .sublime-keymap files and find that 4 different packages all rebind ctrl+t for their own purposes.
So, is there a way to view all the keybindings in an organised way: by key, by package, by command - with descriptions?
Currently my hack is a bash function that shows me all the keymap lines that mention a certain key. For example, *sublime_keys '+t'* finds me all the bindings that use the letter "t"
function sublime_keys {
find ~/.config/sublime-text-2/Packages \( -name 'Default (Linux).sublime-keymap' -or -name 'Default.sublime-keymap' \) -print0 | xargs --null ack-grep -C1 "\".*$*"
}
I've tried KeymapManager but it is very limited - only shows bindings from some of the top-level non-default packages without descriptions or package context. I suppose I could take time to improve on it.
Is there a package that does this better?

I am using a package called KeyCue on OSX. I find it very helpful because I have the same difficulty in remembering all the keystrokes.
http://www.ergonis.com/products/keycue/
On the Mac, when you press and hold the "Command" key for 1 sec, a pop up window will appear and show you all the keystroke for Sublime Text 2, and all other software also. I think it scans through all the menu and show you the keystrokes.
You can also add custom keystrokes. I have added for zencoding and color picker as the keystrokes are from installed package and KeyCue cannot pick those up automatically.
The package is not free (Euro20). Well worth the price as I use it frequently and saves me lots of time.

Related

Variable completion in Octave GUI Editor

I mean to get completion of variable names, function names, function argument names, and keywords in Octave, similarly as in Eclipse CDT, e.g.
This works in the Command window, but not in the Editor, where only keywords and functions can be completed.
Official documentation indicates <Tab> and <M-?> should work.
If I press <Tab> I get a Tab character inserted.
And I do not know which is the Modifier key. Plus, I have a Spanish keyboard, so the question mark is obtained with <Shift>+', so I am not sure how will it work if I find the correct M key.
How can I enable it for the Editor?
Notes:
Help -> About shows
GNU Octave, version 4.4.1... configured for "x86_64-w64-mingw32"...
Using Octave portable under Win 10.
I found files <octave-dir>\etc\inputrc.default and <octave-dir>\share\octave\4.4.1\m\startup\inputrc
There is a file C:\Users\user1\.config\octave\qt-settings containing
...
[editor]
...
codeCompletion=true
...
codeCompletion_threshold=2
codeCompletion_keywords=true
codeCompletion_octave_builtins=true
codeCompletion_octave_functions=true
codeCompletion_document=false
codeCompletion_case=true
codeCompletion_replace=false
...
tab_indents_line=false
This refers to the speed of readline for Octave under Win. I have speed issues with readline of my Portable Msys2 under Win 10, but this is a different issue.
On the top of the editor widget, select Edit > Preferences.
Select the Editor tab.
Look for Auto Completion.
Select Match words in document.
There are essentially no references that mention completion specifically in the editor.
The only one I found, from 2014, stating that:
There is no editor completion on all known function names, nor on
parameter lists of known functions. There is an open bug report
requesting function name completion in the editor, see
http://savannah.gnu.org/bugs/?41371.
The GUI is an experimental new feature in the 3.8 release, please
consider helping to improve it for 4.0 by joining the maintainers
mailing list or participating on the bug tracker (even submitting
feature request bugs if you want).
So at that time it was not available.

Zsh Shell Smart Completion (ala PhpStorm)

While I'm familiar with a few of the options Zsh provides for autocompletions (i.e. the standard Tab menu-complete and the Ctrl+i completion option), but I've been spoiled with the type of search/completion you can get out of PhpStorm.
For example, in a stock Laravel project in PhpStorm you are able bring up the Search Everywhere dialogue (Double Shift), type in wbp, and have the editor complete that to "welcome.blade.php". The closest I can get to that functionality with Zsh would be to type in wb, place the cursor between the two letters (w|b), and use Ctrl+i.
I have searched around and found a few custom completion scripts, but none that have this type of functionality.
So the big questions are:
1. Is it possible to have smart completion functionality in Zsh like it exists in PhpStorm?
2. If so, how does one go about enabling it?
If it's relevant, I'm using OhMyZsh on OS X 10.12.
The following setup works for me (put them in ~/.zshrc):
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
unsetopt CASE_GLOB
zstyle ':completion:*' completer _complete _match _approximate
zstyle ':completion:*:match:*' original only
zstyle ':completion:*:approximate:*' max-errors 2 numeric
Reference: zprezto

Why doesn’t this hotkey configuration for Sublime Text work?

I have configured Ctrl+B to open a file in my browser, but when I press Ctrl+B when the editor is focused on some HTML page, it doesn’t work. Why not?
more details:
what makes me confused is that this ctrl+b works if it is combined to other command such as close, but why not openInBrowser command, so does st2 support this command, how to know whether it support this command or not?
Edit 1:
you may find openInBrowser command in this link http://www.sublimetext.com/docs/commands
Edit 2
#MattDMo what is the corresponding name of command then, i cannot find them in its official document http://www.sublimetext.com/docs/2/
The command you are looking for is open_in_browser, not openInBrowser (which is an old Sublime Text 1 command). So, your keymapping should work with that. However, if you weren't already aware, CtrlB is already mapped to the Build command, used for running build systems. It's not a very good idea to overwrite built-in commands, especially one as important as this one, so I'd suggest changing your keybinding to:
{ "keys": ["ctrl+alt+b"], "command": "open_in_browser" }
This isn't in use by any of the default Sublime commands, although some plugins may use it.

Set syntax for a specific file name in Sublime Text 2/3

I have a program that uses a file called user.cfg to get its user defined configuration settings. The odd thing is that they chose the syntax for this file to be Tcl (it's not odd that it is Tcl, it's odd they chose the .cfg extension instead of .tcl). So, when I open this file in Sublime Text, it doesn't know what syntax highlighting scheme to choose.
What I would like to do is set the syntax highlighting for user.cfg to Tcl, but not all .cfg files to Tcl.
I have seen this question which is very similar to mine, except in that case the special file name had no extension so Sublime Text knew to assign Ruby highlighting to only that one file. Unfortunately, I have an extension so the solution given there will not work for me.
Is there any known way to get Sublime Text base a highlighting scheme on the full filename?
Take a look at the ApplySyntax plugin.
The previous answer is completely true; however, I thought it would be better to have it here all in one place rather than going on another webpage to find the list of procedure to apply it
Sublime text 3
This is found here
Ensure Package Control is installed. Instructions are found here.
In Sublime Text, press Ctrl+Shift+P (Win, Linux) or Cmd+Shift+P (macOS) to bring up the quick panel and start typing Package Control: Install Package.
Select the command and it will show a list of installable plugins.
Start typing ApplySyntax; when you see it, select it.
Restart to be sure everything is loaded proper.
Enjoy!

vim: project wide auto suggestion

When using eclipse upon pressing control space, it show a list of all possible matching function calls irrespective of the file locations.
Is there a similar plugin for VIM ?
I am using vim7.4 and shougo's neocomplete (https://github.com/Shougo/neocomplete.vim). I actually switched from shougo's neocomplcache to this plugin. I am so far satisfied with the auto-complete feature provided by the nice plugin.
I don't write php code though, I made two screenshots of one of my python project.
screenshot 1,
left side is a module tmux_cmd.py, right side I have imported the module, when I type the module name, the plugin suggested me all functions/variables in that module.
screenshot 2,
in same module, when I type keywords (load) in this case, the plugin shows me all possible functions. I opened tagbar on right side to show functions in the current module. I can press <TAB> to choose the one I want, or keep typing something else if I just want to have something else, like loadnothing.... In the screenshot I pressed <tab>
You only need to index your project with ctags (see :help tags and :help ctags) and vim's built-in omni completion will do what you want for PHP when you press <c-x><c-o>.
Vim doesn't do auto-completion, though, you'll need a plugin for that like the one cited by kent but there are others.