PDA

View Full Version : X11 selection copy & paste



PaulStoffregen
04-21-2013, 06:42 PM
I finally got this working in the Arduino IDE today!! I'm planning to put the patch into Teensyduino 1.14, and hopefully someday it'll appear in regular Arduino releases.

This is a Linux only feature. Mac & Windows do not have this type of copy/paste, so if you don't use Linux, just ignore this. If you do, very soon the convenience of Unix/X11's rapid select and paste will work with the Arduino editor!

linuxgeek
04-22-2013, 12:06 AM
That's nice. Since you mentioned using an external editor awhile back, I went that route instead of putting off trying to use eclipse. I use emacs, and add the .ino files to be recognized as c++ files.

PaulStoffregen
04-22-2013, 04:37 PM
When I write a lot of code, I almost always use vim.

But every day I use the Arduino editor for troubleshooting why someone's code doesn't work, or why some library is incompatible. Typically I'll just copy code right from the forum into the editor without ever saving it to files in my sketchbook folder. That's a lot simpler than saving it to a directory+file in the sketchbook folder, and then opening it with both Arduino and vim.

I also copy stuff from Arduino pretty regularly too, into messages, web pages, etc.

Mac & Windows users have no idea how incredibly quick and convenient select-paste is when used together with focus-follows-cursor window management, which also doesn't exist on those platforms.

MichaelMeissner
04-22-2013, 05:46 PM
Its funny, I didn't notice the lack of cut+paste, since I normally use emacs as my external editor. However, for a different chip, I wanted to clone the blink example, and tried to copy the example via cut+paste. Because of the discussion both here and and in the Arduino forum, I quickly realized that it wouldn't work.

As an aside, I often times use cut+paste to upload entire twiki pages that compare two or more spec 2006 runs. Under emacs, this is fairly simple: 6 characters to mark the entire buffer, plus a few to open the file. These files are usually on the order of 1+ megabytes in size with 30,000+ lines in the twiki file. I found that chrome seems to silently truncate large cut+paste requests, but good old mozilla has no problems with such large requests. Of course it would be useful if I could just upload the twiki file directly, but the only way on the work servers is to use web uploading.
:cool:

gwideman
04-23-2013, 01:27 AM
Mac & Windows users have no idea how incredibly quick and convenient select-paste is when used together with focus-follows-cursor window management, which also doesn't exist on those platforms.

That is pretty convenient, I think especially for command line environment and paths. So far as editors go, on Windows (perhaps also on Mac?) there's drag-and-drop from one editor or browser to another editor. This has the slight advantage of not replacing whatever is in the cut/paste buffer. Sadly, Arduino editor doesn't seem to know about drag-and-drop.