programmable-completion

Cycle through only specific file types in PS using custom tab completion on the command line

◇◆丶佛笑我妖孽 提交于 2019-12-08 08:28:28
问题 I use PowerShell's PSReadline-based tab completion and I'm looking to implement the following custom completion behavior: In a folder I have File1.java File1.class File2.java File2.class If I use tab after java I got a list of the files: java .\File File1.java File1.class File2.java File2.class But I want to use a shortcut so I can scroll through only the .java-files but without the extension shown. I also want to get rid of ".\" in the name. So if I write java and use tab I want to have java

Cycle through only specific file types in PS using custom tab completion on the command line

假如想象 提交于 2019-12-08 02:54:15
I use PowerShell's PSReadline -based tab completion and I'm looking to implement the following custom completion behavior: In a folder I have File1.java File1.class File2.java File2.class If I use tab after java I got a list of the files: java .\File File1.java File1.class File2.java File2.class But I want to use a shortcut so I can scroll through only the .java-files but without the extension shown. I also want to get rid of ".\" in the name. So if I write java and use tab I want to have java File1 And next tab gives java File2 And so forth (with tab or some other key). I also wondering,

Is it possible to detect when text wraps?

筅森魡賤 提交于 2019-12-03 12:10:11
问题 Is it possible to detect where text wraps? Lorem ipsum dolor sit amet lets say that above text wraps after 'dolor' word. How to detect that and insert there some mark of it so it would be Lorem ipsum dolor<div class='wrap-mark'/> sit amet for example? 回答1: I've seen this problem solved a few different ways. One of my favorites involves creating a div that mirrors the width of the container that holds your text. You then print words of your content into faux-container one-by-one, measuring the

zsh: use completions for command X when I type command Y

白昼怎懂夜的黑 提交于 2019-12-03 09:36:17
问题 In zsh, I have a function called g which acts like this: with no arguments, call git status with one or more arguments, delegate to git with all given arguments - i.e. call git $@ I would like the tab completions for g to be exactly the same as for git . I can achieve this with alias g=git , but that doesn't allow me to call status by default (the first point above). How can I delegate to the completion for git ? In bash, I simply did complete -F _git g which re-uses git's completion function

Is it possible to detect when text wraps?

橙三吉。 提交于 2019-12-03 02:43:28
Is it possible to detect where text wraps? Lorem ipsum dolor sit amet lets say that above text wraps after 'dolor' word. How to detect that and insert there some mark of it so it would be Lorem ipsum dolor<div class='wrap-mark'/> sit amet for example? I've seen this problem solved a few different ways. One of my favorites involves creating a div that mirrors the width of the container that holds your text. You then print words of your content into faux-container one-by-one, measuring the height of the container along the way. When the height of the container changes, you know you have a line