tab-completion

raw_input without leaving a history in readline

扶醉桌前 提交于 2019-11-29 14:53:13
Is there a way of using raw_input without leaving a sign in the readline history, so that it don't show when tab-completing? You could make a function something like import readline def raw_input_no_history(): input = raw_input() readline.remove_history_item(readline.get_current_history_length()-1) return input and call that function instead of raw_input. You may not need the minus 1 dependent on where you call it from. 来源: https://stackoverflow.com/questions/1202127/raw-input-without-leaving-a-history-in-readline

Jedi Vim Python subclasses are not detected on TAB-completion

混江龙づ霸主 提交于 2019-11-29 12:39:11
The issue is on Arch (1) & Debian Jessie (2) where: 1. > uname -r 4.0.5-1-ARCH > echo $PYTHONPATH /usr/lib/python2.7/ Debian Jessie is without the PYTHONPATH set. My vim is compiled with python. :python import sys; print(sys.version) 2.7.10 (default, May 26 2015, 04:16:29) [GCC 5.1.0] I tried the following Arch Linux packages: > pacman -S python2-jedi vim-jedi completion works on classes but not on the subclasses. import os # os is built-in library. os. # ycm does not complete members of this class. I removed them and downloaded the git package. > cd ~/.vim/bundle/jedi-vim/jedi/test/ && ./run

readline-like library for Java [closed]

跟風遠走 提交于 2019-11-29 10:47:24
Which readline-like library for Java do you use? By 'readline' like library I mean library for editing console input, with support for history, tab-completion, and stuff like this. I'm looking for one, and I cannot choose from so many choices ( jLine -- unmaintained, java-readline -- last release on 2003, others?) I've used JLine to add history, etc. to a Clojure REPL (JVM process) when executed from the command line. It just magically worked and worked well, so I never bothered to investigate anything else. jruby has an internal readline you could probably call out to. 来源: https:/

Tab-completion of filenames as arguments for MATLAB scripts

耗尽温柔 提交于 2019-11-28 21:17:08
We all know MATLAB provides tab-completion for filenames used as arguments in MATLAB function like importdata , imread . How do we do that for the functions we create? EDIT: Displays the files and folders in the current directory. Caution: unsupported hack here. Take a look at the file toolbox\local\TC.xml in your Matlab installation. This appears to contain the argument type mappings for tab completion. (I found this by just grepping the Matlab installation for "imread" in R2009b.) Adding this line inside the <TC> element will get you tab-completion of file names for each of its arguments.

Custom tab completion in python argparse

徘徊边缘 提交于 2019-11-28 17:05:52
问题 How to get shell tab completion cooperating with argparse in a Python script? #!/usr/bin/env python import argparse def main(**args): pass if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('positional', choices=['spam', 'eggs']) parser.add_argument('--optional', choices=['foo1', 'foo2', 'bar']) args = parser.parse_args() main(**vars(args)) With an executable flag set on the .py file, the expected results should be something like: $ ./example.py sp<tab> ->

Tab-completion in Python interpreter in OS X Terminal

泄露秘密 提交于 2019-11-28 16:01:50
问题 Several months ago, I wrote a blog post detailing how to achieve tab-completion in the standard Python interactive interpreter--a feature I once thought only available in IPython. I've found it tremendously handy given that I sometimes have to switch to the standard interpreter due to IPython unicode issues. Recently I've done some work in OS X. To my discontent, the script doesn't seem to work for OS X's Terminal application. I'm hoping some of you with experience in OS X might be able to

How to make PowerShell tab completion work like Bash

你。 提交于 2019-11-28 15:33:56
Let's say I have the following files in my current directory: buildBar.bat buildFoo.bat buildHouse.bat And I type the following at my command prompt, ./bu and then TAB . In Bash, it gets expanded to ./build In PowerShell, it gets expanded to ./buildBar.bat -- the first item in the list. In Cmd, the behavior is the same as PowerShell. I prefer the Bash behaviour - is there a way to make PowerShell behave like Bash. New versions of PowerShell include PSReadline, which can be used to do this: Set-PSReadlineKeyHandler -Key Tab -Function Complete To make it permanent, put this command into C:\Users

raw_input without leaving a history in readline

梦想的初衷 提交于 2019-11-28 08:22:39
问题 Is there a way of using raw_input without leaving a sign in the readline history, so that it don't show when tab-completing? 回答1: You could make a function something like import readline def raw_input_no_history(): input = raw_input() readline.remove_history_item(readline.get_current_history_length()-1) return input and call that function instead of raw_input. You may not need the minus 1 dependent on where you call it from. 来源: https://stackoverflow.com/questions/1202127/raw-input-without

Jedi Vim Python subclasses are not detected on TAB-completion

时间秒杀一切 提交于 2019-11-28 06:00:27
问题 The issue is on Arch (1) & Debian Jessie (2) where: 1. > uname -r 4.0.5-1-ARCH > echo $PYTHONPATH /usr/lib/python2.7/ Debian Jessie is without the PYTHONPATH set. My vim is compiled with python. :python import sys; print(sys.version) 2.7.10 (default, May 26 2015, 04:16:29) [GCC 5.1.0] I tried the following Arch Linux packages: > pacman -S python2-jedi vim-jedi completion works on classes but not on the subclasses. import os # os is built-in library. os. # ycm does not complete members of this

readline-like library for Java [closed]

给你一囗甜甜゛ 提交于 2019-11-28 04:03:37
问题 Which readline-like library for Java do you use? By 'readline' like library I mean library for editing console input, with support for history, tab-completion, and stuff like this. I'm looking for one, and I cannot choose from so many choices (jLine -- unmaintained, java-readline -- last release on 2003, others?) 回答1: I've used JLine to add history, etc. to a Clojure REPL (JVM process) when executed from the command line. It just magically worked and worked well, so I never bothered to