Glyphin » Forums » Cursor movement
Telash
Mikael Johansson
52 posts
1 project
#12769 Cursor movement
3 months, 2 weeks ago

I am currently working on cursor movement in Glyphin alpha 2. So, what kind of cursor movement would you all like/want?
Every kind will ofcource be bindable how ever you want.

The biggest obstacle to great software is lack of motivation. Motivate each other!
Hobey
Ruben Peter
2 posts
#12915 Cursor movement
3 months ago Edited by Ruben Peter on Aug. 21, 2017, 9:17 p.m.

Hey,
Here's a list of the cursor movement commands I currently use (feel free to tell me if something is unclear):



forward/backward one character
forward/backward one word*
forward/backward one subword* (subword as in an individual word in a multi_word_identifier/multiWordIdentifier)


beginning of line
beginning of line after indentation (= goto first non-whitespace character on current line)
end of line
end of line before comment


forward/backward one line
forward/backward several lines (eg. 3/6/12/24)
previous/next blank line
goto line (prompt for number)


forward/backward one page
cursor to line at middle of screen
beginning/end of file



beginning/end of scope
beginning/end of function definition

forward/backward one statement (when at top-level, forward/backward one global declaration)
forward/backward one item in comma seperated list

goto matching parentheses/brackets/braces/quotes () [] {} "Hello"
seek forward to an opening parentheses/brackets/braces / beginning-quote
seek backward to an closing parentheses/brackets/braces / end-quote



previous/next occurence of identifier at cursor
previous/next occurence of selected region
goto declaration of identifier at cursor



swap mark and cursor = cursor to other end of selected region

previous/next error (for "compile/build in editor")





*
in my setup,
"forward one word" always goes to the end of the word,
"backward one word" to the beginning of the word;

this makes marking/selecting a word or group of words nice IMO,
but maybe there should be four seperate commands, like
"next beginning of a word"
"previous beginning of a word"
"next end of a word"
"previous end of a word"

same applies for subwords


Telash
Mikael Johansson
52 posts
1 project
#12917 Cursor movement
3 months ago

Wow, that was a long list :D
I am sure most of it can be implemented eventually, but how do you keep track of all those ways to move thew cursor? And how do you keybind them?

The biggest obstacle to great software is lack of motivation. Motivate each other!
mrmixer
Simon Anciaux
286 posts
#12923 Cursor movement
3 months ago

For word movement left or right I like
- the cursor to stop at the beginning and end of words
- to skip any character that is not a letter, a number or underscore, meaning it doesn't stop on ; , ( ) [ ] < > + - * / ...
- backspace and delete key to work on words too (ctrl + delete, ctrl + backspace).

I don't use those because I find that less keybind is better (doesn't mean you should not have them):
- subword movements
- next/previous blank line (I use fixed 10 lines jump)
- forward/backward one page
- cursor to line at middle of screen
- beginning/end of scope
- beginning/end of function definition
- forward/backward one statement
- forward/backward one item in comma seperated list
- seek forward to an opening parentheses/brackets/braces/beginning-quote
- seek backward to an closing parentheses/brackets/braces/end-quote
- previous/next occurence of identifier at cursor
- previous/next occurence of selected region
Hobey
Ruben Peter
2 posts
#12944 Cursor movement
2 months, 4 weeks ago Edited by Ruben Peter on Aug. 26, 2017, 4:32 p.m.

Telash
... how do you keep track of all those ways to move thew cursor?

I don't really know ... I just kept adding more commands when I felt like I wanted something specific to be more convenient and removed/replaced the ones that I rarely used.

As to
Telash
And how do you keybind them?

I use a 2-mode setup (3 if you count search/i-search bindings), so that helps. But I mean there are a lot of possible keybindings:
48 keys (or more if you count F1-12, arrow keys, page-up/down etc.) * 8 combinations of shift/ctrl/alt = 384
Though, this includes awkward keybindings like "ctrl-alt-!"