sujikinen / pyfiledir Goto Github PK
View Code? Open in Web Editor NEW拼音首字母补全(bash)
拼音首字母补全(bash)
platform.python_version()
platform.architecture()
Operation:
1.add/override
2.delete
pyfiledir
not dealing with this scenario,this was delegate to bash itself,since this is shell specific.
quote is delegate to bash completion option -o filenames
,while unquote is delegate to $(eval echo "$cur")
,and filenames automatic add slash after completion done action,pyfiledir
's ability #4 to completing twice to add slash lost.. I have though to use printf
to quote filename, but it's clobber encoding issue on git bash on Windows.When text stream passed through stdout
and stdin
,has weird line feed \r
.
第1组 第2组 第3组 第4组 第5组
cd d1 -> cd 第1组
cd 第1 -> cd 第2组
directories:
docker/
docker-pg-replication/
current behavior:
cd do[tab]
-> cd docker/
desired behavior:
cd do[tab]
-> cd docker
if selection is a directory
This is inconsistent that completion should not modify basename
eg.
cd $H -> cd $HOME
thought about communicating through Unix domain socket.
daemon can cache lookup.
front-end just send directory and user input to back-end,
while back-end return results.
1.work with menu complete
TAB: menu-complete
"\e[Z": menu-complete-backward (shift+tab)
read inputrc settings from bind -v
menu-complete-display-prefix
setting
2.split env file from core file
In [1]: from src.pyfiledir import unicode_sort
In [2]: group_list = list((f'第{i}组' for i in range(1, 11)))
In [3]: import random
In [4]: group_list
Out[4]: ['第1组', '第2组', '第3组', '第4组', '第5组', '第6组', '第7组', '第8组', '第9组', '第10组']
In [5]: group_list = random.sample(group_list, len(group_list))
In [6]: group_list
Out[6]: ['第5组', '第7组', '第3组', '第4组', '第6组', '第1组', '第2组', '第8组', '第10组', '第9组']
In [7]: unicode_sort(group_list)
Out[7]: ['第10组', '第1组', '第2组', '第3组', '第4组', '第5组', '第6组', '第7组', '第8组', '第9组']
In [8]:
The output should like Out[4]
, not Out[7]
前面有非ascii,最后一个为数字才触发数字选择逻辑。
--envs
output the environment variables
File "/home/sujikinen/.bash-pinyin-abbrev-completion/bin/pyfiledir", line 311, in <module>
print(do_py_completion(path=sys.argv[1]), end="")
File "/home/sujikinen/.bash-pinyin-abbrev-completion/bin/pyfiledir", line 305, in do_py_completion
ret = unicode_sort(ret)
File "/home/sujikinen/.bash-pinyin-abbrev-completion/bin/pyfiledir", line 188, in unicode_sort
locale.setlocale(locale.LC_ALL, "")
File "/home/sujikinen/.pyenv/versions/3.6.6/lib/python3.6/locale.py", line 598, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
this line failed
in Windows, python37 sys.path
not follow symbol link.
just adding bin
directory to sys.path
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.