vim

2023-08-30T17:14:42.723929Z

I want to see just the defined vars in a namespace in a list, I think counterclockwise had this long time ago. How do I do this? using macvim and vim-fireplace

practicalli-johnny 2025-06-25T11:15:11.551829Z

Is the Vim editor configuration information on the Clojure LSP website relatively up to date? Or would it benefit an update? https://clojure-lsp.io/clients/#vim I've submitted https://github.com/clojure-lsp/clojure-lsp/pull/2079 (not sure if any of that is relevant to vim though). I dont know enough about vim to know what the common approaches are for LSP though.

dave 2023-08-30T17:21:16.039509Z

clojure.core has a function for this, ns-publics Example usage:

;; list of vars in current namespace
(ns-publics *ns*)

;; list of vars in another namespace
(ns-publics 'clojure.string)
I'm not sure if fireplace has anything built-in for this, but you could eval a form like that in your REPL session

2023-08-30T17:22:05.827539Z

Hey, I know about this function. I want to have listview like vim nerdtree plugin which lists all vars with jump too

dave 2023-08-30T17:23:40.198819Z

Ah, I see. LSP provides functionality like that. I use Neovim, so I don't know specifically how to set it up in regular Vim, but there ought to be a way!

2023-08-30T17:23:58.818409Z

What's lsp?

dave 2023-08-30T17:25:16.719209Z

Language Server Protocol. It's a feature built into a lot of editors nowadays. The idea is that you have language servers for specific languages (Clojure has one called clojure-lsp) and they work in any editor that supports LSP. On the other side, you have LSP clients that are built into a bunch of different editors, and they support any language that has a language server.

dave 2023-08-30T17:25:40.372109Z

I just remembered a plugin that I used to use that I enjoyed - it might help you here: https://github.com/liuchengxu/vista.vim

dave 2023-08-30T17:26:29.488469Z

Back when I used it, it didn't support LSP, it was based on ctags instead. Looks like nowadays, it supports LSP, which is great

dave 2023-08-30T17:27:11.208079Z

An advantage of doing this via LSP is that it will always work, even if you don't have a REPL running.

practicalli-johnny 2023-08-30T20:03:32.511429Z

Clojure LSP client suggestions for Vim (don't forget to install clojure-lsp server) https://clojure-lsp.io/clients/#vim Note that not all LSP clients will support all LSP features

marrs 2023-08-31T10:02:55.397409Z

Fair warning: I've not been satisfied with any of the LSP clients for Vim. They're slow and flaky. If I have to use the LSP then I run Neovim; its built-in client is pretty sound.

marrs 2023-08-31T10:07:23.915799Z

> I want to have listview like vim nerdtree plugin which lists all vars with jump too @mx2000 Sounds like you want to populate a quickfix list. It might be possible for vim-fireplace to pipe its eval output to other commands. The :Last command will output the result of the last eval to a preview buffer. Perhaps that can be converted to a quickfix list?

2023-08-31T13:08:54.959429Z

If you use tags there may be a way to show a window with current file tags and get defined variables 🤔

2023-08-31T13:42:55.901619Z

Strange, shouldn't this be included

dave 2023-08-31T14:59:48.820819Z

Neovim's built-in LSP is 💯

dave 2023-08-31T15:00:40.914109Z

That plugin I posted above, vista.vim, works with ctags as well, if you don't want to take the plunge and set up LSP

👍 1
dave 2023-08-31T15:01:03.575099Z

But my recommendation would be to set up LSP, because it's amazing.

2023-08-31T15:01:25.054379Z

I need neovim for that?

dave 2023-08-31T15:01:33.838249Z

No, there are LSP client plugins for regular Vim too.

dave 2023-08-31T15:01:59.565009Z

Oh, you mean vista? No, that works in both Neovim and not-Neovim (Oldvim?)