Follow

if i was ceo of computers i would force everyone to use snake_case everywhere

unless you really need caps, in which case PascalCase is fine

kebab case is invalid and camel case even more so

@ionchy kebab case:
- conflicts with infix minus sign
- most text editors treat a kebab-case symbol as multiple symbols, whereas a snake_case symbol is treated as a single symbol
- looks like you're hyphenating everything

camelCase:
- makes renaming things difficult
- is it capitalized or not?
- just don't

@david

  • it's not an infix operator if it doesn't have spaces around it
  • they're wrong
  • yes

@ionchy why would you want a-b and a - b to mean different things

@david one is clearly a name and the other is clearly a subtraction

@david @ionchy counterpoint: I want to treat the components of a snake_kebab-camelCase identifier as separate words for keyboard navigation purposes, so that editor behaviour is actually correct.

@bruceiv @ionchy idk i prefer to be able to double click on an identifier and select the whole thing

@david @bruceiv they should make it so double click selects the word and triple click selects the identifier

@david @bruceiv I guess triple click is usually for selecting the whole line but I think I usually double click in the margin or smth like that? can't remember

@ionchy @bruceiv convenient because in sublime text you can press ctrl-L a bunch of times to select even more lines and then ctrl-shift-D to duplicate them

@ionchy @bruceiv it took me 4 years to learn the shortcuts on this thing and i am finally putting them to good use

@haskal @david @bruceiv I did like the little Vim tutorial in the beginning and I have not learned any new Vim shortcuts since unless someone mentions it

@ionchy @haskal @bruceiv i know i, a, h, j, k, l, x, d, g, G, and maybe if i played around with it a bit i could figure out how c works again

long 

@david @ionchy @bruceiv
y (copy ["yank"])
p (paste)
v (visual select. when mouse is enabled the mouse also visual selects)

b (back 1 word) and w (forward 1 word)
iw (suffix to do a thing on the word you are in the middle of)
^ $ (start and end of line)
% (matching paren, bracket, brace etc)

g C-g (display stats)

C-d and C-u (scroll up/down)
zz and zt and zb (scroll so the current line is in the middle, top and bottom)

f and F (use like, fx finds the next char x and Fx finds the previous char x)

J (join next line)
K (open manual)

r (replace 1 character)
R (enter replace mode)

o (insert new line below cursor)
O (insert new line above cursor)

gqip (reflow paragraph of text to fit the current column limit)

use numbers to repeat literally any of the above. even insert lol
if you hit 5i then type meow then esc
then it puts in 5 meows
or 2fx finds the second char x

* (search word under cursor)
# (same but search backwards)
n and N (next and prev search)

. (repeat last edit)

@david @ionchy
also tbh
me thinking i'm hot shit with vim:

milo writing agda in emax:

long 

@haskal @david I will forget the second half of these by tomorrow

@david @ionchy @bruceiv i started with vimtutor and that was enough to get editing lol
i still don't know the majority of shortcuts. only reason i tried vim is because i realized it's faster to type shortcuts than move my hand to the mouse, click on stuff, and then move it back
and i suck at typing fast. so strangely the solution to that is actually typing more keys

@david @ionchy @bruceiv also the definition of a word can change in vim which is useful
for example for racket viw selects any camel-case-identifier whereas for C it'll select only the C identifier and not include the -

@david @bruceiv huh. didn't know it did that
I think I only learned about ctrl-U deleting everything in front of the cursor some time last year

@david @bruceiv it depends where you are though, I only use ctrl-U in the terminal
not sure if it works in an editor, I usually go for ctrl-shift-backspace or press ctrl-backspace a bunch of times because I forget about deleting entire lines

@david I'm sorry to be the one to tell you this but pascal case is precisely camel case

Sign in to participate in the conversation
types.pl

A Mastodon instance for users who like the study of programming languages, formal semantics, types, or linguistics.