Fork me on GitHub
#vim
<
2023-11-22
>
samoleary11:11:28

Any Astrovim users know how to jump from function to function or form to form? 👀 I'm used to vim-sexp and vim-sexp-mappings-for-regular-people, I can't seem to figure out the equivalent or perhaps replacement?

practicalli-johnny12:11:11

I havent seen specifics for navigating between expressions in a file, Mostly I use / search to move around or 10 j to jump lines. However, I also use some LSP magic... g d will jump to definitions, including let and function args SPC l s shows symbols in telescope popup SPC l S shows symbols in a new buffer Otherwise try adding the vim-sexp mappings package or investigate some more neovim navigation options, e.g some hints in this stack exchange post https://vi.stackexchange.com/a/35201 I would also find it useful to learn more about neovim built-in tools for navigating code and any lua plugins that help with Clojure

timo13:11:56

there is also shift+[ and shift+] for traversing code blocks

practicalli-johnny13:11:21

% is useful to jump between matching parens (open close parens). I use this with visual select to cut and move expressions around

chico15:11:53

I know it's not what you asked, but any reason not to use Astrovim + sexp?

samoleary10:11:36

Perfect, this plugin is exactly what I'm looking for! Thanks @U05254DQM!

practicalli-johnny13:11:38

@UAJLHU1V1 let me know how you get on with the plugin and I'll add a configuration to the Astronvim community Clojure pack. I am interested in knowing if there are any key binding conflicts with existing Astronvim keys

samoleary11:11:52

It's working great so far. Slurping and barfing don't play nice with parinfer as you might expect but haven't come across any surprises yet.

practicalli-johnny11:11:59

Thanks for the feedback Sam. I'll hopefully do some coding myself and see if I can make some useful tweaks to the AstroNvim Clojure pack (or add docs & examples to override parinfer)