Mastering Bash and Terminal
blockloop.io
Mastering Bash and Terminal
1–10 of 186 posts
Re: Mastering Bash and Terminal
#2For example
:!ls
will execute ls and show you the result (press enter to return) :r!ls
will read the result of ls in for youMore usefully
:r!sed -n5,10p that/other/file
will read lines 5-10 from that other file.However you will most often want to
:!make
:!up build
:!git status
:!git commit -am "Fixed #23"Re: Mastering Bash and Terminal
#3Rather 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…
Re: Mastering Bash and Terminal
#4Rather 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…
Re: Mastering Bash and Terminal
#5Rather 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…
You can also install a plug-in like ConqueTerm to devote an entire in-vim buffer to something like a shell session.
Re: Mastering Bash and Terminal
#6Rather 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…
For example, when reading xml I use xmllint to clean it up:
:%!xmllint --format -Re: Mastering Bash and Terminal
#7 Tracks your most used directories, based on 'frecency'.
After a short learning phase, z will take you to the most 'frecent'
directory that matches ALL of the regexes given on the command line, in
order.
For example, z foo bar would match /foo/bar but not /bar/foo.Re: Mastering Bash and Terminal
#8Rather 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…
Re: Mastering Bash and Terminal
#9Earlier quoted context omitted.
You can also install a plug-in like ConqueTerm to devote an entire in-vim buffer to something like a shell session.
Or you can use tmux (which can be have vim bindings) to run vim in one pane.
Re: Mastering Bash and Terminal
#10Rather 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…
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 that suspending the process and bringing it back into the fg would harm anything.