Home Download Buy Blog Forum Support

column selection

Re: column selection

Postby jps on Tue Apr 22, 2008 2:46 pm

Welcome to the forums! There's no way to do it yet, but I'll add something for the next beta.
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: column selection

Postby vim on Tue Sep 16, 2008 3:24 pm

Any update on binding column selection to keyboard shortcut?
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: column selection

Postby jps on Thu Sep 25, 2008 3:33 pm

Still only half way there: As Sublimator mentioned, Ctrl+alt+up/down implements a sort-of column select.
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: column selection

Postby vim on Thu Sep 25, 2008 8:26 pm

...and finish with shift to do the actual selection.
it's good enough, thanks
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: column selection

Postby gpfsmurf on Tue Oct 14, 2008 6:44 pm

And if, like me, you need to cut & paste some columns using the keyboard, here's a simple plugin to do it:

Code: Select all
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() != ""
gpfsmurf
 
Posts: 211
Joined: Mon Jun 23, 2008 6:31 pm

Re: column selection

Postby vim on Wed Oct 15, 2008 5:45 am

delicious! i was missing this kind of ability :)
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: column selection

Postby DaveM on Sun Aug 19, 2012 3:31 pm

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 -


Code: Select all
<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:

Code: Select all
<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" ;) ).
DaveM
 
Posts: 1
Joined: Sun Aug 19, 2012 3:12 pm

Re: column selection

Postby jbjornson on Mon Aug 20, 2012 7:42 am

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:
1) select all of the end of the name attribute values: closing quote with closing angle bracket (">)
2) extend the selections to the beginning of the line with shift+home
3) deselect to the beginning of the name attribute value with 3 times ctrl+shift+right_arrow.
jbjornson
 
Posts: 344
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland

Previous

Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 5 guests