3 ms·
>Certainly you don't need ack.vim, you could just ^z and do it the old fashioned way, but where is the utility in that? Because ack.vim can't be piped into oth
by Sir_Cmpwn 8y ago
>Certainly you don't need ack.vim, you could just ^z and do it the old fashioned way, but where is the utility in that?
Because ack.vim can't be piped into other tools. You can't, for example, limit your search to the last 50 files modified. Or only to executable files. You can't pipe the results into sed or make matching files world-readable. Sure, you could install ack.vim, slow down vim's startup and bloat your installation, or you could just hit ^z and use the unparalleled power of the Unix shell.
>How is that more in line with the unix philosophy than simply having vim shell out to those utilities for you?
Sometimes it's not. But vim has ! built in, you don't need plugins to run commands from it. I do it all the time.
- JackCh 8y ago> "or you could just hit ^z and use the unparalleled power of the Unix shell." Or I could use both, when the need arises, which frankly it never has for me. Ack.vim does not preclude using ^z when you have a special need, it optimizes the common case. And Ack.vim is much nicer than !ack <cword> > "install ack.vim, slow down vim's startup and bloat your installation" Well I don't run vim on a z80, so the difference would be pretty hard to measure ;). The way modern well-coded vim plugins like Ack.vim work involves lazyloading using 'autoload' (which is poorly named.) Ack.vim includes plugin/ack.vim (p/av) and autoload/ack.vim (a/av). p/av loads when you start vim, but is a light-weight file that only contains keybindings and settings variables. The actual code of Ack.vim, the function definitions, exists in a/av which is loaded lazily, when one of those functions is called by a keybinding created in p/av. The result is a truly negligible startup impact. https://github.com/mileszs/ack.vim/blob/master/plugin/ack.vim https://github.com/mileszs/ack.vim/blob/master/plugin/ack.vi... https://github.com/mileszs/ack.vim/blob/master/autoload/ack.vim https://github.com/mileszs/ack.vim/blob/master/autoload/ack....
- joshuamorton 8y ago"simple things should be easy, hard things should be possible." I rarely (if ever) need to make matches world readable from the context of text editing. When I do, there's nothing stopping me from using ^z, but until that day comes, a plug-in is going to be fewer keystrokes, faster, and better integrated with what I was already doing.
- pasabagi 8y agoOne thing I don't understand, is how do you handle mistakes with the 'unix-as-ide' approach? I was using sed to refactor. Now, I typically use bufdo %s/foo/bar/gc, because it's much more forgiving. It's the same story with a lot of stuff you can ctrl-z for - if you can do it inside vim, it's usually far easier to control and roll back.
- C0d3r 8y agoGit helps you with those mistakes, otherwise, yes, very unforgiving