I am about to create a web version for a LISP-like command line interpreter. What I really need is tab completion. That is, something like completing the input in a form like "(command ...)". Here the command begins with a parenthesis. Does xterm.js offer a way to do that with minimal effort?
Related
When opening a Python file in vscode, I see an overlay in the upper right corner of the window that allows me to directly run the program:
Where does this overlay comes from?
from an extension specific to Python?
from something that leverage tasks and allows for such display?
something else?
I am asking because it would be great to have such a shortcut in other programming languages (Go in my case) to quickly launch (something, usually to run a program)
This functionality comes from the ms-python.python extension.
You can verify for yourself: Disable the extension, then do the required IDE reload, then observe that that button is gone. Then enable the extension and observe that it is back.
There's even a corresponding command that you can use in the command palette: Straight from the extension docs:
Python: Run Python File in Terminal
Runs the active Python file in the VS Code terminal. You can also run a Python file by right-clicking on the file and selecting Run Python File in Terminal.
Note: Since you mentioned:
I am asking because it would be great to have such a shortcut in other programming languages (Go in my case) to quickly launch (something, usually to run a program)
Since this is functionality provided by an extension, you're "at the mercy" of whatever the extension devlopers actually want to implement, and whether such a feature actually makes sense for a given language.
Such a "run file" button would very natural for languages that lend themselves toward scripting, but less so for languages geared toward larger projects where it's not statistically normal for a file to "have a main function".
I would like to have a completion in Sublime Text 3, for Python code documents, that would:
Complete the actual object method and other properties (like e.g.: os.path.isd → os.path.isdir without any previous occurence of the word isdir in the document).
Complete the general set of all document's words with a second, lower priority ↔ i.e.: have them listed them after the actual methods.
I would also like to see ST letting the words appearing nearier from the completion point to appear higher in the completion popup window.
Basically, I would like to have a completion resembling the Vim's CoC for C++ in its general features.
Is this possible? If yes, then what should be done to configure Sublime Text 3 for such coimpletion?
The behavior after installing the Python Completions package is far from perfect — all it does is apparently changing the priorities of the basic completion sources (after adding some that i didn't identify), so that it's worse than the shipped original' completion.
The Anaconda package (not at all related to the Anaconda Python distribution) does most of what you're looking for. You may also want to take a look at the LSP package as well.
It's upto you.
You can choose any plugin you like and your computer can support.
Just search the internet about the best python auto-complete.If you feel one of them is best suited for you, search in the package discoverer of Sublime Text for that name. If there is a plugin, install it or read the instructions,etc.
But I heard of some like Kite and Jedi.
I'm running Console2, which I believe is just an interface to windows cmd
I have a custom batch file that does most of my dirty work for me, but there are lot of commands in it now. Is there a way I can get a tap autocomplete working for it in the windows command prompt?
For example: my script is called rob.bat and it takes in a various number of arguments
It'd like to type rob set{Tab} and then have it cycle through
setup_envvars
setup_userprefs
setup_whateverothersetupscriptsIhave
Is there a way to do this?
Console2 has no special provisions for tab completion and instead relies on the program running within it to provide such features. Picture Console2 as little more than something that runs a console program hidden somewhere, regularly polls that hidden window for changes, and forwards all input to that window; this is, in essence, what's happening.
Note that Console2 does nothing special with cmd. You can run any shell within it. As for customizing tab completion, cmd offers nothing of that sort. You may be able to change this by installing clink, which has extension points for Lua code. Another option would be PowerShell, which has customizable tab completion out of the box, either by wrapping your program in a function that provides the necessary parameters, or by writing a custom TabExpansion or TabExpansion2 function.
I want to use rlwrap with a custom erlang repl.
It works perfectly if I run it as "rlwrap -a myrepl".
The problem is that myrepl has builtin tab completion which gets trampled by rlwrap.
I want to make rlwrap to release the TAB key
You can't use rlwrap's line editing/history and your repl's TAB completion at the same time.
rlwrap provides line editing, history and (very simple) completion for commands that don't have it. A command that has something as fancy as TAB completion shouldn't need rlwrap to do its line editing, should it?
The -a (--always-readline) option is a rather crude way to substitute rlwrap's line editing behaviour for that of your command. It is primarily meant for commands that have a very simple line editor, without e.g. command history
If you want to use the -a option because you prefer rlwrap's fanciness (like persistent history, or coloured prompts) to your command's (like TAB completion), go ahead, but it is impossible to pick some fanciness of one and keep some of the other.
This is the (small) price programs (and their users) have to pay for avoiding the readline library and the GPL license that comes with it.
Hans (rlwrap author)
Edit (April 2017):
In many cases it will be possible to use a filter to restore completion. See A node shell based on readline for an example of this.
Rlwrap is cute. But in Erlang, it only offers persistent history while breaking erl's tab completion.
The fundamental issue is Erlang's erl REPL is just old and busted, and doesn't follow normal *nix conventions. Furthermore, they refuse to fix it because of fear of random, grouchy sysadmins whom can't accept any changes. No amount of rlwrap "duct-tape" hacks can fix a poor UX REPL.
It would be better (though significantly more work) to write a REPL from scratch like pry/ipython/etc. that does configurable color, tab completion, persistent history, paging, CLI observer, plugins, etc.
Rlwrap shines on programs with primitive shells.
I've never really used PowerShell before, and playing with it a bit, it looks like it uses cmd.exe's style of tab completion (fill in the first likely candidate, and then you can use tab to cycle through other alternatives). I'd much prefer the way e.g. bash works, where if there are multiple candidates, it shows a list of them.
Is there an easy way to turn this on, by any chance?
I have seen this implemented with an add-on called PowerTab (original post). For script editing there are some editors that support this sort of drop down Intellisense. Check out the free PowerGUI editor.
You want PSReadline: https://github.com/lzybkr/psreadline
It includes many completion and shell experiences you might expect from bash, etc.