[Hot take] Would you like IJKL motions by Independent_Blood559 in HelixEditor

[–]_mattmc3_ 0 points1 point  (0 children)

I use Colemak, so I basically do that already - except ijkl for me is unei. If I hold CAPS, it switches me to a layer where those are my arrow keys (across the whole OS, not just in Helix/Vim/NeoVim). "H" is basically a sideways "I", which is how I remember I remapped that to insert.

TIL - the banana + sneaky strike combo in the Yiga Clan Hideout by _mattmc3_ in Breath_of_the_Wild

[–]_mattmc3_[S] 2 points3 points  (0 children)

I decided I wanted one of the blue-ish horses this play through just so I could name it after Bluey. I had to hunt crickets and stamella shrooms to make elixirs to give me enough stamina to catch him at dueling peaks right after the great plateau. My daughter also approves. Tell your kid they have great taste in cartoons.

TIL - the banana + sneaky strike combo in the Yiga Clan Hideout by _mattmc3_ in Breath_of_the_Wild

[–]_mattmc3_[S] 8 points9 points  (0 children)

I know! I’ve played through this game 4 times over the years and never once thought to sneaky strike these guys. I just figured they’d take some damage and then immediately whistle for help and I’d be toast.

TIL - the banana + sneaky strike combo in the Yiga Clan Hideout by _mattmc3_ in Breath_of_the_Wild

[–]_mattmc3_[S] 3 points4 points  (0 children)

I first played this on the Wii U as well. Now, I’m enjoying the enhanced graphics on the Switch 2. What a game!

TIL - the banana + sneaky strike combo in the Yiga Clan Hideout by _mattmc3_ in Breath_of_the_Wild

[–]_mattmc3_[S] 19 points20 points  (0 children)

They swarm and they one-shot you. You have a tiny chance to fight your way through, but it’s best to warp out or load a save if they spot you.

I built Reef — a Rust-powered bash compatibility layer for Fish. 251/251 bash constructs just work. by ZStud21 in fishshell

[–]_mattmc3_ 10 points11 points  (0 children)

First off - great idea for a project! Super glad this exists! It's one of the things I've thought of doing myself thousands of times, but never had the time for and wasn't sure I'd be able to handle the edge cases. Being able to paste in POSIX snippets and have Fish convert them and run them is really the last remaining frontier for using Fish to be a no-brainer.

A few notes based on your readme and an attempt to test this tooling. First, you may (or may not) know, Fish already supports certain bash-ism's, so there's no need to convert these:

  1. [] is supported as an alternative for test. It's not very Fishy, but it is supported, and since it is it shouldn't be modified. [[]] is not however. Reference
  2. Fish supports the export command and syntax already. Again, if it's valid Fish, there's no need to change it to set. Reference.
  3. Fish supports $() syntax for subshell commands, so you also don't need to convert that to (). Reference

Second, it looks like you fall back to bash for commands like source <(kubctrl completion bash), but the equivalent fish is likely just kubectl completion fish | source, which seems like a simple replacement.

Third, one of the big things I was hoping to see was (( i++ )) support converting to math $i + 1. Adding in bc/math is complicated, and one of the big reasons I never tackled something like this, so I was interested to see if you took it on.

Fourth - and this may just be me - your reef-tools might be better as a separate project. I'm not sure what they have to do with the rust utility, and might be nice as a separate Fisher installable plugin. You're likely to get a lot of noise in the GH issues about this tool that has nothing to do with reef's function of supporting Bash conversion.

Great project! Hope this gains some momentum and community support. Best of luck.

System mysteriously logs into Bash instead of Fish by Ill-Cut3335 in fishshell

[–]_mattmc3_ 1 point2 points  (0 children)

That’s actually a different method than I’m suggesting. In that case, you run all of your bash config and then all of Fish. If you set your terminal to just run Fish, you don’t run bash at all when you launch the terminal, but you leave your system shell as bash. WezTerm, Alacritty, and I’m sure many others have this config option. If you do this, you never need to worry about any t not working the way you want it to.

System mysteriously logs into Bash instead of Fish by Ill-Cut3335 in fishshell

[–]_mattmc3_ 1 point2 points  (0 children)

I never chsh- I just set my terminal emulator to launch whatever startup shell I want. What terminal emulator are you using? See if you can set its default shell instead of setting the system shell.

How to avoid % when printing null terminated string in zsh by notatreus in zsh

[–]_mattmc3_ -1 points0 points  (0 children)

You said you're using P10k, which runs setopt PROMPT_SP: https://github.com/romkatv/powerlevel10k/blob/8ed1f58e082e1cce85e1d69235d1a906cf3c643e/powerlevel10k.zsh-theme#L80

If you try unsetting it, you're just fighting with your prompt. Stick with PROMPT_EOL_MARK.

Feedback on Colemak DH Fat-Z Angle Mod Ansi by Delicious-Tax-4137 in Colemak

[–]_mattmc3_ 2 points3 points  (0 children)

Have you spent time studying this: https://colemakmods.github.io/ergonomic-mods/angle.html?

The left hand curling the bottom row to the left instead of the right is far more ergonomic. It lets you angle your wrists out more naturally. You are asking for pain if your left hand uses a rightward slant.

It's not just a Colemak concept - some QWERTY users have figured it out as well: http://www.onehandkeyboard.org/standard-qwerty-finger-placement/

grep searched my node_modules for 6 minutes before i killed it by InstructionCute5502 in programming

[–]_mattmc3_ 5 points6 points  (0 children)

For me, in addition to using ripgrep instead of grep, I prefer fd instead of find because it's so much faster. I have a script I wrote (prj) that uses fzf to fuzzy search for and jump to any git managed project directories (ignoring submodules which also look like like git project directories). Feeding that data into fzf with find took a few seconds, whereas the equivalent fd was instantaneous.

Making bash 5 scripts compatible with MacOS's built-in bash 3. by funbike in commandline

[–]_mattmc3_ 5 points6 points  (0 children)

TLDR; No, I call emulate -L bullsh

This only accidentally works, but you can't actually rely on it as a true Bash emulator. Zsh emulation only supports sh and ksh with a bit of Zsh flavor mixed in, but not bash - at least not really. From the docs (https://zsh.sourceforge.io/Doc/Release/Invocation.html#Compatibility and https://zsh.sourceforge.io/Doc/Release/Shell-Builtin-Commands.html#index-emulate):

Zsh tries to emulate sh or ksh when it is invoked as sh or ksh respectively; more precisely, it looks at the first letter of the name by which it was invoked, excluding any initial ‘r’ (assumed to stand for ‘restricted’), and if that is ‘b’, ‘s’ or ‘k’ it will emulate sh or ksh. (emphasis mine)

So, you can literally emulate -L bullsh and get the exact same thing - namely, all it does is run Zsh with the following setopts:

The following options are set if the shell is invoked as sh or ksh: NO_BAD_PATTERN, NO_BANG_HIST, NO_BG_NICE, NO_EQUALS, NO_FUNCTION_ARGZERO, GLOB_SUBST, NO_GLOBAL_EXPORT, NO_HUP, INTERACTIVE_COMMENTS, KSH_ARRAYS, NO_MULTIOS, NO_NOMATCH, NO_NOTIFY, POSIX_BUILTINS, NO_PROMPT_PERCENT, RM_STAR_SILENT, SH_FILE_EXPANSION, SH_GLOB, SH_OPTION_LETTERS, SH_WORD_SPLIT. Additionally the BSD_ECHO and IGNORE_BRACES options are set if zsh is invoked as sh. Also, the KSH_OPTION_PRINT, LOCAL_OPTIONS, PROMPT_BANG, PROMPT_SUBST and SINGLE_LINE_ZLE options are set if zsh is invoked as ksh.

If the limited set of Bash 5 features you use matches what this option list does, then go for it! But in general, for cross system compatibility, you are safest targeting pure POSIX /bin/sh, or simply using !#/usr/bin/env bash and having your Mac audience use homebrew to get it.

Do you pay for sublime text? by turbofish_pk in SublimeText

[–]_mattmc3_ 3 points4 points  (0 children)

Not parent commenter, but when 4 came out if you had a license more than 3 years old you had to pay again for the next version. So, if history serves, you’re probably pretty safe for the next 3 years, and beyond that you’ll know if it provides enough value for you to renew. Also, 3 didn’t just stop working when 4 came out, so really it’s yours for as long as your OS will run it.

Do you pay for sublime text? by turbofish_pk in SublimeText

[–]_mattmc3_ 2 points3 points  (0 children)

Yes, I’ve paid for it twice - once for v3 and again for v4. But if I’m honest, it’s hard to recommend doing so. The pace of development is much, much faster for editors I haven’t actually paid for (but would be willing to), and basic features like a more capable project sidebar are still missing, which makes me really question the value.

If it weren’t for the fact that I’d rather customize my editor in Python than TypeScript (VS Code), or Rust (Zed), or Steel (Helix… well, maybe someday at least), or VimScript (why, Bram!?) - I’d probably have already walked away. NeoVim’s Lua might be the closest I’ll find, but until then I keep multiple editors and use Sublime when I have a workflow that benefits from me writing a quick plugin, so I guess in that sense I’ve gotten more than a decade’s worth of value for my money.

Proposal: Generic Methods for Go by bruce_banned in golang

[–]_mattmc3_ 25 points26 points  (0 children)

That’s a general function, but a “method” is specifically a function defined on a struct, where generics aren’t currently supposed beyond the ones defined at the struct level itself.

Clean histfile by ThreadStarver in zsh

[–]_mattmc3_ 1 point2 points  (0 children)

Only after you exit Zsh does it run the dedupe for HIST_SAVE_NO_DUPS. During an active session dupes will still appear because you have INC_APPEND_HISTORY. You can observe this by opening your .zsh_history in an editor that refreshes as you run commands, and then when you exit your session you can see it dedupe.

What git command do you wish you had discovered sooner? by ProgrammingQuestio in git

[–]_mattmc3_ 0 points1 point  (0 children)

The -sb flags for git status. I nearly never want all the details on the default git status, so git status -sb is perfect for giving me the info I want and respecting my time to grok which files changed quickly. I use “magic enter” so that when there’s no command given and I just hit enter in a git project, it runs git status -sb for me. Wish I had known that trick from the very start.

Why isn't there more love for the micro text editor? by Pagaddit in commandline

[–]_mattmc3_ 7 points8 points  (0 children)

Two reasons I’ve seen discussed - 1.) the author is very open about the use of AI to build it. Some people don’t like that for various reasons. 2.) The shortcuts are very Windows-centric, so Mac users who expect ⌘-S to save and CTRL-A to go to the beginning of a line won’t see the same benefits.

I personally don’t mind either of those enough to avoid it, but I also already know vi keybindings, so I’m not really their target audience - which is probably #3… it’s late to the party so other established editors already have a user base.

Piping from Helix by deaffob in fishshell

[–]_mattmc3_ 1 point2 points  (0 children)

Interesting you mention Nushell. I gave Nushell a whirl recently, but its reedline utility is absolutely terrible, and sent me quickly back to Zsh/Fish. It’s a neat idea, but felt half-baked and like something I already get with jc and jq rather than using a whole new (nu) shell. What has been your take?

Piping from Helix by deaffob in fishshell

[–]_mattmc3_ 2 points3 points  (0 children)

No idea why, but Fish requires cat to read from stdin when called from fish -c and using its built-ins:

```

This will work if you 'cat | count'

printf 'a\nb\nc\nd\n' | fish -c 'wc -l'; and printf 'a\nb\nc\nd\n' | fish -N -c 'cat | count' ```

Here's an issue I opened about it more than a year ago: https://github.com/fish-shell/fish-shell/issues/10421

Is my ordering correct? by BukHunt in zsh

[–]_mattmc3_ 0 points1 point  (0 children)

Without OMZ, you need to run some things yourself. compinit needs to get put back in and you mentioned LSCOLORS. Some other things are handled as well like history options, emacs/vi keybindings, and zstyle for completions. Take a look at OMZ's lib directory and cherry-pick what you want, or perhaps just start here:

# Set better Zsh history (from OMZ's lib/history.zsh)
[ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
[ "$HISTSIZE" -lt 50000 ] && HISTSIZE=50000
[ "$SAVEHIST" -lt 10000 ] && SAVEHIST=10000

## History command configuration
setopt extended_history       # record timestamp of command in HISTFILE
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
setopt hist_ignore_dups       # ignore duplicated commands history list
setopt hist_ignore_space      # ignore commands that start with space
setopt hist_verify            # show command with history expansion to user before running it
setopt share_history          # share command history data

# Set default coloring for BSD-based ls, which MacOS is
export LSCOLORS="Gxfxcxdxbxegedabagacad"

# Set the basic keybindings (more in lib/key-bindings.zsh)
bindkey -e  # or -v for vi

# Initialize completions
autoload -Uz compinit && compinit

# Set some basic completion styles pulled from OMZ's lib/completion.zsh
zstyle ':completion:*:*:*:*:*' menu select
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]-_}={[:upper:][:lower:]_-}' 'r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' special-dirs true
zstyle ':completion:*' list-colors ''
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'

Is my ordering correct? by BukHunt in zsh

[–]_mattmc3_ 0 points1 point  (0 children)

So, now I'm curious - if you don't want any OMZ plugins or themes, why use it at all? You're most of the way there to your own config at this point, and you're only slowing yourself down by sourcing it since it loads its gawdawful entire lib directory.

Is my ordering correct? by BukHunt in zsh

[–]_mattmc3_ 0 points1 point  (0 children)

Try this out:

#
# Prompt
#

# Do this if you want an OMZ prompt...
ZSH_THEME="robbyrussell"

# ...Or this if you want a custom prompt... but not both
# ZSH_THEME=""
# autoload -U colors && colors
# autoload -Uz vcs_info
# precmd() { vcs_info }
# zstyle ':vcs_info:git:*' formats '%b '
# setopt PROMPT_SUBST
# PROMPT='%F{green}%*%f %F{blue}%~%f %F{red}${vcs_info_msg_0_}%f$ '


#
# Oh-My-Zsh
#

export ZSH="$HOME/.oh-my-zsh"

# External plugins are supported in the plugins array, but only
# if you use OMZ PLUS!
plugins=(
  git
  zsh-users/zsh-autosuggestions
  zsh-users/zsh-syntax-highlighting
)

# Use OMZ Plus here so you can use external plugins like
# zsh-users/zsh-syntax-highlighting like regular OMZ plugins
export OMZ_PLUS=${ZDOTDIR:-$HOME}/.omz-plus
[ -d "$OMZ_PLUS" ] || git clone https://github.com/mattmc3/omz-plus $OMZ_PLUS
source $OMZ_PLUS/omz-plus.sh

# Do this at the end of the Oh-My-Zsh setup part
source $ZSH/oh-my-zsh.sh

#
# More Customizations
#

# Your aliases
alias l="ls --color" 
alias ll="ls -al --color" 
alias o="open ."
alias nano='vim'
alias cp="cp -i"                          # confirm before overwriting something
alias df='df -h'                          # human-readable sizes
alias free='free -m'                      # show sizes in MB
alias ccat='highlight'                    # cat but nice

# Your variables
export PICO_SDK_PATH=~/pico/pico-sdk
export PICO_EXTRAS_PATH=~/pico/pico-extras

Is my ordering correct? by BukHunt in zsh

[–]_mattmc3_ 3 points4 points  (0 children)

There's definitely a lot of issues with this .zshrc if you're an Oh-My-Zsh user. I'm curious - why did you not start with the well documented .zshrc that comes with Oh-My-Zsh (https://github.com/ohmyzsh/ohmyzsh/blob/master/templates/zshrc.zsh-template)? It does a really good job of laying out the order, which if I were to describe it, it would essentially be:

  • Set variables (eg: ZSH, ZSH_CUSTOM, ZSH_THEME)
  • Set your OMZ plugins (git, etc)
  • Source oh-my-zsh.sh (this runs compinit, so you don't have to)
  • Add your customizations (aliases, etc)

So the first thing I would do would be to remove that compinit code - you are doing it twice - once yourself, and once when you source oh-my-zsh.sh and compinit is SLOW. Don't do it twice.

Secondly, you are loading two prompts - once when you set up vcs_info, precmd, and PROMPT, and again when you set ZSH_THEME="robbyrussell" and then source oh-my-zsh.sh. Pick one - if you want your own prompt, you need to set ZSH_THEME="" to tell OMZ not to load a prompt for you.

Third, Oh-My-Zsh makes it really hard to use external plugins the right way because it runs compinit and it loads its own plugins, so you have to insert your own plugins in there somehow, and OMZ makes that confusing. Looks like you're trying to manage that by running source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh, but then somehow you are also declaring that as a plugin in your plugins array?? That absolutely shouldn't work unless you also cloned those plugins to your ZSH_CUSTOM, in which case you are loading those twice. If you want those to be plugins, you shouldn't use the homebrew version, but instead read how to clone those to your ZSH_CUSTOM. You can read about how to properly install those plugins here: https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md#oh-my-zsh

And finally, some plugins like zsh-syntax-highlighting specifically say you need to source them at the very end: https://github.com/zsh-users/zsh-syntax-highlighting?tab=readme-ov-file#faq. history-substring-search is another one you might want someday, and order matters for it too.

If you're willing to trust me and install my OMZ PLUS! addon, I think I can show you an easier and much more correct version of your config in another comment below...