change ace editor line numbering to relative to cursor - ace-editor

Is it possible to change the line numbering of Ace Editor to show lines relative to current cursor position, such as in the following gif? Of course it does not need to be as pretty.

There is relativeLineNumbers option in the editor, which looks almost that pretty
editor.setOption("relativeLineNumbers", true)

Related

RichEdit20A line selection mode similar to Notepad

I'm trying to change the way RichEdit20A Windows control selects line so it's similar to how it works in Notepad.
By default, if I select a line (e.g. Shift-End), then all the characters and the end of line is selected:
Sample text
^^^^^^^^^^^^ <- this is the selection
In Notepad it selects just the text:
Sample text
^^^^^^^^^^^
As a result, pressing delete (or backspace) in RichEdit20A control removes the line while in Notepad it just removes the text and keeps the line empty.
Is there any simple way (other than handling selection on my own) to configure the RichEdit20A control to keep formatting but make the line selection to work like in Notepad?
I don't know such a setting to influence the RTF control. But pressing Shift+End is a key input that is possible to trap with a WM_KEYDOWN handler, when you subclass the control.
You can use EM_LINEINDEX with -1 to get the current line start index.
Now with this index you can use EM_LINELENGTH.
Get the current selection (EM_GESTEL) and now you are free to use EM_SETSEL with the values you like to extend it.

Sublime behavior like in VS

How to do same behaving in Sublime Text as in Visual Studio, when using column selection
for example if there is a line break in a text, the cursor in Sublime go to beginning of a line
And this is behavior in Visual Studio desired behavior
Thanks
While you may want this functionality for other reasons, it seems like you are using it to adjust the indentation of code blocks. Fortunately, there is a much easier way of doing this. Select the text for which you want to change the indentation, then press Ctrl] to increase the indentation (move block right), or Ctrl[ to decrease indentation (move block left). You can also increase indentation by selecting the desired lines and hitting Tab, and using ShiftTab to decrease it. The one place I can think of where multiple selections would come in handy is if, for some reason, you need to indent/dedent by fewer spaces than are in your tab stop. For example, if I have some code that's indented 3 spaces, and I want to change it to 4 (using the Indent Using Spaces setting in the View -> Indentation menu), I would use a multiple selection to put a cursor on each line, then use Space or Backspace to adjust spacing appropriately.

How to Add tab space to multilple line at the same time in any text editor

If you select a text you can add multiple tab spaces to the all lines simultaneously.
For that you must select the n lines of the code and press the key tab. If you want
remove the tab spaces should select the text and press shift+tab.
I was programming in my job and I accidentally discovered this in the IDE eclipse. I test the same process
in the Sublime Text and Geany and it works too.
Y suposse and pressume that works for the most of text editor
I can confirm the answer from kelgwiin for sublime text.
Depending on your platform you could also do the following in sublime text:
Linux: Hold shift and the right mouse button, then move the mouse up or down to make a column selection.
Windows + OS X: Simply hold down the mousewheel and move your mouse up and and down to select the columns.
Hope this helps!
On Geany you can create by using Alt+Shift+Mouse (Windows) or Ctrl-Shift-Mouse (*x) a multiline cursor or an rectange selection, where you can work on many lines at the same time. This is only working for lines 'in row' so you cannot choose line 9 and lines 12-16 and lines 23-44 to be edited at the same time.

Select upward when cursor is at the bottom of the selected block

Sometimes I select a block of text downward and notice that I want to select one extra line at the beginning (and vice-versa). Is there a way to do it without losing my current selection in Sublime Text?
Thanks.
Found this plugin:
https://github.com/philippotto/Sublime-MultiEditUtils/#normalize-and-toggle-region-ends
Which also includes some other nice features.

Can VS be configured to automatically remove blank line(s) after text is cut?

Is there a way (or shortcut) to tell VS 2008 that it cuts a line like this:
Before:
Some Text here
This gets cut
Some Code there
After:
Some Text here
Some Code there
What I want:
Some Text here
Some Code there
PS: I don't want to select the whole line or something like this... only the text I want to cut.
Unless I misunderstood you:
Just place cursor on the line you want to cut (no selection) and press Ctrl + x. That cuts the line (leaving no blanks) and puts the text in the Clipboard. (tested in MS VC# 2008 Express with no additional settings I'm aware of)
Is that what you want?
Shift+Delete also works.
Select a line and hit Shift-Delete it will remove the line and place that line in your clipboard.
Don't select anything, just hit ctrl+x when the cursor is on the line.

Resources