Don't ctrl-f and ctrl-b work?
Mastering Bash and Terminal
101–110 of 186 posts
Re: Mastering Bash and Terminal
#102Earlier quoted context omitted.
I wasn't so much commenting on the release date when I said "newcomers." Mostly commenting on my personal experience. I've been using bash for a long time and only recently have I seen zsh get so popular. It's entirely possible that only the people I know have only recently taken an interest in it. I would have to run zsh again to remember the pieces that I didn't like. I might have been able to configure my way arou…
When I started using Unix in the early '90s, zsh was more popular than bash by a long way. And tcsh was more popular still. You had to be a GPL purist or something to want to use bash. Its success is really down to its status as the Linux default. If you try zsh again, you'll find the mailing list and IRC are full of helpful people if some things aren't as you expect.
I like to come up with one-liners when doing stuff as a challenge and not being able to do a for-loop as a single line drove me nuts (keeping it one line is really useful when you're iterating over a command and using history). I also find subshells very handy in bash.
Re: Mastering Bash and Terminal
#103Earlier quoted context omitted.
I didn't know about :r in combination with !. That's neat. I typically use :r for reading a file into the current buffer (instead of cp ). Thanks for sharing. I don't find myself using ! commands when I know there are multiple commands that I need to run (like your last example). That's usually when I'll suspend and then use the command line. Could you elaborate on "wreak havoc on your vim session?" I wasn't aware th…
> I didn't know about :r in combination with ! You can even use :w in combination with !. For example :w !xclip to write the vim buffer contents to the clipboard. You could visually highlight part of the buffer and do the same thing for just the text you want.
"*y
"+yRe: Mastering Bash and Terminal
#104Earlier quoted context omitted.
I wasn't so much commenting on the release date when I said "newcomers." Mostly commenting on my personal experience. I've been using bash for a long time and only recently have I seen zsh get so popular. It's entirely possible that only the people I know have only recently taken an interest in it. I would have to run zsh again to remember the pieces that I didn't like. I might have been able to configure my way arou…
zsh was quite popular when I first went spelunking in *NIX-land (2005). oh-my-zsh, which was a decent boost to zsh popularity, seems to have been around since 2009 ( http://ohmyz.sh/ ). zsh has always been held back by the "default browser"-syndrome: Linux and Mac OS both come with "good enough" default shells, so few people actually want to go through the effort of switching. Especially since there is a bit of a lea…
Re: Mastering Bash and Terminal
#105Earlier quoted context omitted.
> I didn't know about :r in combination with ! You can even use :w in combination with !. For example :w !xclip to write the vim buffer contents to the clipboard. You could visually highlight part of the buffer and do the same thing for just the text you want.
Though I understand that this is just an example of the power of `!r`, readers should know that VIM in fact can copy to the system clipboards natively. "*y "+y
Re: Mastering Bash and Terminal
#106Earlier quoted context omitted.
> I didn't know about :r in combination with ! You can even use :w in combination with !. For example :w !xclip to write the vim buffer contents to the clipboard. You could visually highlight part of the buffer and do the same thing for just the text you want.
Though I understand that this is just an example of the power of `!r`, readers should know that VIM in fact can copy to the system clipboards natively. "*y "+y
One advantage of the method you describe is that it can be limited to just part of a line. Piping output to xclip is limited to complete lines of text due to the nature of :w !.
Re: Mastering Bash and Terminal
#107With fish I have a setup.fish script that defines all my universal exports, for when I setup a new computer. This is for private tokens, like HOMEBREW_GITHUB_API_TOKEN. For aliases and utilities, I wrote a fisherman [0] plugin. It has a functions folder and a fishfile for the few other plugins I use.
Re: Mastering Bash and Terminal
#108Rather than temporarily suspend vim to use the terminal you can get vim to suspend and resume itself with the exclamation mark command. This has the benefit of not wreaking havoc on your vim session and allowing you to read data into vim by prefixing with r. For example :!ls will execute ls and show you the result (press enter to return) :r!ls will read the result of ls in for you More usefully :r!sed -n5,10p that/ot…
Interesting. Your use of `git commit -am` resounded with me. I can't stand doing `git add .` ; `git commit -m "message"`; `git push`. I aliased "commit" to "ci" in git-config, and then do `git ci -am "message" && git push`. I'm sure at some point I will add a hook to have the push done automatically (though sometimes I prefer to do it manually, so I will have to make a decision.) I am an avid emacs user though. I rea…
Re: Mastering Bash and Terminal
#109Earlier quoted context omitted.
On my version of zsh I was not able to do the following which is available on bash: http://unix.stackexchange.com/a/203075
Binding the vi widget in emacs mode works: bindkey '^]' vi-find-next-char
Re: Mastering Bash and Terminal
#110Rather than temporarily suspend vim to use the terminal you can get vim to suspend and resume itself with the exclamation mark command. This has the benefit of not wreaking havoc on your vim session and allowing you to read data into vim by prefixing with r. For example :!ls will execute ls and show you the result (press enter to return) :r!ls will read the result of ls in for you More usefully :r!sed -n5,10p that/ot…
tmux is a good alternative to the whole paradigm of 'running shell commands within a text editor like vim'. Why run a shell command within vim when one can run the shell command in an actual shell? It seems to me that running a shell command in vim is using vim outside of its intended scope. It might be able to do it but it won't be able to do it well, which is where something like tmux comes in. I might be in the mi…