Live data from Hacker News

Linux Terminal Goods

diego-pacheco.blogspot.com

31–40 of 65 posts

Re: Linux Terminal Goods

#31
post #7

I've just skimmed around it as someone who repeatedly need that kind of book to achieve little things in bash. I understand bash is the basis of so many things, that its importance is just enormous. But at the same time, I'm appalled by its syntax, idioms, etc. It's barely readable for the casual reader that I am. I wonder why nobody tries to provide a meaningful alternative. I've seen some (in python for example) bu…

Strangely no one's pointed this out yet but you appear to have posted this comment in the wrong thread.

This seems to be the post you're replying to.

https://news.ycombinator.com/item?id=21013150

Re: Linux Terminal Goods

#32
post #13
post #6

I prefer my terminals dumb and without much color, as the UNIX gods intended them to be. This being said, I'm in love with `fzf`, my workflow improved markedly after scripting (on mac) `ggvi() { git grep "$@" | fzf | sed \"s/:/ +/\" | cut -d \":\" -f 1 | gxargs -r -o vim }`

You can also combine it with ripgrep. Much faster than git grep.

I actually time-tested git grep vs ripgrep, and I'm not seeing meaningful differences on my repos. ripgrep smokes regular grep but for some reason git grep is just as fast as ripgrep

Re: Linux Terminal Goods

#33
post #24

I spend loads of time in a shell. One day I'll push my full dotfiles publicly, but until then here's a few snippets I've found super handy. I'd advise against using them verbatim but there's a few things in there that took some time to figure out. Beware they can be somewhat buggy / break things though. Highlights include: - Bind C-c/C-v to Copy/Paste, bind C-g to sigterm (Note: Breaks docker interactive unless you m…

Inspired by a colleague, I wrote this (for bash): https://gist.github.com/archi/2a2331401842c0548fa8de0f69796f... > up 4 go up 4 folders (=> "cd .." 4 times). > up goes up one folder, and you can repeat pressing ENTER to go up one more. Press anything else to drop back to the shell. Could probably be "better" (e.g. no subshells), but works well for me.

Thats cool! I'm not sure where it comes from, but I get similar behavior in zsh with 'cd ....' - similar doesn't happen in bash though.

I mapped 'cd' to 'c' in my bashrc, but while doing it I also mapped 'c' to execute 'ls' as the latter was basically muscle memory whenever I was using cd. The .bashrc function looks like this:

c() { builtin cd "$@" && ls; }

Re: Linux Terminal Goods

#35
post #28

I spend loads of time in a shell. One day I'll push my full dotfiles publicly, but until then here's a few snippets I've found super handy. I'd advise against using them verbatim but there's a few things in there that took some time to figure out. Beware they can be somewhat buggy / break things though. Highlights include: - Bind C-c/C-v to Copy/Paste, bind C-g to sigterm (Note: Breaks docker interactive unless you m…

I agree with powerlevel9k. i still have marginal enjoyment from the fiddly things thought and i've switched to powerlevel10k [1]. Its noticeably faster and the default settings are minimalist enough for me. does not fix the fact that you need to install fonts which I can't get working on some terminals (urxvt). [1] https://github.com/romkatv/powerlevel10k

I had issues with urxvt and ended up moving to Kitty (https://github.com/kovidgoyal/kitty). I'm not impressed with its' autoupdate feature, but it can be disabled. Apart from that a few visual bugs which are probably to do with nvidia the terminal is great. The best feature? Emojis render flawlessly.

I had a proof of concept, but hackernews doesn't support emojis :'(

Re: Linux Terminal Goods

#36

some vim enthousiast here scalded me for sending him spacevim linkand told me to use neovim. i don't use vim so i wouldn't know, and vim people seem easily offended :D. anyhow, just thought i'd not his input.

Spacevim actually has some original features (kind of ripped off from emacs) that I really like, and can't find a way to get without using Spacevim. There's nothing wrong with using it, but most vim users like to start from scratch and build their own experience to meet their specific needs. Starting with something like Spacevim is 100% ok if you've never used vim before, but most people end up moving onto the more 'custom' experience eventually anyway.

Re: Linux Terminal Goods

#38
post #24

Earlier quoted context omitted.

Inspired by a colleague, I wrote this (for bash): https://gist.github.com/archi/2a2331401842c0548fa8de0f69796f... > up 4 go up 4 folders (=> "cd .." 4 times). > up goes up one folder, and you can repeat pressing ENTER to go up one more. Press anything else to drop back to the shell. Could probably be "better" (e.g. no subshells), but works well for me.

Thats cool! I'm not sure where it comes from, but I get similar behavior in zsh with 'cd ....' - similar doesn't happen in bash though. I mapped 'cd' to 'c' in my bashrc, but while doing it I also mapped 'c' to execute 'ls' as the latter was basically muscle memory whenever I was using cd. The .bashrc function looks like this: c() { builtin cd "$@" && ls; }

Hey guys, I have the same thing, but I called the command ".." (no it doesn't conflict with the directory). ".." by itself is the same as ".. 3"

    .. () {
      local arg=${1:-1};
      while [ $arg -gt 0 ]; do
        builtin cd .. &> /dev/null;
        arg=$(($arg - 1));
      done;
    }

Re: Linux Terminal Goods

#40
post #32
post #13

Earlier quoted context omitted.

You can also combine it with ripgrep. Much faster than git grep.

I actually time-tested git grep vs ripgrep, and I'm not seeing meaningful differences on my repos. ripgrep smokes regular grep but for some reason git grep is just as fast as ripgrep

git grep is parallel, too.
Post reply on HN