-
Notifications
You must be signed in to change notification settings - Fork 491
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from alxbl/omzsh-plugin
Thanks for making this project, it's really cool! I'd been looking for something like this for a while. I noticed that your shell widget is pretty much stand-alone and I wanted to be able to use navi directly as an [oh-my-zsh][1] plugin, so I added a few things to the widget and moved it to the root of the repository so that the repo can be cloned straight into the `plugins` folder and detected when added in the plugin array. I think it should be similarly simple with `fish`, but I'm not too familiar with that shell, so I'll leave it to someone else. The `navi.plugin.zsh` file should still be sourcable as a widget for people not using oh-my-zsh, so technically the `shell/` directory could be removed and `navi widget`updated to use the new file. ## What's included - oh-my-zsh plugin - install documentation - no PATH modification required when used with OMZ - Added bonus: #51 is kind of unofficially addressed by this (assuming one uses OMZ) ## Future Work - Pre-filter using `$BUFFER` when hitting `Alt+G` to get something similar to `navi query` - Update `navi widget zsh` to use `navi.plugin.zsh` Let me know what you think. I'm working on a few cheatsheets, and will open PRs for those as they become ready. Cheers, Alex [1]: https://github.com/robbyrussell/oh-my-zsh
- Loading branch information
Showing
4 changed files
with
44 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
local _navi_path=$(dirname $0:A) | ||
|
||
_call_navi() { | ||
local buff="$BUFFER" | ||
zle kill-whole-line | ||
local cmd="$(NAVI_USE_FZF_ALL_INPUTS=true $_navi_path/navi --print <> /dev/tty)" | ||
zle -U "${buff}${cmd}" | ||
# zle accept-line | ||
} | ||
|
||
zle -N _call_navi | ||
|
||
bindkey '\eg' _call_navi |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters