Author Topic: HowTo do selections in an document  (Read 3250 times)

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
HowTo do selections in an document
« on: September 30, 2009, 04:37:12 PM »
I just collect some tips&tricks to easy do selections in an document.
One do not have to know all... but knowing some of them will increase your working speed dynamically.

Sorry for the lame layout how i present this...  but anyway: happy HippoEDITing all  ;D

O.K. let's start:

-------------------------------------------------------
01

Shift+Click   
- Click on one point at a line
- hold Shift
- Click on an another line  => all between is selected

-------------------------------------------------------
02

Shift+Click   on Pos1
- Click on one point at a line
- hold Shift
- Click on an another line but at Pos1 or at the LineNumbers => all LINES between are selected

-------------------------------------------------------
03

Left-Click on a LineNumber => whole Line is selected
Left-Click on a LineNumber and move mouse => all LineS are selected
Ctrl+Click on a LineNumber => whole file is selected

I don't know if i should mention Ctrl+A to select the whole document?, you all know this already i guess.

-------------------------------------------------------
04

Ctrl+Alt plus an Arrow-key (up/down/left/right) => select columns/block

Or hold the Alt-key and select columns/block  with the mouse while pressing the left mouse button.

Ctrl+Alt plus Arrow (up/down only) => zero-width selection for column-mode

-------------------------------------------------------
05

Double click selects whole word
Tripple click selects whole line
Double click on empty line selects whole document

Shift+PgUp/PgDown => select page wide

-------------------------------------------------------
06

Select an block:
- press F7 ("Navigation > Set Anchor")
- go up/down in document
- press Shift+F7 ("Edit > Selection > Select from Anchor")


Select an Function block:  (Function func() ... End Function)
Select an Statement block: (IF condition Then Else End If)
Select an HTML tags block: (<script ... </script>)
- go to one end of this block, e.g. go right before  "Function" or "IF" or "<script "
- press F7 ("Navigation > Set Anchor")
- jump to corresponding end by double clicking this keyword  "Function" or "IF" or "<script "
- at the other end of the block, (at "End Function" or "End IF" or "</script>" ) go to end of the line
- press Shift+F7 ("Edit > Selection > Select from Anchor")
The whole block is selected. Ready to copy, delete or comment it out.

(tip: To select an whole function block check out "Alt+Arrow down" and/or "Alt+G Smart Navigate" too. See below)


OR
- "Edit > Selection > Begin/End xxx Selection", best assign an shortcut to this command
- go up/down in document
- click left mouse button

-------------------------------------------------------
07

Select an paragraph
- put cursor inside an word or an line only
- Alt+Arrow down => select whole word
- next Alt+Arrow down => select whole line
- next Alt+Arrow down => select whole paragraph
- next Alt+Arrow down => select whole document
OR
Pos1, Alt+Arrow down => select whole paragraph

Back with Alt+Arrow up


OR
Ctrl+Shift+` => select to begin of next paragraph
Ctrl+Shift+ß  => select to begin of THIS paragraph

Tip:
Ctrl+` => Jumps to start of next paragraph
Ctrl+ß => Jumps to start of prev paragraph

So you can easy select whole paragraph with:
Strg+ß;   Strg+Shift+`;     2xShift+Arrow Left

OR put cursor on end of paragraph and press Strg+Shift+ß

(Note:
 ` and ?  are found on german keyboard layout.
Should be + and - on US-International layout?
Check it on http://en.wikipedia.org/wiki/Keyboard_layout#Germany_and_Austria_.28but_not_Switzerland.29
or check "Tools > Keyboard Settings..." and filter for paragraph to see what key is set for you.

EDIT: i found this on "Tools > Keyboard Settings... > [View...]"

№ Command                 Shortcut
1 Edit.ParagraphNext Ctrl + ]
2 Edit.ExtParagraphNext Shift + Ctrl + ]
3 Edit.ExtColumnParagraphNext Shift + Ctrl + Alt + ]
4 Edit.ParagraphPrev Ctrl + [
5 Edit.ExtParagraphPrev Shift + Ctrl + [
6 Edit.ExtColumnParagraphPrev Shift + Ctrl + Alt + [

)
-------------------------------------------------------
08

Extra fine:
"Edit > Selection > Lock F6" to never destroy the selection, till you do an another selection or press F6 again.

Even better:
"Edit > Selection > Restore" to re-select an by accident destroyed selection

-------------------------------------------------------
09

Ctrl+Arrow left/right => jump word wise
Shift+Arrow left/right => select char wise
Shift+Home/End => select till begin/end of line
Ctrl+Shift+Arrow left/right => select Word wise
Shift+Arrow up/down => select line wise
Ctrl+Shift+Arrow up/down => select whole lines
Press DEL-key or BackSpace, or Space to delete the selected text, or start typing to overwrite

-------------------------------------------------------
10

Ctrl+Arrow up/down => scroll current line up/down in view
Ctrl+Pos1/End => move cursor to Top/End Of File

-------------------------------------------------------
11

Ctrl+Click on an sign/char/word => all others are highlighted too

-------------------------------------------------------
12

Left-Click at Ruler => zero-width selection for column-mode edit is set over whole document
(could be used to visible check align of column, but take care not to modify your document)

Left-Click at Ruler and move mouse => select column

-------------------------------------------------------
13

Ctrl+D => Duplicate line or whole selection and paste above. (same like Ctrl+C;go up;Ctrl+V)
I use this often to duplicate my "adornment" lines between paragraph.
'/\/\/\/\***********:=:=:=:= my adornment line =:=:=:=:*********************/\/\/\/\'

-------------------------------------------------------
14

Tip BTW:
did you know HippoEDIT intern clipboard collection tool, called "Clipboard Ring"?

Try it by pressing Ctrl+Shift+V
... i do this right now to paste my paragraph-delimiter-line again from the Ring
-------------------------------------------------------
-------------------------------------------------------
-------------------------------------------------------




-------------------------------------------------------
15

Ctrl+Shift+Enter => Add an New Line above, even if you are in the middle of an line
Shift+Enter => Add an New Line below, even if you are in the middle of an line, so you get no line break as by using Enter alone.

-------------------------------------------------------
16

Ctrl+Alt+T => Transpose, swap, exchange current line with line above
Ctrl+Alt+Arrow up/down => move current line/selection up or down in document. (same as Ctrl+X;move;Ctrl+V)
This swaps the line with the next line and go further to the next but one.
Nifty to see if an text fit better to an other position or to move paragraph to an other place without involve the clipboard .

-------------------------------------------------------
17

"Edit > Line > Copy" Ctrl+Shift+T => copy whole line without selecting it first.
Same as Ctrl+C without an selection, if 'Easy Line Copy' flag is set in "Options->Formatting->Smart Helpers".

"Edit > Line > Cut"  Ctrl+Shift+X => cuts the whole line without selecting it first.
Same as Ctrl+X without an selection, if 'Easy Line Copy' flag is set in "Options->Formatting->Smart Helpers".

"Edit > Line > Delete" Ctrl+Shift+L => deletes the whole line without selecting it first.
Same as Ctrl+X without an selection, but does NOT store it at the clipboard for re-use.

"Edit > Line > Delete to End" Ctrl+Shift+Del => delete from current position to end of line.
Same as Shift+End; Del.
Tip: Use Shift+Pos1 to delete from current position to start of line


-------------------------------------------------------
18

Example text for testing the above commands:

1 HippoEDIT is an editor
2 HippoEDIT is portable
3 HippoEDIT use highlighting
4 HippoEDIT supports RegEx
5 HippoEDIT use per syntax settings
6 HippoEDIT have word completion function
7 HippoEDIT provide column editing
8 HippoEDIT edit multi files at once


More to come... till then check out "Edit" and "Navigation" menu or check "Tools > Keyboard Settings...".




19

Select text inside brackets and Quotes:
Which type of braces would be taken into account
on Expand/Shrink Selection (Alt+arrow up/down) depends on <lang>_spec.xml schema (OpenClose tags), example:
    <SPECIFICATION>
      <OpenClose>()[]{}''&lt;&gt;</OpenClose>


If have modified my txt_spec.xml and use this open/close specification for my tests:
<OpenClose>""()[]{}''&lt;&gt;``´´&gt;&lt;</OpenClose>

Normally, when you expand an selection, first you should get text inside braces selected, then text together with braces.
Then whole line is selected, then outer braces, then next and then whole file.


Example 1, cursor was on word in bold, then Alt+Arrow down was pressed 5 times, then code in blue was selected:

int main(int argc, char *argv[])
{
   printf("Hello, world\n");
   for (int i = 0; i < ; i++)
   {
     test line test line
   }
   return 0;
}






Example 2, various braces to test with:
Place your cursor inside of the braces and press Alt+Arrow down one or more times.
If something doesn't work, the OpenClose tags have to be adjusted for your current syntax.

      {test line test line}
      [test line test line]
      'test line test line'
      `test line test line`
      (test line test line)
      <test line test line>
       "test line test line"."test line test line""test line test line" "test line test line"
      {"test line test line"}
      ["test line test line"]
      '"test line test line"'
      `"test line test line"`
      ("test line test line")
      <"test line test line">
      <TR><td>table data here</td></TR>
      <TR><td>"table data here"</td></TR>
      {test
         line
         test line}
      [test
          line test line]
      'test
         line test line'
      `test line
         test line`
      (test line
         test line)
      <test line
         test line>
         



Example 3, multi line test text to experiment with:

(Multi line test sentences Multi line test sentences.
Multi line test sentences.
   Multi line test sentences Multi line test sentences
   Multi line test sentencesMulti line test sentences.
 Multi line test sentences.)

"Multi line test sentences Multi line test sentences.
Multi line test sentences.
   Multi line test sentences Multi line test sentences
   Multi line test sentencesMulti line test sentences.
 Multi line test sentences."

---

20

Brackets or Quotes around Selection
Note that you can also put brackets and quotes around an selection.

"Tools > Options > Formatting > Smart Helpers" > "Surround Selection With (, {, [, " ' "
will put brackets on both sides of an selection - if opening bracket is pressed.

- select an word or line
- press opening bracket or quote
=> the selection is surrounded.


Which type of braces would be taken into account
depends on <lang>_spec.xml schema (OpenClose tags), example:
    <SPECIFICATION>
      <OpenClose>()[]{}''&lt;&gt;</OpenClose>



21

Select whole HTML tags:
How To Do:
- go to (1)
- press F7 (Set Anchor in current position)
- go inside the opening tag (2)
- press Alt+G (Smart Navigate to go to matching tag) (3)
- go outside the tag (4)
- use Select From Anchor (Shit+F7)
and the whole tag is selected.
Note that this works only if the scope is defined in the lang_spec.xml,
i.e. jump f.ex. to HTML-tag works only in an HTML document.



<html>
 (1)<h(2)ead>
  <title>Untitled</title>
  <meta name="generator" content="HippoEDIT" />
  <meta name="author" content="Stefan Monk" />
  <meta name="keywords" content="" />
  <meta name="description" content="" />
 </(3)head>(4)
 <body>
   <DIV style=width:65%;>
 "test line test line"

  </DIV>
 </body>
</html>

Note: Alt+G (Smart Navigate to go to matching tag) works only if the syntax this supports,
      i.e if the open/close tags are defined in lang_spec.xml, example:
      <SCOPES open_container="xml_open_tag" close_container="xml_close_tag">
         <Scope open="a" close="a"/>
         <Scope open="table" close="table"/>


-------------------------------------------------------
22

_
« Last Edit: March 23, 2012, 08:29:50 AM by Stefan »
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-