I find the control+a and control+e hard to press, and for some reason control+shift+e doesn't seem to highlight the entire line.
I want to copy the line into my clipboard. How do I do this?
To highlight a line in TextMate, Shift+Command+L is what you want.
Command-LeftArrow Shift-DownArrow is one way
Triple-click, then hit ⌘+C to copy.
cmd-leftArrow # to get cursor to beginning of line
shift-cmd-rightArrow # to highlight entire line
cmd-c # copy the line to clipboard
If you want to duplicate a line you can use this shortcut:
Cmd + left arrow to go at the beginning of the line
Ctrl + Shift + D to duplicate the entire line below the one you want to duplicate
Duplicate Line / Selection (⌃⇧D) — this will duplicate the current line, leaving the caret in the same column on the new line, or if there is a selection, duplicate that.
Source: textMate official website
PERSONAL WARNING:
Selecting a word, or whatever, and apply this shortcut will duplicate next to the original one. Not below.
TIPS
If you want to move your new duplicated line or whatever:
Ctrl + Cmd + arrow up will move up
Ctrl + Cmd + arrow down will move down
Happy coding 🖖
Related
I usually duplicate the line if i need to use the code same as the above line. I did not find the shortcut key to duplicate the line . I saw some posts to implement shortcut key to duplicate line but they are rather complicated and requires to run script every time.
For anyone still looking for a keyboard shortcut to duplicate lines in Google Colab,Left_Alt + Shift + Down_arrow works for me!
if you want duplicate a code line or selected code lines just use ctrl+c and ctrl+v. or ctrl+c+v
I found the solution just in case anyone wants to use it.
Ctrl + Shift + Down_arrow
Use this: Alt + Shift + Arrow down
I can do command-return to create a new line under the current one, even if the caret is in the middle of a word, but I often find myself wishing there was a similar command for inserting a line above and moving the caret to it. Does that exist?
I know I can type out my new line and then move it, but it'd be nice to skip that.
Yep: ⌘ (Command) + shift + enter if you're on a Mac
Found here
Is there any way to select the whole line at caret in IntelliJ 15? I know you can select the current word (ctl + w), go to beginning/end of line but I can't find a current line selection feature.
Simply hit
ctrl+c
Note that for this to select the whole line, you need to ensure that nothing is already selected; otherwise it'll work as an usual "copy" command.
move caret to line
on Windows, press ctrl+shift+a .
This popup appears, where you find Select Line at Caret
for quick access, you can specify a shortcut in Settings
I would like to also add the following from JetBrains website. Because, that what i was looking for here, but no one mentioned it.
1- To select text from the current caret position to the beginning/end of
the current word:
Ctrl+Shift+Left, Ctrl+Shift+Right.
2- To select text from the caret
position to the beginning/end of the current line:
Double-click Ctrl and press Home/End
3- To select text from the current
caret position to the top/bottom of the screen:
Ctrl+Shift+Page Up, Ctrl+Shift+Page Down.
If none of the above are working, I suggest using end and home keys in combination with shift allowing you to select lines quickly.
Go to the end of the line and hit Ctrl+W. If you'll hit Ctrl+W at the beginning of the line it will select only one word.
Not a keyboard feature, but nice to use:
to select the whole row just click on row number on the left of the code.
In addition to that you can click and drag selection.
Moreover, you can doubleclick on the number of the first line of method which results selection of the whole method.
Is there an shortcut in nano for moving through a line faster? I have some log files with gigantic lines and getting to the middle of them is awful.
I know I could use a different text editor that doesn't have this particular problem (less will wrap lines), but I'm used to nano and I like a lot of its other features.
Here are the shortcuts for moving through a line in nano.
Use these to go faster through a line:
ctrl + space move one word forward in a line.
alt + space move one word backwards in a line.
Other line shortcuts:
ctrl + f move one character forward in a line.
ctrl + b move one character backwards in a line.
ctrl + a move to the beginning of a line.
ctrl + e move to the end of a line
To move to a specific line use ctrl + _.
You may want to check out more Nano Keyboard Commands
I'm curious if there is a way to paste text to the end of every line in Sublime 2? And conversely, to the beginning of every line.
test line one
test line two
test line three
test line four
...
Say you have 100 lines of text in the editor, and you want to paste quotation marks to the beginning and end of each line.
Is there an easy way to do this or a plugin that anyone would know of? This would often save me a lot of time on various projects.
Thanks.
Yeah Regex is cool, but there are other alternative.
Select all the lines you want to prefix or suffix
Goto menu Selection -> Split into Lines (Cmd/Ctrl + Shift + L)
This allows you to edit multiple lines at once. Now you can add *Quotes (") or anything * at start and end of each lines.
Here's the workflow I use all the time, using the keyboard only
Ctrl/Cmd + A Select All
Ctrl/Cmd + Shift + L Split into Lines
' Surround every line with quotes
Note that this doesn't work if there are blank lines in the selection.
Select all the lines on which you want to add prefix or suffix. (But if you want to add prefix or suffix to only specific lines, you can use ctrl+Left mouse button to create multiple cursors.)
Push Ctrl+Shift+L.
Push Home key and add prefix.
Push End key and add suffix.
Note, disable wordwrap, otherwise it will not work properly if your lines are longer than sublime's width.
Let's say you have these lines of code:
test line one
test line two
test line three
test line four
Using Search and Replace Ctrl+H with Regex let's find this: ^ and replace it with ", we'll have this:
"test line one
"test line two
"test line three
"test line four
Now let's search this: $ and replace it with ", now we'll have this:
"test line one"
"test line two"
"test line three"
"test line four"
You can use the Search & Replace feature with this regex ^([\w\d\_\.\s\-]*)$ to find text and the replaced text is "$1".
Use column selection. Column selection is one of the unique features of Sublime2; it is used to give you multiple matched cursors (tutorial here). To get multiple cursors, do one of the following:
Mouse:
Hold down the shift (Windows/Linux) or option key (Mac) while selecting a region with the mouse.
Clicking middle mouse button (or scroll) will select as a column also.
Keyboard:
Select the desired region.
Type control+shift+L (Windows/Linux) or command+shift+L (Mac)
You now have multiple lines selected, so you could type a quotation mark at the beginning and end of each line. It would be better to take advantage of Sublime's capabilities, and just type ". When you do this, Sublime automatically quotes the selected text.
Type esc to exit multiple cursor mode.
Select all lines you want to add a suffix or prefix.(command+ A to select all the lines)
Press command+shift+L. This will put one cursor at the end of every line and all the selected lines would still be selected.
For adding suffix press command+right and for adding prefix command+left. This will deselect all the earlier selected text and there will only be cursors at the end or start of every line.
Add required text