Fork me on GitHub
#spacemacs
<
2017-11-21
>
eggsyntax02:11:12

@alexkeyes more than anything, I'd read this article. If it's something you already intuitively get, it won't give you much, but it took me a long time of vimming to really grasp it. Quick read: https://yanpritzker.com/learn-to-speak-vim-verbs-nouns-and-modifiers-d7bfed1f6b2d

eggsyntax02:11:16

& in conjunction with that, be aware that SM will let you define your own text objects, which are then combinatorially valuable.

eggsyntax02:11:32

(as well as, of course, your own verbs)

vuuvi14:11:54

@eggsyntax currently reading the article you sent - thanks for sharing

vuuvi14:11:11

and to respond to your second point - i have actually defined my own keyboard commands before, when using the Spotify app. It was a pretty cool experience and it definitely helped give context to how Spacemacs works and the philosophy behind using the spc bar as a leader key

eggsyntax14:11:50

Well, to clarify, IMHO defining a new text object goes somewhat beyond defining a keyboard command, because text objects are the "nouns" in the article -- so for example if you define a sexp text object (which some layers already do, of course), you can use it with every verb vim/SM supports.

vuuvi14:11:00

oh I see!

vuuvi14:11:06

yeah I’ve never done that hahah

eggsyntax14:11:03

I've only done it once or twice, since most useful text objects are already defined, but on those rare occasions it's been incredibly powerful 🙂

vuuvi14:11:40

that article was really helpful!

vuuvi15:11:00

I guess what I’ve been trying to get at lately is some kind of cheatsheet so that I know I know all the possible verbs and nouns

eggsyntax15:11:32

Ah, yeah, I know there's cheatsheets out there, but I don't know a good one offhand.

vuuvi15:11:35

I guess ones I don’t know means that I probably am not going to find them too useful in the future but IDK

vuuvi15:11:50

yeah I’ll keep looking and if I come across one I’ll post it here

chris15:11:55

fwiw by default spacemacs has extra motions and operators built in that aren't in vim

chris15:11:46

the argument and symbol text objects are particularly helpful

vuuvi15:11:25

that’s interesting

vuuvi15:11:15

I mean my only use of ‘real’ vim is when I need to edit a text file or something on a server that isn’t my localhost

eggsyntax16:11:59

@chris do you happen to know where that's documented? Just googled and not coming up w/ it so far.

chris16:11:50

oops there's a bug on there \vert should have been expanded to |

chris16:11:02

but that's more helpful than I've ever seen

vuuvi16:11:13

when you guys are using visual mode do you directly enter it or do you just user the v command as needed?

vuuvi16:11:08

for example, more often than not I find myself using the V or v[somenouns] to select things instead of directly entering visual mode with SPC v

eggsyntax16:11:25

I pretty much never do SPC v. I think (perhaps mistakenly) of v as entering visual mode, and then I move around as necessary. Bonus protip -- while in visual mode, o will jump the cursor to the other end of the selection. That's one I wish I'd known way sooner 😉

vuuvi16:11:48

oh that’s a major key!

vuuvi16:11:51

thanks for sharing

vuuvi16:11:37

I’ve been practicing visual mode via vimum in the browser that’s been helpful for general vim knowledge as well. plus it feels great to browse the web exclusively from the keyboard

eggsyntax16:11:05

(except: once I'm already in visual mode, I do occasionally do SPC v to expand the selection, but usually I find it faster to just use regular movement commands)

ag20:11:29

don't forget you can do vi(, vi[ vit etc. as "in" and va(, va[ as "a", you can select things between parens, brackets, tags, quotes etc. you can also quickly reselect things with gv

eggsyntax20:11:50

Anyone know a version of find-file (or projectile-helm, or any of the other file search tools) that either limits itself to source files, or preferentially lists source files? I mostly use projectile-helm, but often the first option is some haml file or other non-source file that's only very rarely what I'm looking for. Or, failing that, a way to exclude certain filetypes? Projectile supposedly has that (https://emacs.stackexchange.com/questions/16497/how-to-exclude-files-from-projectile) but I've never gotten it to work.

ag00:11:36

afaik it ignores files in .gitignore

eggsyntax18:11:14

Not stuff I can .gitignore, unfortunately, but good thought 🙂 I'll probably take another stab at doing it with projectile-globally-ignored-file-suffixes

eggsyntax18:11:35

& actually go dig into the source code for it this time...

vuuvi22:11:40

I haven’t had any issues - projectile-helm works well for me