This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-15
Channels
- # announcements (8)
- # architecture (9)
- # autochrome-github (1)
- # babashka (48)
- # beginners (55)
- # calva (36)
- # cider (16)
- # clj-commons (1)
- # clj-kondo (38)
- # cljs-dev (44)
- # cljsrn (1)
- # clojure (164)
- # clojure-europe (35)
- # clojure-nl (2)
- # clojure-norway (10)
- # clojure-uk (23)
- # clojurescript (50)
- # conjure (24)
- # core-async (1)
- # cryogen (2)
- # cursive (38)
- # datalevin (11)
- # datascript (2)
- # datomic (13)
- # duct (1)
- # emacs (16)
- # events (12)
- # exercism (3)
- # figwheel-main (7)
- # fulcro (26)
- # honeysql (5)
- # integrant (1)
- # jobs (3)
- # kaocha (6)
- # lsp (72)
- # malli (22)
- # nextjournal (35)
- # nrepl (1)
- # off-topic (34)
- # pathom (5)
- # polylith (8)
- # portal (40)
- # re-frame (14)
- # reagent (42)
- # reitit (1)
- # releases (1)
- # remote-jobs (1)
- # reveal (9)
- # sci (2)
- # shadow-cljs (13)
- # sql (3)
- # tools-deps (33)
- # vim (25)
General vim question for you folks cuz I wasn't able to get help on the neovim and coc gitters: I've been doing a lot of html and I have autocomplete working fine but the behavior I want is like in VSC where when you have `<div>|</div>` and hit enter it autoindents the cursor and pushes the closing tag to it's own line like so:
<div>
|
</div>
Right now I just get:
<div>
|</div>
which is no huge deal obviously but I would love to streamline that and not have to manually format it correctly because my autoformatter doesn't give me the desired behavior after the fact either.really not sure, mine does the same. this plugin makes it so that you press >
in that situation and it lays things out like you want
<https://github.com/alvan/vim-closetag>
but idk how you would get the same effect with enter
what does :verbose set indentexpr?
say?
` indentexpr=HtmlIndent() Last set from /usr/local/share/nvim/runtime/indent/html.vim line 36 `
indent works when I go from say <body>|
and hit enter. It just doesn't work when the cursor is in between opening and closing tags
I have the same indentexpr
and it works as expected. However, I’m on the OSX stock vim not on neovim
I use CoC and I don’t have any html plugin
Hmmm. Do you use coc-html
and/or coc-html
? Sorry for pestering, just trying to track this behavior down.
and if I disable CoC, vim produces the same wrong indent as you have
here is the list of loaded vim scripts:
1: /usr/share/vim/vimrc
2: ~/.vim/vimrc
3: /usr/share/vim/vim82/defaults.vim
4: /usr/share/vim/vim82/filetype.vim
5: /usr/share/vim/vim82/ftplugin.vim
6: /usr/share/vim/vim82/indent.vim
7: /usr/share/vim/vim82/syntax/syntax.vim
8: /usr/share/vim/vim82/syntax/synload.vim
9: /usr/share/vim/vim82/syntax/syncolor.vim
10: /usr/share/vim/vim82/autoload/netrw_gitignore.vim
11: ~/.vim/pack/coc/opt/coc.nvim/plugin/coc.vim
12: ~/.vim/pack/coc/opt/coc.nvim/autoload/coc/rpc.vim
13: ~/.vim/pack/coc/opt/coc.nvim/autoload/coc/util.vim
14: ~/.vim/pack/coc/opt/coc.nvim/autoload/coc/client.vim
15: ~/.vim/coc.vim
16: /usr/share/vim/vim82/autoload/dist/ft.vim
17: /usr/share/vim/vim82/ftplugin/xhtml.vim
18: /usr/share/vim/vim82/ftplugin/xml.vim
19: /usr/share/vim/vim82/ftplugin/html.vim
20: /usr/share/vim/vim82/autoload/htmlcomplete.vim
21: /usr/share/vim/vim82/indent/xhtml.vim
22: /usr/share/vim/vim82/indent/html.vim
23: /usr/share/vim/vim82/indent/javascript.vim
24: /usr/share/vim/vim82/syntax/xhtml.vim
25: /usr/share/vim/vim82/syntax/html.vim
26: /usr/share/vim/vim82/syntax/javascript.vim
27: /usr/share/vim/vim82/syntax/vb.vim
28: /usr/share/vim/vim82/syntax/css.vim
29: ~/.vim/pack/coc/opt/coc.nvim/autoload/coc/api.vim
30: ~/.vim/pack/coc/opt/coc.nvim/autoload/coc.vim
31: /private/var/folders/b5/y3y754c96g5bbqj4mdn15dnr0000gp/T/vBDjv1V/coc.nvim-25774/coc-25774.vim
32: ~/.vim/pack/coc/opt/coc.nvim/autoload/coc/cursor.vim
33: ~/.vim/pack/coc/opt/coc.nvim/autoload/coc/float.vim
my ~/.vim/coc.vim
is basically the same as https://github.com/neoclide/coc.nvim#example-vim-configuration
I seem to have those same things but I imagine that is for the vim installed on my system, not neovim. I suspect that is where the different behavior is coming from. vim vs neovim but no clue how to clarify that
I can test it for you but my neovim is broken. brew cannot compile it for a while. let me try to fix that first
Oh, you already spent too much time on me. Haha. I appreciate it but don't bother yourself
ok, so I fixed my neovim and installed CoC using packer
use {'neoclide/coc.nvim', branch = 'release'}
and HTML indent works for me in neovim toothis my coc config https://paste.sr.ht/~kalmi/46d890e53f42f9be41f0c2631a6fa641068aa919
I guess this does the trick https://paste.sr.ht/~kalmi/46d890e53f42f9be41f0c2631a6fa641068aa919#coc.vim-L54
also, I think you need this to be true https://github.com/neoclide/coc.nvim/blob/4bf907196be1210ce0973edfc0d62adcd7b36642/doc/coc.txt#L952 (which is the default)
I thought I basically copied the example coc config too but it was years ago, not sure why I didn't have those two lines in there. I have everything before and after of course. haha
Actually that example config seems much bigger, I assume it's been added to over the years. Anyways, thanks so much. Huge quality of life improvement while doing html
ah, cool :)