zsh-dwim: Simple chmod and chattr Transforms Are Too Simple.« A Year of Native Linux Indie Games on My Arcade Cabinet - 2011 Native Linux Games for an Arcade Cabinet: Super Meat Boy » Posted by Pat Regan Jan 24 th, 2012 Shell Source $ZSH/custom/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh Here’s what my zsh-syntax-highlighting configuration looks like: ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets) I just moved zsh-syntax-highlighting into my custom directory and loaded it manually. I thought this was a bit strange because oh-my-zsh loads plugins before it runs anything in ~/.oh-my-zsh/custom. When I did, this it was acting like the colors were not already defined. I tried setting the color variables in a file in my ~/.oh-my-zsh/custom directory while loading zsh-syntax-highlighting as a plugin from my ~/.oh-my-zsh/plugins directory. That will probably help me catch mismatched and unescaped quotes pretty easy. It also does a good job of quote highlighting. It does match pairs of brackets, though, so maybe I can get in the habit of using those instead of old bash-isms… Highlighting makes that slightly more, obvious but I sure wish the done would highlight red if it didn’t match a do. I use one-liner for loops all the time, but I’m very good at leaving out the do. Highlighting reserved words should be pretty helpful. It is nice to catch typos before trying to execute a command. Highlighting a misspelled command in red is very nice. I may not like all the extra noise, but there are a few things that I’m finding to be very useful. I was especially unhappy with the underlined path names. Every correctly typed command, every file name, and every globbing character is highlighted in one way or another. Too many things are highlighted by default for my tastes. It looked like it would be pretty handy, so I decided to try it out for a couple of weeks. Correct grammar.I recently read about this nifty new real-time syntax highlighter: zsh-syntax-highlighting. Update Update the supported Bash versions. If there are problems, I would appreciate it if you could tell me that in the comments. Yes, I have to admit that this is actually self-promotion, but I believe that this helps people who want the feature. User promoting his software in relevant questions without disclosure - Meta Stack Overflow. ![]() How to offer personal open-source libraries? - Meta Stack Exchange.Referring to the following meta-questions/answers, I described the idea first and next provided a link to my project as an example implementation. So I decided to answer this question today. However, as no other solutions were offered after a long time despite many views (which reflect significant demand). Note: I know that sometimes answering questions with links to own products is considered self-promotion and unpreferable, so I have been refraining from answering this question. # Add the following line at the end of bashrc Source "$HOME/.local/share/blesh/ble.sh" -attach=none # Add the following line at the beginning of bashrc $ make INSDIR="$HOME/.local/share/blesh" install Here is an example to set up ble.sh in the bashrc (see README for details): $ git clone ![]() Since it is written in (almost-)pure Bash scripts, you can just source the script in ~/.bashrc. In fact, I implemented a line editor ble.sh with features like syntax highlighting and auto-suggestions. It is of course possible to integrate the feature of syntax highlighting in your own line editor. There is no simple way to obtain syntax highlighting in GNU Bash (or GNU Readline), but it is in principle possible to implement your own line editor in Bash script by binding all the user inputs to shell functions using the builtin command bind -x 'BYTE: SHELL-COMMAND'.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |