Fork me on GitHub
#vim
<
2022-03-26
>
sheluchin10:03:37

How do I debug/fine tune the indent rules? It seems particularly after I enabled treesitter, indents are not being handled correctly in some cases.

dharrigan11:03:17

If you do set, you should see something like indentexpr=GetClojureIndent()

dharrigan11:03:25

that will be the function used to indent your code

dharrigan11:03:29

for me, I use vim-polygot

dharrigan11:03:51

do you use vim-polygot?

sheluchin11:03:41

@dharrigan I do not. As far as Clojure is concerned, I think these are the plugins that are at play: • neoclide/coc.nvim: coc-clojure, coc-highlight • vim-scripts/VimClojure • guns/vim-sexp • liquidz/vim-iced • liquidz/vim-iced-coc-source • nvim-treesitter/nvim-treesitter In my case, it looks like vim-iced is controlling indents: indentexpr=GetIcedIndent(). Although iced itself interacts with other plugins in a way I haven't yet made sense of. Maybe it doesn't support treesitter properly?

dharrigan11:03:32

Unable to comment really, as I don't use either. Perhaps if you go into $HOME/.vim/bundle/vim-iced.... and have a look around for that function

dharrigan11:03:37

you can discern what it is doing

dharrigan11:03:28

there are other things that will help you like :h formatprg, :h formatexpr, and so on

dharrigan11:03:31

good luck!

🙏 1
dharrigan11:03:39

Are you sure you need vim-scripts/vimclojure? Wouldn't coc give you thinks like completion etc...?

dharrigan11:03:44

and vim-iced for eval etc...?

sheluchin11:03:24

I am not sure. I'm certain there is some overlap in my plugins but arrived at this combination through trial and error. I'll try disabling.

dharrigan11:03:50

If you want to view mine, it is here:

dharrigan11:03:01

althoug I do use conjure, not iced. Everything else should be similar.

sheluchin11:03:01

> vim-iced’s code formatting is powered by cljfmt. Maybe cljfmt isn't playing nicely with treesitter :thinking_face:

sheluchin11:03:26

I've perused your repo and copied bits of it 🙂

dharrigan11:03:43

🙂 good good 🙂 Take what you need, reject want you don't like 🙂

sheluchin11:03:46

iced is pretty great but I think I'll have to give conjure a spin one of these days.

dharrigan11:03:31

I've just updated the repo with my latest, which brings in telescope, which is pretty awesome.

sheluchin11:03:42

I keep seeing telescope mentioned all over the place. It isn't redundant when using vim-fzf for search/file selection, etc.?

dharrigan11:03:10

Perhaps, although telescope does use fzf if you want it to

dharrigan11:03:14

It's very fast

dharrigan11:03:22

and has great integration with neovim

dharrigan11:03:59

I actually also use this plugin for it

dharrigan11:03:07

which makes it even faster

sheluchin11:03:22

Do you know if it supports autocomplete the same way fzf does or if it's just based around that popup interface?

dharrigan11:03:44

I'm not sure exactly what you mean by autocomplete?

dharrigan11:03:24

Well, I do use both, so I use telescope for searching files and grepping and buffers

dharrigan11:03:33

then I still have the fzf plugin for autocomplete

dharrigan11:03:51

they work together fine 🙂

dharrigan11:03:08

perhaps there is a more optimal solution, but seems to be okay so far

sheluchin11:03:18

Makes sense. I'll try it out once I get these indents sorted lol

dharrigan11:03:24

good luck!

🙏 1
dharrigan11:03:43

time to feed the dog and take for a walk

snoe18:03:22

Hi, if I have a binding to clojure-lsp to transpose map entries

nnoremap <silent> crmu :call CocRequest('clojure-lsp', 'workspace/executeCommand', {'command': 'move-coll-entry-up', 'arguments': [Expand('%:p'), line('.') - 1, col('.') - 1]})<CR>
Is it possible to make that repeatable (using .) with https://github.com/tpope/vim-repeat ?

Leaf Garland09:03:01

vim-repeat is a fairly basic idea - you define your mapping to include a call that maps . to your mapping. Something like the below.

nnoremap <silent> <Plug>InitMoveColEntryUp
\ :call CocRequest('clojure-lsp', 'workspace/executeCommand', {'command': 'move-coll-entry-up', 'arguments': [Expand('%:p'), line('.') - 1, col('.') - 1]})<CR><Bar>
\ silent! call repeat#set("\<Plug>InitMoveColEntryUp")

nnoremap crmu <Plug>InitMoveColEntryUp