diff options
author | Alan Pearce | 2023-03-25 21:39:23 +0100 |
---|---|---|
committer | Alan Pearce | 2023-03-25 21:39:23 +0100 |
commit | 363c634d3af8bc81b1b9a66e6a07dcc12aaf7983 (patch) | |
tree | 72c8d7ac701b0a974fb7fd634498d2f7c5f67b17 /user | |
parent | 85aed2343af26b278eb8254846554881f8e35330 (diff) | |
download | nixfiles-363c634d3af8bc81b1b9a66e6a07dcc12aaf7983.tar.lz nixfiles-363c634d3af8bc81b1b9a66e6a07dcc12aaf7983.tar.zst nixfiles-363c634d3af8bc81b1b9a66e6a07dcc12aaf7983.zip |
zsh: add `field` as a simplified `cut` that works more like `awk`
Diffstat (limited to 'user')
-rw-r--r-- | user/zsh/zshrc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/user/zsh/zshrc b/user/zsh/zshrc index d843ce2f..dce20aeb 100644 --- a/user/zsh/zshrc +++ b/user/zsh/zshrc @@ -21,6 +21,11 @@ dc () { } compdef '_dispatch docker-compose docker-compose' dc +field () { + awk "{ print \$${1:-0} }" +} +alias f=field + backward-argument () { local WORDCHARS="\!\`~#@$%^&*()-_=+[{]}\|;:,<.>/?\'\"" zle backward-word |