Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

hm, I just select the text and do

     xclip -o | awk '{ print "\"" $0 "\"," }'
find it simpler than 10 lines of lisp but what do I know :p


Once you bind it to a key, though, it's a lot quicker. There is something to be said for emacs as a unified computing environment when compared to the UNIX way of doing things. Instead of wrangling different parts of the filesystem and tying them together with aliases and shell scripts, you can just version-control the productivity software (i.e. your emacs config) you write in the course of using emacs.


And now since I'm sucked into the cult of the helm-o-verse I find I am binding many fewer keys. Just start typing 'M-x ar' and now it's the second item. Add another 'r' brings it to the fore. Less (for me) to remember.

I note this mainly because it took me quite a long time to grok helm. Keep working with it!


You don't need Helm for that: smart M-x aka "smex" accomplished that for me and let me stay with ido, as I find Helm too intrusive.


Oh I really really loved smex. That's probably why it took me so long to get helm. helm doesn't improve on smex for this use case, I think. At least the stupid simple way I'm only going to use helm. But helm improves on other things spectacularly.


A lot quicker to do something specific. What if your problem involves text, but is always changing? Then you need general tools and a way to compose them together. Just like general Unix command and Awk which automatically loop through files. I would go crazy if I had to write actual code to do that kind of work 50 times a week.


A difference between emacs functions and awk one-liners is that the former are highly composable. Over the course of weeks you can build whole libraries of custom text-manipulation functionality for your particular domain, all integrated seamlessly into your editor. The thought of calling out to tools like awk for this is really galling. Could just be me, though.


Yeah...I was thinking about just writing a bunch of Powershell or TCL to make an expert shell. Sounds like a similar idea.


I'll be that guy ;)

In vim/unix you can run this command (keybinding not included but simple enough):

  :'<,'>%!awk 'BEGIN {ORS=" "} {print "\" $1 "\"," }
As for a unified computing environment, it is unified with the OS and not a world unto itself, there is no need to have one way of doing things within the editor and another if you want to script something. Both work just as well with version control, plus it gives you the flexibility to change text editor, like from vim to kak.

Speaking of kak, multiple cursors > any of these scripted options.


Yes, vim has a multiple cursor plugin that is useful for things like this: https://github.com/terryma/vim-multiple-cursors.

It's not as good as sublime in my experience, and I haven't used kakoune, but it's very serviceable.


Just put the following in your bashrc and it will simplify everything:

Alias emacs=‘vim’

:)


> Once you bind it to a key, though, it's a lot quicker.

but that's something any IDE in the world can do ?


Easier: C-u M-| will run a console program against the text.

It's great for running sort, awk, sed, etc.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: