Let’s make sure zsh is our default shell: chsh -s $(which zsh ) Installing Autosuggestions & histdb You need to install xcode’s devleoper tools before you can install oh-my-zsh. If you get an error that says: invalid active developer path (/Library/Developer/CommandLineTools ), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun Once that finishes, we’ll install zsh using homebrew brew install zshĪnd finally, let’s install oh my zsh sh -c " $(curl -fsSL ) " Which you can install by running this in your terminal /usr/bin/ruby -e " $(curl -fsSL ) " To installing Zsh and Oh My Zsh as is the official oh-my-zshįirst, we need to install Zsh since oh my zsh is a framework that sits on top of Zsh. Up our sleeves and get some things installed. Specific suggestions with a fallback to all directory suggestions. With some SQL querying to we can use all of that data to accomplish directory history: which provides us with a session id, a command_id which links with the commands table, a place_id which links with the places table, an exit_status, a start_time, and a duration.places: which provides us with a host (computer host) and a dir which is the present working directory that command was used in.commands: which provides us with an argv column.If we were to lookĪt the schema zsh-histdb provides we would see that it has three tables: To do that, we leverage zsh-histdbĭatabase to track our commands and store them in the database. To be able to just use the present working directories history we have to track that What we’re doing is overriding the strategyĪnd providing our own custom strategy. Suggestion strategy that you can specify to guide it how to exactly suggest Provide us with “Fish like autosuggestions for zsh” based on the command history. This leverages a few excellent libraries which are very useful just by themselves. Then use all the commands typed in this present working directory (PWD) to searchīased on the string we’re looking for. The last number of X commands used in this directory. Suggests commands that have been previously typed on this computer at any pointĪs a bonus, we also have the commmands “show_local_history” with a number to show If there are no matches to what has been previously typed in that directory, it then As seen below the suggestions show up in a light blueĬolor and those suggestions are based on commands previously typed in that directory. I think it's better to refactor the whole logic.Īnyway, I'm sharing my code here because if may help when someone try to refactor the whole code.This is what we’re aiming for. ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean If ] -52,3 +70,5 ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is d # For GNU ls, we use the default ls color theme. I tried the workaround listed in the thread: zstyle ':completion:*:default' list-colors $" + fi I came across #1563 but I am new to this and don't know enough about zsh theming to know what dir_colors is or really understand what's going on in that thread. (In my case I'm using the Smyck color scheme for iTerm, though that should not matter here)Īs you can see, all the colors are different and the Adobe entry is downright illegible. Run ls then type vim with default color scheme/themeĬolors displayed should match colors of output of lsĬolor of output is different than color of ls output Problem: tab completion is colored, but colors do not match other colors throughout the terminal.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |