vim

sharky 2025-01-25T00:40:04.545759Z

Is there a plugin for vim which allows to jump to the implementation of a function ? It would be good for my own code , but also to lookup function how they are implemented in Clojure core for example. I see this all the time, people are doing it with there ide‘s :-) .

Jan K 2025-01-25T14:58:28.258619Z

https://github.com/tpope/vim-fireplace

reefersleep 2025-02-12T12:22:47.470589Z

I would suggest reading or using nvim-kickstart to get a sense of a working lsp setup.

practicalli-johnny 2025-01-25T01:13:36.578809Z

I suggest using https://www.reddit.com/r/vim/comments/7lnhrt/which_lsp_plugin_should_i_use/ or use neovim which includes an LSP client, The LSP Client connects to the https://clojure-lsp.io/ which analyses project code to support features like jump to definitions and more

☝️ 2
🙏 1
2025-01-25T01:52:49.938479Z

I use https://github.com/ludovicchabant/vim-gutentags. it's based on regexes so it's kind of janky, but it actually works quite well and is very fast. Works for ~any language too, e.g. I do some python at work occasionally and I didn't have to do any additional setup for it. I have this in my ctags config that I copied from somewhere and modified:

--exclude=node_modules
--exclude=target
--exclude=resources
--exclude=.shadow-cljs
--exclude=backups
--exclude=package-lock.json
--langmap=Clojure:.clj
--langmap=Clojure:+.cljs
--langmap=Clojure:+.cljc
--regex-clojure=/\([ \t]*create-ns[ \t]+([-[:alnum:]*+!>_:\/.?]+)/\1/n,namespace/
--regex-clojure=/\([ \t]*def[ \t]+([-[:alnum:]*+!>_:\/.?]+)/\1/d,definition/
--regex-clojure=/defsc[ \t]+([-[:alnum:]*+!>_:\/.?]+)/\1/g,component/
--regex-clojure=/defmutation[ \t]+([-[:alnum:]*+!>_:\/.?]+)/\1/t,mutation/
--regex-clojure=/defattr[ \t]+([-[:alnum:]*+!>_:\/.?]+)/\1/e,attribute/
--regex-clojure=/\([ \t]*defn-[ \t]+([-[:alnum:]*+!>_:\/.?]+)/\1/p,privatefunction/
--regex-clojure=/\([ \t]*defmacro[ \t]+([-[:alnum:]*+!>_:\/.?]+)/\1/m,macro/
--regex-clojure=/\([ \t]*definline[ \t]+([-[:alnum:]*+!>_:\/.?]+)/\1/i,inline/
--regex-clojure=/\([ \t]*defmulti[ \t]+([-[:alnum:]*+!>_:\/.?]+)/\1/a,multimethoddefinition/
--regex-clojure=/\([ \t]*defmethod[ \t]+([-[:alnum:]*+!>_:\/.?]+)/\1/b,multimethodinstance/
--regex-clojure=/\([ \t]*defonce[ \t]+([-[:alnum:]*+!>_:\/.?]+)/\1/c,definitiononce/
--regex-clojure=/\([ \t]*defstruct[ \t]+([-[:alnum:]*+!>_:\/.?]+)/\1/s,struct/
--regex-clojure=/\([ \t]*intern[ \t]+([-[:alnum:]*+!>_:\/.?]+)/\1/v,intern/
--regex-clojure=/\([ \t]*ns[ \t]+([-[:alnum:]*+!>_:\/.?]+)/\1/n,namespace/

1
2025-01-25T01:54:03.182179Z

I have this in my nvim config:

" gutentags
" use <C-]> for go to definition
"let g:gutentags_trace = 1
set tags=./.tags,.tags;
"let g:gutentags_enabled = 1
let g:gutentags_ctags_tagfile = '.tags'
let g:gutentags_file_list_command = {
      \ 'markers': {
      \ '.git': 'git-ls-files',
      \ },
      \ }
let g:gutentags_generate_on_new = 1
let g:gutentags_define_advanced_commands = 1