From 7f0958a91688932a40f34fb4de6cd1aef60e6001 Mon Sep 17 00:00:00 2001 From: <> Date: Sun, 26 May 2024 15:50:29 +0000 Subject: [PATCH] Deployed 796abee with MkDocs version: 1.6.0 --- .../astronvim/config-design/index.html | 508 ++++++++---------- search/search_index.json | 2 +- 2 files changed, 240 insertions(+), 270 deletions(-) diff --git a/configuration/astronvim/config-design/index.html b/configuration/astronvim/config-design/index.html index 03cf4ed1..3dac15e0 100644 --- a/configuration/astronvim/config-design/index.html +++ b/configuration/astronvim/config-design/index.html @@ -889,9 +889,9 @@
A guide to the AstroNvim Config user configuration created by Practicalli to support Clojure development.
+A guide to the design of AstroNvim Config created by Practicalli to support a comprehensive development workflow.
Plugin configurations from AstroCommunity are used to minimise the code size and maintenance of the Practicalli configuration
Plugins and configuration is added vial AstroCommunity were possible, to minimise the code size and maintenance of the configuration
-core.lua
is for tuning plugins shipped with astronvim config
plugins/
for additional plugins organised logically. All .lua
files are read from this directory
The file structure as taken from the AstroNvim template and new files were created to minimise changes, making it simpler to add updates from the original template repository.
+Key: AstroNvim template file changes
user.lua
for general user defined pluginsclojure.lua
adds Conjure and parinf, ensuring Clojure treesitter parser and Clojure LSPif
statement to activate) init.lua
ensures the Lazy package manager is available when Neovim starts up. This file is unchanged from the AstroNvim template.
lua/lazy_setup.lua
configures the Lazy package manager. zipPlugin
enabled to support Clojure docs and source navigation inside libraries.
lua/community.lua
imports plugin configurations from AstroCommunity, including the Clojure pack.
lua/polish.lua
general lua configuration loaded after AstroNvim configs.
lua/plugins/
for additional plugins organised logically. All .lua
files are automatically loaded from this directory when starting Neovim.
astrocore.lua
, astrolsp.lua
, astroui.lua
examples of overriding AstroNvim defaultsclojure.lua
alternative approach to configure clojure, extending the AstroNvim Clojure packgithub.lua
issue & PR management with octo.nvim (requires GitHub CLI)mason.lua
ensure tools are installed by default (LSP servers, format & lint tools, DAP debug tools)neo-tree.lua
visual file navigator - example confignone-ls.lua
example config for format & lint toolsplatuml.lua
UML diagrams defined with code - requires plantuml.com installpracticalli.lua
theme, dashboard & key binding preferences enjoyed by Practicallisnippets.lua
load JSON style snippet definitionstelescope.lua
ensure Treesitter languages are installed (AstroCommunity language packs also ensure parsers installed)treesittter.lua
ensure Treesitter languages are installed (AstroCommunity language packs also ensure parsers installed)user.lua
example user configuration, added via lua/plugins/practicalli.lua
The AstroCommunity provides a Clojure language pack that adds Conjure and nvim-parinfer, along with clojure
Treesitter parser and clojure-lsp
support.
The AstroCommunity provides a Clojure language pack that ensures clojure
Treesitter parser and clojure-lsp
support and installed automatically.
The pack contains 4 Neovim plugins:
+!!! INFO: "Practicalli AstroNvim Config includes Clojure pack"
+Edit the plugins/community.lua
file and import the Clojure pack. The "AstroNvim/astrocommunity",
repository is already added to to the file.
Create a plugins/clojure.lua
file and add the AstroCommunity repository, Clojure pack and additional configuration to your own preferences
Clojure configuration with user configration overrides
+The Clojure pack includes parinfer and paredit tools for structural editing, which both work together without issue. Should one or both of these plugins not be reqiured, set enabled to false
return {
"AstroNvim/astrocommunity",
{ import = "astrocommunity.pack.clojure" },
- {
- "Olical/conjure",
- -- load plugin on filetypes
- ft = { "clojure", "fennel" },
- config = function()
- -- HUD
- -- Example: Set to `"SE"` and HUD width to `1.0` for full width HUD at bottom of screen
- vim.g["conjure#log#hud#width"] = 1 -- Width of HUD as percentage of the editor width, 0.0 and 1.0.
- vim.g["conjure#log#hud#enabled"] = false -- Display HUD
- vim.g["conjure#log#hud#anchor"] = "SE" -- Preferred corner position for the HUD
- vim.g["conjure#log#botright"] = true -- Open log at bottom or far right of editor
- -- REPL
- vim.g["conjure#extract#context_header_lines"] = 100 -- Number of lines to check for `ns` form
- vim.g["conjure#client#clojure#nrepl#connection#auto_repl#enabled"] = false -- ;; Start "auto-repl" process, eg. babashka
- vim.g["conjure#client#clojure#nrepl#connection#auto_repl#hidden"] = true -- ;; Hide auto-repl buffer when triggered
- vim.g["conjure#client#clojure#nrepl#connection#auto_repl#cmd"] = nil -- ;; Command to start the auto-repl
- -- ;; Automatically require namespace of new buffer or current buffer after connection
- vim.g["conjure#client#clojure#nrepl#eval#auto_require"] = false
- -- Reloading code
- -- Function to call on refresh (reloading) the log, namespace-qualified name of a zero-arity
- -- vim.g["conjure#client#clojure#nrepl#refresh#after"] = nil
- -- The namespace-qualified name of a zero-arity function to call before reloading.
- -- vim.g["conjure#client#clojure#nrepl#refresh#before"] = nil
- -- List of directories to scan. If no directories given, defaults to all directories on the classpath.
- -- vim.g["conjure#client#clojure#nrepl#refresh#dirs"] = nil
- -- Testing
- -- ;; Test runner called from the test key mappings
- vim.g["conjure#client#clojure#nrepl#test#runner"] = "kaocha"
- -- Print raw test evaluation result, suppressing prefix for stdout lines `; (out)`
- -- vim.g["conjure#client#clojure#nrepl#test#raw_out"] = nil
- -- Override string appended to the end of the test runner calls
- -- vim.g["conjure#client#clojure#nrepl#test#call_suffix"] = nil
- end
- },
- {
- "gpanders/nvim-parinfer",
- ft = { "clojure" },
- config = function()
- vim.g.parinfer_force_balance = true
- vim.g.parinfer_comment_chars = ";;"
- end,
- },
-}
+ { "gpanders/nvim-parinfer", enabled = false },
+
Override Conjure configration
+Add the AstroCommunity Clojure pack and additional configuration to create a tailored experience
+:help conjure
for general Conjure options.
:help conjure-client-clojure-nrepl
for Clojure specific options.
return {
+ "AstroNvim/astrocommunity",
+ { import = "astrocommunity.pack.clojure" },
+ {
+ "AstroNvim/astrocore",
+ opts = {
+ options = {
+ g = {
+ -- show HUD REPL log at startup
+ ["conjure#log#hud#enabled"] = false,
+
+ -- Hightlight evaluated forms
+ -- ["conjure#highlight#enabled"] = true,
+
+ -- Trim log after number of lines. Default: `10000`
+ -- ["conjure#log#trim#at"] = 200,
+ -- Trim log to number of lines. Default: `7000`
+ -- ["conjure#log#trim#to"] = 100,
+
+ -- auto repl (babashka)
+ ["conjure#client#clojure#nrepl#connection#auto_repl#enabled"] = false,
+ ["conjure#client#clojure#nrepl#connection#auto_repl#hidden"] = true,
+ ["conjure#client#clojure#nrepl#connection#auto_repl#cmd"] = nil,
+ ["conjure#client#clojure#nrepl#eval#auto_require"] = false,
+
+ -- Test runner: "clojure", "clojuresCRipt", "kaocha"
+ ["conjure#client#clojure#nrepl#test#runner"] = "kaocha",
+ },
+ },
+ },
+ },
+}
The parinfer comment configuration may not be required when using ts-comment.nvim to set the Clojure comment pattern. +
Treesitter Parser for clojure in AstroNvim user configuration
-return {
- "nvim-treesitter/nvim-treesitter",
- opts = function(_, opts)
- -- add more things to the ensure_installed table protecting against community packs modifying it
- opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, {
- -- "lua"
- "clojure"
- })
- end,
-}
+.config/astronvim-config/plugins/treesitter.luareturn {
+ "nvim-treesitter/nvim-treesitter",
+ opts = function(_, opts)
+ -- add more things to the ensure_installed table protecting against community packs modifying it
+ opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, {
+ -- "lua"
+ "clojure"
+ })
+ end,
+}
Install Treesitter Clojure Parser manually
+Manual install of Treesitter Clojure Parser
:TSInstall clojure
in Neovim will install the parser. A parser not included in the opts.ensure_installed
configuration must be updated manually each time treesitter plugin is updated
{
- "gpanders/nvim-parinfer",
- ft = { "clojure" },
- config = function()
- vim.g.parinfer_force_balance = true
- vim.g.parinfer_comment_chars = ";;"
- vim.g.parinfer_mode = "paren"
- end,
- },
+
options.lua
in the user configuration provides a consistent way to set Neovim options.
-- set vim options here (vim.<first_key>.<second_key> = value)
-return {
- opt = {
- -- set to true or false etc.
- relativenumber = true, -- sets vim.opt.relativenumber
- number = true, -- sets vim.opt.number
- spell = false, -- sets vim.opt.spell
- signcolumn = "auto", -- sets vim.opt.signcolumn to auto
- wrap = false, -- sets vim.opt.wrap
- },
- g = {
- mapleader = " ", -- sets vim.g.mapleader
- maplocalleader = ",", -- Set local leader key binding (supports Conjure key bindings)
- autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled)
- cmp_enabled = true, -- enable completion at start
- autopairs_enabled = true, -- enable autopairs at start
- diagnostics_mode = 3, -- set the visibility of diagnostics in the UI (0=off, 1=only show in status line, 2=virtual text off, 3=all on)
- icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing)
- ui_notifications_enabled = true, -- disable notifications when toggling UI elements
- VM_leader = "gm" -- Visual Multi Leader (multiple cursors)
- },
-}
+.config/astronvim-config/options.lua-- set vim options here (vim.<first_key>.<second_key> = value)
+return {
+ opt = {
+ -- set to true or false etc.
+ relativenumber = true, -- sets vim.opt.relativenumber
+ number = true, -- sets vim.opt.number
+ spell = false, -- sets vim.opt.spell
+ signcolumn = "auto", -- sets vim.opt.signcolumn to auto
+ wrap = false, -- sets vim.opt.wrap
+ },
+ g = {
+ mapleader = " ", -- sets vim.g.mapleader
+ maplocalleader = ",", -- Set local leader key binding (supports Conjure key bindings)
+ autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled)
+ cmp_enabled = true, -- enable completion at start
+ autopairs_enabled = true, -- enable autopairs at start
+ diagnostics_mode = 3, -- set the visibility of diagnostics in the UI (0=off, 1=only show in status line, 2=virtual text off, 3=all on)
+ icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing)
+ ui_notifications_enabled = true, -- disable notifications when toggling UI elements
+ VM_leader = "gm" -- Visual Multi Leader (multiple cursors)
+ },
+}
Clojure LSPλ︎
@@ -3230,62 +3259,41 @@ Clojure LSPclojure_lsp
can be added using Mason UI, SPC p m
or in the plugins/mason.lua
file
Manual user config of clojure lsp server
--- customize mason plugins
-return {
- -- use mason-lspconfig to configure LSP installations
- {
- "williamboman/mason-lspconfig.nvim",
- -- overrides `require("mason-lspconfig").setup(...)`
- opts = function(_, opts)
- -- add more things to the ensure_installed table protecting against community packs modifying it
- opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, {
- -- "clojure_lsp", -- provide by Clojure pack
- "marksman", -- Markdown structure (also in markdown pack)
- "yamlls",
- })
- end,
- },
-}
+-- customize mason plugins
+return {
+ -- use mason-lspconfig to configure LSP installations
+ {
+ "williamboman/mason-lspconfig.nvim",
+ -- overrides `require("mason-lspconfig").setup(...)`
+ opts = function(_, opts)
+ -- add more things to the ensure_installed table protecting against community packs modifying it
+ opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, {
+ -- "clojure_lsp", -- provide by Clojure pack
+ "marksman", -- Markdown structure (also in markdown pack)
+ "yamlls",
+ })
+ end,
+ },
+}
Snippetsλ︎
The AstroNvim user example includes a commented LuaSnip configuration
-.config/astronvim-config/plugins/core.lua -- {
- -- "L3MON4D3/LuaSnip",
- -- config = function(plugin, opts)
- -- require "plugins.configs.luasnip" (plugin, opts) -- include the default astronvim config that calls the setup call
- -- -- add more custom luasnip configuration such as filetype extend or custom snippets
- -- local luasnip = require "luasnip"
- -- luasnip.filetype_extend("javascript", { "javascriptreact" })
- -- end,
- -- },
-
-AstroNvim includes a Recipe for custom snippets
-return {
- plugins = {
- {
- "L3MON4D3/LuaSnip",
- config = function(plugin, opts)
- require "plugins.configs.luasnip"(plugin, opts) -- include the default astronvim config that calls the setup call
- require("luasnip.loaders.from_vscode").lazy_load { paths = { "./lua/user/snippets" } } -- load snippets paths
- end,
- },
- },
-}
-
-Practicalli AstroNvim Config combines the two examples to get
-AstroNvim config with custom VS Code style snippets
-.config/astronvim-config/plugins/core.lua{
- "L3MON4D3/LuaSnip",
- config = function(plugin, opts)
- require "plugins.configs.luasnip" (plugin, opts) -- include the default astronvim config that calls the setup call
- -- add more custom luasnip configuration such as filetype extend or custom snippets
- require("luasnip.loaders.from_vscode").lazy_load { paths = { "./lua/user/snippets" } } -- load snippets paths
- local luasnip = require "luasnip"
- luasnip.filetype_extend("javascript", { "javascriptreact" })
-end,
-},
+LuaSnip with json format snippets in snippets/
directory
+.config/astronvim-config/plugins/core.luareturn {
+ --LuaSnip with json format snippets in `snippets/` directory
+ {
+ "L3MON4D3/LuaSnip",
+ config = function(plugin, opts)
+ require "astronvim.plugins.configs.luasnip"(plugin, opts) -- include the default astronvim config that calls the setup call
+ -- add more custom luasnip configuration such as filetype extend or custom snippets
+ require("luasnip.loaders.from_vscode").lazy_load { paths = { "./snippets" } } -- include JSON style snippets
+ local luasnip = require "luasnip"
+ luasnip.filetype_extend("javascript", { "javascriptreact" })
+ end,
+ },
+}
AstroNvim Community packagesλ︎
@@ -3330,56 +3338,18 @@ ThemesEverforest provides a good dark and light theme and supports the background option to toggle between each colorscheme.
Practicalli AstroNvim Config - default theme
-
-
-Practicalli AstroNvim Config themes
-return {
-{
-"AstroNvim/astrotheme", -- default AstroNvim theme
-lazy = false,
-},
- -- Add the community repository of plugin specifications
- "AstroNvim/astrocommunity",
- { import = "astrocommunity.colorscheme.everforest" },
- {
- "sainnhe/everforest",
- lazy = false,
- },
- { import = "astrocommunity.colorscheme.nightfox-nvim" },
- {
- "EdenEast/nightfox.nvim",
- lazy = false,
- },
- { import = "astrocommunity.colorscheme.kanagawa-nvim" },
- {
- "rebelot/kanagawa.nvim",
- lazy = false,
- },
- { import = "astrocommunity.colorscheme.github-nvim-theme" }, -- no background support
- {
- "projekt0n/github-nvim-theme",
- lazy = false,
- },
-
-
-
-
Configure Lazy pluginsλ︎
Lazy.nvim Plugin specification
Config Format and Lint toolsλ︎
@@ -3398,22 +3368,22 @@ Config Format and Lint tools
Override null-ls builtin configuration
Specify configuration files to use that override the null-ls builtin configuration
-return {
- "jose-elias-alvarez/null-ls.nvim",
- opts = function(_, config)
- -- config variable is the default configuration table for the setup function call
- local null_ls = require "null-ls"
- config.sources = {
- null_ls.builtins.formatting.markdownlint.with {
- -- pass arguments to modify/override the null-ls builtin configuration
- extra_args = {
- "--config-path",
- vim.fn.expand("~/.config/astro-config/tool-config/markdownlint.yaml") },
- },
- }
- return config -- return final config table
- end,
-}
+return {
+ "jose-elias-alvarez/null-ls.nvim",
+ opts = function(_, config)
+ -- config variable is the default configuration table for the setup function call
+ local null_ls = require "null-ls"
+ config.sources = {
+ null_ls.builtins.formatting.markdownlint.with {
+ -- pass arguments to modify/override the null-ls builtin configuration
+ extra_args = {
+ "--config-path",
+ vim.fn.expand("~/.config/astro-config/tool-config/markdownlint.yaml") },
+ },
+ }
+ return config -- return final config table
+ end,
+}
vim.fn.expand()
reports luacheck error accessing undefined variable
but seems to work regardless
@@ -3421,34 +3391,34 @@ Config Format and Lint tools
General configuration for LSP Servers
-.config/astronvim-config/init.lua lsp = {
- -- customize lsp formatting options
- formatting = {
- -- control auto formatting on save
- format_on_save = {
- enabled = true, -- format on save globally
- allow_filetypes = { -- format on save for specified filetypes only
- -- "go",
- },
- ignore_filetypes = { -- turn off format on save for specified filetypes
- -- "python",
- },
- },
- disabled = { -- switch off formatting capabilities for the listed language servers
- -- turn off lua_ls formatting capability if you want to use StyLua to format your lua code
- -- "lua_ls",
- "markdownlint",
- },
- timeout_ms = 1000, -- default format timeout
- -- filter = function(client) -- fully override the default formatting function
- -- return true
- -- end
- },
- -- enable servers that you already have installed without mason
- servers = {
- -- "pyright"
- },
- },
+.config/astronvim-config/init.lua lsp = {
+ -- customize lsp formatting options
+ formatting = {
+ -- control auto formatting on save
+ format_on_save = {
+ enabled = true, -- format on save globally
+ allow_filetypes = { -- format on save for specified filetypes only
+ -- "go",
+ },
+ ignore_filetypes = { -- turn off format on save for specified filetypes
+ -- "python",
+ },
+ },
+ disabled = { -- switch off formatting capabilities for the listed language servers
+ -- turn off lua_ls formatting capability if you want to use StyLua to format your lua code
+ -- "lua_ls",
+ "markdownlint",
+ },
+ timeout_ms = 1000, -- default format timeout
+ -- filter = function(client) -- fully override the default formatting function
+ -- return true
+ -- end
+ },
+ -- enable servers that you already have installed without mason
+ servers = {
+ -- "pyright"
+ },
+ },
Override Key bindingλ︎
@@ -3457,24 +3427,24 @@ Override Key binding
Override Key bindings for vim highlighter
-.config/astronvim-config/plugins/community.lua{
- "vim-highlighter",
- keys = function()
- return {
- { "<leader>nn", "<cmd>Hi><CR>", desc = "Next Recently Set Highlight" },
- { "<leader>ng", "<cmd>Hi<<CR>", desc = "Previous Recently Set Highlight" },
- { "<leader>n[", "<cmd>Hi{<CR>", desc = "Next Nearest Highlight" },
- { "<leader>n]", "<cmd>Hi}<CR>", desc = "Previous Nearest Highlight" },
- }
- end,
-}
+.config/astronvim-config/plugins/community.lua{
+ "vim-highlighter",
+ keys = function()
+ return {
+ { "<leader>nn", "<cmd>Hi><CR>", desc = "Next Recently Set Highlight" },
+ { "<leader>ng", "<cmd>Hi<<CR>", desc = "Previous Recently Set Highlight" },
+ { "<leader>n[", "<cmd>Hi{<CR>", desc = "Next Nearest Highlight" },
+ { "<leader>n]", "<cmd>Hi}<CR>", desc = "Previous Nearest Highlight" },
+ }
+ end,
+}
Plugin Key bindingλ︎
Add key binding if a plugin is available wrapped in an if statement, when defining keys in a different place to adding the plugin, e.g whichkey mappings.lua
-