gabbar0x
gabbar0x

Reputation: 4266

Don't copy package name while copying complete a class code (Ctrl+A, Ctrl+C) code in Intellij

Is there any way I can configure Intellij to NOT copy the package name at the top of the code when I select and copy it? I need my code to be reusable because I often submit these to an Online Judge and find it tedious (and often forget) to remove this package name everytime.

Upvotes: 0

Views: 76

Answers (1)

Matt C
Matt C

Reputation: 4555

I think the easiest way it to add a few keyboard shortcuts before you copy:

CTRL+HOME         #Go to line 1
DOWN-ARROW        #Go to line 2
CTRL+SHIFT+END    #Select text from cursor to end of file
CTRL+C            #Copy selected text

Another set of shortcuts that will accomplish this:

CTRL+END          #Go to last line
CTRL+SHIFT+HOME   #Go to line 1
SHIFT+DOWN-ARROW  #Deselect line 1
CTRL+C            #Copy selection

There is no native way to configure IntelliJ to ignore a line when copying text.

Upvotes: 1

Related Questions