Hi,
i would like to see a column selection mode .
You can drag with the middle mouse button (generally the mouse wheel), or shift+right mouse button to do a column selection.
Ah, didnāt try that, thanks.
[size=75]although it would be nice if this could be trigged via keyboard only too (alt+ up/down/left/right?)[/size]
another thing:
when i have something like this
foo foo bar bar
foo foo bar bar
foo foo bar bar
foo foo bar bar
foo foo bar bar
foo foo bar bar
foo foo bar bar
foo foo bar bar
and want to replace/select the first ābarā i get this
foo foo |bar| bar
foo foo |bar| bar
|
foo foo |bar| bar
foo foo |bar| bar
|
foo foo |bar| bar
foo foo |bar| bar
|
foo foo |bar| bar
foo foo |bar| bar
Imho it would be nice if empty parts would be ignored when selecting columns, so only the bars would be selected.
Sometimes you want the column selection to select empty areas, such as dragging to the right of the text to quickly get one cursor per line.
Iāll take a look at changing the behaviour so that all the empty regions are removed as soon as thereās at least one non-empty region in the column selection.
Iām new to Sublime so Iām not sure if this is already possible, but it would be really useful to be able to do column mode selection from the keyboard - maybe alt+arrows, rather than the normal shift+arrows - does anyone know if you can do this now, or if itās planned for the future?
Welcome to the forums! Thereās no way to do it yet, but Iāll add something for the next beta.
Still only half way there: As Sublimator mentioned, Ctrl+alt+up/down implements a sort-of column select.
And if, like me, you need to cut & paste some columns using the keyboard, hereās a simple plugin to do it:
import sublime, sublimeplugin
class pasteColumnCommand(sublimeplugin.TextCommand):
def run(self, view, args):
clip = sublime.getClipboard().split(u"\n")
for region in view.sel():
view.replace(region, clip.pop(0))
def isEnabled(self, view, args):
return sublime.getClipboard() != ""
Column selection and replace works amazing, but it is only for rectangular selection
e.g. replacing - with _ in the name attribute without touching the other -
<string name="x-x-x">a-a-a</string>
<string name="y-y-y">b-b-b</string>
<string name="z-z-z">c-c-c</string>
I have tried other editors as well and then replace in the column selection was not possible (selection disabled or all lines were selected)
But what if it looks like:
<string name="x-x">a-a-a</string>
<string name="y-y-y-y-y">b-b-b</string>
<string name="z-z-z">c-c-c</string>
What I would like is an organically adjusting selection. You select x-x and then like column selection it auto adjusts the selection upto the double quotes. It looks constantly for the same shape in every line and add it to the selection.
I donāt know if this already possible in Sublime Text by the way or what the real name for it is ( āorganic block selectionā, ācolumn selection with GaudĆ featureā,āshape based selectionā, āauto regexp selectionā ).
There are different ways to do this with multiple selections in Sublime. On approach is to use whole-word navigation (ctrl+shift+arrow_keys) once you have the cursors at the beginning (or end) of your desired text. shift+home/end are also very helpful. Iām almost always able to fulfill my oddly-shaped selection criteria using that approach. In the few cases where that approach hasnāt worked, you can always do a regular expression search.
In your example, you could easily get your desired multiple selections in the following way: