4 ms·
This is the biggest change: > http://fishshell.com/release_notes.html http://fishshell.com/release_notes.html > When tab-completing a file, fish will first at
by pooriaazimi 13y ago
This is the biggest change:
> http://fishshell.com/release_notes.html http://fishshell.com/release_notes.html
> When tab-completing a file, fish will first attempt prefix matches (foo matches foobar), then substring matches (ooba matches foobar), and lastly subsequence matches (fbr matches foobar). For example, in a directory with files foo1.txt, foo2.txt, foo3.txt…, you can type only the numeric part and hit tab to fill in the rest.
This is really brilliant! I always wanted that (without knowing it).
- lignuist 13y agoI am looking for something that lets me type the first few letters and when I press the arrow-up key then (maybe in combination with another key), it will only offer those items from the history, which match my previous input. Something like: Type: > ssh press arrow-up: > ssh larry@google.com press arrow-up: > ssh mark@facebook.com
- quarterto 13y agoCtrl+R.
- pacefalm 13y agozsh does that
- mineo 13y agoThis is what the arrow-up key in ZSH does by default.
- mmgutz 13y agoOn my box, zsh only searches based on the first word. Other options, in comments above, search on multi words. For example "git push" then up arrow works expected.
- cshenoy 13y agooh-my-zsh[1] does that for me. It's a pretty great function. 1. https://github.com/robbyrussell/oh-my-zsh https://github.com/robbyrussell/oh-my-zsh
- jlgreco 13y agoThe history-beginning-search-backward widget, which is standard to the zsh line editor, does it. You don't need to pull in all of oh-my-zsh. To use it, I use: bindkey "^[[A" history-beginning-search-backward
- josteink 13y agoIm using oh-my-zsh, but I cant find this one. Care to enlighten me which option or plugin I should enable? :) Edit: Seems ctrl-up and ctrl-down does the trick.
- Spittie 13y agoI'm using https://github.com/zsh-users/zsh-history-substring-search https://github.com/zsh-users/zsh-history-substring-search It emulates the Fish behavior (which is just awesome). I'm not sure if it requires oh-my-zsh, but I think it doesn't.
- josteink 13y agoIt's actually a plugin bundled with oh-my-zsh, but I copy-pasted the default keybindings from the github page you linked, and it's indeed pretty awesome.
- jevinskie 13y agoThis seems to have been broken for me unless I add DEBIAN_PREVENT_KEYBOARD_CHANGES=yes to my .zshenv. I'm not sure if it was an update to ZSH, oh-my-zsh, or Ubuntu that causes the issue.
- patrickg 13y agobash: "\C-p": history-search-backward in ~/.inputrc
- iron_ball 13y agoOr in .bashrc: bind "C-p":history-search-backward bind "C-n":history-search-forward
- siteshwar 13y agofish does this too when you press up arrow key.
- stith 13y agoYou can do that in bash with ctrl+r: Type: ctrl+r Type: ssh Bash says: (reverse-i-search)`ssh': ssh dude@somewhere.com Type again: ctrl+r (reverse-i-search)`ssh': ssh someoneelse@elsewhere.com
- TeMPOraL 13y agoFish does that by default.
- vially 13y agoNot exactly what you're asking for but: Alt + Up might help. From the docs: Alt-Up and Alt-Down search the command history for the previous/next token containing the token under the cursor before the search was started. If the commandline was not on a token when the search started, all tokens match. See the history section for more information on history searching. [1] [1] - http://fishshell.com/docs/2.1/ http://fishshell.com/docs/2.1/
- lunixbochs 13y agoUp does this by default. Alt+Up is useful for searching a single word through history I know of three history completion modes in fish. Full command search: start typing a command and press Up. This will search for entire commands matching your query. Word search: type any letters in a command, then press Alt+Up. This will cycle only the current word based on a substring match of your query. Useful for hostnames, filenames, etc. Context-sensitive: If fish 'previews' the rest of a line as a lighter color text, press the right arrow key to complete. This is sensitive to the current directory and available files. If you go into a directory, `touch filename`, `cat filename`, and type `cat`, it will preview `cat filename` for you. Pressing the right arrow key will type it. If you `rm filename` or change directory, `cat filename` will no longer appear.
- krcz 13y agoIn my Fedora Linux bash page-up works like that.
- lignuist 13y agoThanks for all the tips! :)
- tambourine_man 13y agoNot sure if that's what you want, but have you tried this in your .inputrc? "\e[B": history-search-forward "\e[A": history-search-backward
- lignuist 13y agoLooks interesting. How would I use that afterwards?
- bretthoerner 13y agoType, say, 's' and then press your up arrow.
- JelteF 13y agoYou can also put this in your bashrc: bind '"\e[A":history-search-backward' bind '"\e[B":history-search-forward' It's one of the things I always tell people to use since it makes using bash so much easier.
- chanux 13y agoIn your ~/.inputrc "\e[A": history-search-backward "\e[B": history-search-forward
- Osiris 13y agoThis is actually the feature of fish I use the most and is the primary reason I always install fish on my servers. Automatic history search using the up-arrow is fantastic.
- nzp 13y agoTcsh does just that by default (at least on FreeBSD).
- rsync 13y agoI have been doing this for over a decade with csh.