‘Make the editor work like Sublime Text or Crimson!’
So goes the several dozen requests I get each year.
Well, in version 4.1, we’ve got something I think you’ll like. It’s a bit different than column text edit modes – but it allows for the same idea, and it’s even more powerful…I think.
You can set the multi-cursor ‘hot key’ in the preferences:
You like?
@thatjeffsmith Does it count as "lifeless geek" if I find this mind-blowingly awesome?
— Christian Berg (@Nephentur) December 11, 2014
33 Comments
How did you apply the leading commas? It’s not clear in the picture. I am using Version 19.1.0.094.
Invoke the formatter via keyboard shortcut, and then also make sure formatter is set to apply leading vs trailing commas.
PS your copy of SQLDev is 2.5 years old now.
I got it. It’s mentioned in another article. Tools> preferences> code editor> format> advanced formatting> line breaks> set “on comma” to before.
Using a Mac, SQL-developer 18.3, database: 12c
I cannot make click-shift-control do the magic of multi-cursor. Soon as I hit Control and Click, the “right click” menu rolls down.
However, if I switch to Block Selection, I can hold shift pressed and use Down arrow to make a multi cursor on each line, which is nicer than having to click around.
Esc releases the cursors, so ther’s one left to play with.
Block Selection and Multi Cursor are both very nice features.
check Preferences, Mouse Actions
might be set differently on a mac
I just wanted to add I’m having the same issue on a Mac (right click menu appearing on Ctrl + click). It seems it’s a MacOS-wide feature that can’t be disabled. Fortunately we can change the keys pressed for this in SQL Developer, to make it Command+Shift instead.
Hi Jeff,
Is there a setting to allow the multi cursor edit to work with a mouse scroll?
CTRL-SHIFT mouse scroll?
Version 4.2.0.17.089
Build 17.089.1709
Thanks.
Hello,
I’m able to add new multi-line cursors with Ctrl+Alt+Down while editing packages but not in a SQL Worksheet. Only Ctrl+Shift+Click works in SQL Worksheet to add multiple cursors. Why it’s so?
I have this issue as well. The options ‘Add Cursor Above’ and ‘Add Cursor Below’ are greyed out in all SQL Worksheets, but available in all Object Editors. It would be very nice to have them in SQL Worksheets as well.
just ctrl+shift+click to add a new cursor in a SQL Worksheet
Thanks Jeff.
Can we select with arrow keys instead of mouse clicks? like that in Microsoft SSMS or Visual Studio?
Nice…
How about combining this with Code Templates, by multi-selecting all instances of [xxx] in a template after expansion? 🙂
I like that idea, a lot. For now you’d have to use search/replace…
Nice feature Jeff, thanks.
I’m interested in the feature at the start of your animation where you hover over the asterisk and “explode” the table columns. This doesn’t happen for me, but I probably have some options disabled (for example I tried enabling the Completion Insight settings but it made no difference). Please advise. Version 4.1.1.19.
the table cols ‘explode’ should work for everyone in 4.1
the select ‘explode’ will only work if you’re on a 12c db though
can you send me a screenshot of your worksheet?
also, try a blank worksheet, type
SELECT * FROM HR.EMPLOYEES
wait a second, do you get a squiggle under the ‘*’ ?
We are on 11g, so I guess that explains it? No, there is no squiggle that appears, nothing happens at all if I hover over the asterisk. I’m not sure how to send you a screenshot, but it probably wouldn’t show you very much.
No, it should work.
View > Log
Statements
When you type your statement, you should see our parser running these two queries. First, we try to figure out what kind of object you’re querying. Then we ask the data dictionary for a list of columns on said object.
begin SYS.DBMS_UTILITY.NAME_RESOLVE(?,?,?,?, ?,?,?,?); end;
SELECT ‘COLUMN’ type, owner, table_name object_name, column_name, column_id, data_type
FROM sys.all_tab_cols
WHERE hidden_column = ‘NO’ and rownum <=999 and owner = ? and table_name = ? Do you see these running? Try running them yourself using the bind variables as shown in the log. If you get nothing back or an error, that's why the feature isn't working for you.
Thanks Jeff. But what were you saying regarding a 12c database previously?
I enabled the log/statements tab as you suggested. No amount of hovering over the asterisk makes anything appear in the log. I’m not sure whether the whole query needs to be highlighted first or not, but I tried with and without and it makes no difference.
I am able to run the all_tab_cols query with no problems. I haven’t tried the dbms_utility call as I don’t know what the parms are.
if you could please help, install sql developer v4.1 and facing a problem that courser cursor disappears using debian jessie 8.0 with jdk 8 which runs fine with sql developer 4.0 with jdk 7.x but i prefer the new with it’s cool panel DBA > Database Status > DB instance.
it’s probably something between debian and your java 8 version…
I would love to see an option where you could press Cntrl+Shift and drag down vertically to select a block of lines to multi-edit .
This is great – thank you!
Great feature. Not sure if this is the same or different, but I was looking for block-select too (think it might be called column selection) — might that make an appearance?
thanks!
i think eventually…we have block select now, but not block-select-editing
Hi Jeff.
Neat, and perhapsfunctional for writing new sql, but that’s still going to be a lot of clicks. Probably still easier to paste it into Sublime Text, do the heavy duty editing, and then paste back into SQL Dev.
Most apps do implement a click and drag, for Sublime it’s shift-RightClick and just drag.
yeah, I think there’s something that we can do about that, just have to circle the developer back in
This is awesome.
Hi Jeff
I like it! However, the only one downside I see is having to click on each individual line. That could get tedious for a larger amount of lines.
I would love to see an option where you could press Cntrl+Shift and drag down vertically to select a block of lines to multi-edit .
I mentioned that to the developer, and I think that won’t be too hard to make happen.
Great! – Thanks Jeff.
I concur. This is a feature all editors should have, but loses vital points for not being able to click/drag.
Click drag would make this ideal.
i’m all for less mouse and more keyboard, trying to get the keyboard toggle to work for the GA release