I have liked a feature very much in Notepad++, pressing Alt
and selecting with the mouse enabled a rectangular selection, just like the selection on desktop...can not think of a proper term for it, maybe rectangular selection
or vertical selection
or block selection
. The cool thing was that it worked also with blank line endings, it generated spaces automatically.
Is there a similar functionality in Atom?
So for example, an use case would be to extract a list of files with tree
command :
.
├── element_portals_commands
│ ├── depends.txt
│ └── init.lua
├── element_portals_functional
│ ├── portal_data_api.lua
├── liquid_portals
│ ├── constants.lua
│ ├── crafts.lua
│ ├── depends.txt
│ ├── sounds
│ │ └── fireball_whoosh.ogg
│ └── textures
│ ├── ray_y_tile.png
│ └── README.md
.......
place the multi cursor at a fixed width (the last |
for each line represents the cursor)
. |
├── element_portals_commands |
│ ├── depends.txt |
│ └── init.lua |
................
│ ├── sounds |
│ │ └── fireball_whoosh.ogg |
│ └── textures |
│ ├── ray_y_tile.png |
│ └── README.md |
.......
and start typing
. <- |
├── element_portals_commands <- |
│ ├── depends.txt <- |
│ └── init.lua <- |
................
│ ├── sounds <- |
│ │ └── fireball_whoosh.ogg <- |
│ └── textures <- |
│ ├── ray_y_tile.png <- |
│ └── README.md <- |
.......
What I do now to achive this:
\r
or \n
with a lot of spaces \n
I'm sure there is a better way. It is possible without any plugin? Do you know an alternative?
Some further research showed that
Add selection below alt+shift+↓
places another cursor beneath the current cursor... but it doesn't pad the lines with white spaces. Exists something that also pads the lines ?
the default keybindings Ctrl+Shift+Up/Down seems to work. Then place the cursor where you want to start and press and hold Shift+Alt and press Up or Down repeatedly to extend the cursor to as many lines as needed.
Hold the modifier key then click and drag with the configured mouse button across multiple lines. Dragging vertically places carets on each line at that column; dragging horizontally as well selects the text on each line.
Ctrl+Alt+M ( Cmd+Ctrl+M on Mac) selects entire code inside the current brackets.
First, according to the official site of Notepad++, this function is called column mode editing.
There is a plugin to do similar thing in Atom, but sadly it will just skip lines if that line is not long enough, instaed of filling space. This is the plugin:
Sublime-style-column-select
Today I found a package in Atom named "column-select". So far it works perfectly fine. They way it works is very close to the implementation of Block selection of Rstudio and Kate.
It does not add space to fill the gap. It literally let you select vertically if there is anything there (skips empty lines and lines that does not have enough length).
The following gif from their github shows how it works:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With