Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add clojure pack #247

Closed
practicalli-johnny opened this issue May 31, 2023 · 0 comments · Fixed by #248
Closed

feat: add clojure pack #247

practicalli-johnny opened this issue May 31, 2023 · 0 comments · Fixed by #248

Comments

@practicalli-johnny
Copy link
Contributor

Add a clojure pack to the Astrocommunity

  • Treesitter parser: clojure
  • LSP: clojure_lsp
  • Plugins: "Olical/conjure" and "gpanders/nvim-parinfer"

Additional config

Conjure defined keybingings relative to the localleader to be mapped, usually the , key
An autocmd is used to set ;; as the line comment character, to follow the Clojure style guide.

Draft clojure pack

A draft of what I think a Clojure pack would look like. I am new to lua and astronvim, so code enhancements are most welcome.

-- Clojure support with Conjure plugin
local utils = require "astronvim.utils"
return {
  -- Clojure Language Server
  {
    "williamboman/mason-lspconfig.nvim",
    opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "clojure_lsp") end,
  },
  -- Clojure parser
  {
    "nvim-treesitter/nvim-treesitter",
    opts = function(_, opts)
      if opts.ensure_installed ~= "all" then
        opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "clojure")
      end
    end,
  },
  -- Parinfer parens management for Clojure
  {
    "gpanders/nvim-parinfer",
    ft = { "clojure" },
    config = function()
      vim.g.parinfer_force_balance = true
      vim.g.parinfer_comment_chars = ";;"
    end,
  },
  -- Conjure plugin for Clojure REPL
  {
    "Olical/conjure",
    -- load plugin on filetypes
    ft = { "clojure" },
    config = function()
      vim.g.maplocalleader = ","
      vim.g["conjure#log#hud#width"] = 1
      vim.g["conjure#log#hud#enabled"] = false
      vim.g["conjure#log#hud#anchor"] = "SE"
      vim.g["conjure#log#botright"] = true
      vim.g["conjure#extract#context_header_lines"] = 100
      vim.g["conjure#eval#comment_prefix"] = ";;"
      vim.g["conjure#client#clojure#nrepl#connection#auto_repl#enabled"] = false
      vim.g["conjure#client#clojure#nrepl#connection#auto_repl#hidden"] = true
      vim.g["conjure#client#clojure#nrepl#connection#auto_repl#cmd"] = nil
      vim.g["conjure#client#clojure#nrepl#eval#auto_require"] = false
      vim.g["conjure#client#clojure#nrepl#test#runner"] = "kaocha"

      vim.api.nvim_create_autocmd("FileType", {
        group = vim.api.nvim_create_augroup("comment_config", { clear = true }),
        pattern = { "clojure" },
        callback = function() vim.bo.commentstring = ";; %s" end,
        desc = "Lisp style line comment",
      })
    end,
  },
}

References

mehalter pushed a commit that referenced this issue Jun 1, 2023
feat: clojure language pack

Add a clojure pack to the Astrocommunity

- Treesitter parser: clojure
- LSP: clojure_lsp
- Plugins: "Olical/conjure" and "gpanders/nvim-parinfer"
- Add autocmd to disable lsp diagnostics in Conjure log
- Add autocmd to configure comments to Clojure style guide

Conjure defines key mappings relative to the `<localleader>` by default.
Define localleader in `options.lua` using `g = {maplocalleader = ","}`

An autocmd is used to set ;; as the line comment character, to follow the Clojure style guide.

[Resolve: #247]
Uzaaft pushed a commit that referenced this issue Jun 11, 2023
feat: clojure language pack

Add a clojure pack to the Astrocommunity

- Treesitter parser: clojure
- LSP: clojure_lsp
- Plugins: "Olical/conjure" and "gpanders/nvim-parinfer"
- Add autocmd to disable lsp diagnostics in Conjure log
- Add autocmd to configure comments to Clojure style guide

Conjure defines key mappings relative to the `<localleader>` by default.
Define localleader in `options.lua` using `g = {maplocalleader = ","}`

An autocmd is used to set ;; as the line comment character, to follow the Clojure style guide.

[Resolve: #247]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant