On Thu, Feb 18, 2010 at 09:07:00PM +0100, clemens fischer wrote: > The other problem: for my purposes, I used to rely on screens > ability to 'J'oin the lines of any selection by either spaces, > commas, newlines (the default) or whatnot, ie. to make one long > line of the selected lines. For example, in a "ls -l" listing, I > could select a few files on the right hand side, 'J'oin them with > commas and - in bash - type eg. "cp <dir>/{<THE_SELECTION>} .". > Not worry about the proper glob, that is. > > If this is not too difficult and you can point me to the files > involved, I'd like to give it a try. If not, I'd have to call on > the masters to hand down the solution to this problem from heaven > ...
I expect this one to be tricky, at least to do properly. I'm hoping to get time to work on it soon, but you're quite welcome to try yourself. Micah's suggestion was to set something up where the block would get passed through an arbitrary shell command before pasting, which I think is a great idea. - ------------ < micahcowan> rlpowell, it seems to me that a more general solution than adding J, is to use a keybinding that pastes the buffer to a file, runs a shell command to process it, and loads it back in. < micahcowan> That way, people could do any sort of J-ish thing they want, including some that screen doesn't do, like quote each line and _then_ separate by commas, etc < rlpowell> Yeah, I was trying to make it more general, but I had'nt thought of going in that direction. < micahcowan> Though, I don't think you can do that _just_ yet, given that run-shell doesn't currently block. < rlpowell> Ah. < micahcowan> i.e., the load buffer might happen before the processing :\ < rlpowell> *nod* < micahcowan> rlpowell, you could get around that nonblocking run-shell thing, actually: just use "tmux save-buffer", etc, in the shell command, rather than doing it as a direct tmux command. - ------------ The other aspect to it is having a key that can shift between the various options. My idea there is to store the pass-through-before-pasting command in a (window?) option, and make a tmux command that takes an option name and a list of possible values. Every time it's called, it checks for the current value in the list, and moves to the next one. This would be a fully general solution that people could use for other things. Neither of these is particularily easy to do. Having said that, the code is very clean and easy to read. Feel free to give it a shot. -Robin -- They say: "The first AIs will be built by the military as weapons." And I'm thinking: "Does it even occur to you to try for something other than the default outcome?" See http://shrunklink.com/cdiz http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/ ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users