Is there a way to only copy the text and not the blank space around it?


#1

Is there a package or setting I can change that when I copy a whole line of text only the actual text is selected and not the blank space surrounding it?


#2

Are you experiencing a behavior where white space that you have not selected is getting copied, or are you trying to be able to select a line minus the white space?


#3

“Trying to be able to select a line minus the white space”.


#5

How are you selecting the line?


#6

Either by highlighting the text or copying the whole line.
I would like to be able to copy the whole line without all the blank space since its quicker than highlighting.


#7

There are a bunch of ways to highlight text and copy lines. If you have a specific input sequence that you would like to translate into “select this line with no external white space” or “copy this line with no external white space”, Atom can be told to do that thing.


#8

Do you have autoindent enabled? (In the Editor tab under settings)

Pressing ctrl-c on a line with no selection will copy the line, ignoring the beginning whitespace. It will pick up any trailing whitespace, but that shouldn’t exist because the whitespace package should be stripping it. (If you actually want trailing whitespace for something, I’d be surprised)

What you are seeing may be the effect of autoindent, where it will automatically insert whitepace before the line to make it line up with the first line above that has text.


#9

I think that was the issue. I had auto indent on. Cool thanks