eye
eye copied to clipboard
Feature request: search/run command by name
Emacs: M-x Vi*: ESC : Sublime Text: control-shift-p
http://docs.sublimetext.info/en/latest/extensibility/command_palette.html
I'm not sure to understand what it does, it seems there are diverse things in it. Sublime's command palette lists a few customizable commands or does it also add stuff to the menubar?
BTW, there's an REPL console in eye (though it really lacks autocompletion). Use this sample config:
import eye.widgets.eval_console
from eye.connector import *
from eye.helpers.qt_all import Qt
from eye.pathutils import getConfigFilePath
@registerSetup('eval_console')
def consoleConfig(console):
console.line.setHistoryFile(getConfigFilePath('eval_console.history'))
@registerShortcut('window', 'F2', Qt.WindowShortcut)
def popConsole(win):
if not hasattr(win, 'console'):
console = eye.widgets.eval_console.EvalConsole()
win.console = win.addDockable(Qt.BottomDockWidgetArea, console)
win.console.show()
win.console.widget().setFocus()
In this REPL, there are a few variables set, for example editor
points to the currently focused editor widget, window
points to current window, eye
is already imported.
Is it something like that you're looking for? Or are you rather looking for a place to type simpler commands like saveFile
, instead of Python code like editor.saveFile()
?
It is something like this, but both simpler and easier to use
- simpler in that it is not possible to to compose anything, even arguments can not be given
- easier as there is
autocomplete
- or rather select as you type
It is a replacement for menu.
E.g. if I want to replace tabs with spaces in a file, I type ctrl-shift-P ind
here ind
will match the command "Indentation: Convert to Spaces" or ctrl-shift-P wr
for "Word Wrap: Toggle".
ind
and wr
are substrings with character omissions of the selected command names.
It is highly usable: compare these key-presses with remembering which menu to look for these commands and navigating there. It also makes commands discoverable, as typing something usually lists more related commands/operations.
If this popup bases its completion entries, I have a thing I'll push to experimental branch. However, the standand menus are quite empty. Another helper could fill the menus with a set of common tools (like the ones you used as example: word wrapping etc.).
(Sorry for the wrong closing, I reopened is) Another possibility would be to propose completions based on slot names in the editor widget for example.
I think this feature is most useful if all of the editor functionality is available through it (thus needs to search/filter the command registry), and menus/shortcuts only provide a well selected, greatly reduced set of functions.