From 7028a8f9ee1d09f5b2550e09a2e878b9edc74edd Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Sat, 7 Oct 2023 15:19:42 -0400 Subject: [PATCH] final release of AstroNvim v1 docs --- docusaurus.config.js | 11 +- .../version-1.7.0/acknowledgements.md | 65 -- .../configuration/basic_configuration.md | 302 ------ .../configuration/config_options.md | 51 - .../configuration/manage_user_config.md | 64 -- .../configuration/override_formats.md | 90 -- .../configuration/plugin_defaults.md | 942 ----------------- .../configuration/splitting_up.md | 99 -- .../version-1.7.0/configuration/updater.md | 65 -- versioned_docs/version-1.7.0/intro.md | 115 --- .../version-1.7.0/recipes/advanced_lsp.md | 137 --- versioned_docs/version-1.7.0/recipes/alpha.md | 45 - .../version-1.7.0/recipes/black_belt.md | 12 - versioned_docs/version-1.7.0/recipes/cmp.md | 257 ----- .../version-1.7.0/recipes/colorscheme.md | 58 -- .../version-1.7.0/recipes/globalstatus.md | 12 - .../version-1.7.0/recipes/snippets.md | 62 -- .../version-1.7.0/recipes/telescope_theme.md | 41 - .../recipes/unattended_install.md | 17 - .../version-1.7.0/usage/mappings.md | 141 --- .../version-1.7.0/usage/walkthough.md | 91 -- .../version-1.8.0/Basic Usage/mappings.md | 141 --- .../version-1.8.0/Basic Usage/walkthough.md | 91 -- .../Configuration/basic_configuration.md | 302 ------ .../Configuration/config_options.md | 54 - .../Configuration/manage_user_config.md | 64 -- .../Configuration/override_formats.md | 90 -- .../Configuration/plugin_defaults.md | 942 ----------------- .../Configuration/splitting_up.md | 99 -- .../version-1.8.0/Configuration/updater.md | 65 -- .../version-1.8.0/Recipes/advanced_lsp.md | 137 --- versioned_docs/version-1.8.0/Recipes/alpha.md | 45 - .../version-1.8.0/Recipes/black_belt.md | 12 - versioned_docs/version-1.8.0/Recipes/cmp.md | 257 ----- .../version-1.8.0/Recipes/colorscheme.md | 58 -- .../version-1.8.0/Recipes/globalstatus.md | 12 - .../version-1.8.0/Recipes/snippets.md | 62 -- .../version-1.8.0/Recipes/telescope_theme.md | 41 - .../Recipes/unattended_install.md | 17 - .../version-1.8.0/acknowledgements.md | 65 -- versioned_docs/version-1.8.0/intro.md | 155 --- .../version-1.9.0/Basic Usage/mappings.md | 141 --- .../version-1.9.0/Basic Usage/walkthough.md | 91 -- .../Configuration/basic_configuration.md | 351 ------- .../Configuration/config_options.md | 56 -- .../Configuration/manage_user_config.md | 64 -- .../Configuration/override_formats.md | 90 -- .../Configuration/plugin_defaults.md | 950 ------------------ .../Configuration/splitting_up.md | 99 -- .../version-1.9.0/Configuration/updater.md | 69 -- .../version-1.9.0/Recipes/advanced_lsp.md | 163 --- versioned_docs/version-1.9.0/Recipes/alpha.md | 45 - .../version-1.9.0/Recipes/black_belt.md | 12 - versioned_docs/version-1.9.0/Recipes/cmp.md | 273 ----- .../version-1.9.0/Recipes/colorscheme.md | 58 -- .../version-1.9.0/Recipes/globalstatus.md | 12 - .../version-1.9.0/Recipes/snippets.md | 62 -- .../version-1.9.0/Recipes/telescope_theme.md | 41 - .../Recipes/unattended_install.md | 17 - .../version-1.9.0/acknowledgements.md | 65 -- versioned_docs/version-1.9.0/intro.md | 159 --- .../version-1.7.0-sidebars.json | 42 - .../version-1.8.0-sidebars.json | 8 - .../version-1.9.0-sidebars.json | 13 - versions.json | 5 - 65 files changed, 2 insertions(+), 8270 deletions(-) delete mode 100644 versioned_docs/version-1.7.0/acknowledgements.md delete mode 100644 versioned_docs/version-1.7.0/configuration/basic_configuration.md delete mode 100644 versioned_docs/version-1.7.0/configuration/config_options.md delete mode 100644 versioned_docs/version-1.7.0/configuration/manage_user_config.md delete mode 100644 versioned_docs/version-1.7.0/configuration/override_formats.md delete mode 100644 versioned_docs/version-1.7.0/configuration/plugin_defaults.md delete mode 100644 versioned_docs/version-1.7.0/configuration/splitting_up.md delete mode 100644 versioned_docs/version-1.7.0/configuration/updater.md delete mode 100644 versioned_docs/version-1.7.0/intro.md delete mode 100644 versioned_docs/version-1.7.0/recipes/advanced_lsp.md delete mode 100644 versioned_docs/version-1.7.0/recipes/alpha.md delete mode 100644 versioned_docs/version-1.7.0/recipes/black_belt.md delete mode 100644 versioned_docs/version-1.7.0/recipes/cmp.md delete mode 100644 versioned_docs/version-1.7.0/recipes/colorscheme.md delete mode 100644 versioned_docs/version-1.7.0/recipes/globalstatus.md delete mode 100644 versioned_docs/version-1.7.0/recipes/snippets.md delete mode 100644 versioned_docs/version-1.7.0/recipes/telescope_theme.md delete mode 100644 versioned_docs/version-1.7.0/recipes/unattended_install.md delete mode 100644 versioned_docs/version-1.7.0/usage/mappings.md delete mode 100644 versioned_docs/version-1.7.0/usage/walkthough.md delete mode 100644 versioned_docs/version-1.8.0/Basic Usage/mappings.md delete mode 100644 versioned_docs/version-1.8.0/Basic Usage/walkthough.md delete mode 100644 versioned_docs/version-1.8.0/Configuration/basic_configuration.md delete mode 100644 versioned_docs/version-1.8.0/Configuration/config_options.md delete mode 100644 versioned_docs/version-1.8.0/Configuration/manage_user_config.md delete mode 100644 versioned_docs/version-1.8.0/Configuration/override_formats.md delete mode 100644 versioned_docs/version-1.8.0/Configuration/plugin_defaults.md delete mode 100644 versioned_docs/version-1.8.0/Configuration/splitting_up.md delete mode 100644 versioned_docs/version-1.8.0/Configuration/updater.md delete mode 100644 versioned_docs/version-1.8.0/Recipes/advanced_lsp.md delete mode 100644 versioned_docs/version-1.8.0/Recipes/alpha.md delete mode 100644 versioned_docs/version-1.8.0/Recipes/black_belt.md delete mode 100644 versioned_docs/version-1.8.0/Recipes/cmp.md delete mode 100644 versioned_docs/version-1.8.0/Recipes/colorscheme.md delete mode 100644 versioned_docs/version-1.8.0/Recipes/globalstatus.md delete mode 100644 versioned_docs/version-1.8.0/Recipes/snippets.md delete mode 100644 versioned_docs/version-1.8.0/Recipes/telescope_theme.md delete mode 100644 versioned_docs/version-1.8.0/Recipes/unattended_install.md delete mode 100644 versioned_docs/version-1.8.0/acknowledgements.md delete mode 100644 versioned_docs/version-1.8.0/intro.md delete mode 100644 versioned_docs/version-1.9.0/Basic Usage/mappings.md delete mode 100644 versioned_docs/version-1.9.0/Basic Usage/walkthough.md delete mode 100644 versioned_docs/version-1.9.0/Configuration/basic_configuration.md delete mode 100644 versioned_docs/version-1.9.0/Configuration/config_options.md delete mode 100644 versioned_docs/version-1.9.0/Configuration/manage_user_config.md delete mode 100644 versioned_docs/version-1.9.0/Configuration/override_formats.md delete mode 100644 versioned_docs/version-1.9.0/Configuration/plugin_defaults.md delete mode 100644 versioned_docs/version-1.9.0/Configuration/splitting_up.md delete mode 100644 versioned_docs/version-1.9.0/Configuration/updater.md delete mode 100644 versioned_docs/version-1.9.0/Recipes/advanced_lsp.md delete mode 100644 versioned_docs/version-1.9.0/Recipes/alpha.md delete mode 100644 versioned_docs/version-1.9.0/Recipes/black_belt.md delete mode 100644 versioned_docs/version-1.9.0/Recipes/cmp.md delete mode 100644 versioned_docs/version-1.9.0/Recipes/colorscheme.md delete mode 100644 versioned_docs/version-1.9.0/Recipes/globalstatus.md delete mode 100644 versioned_docs/version-1.9.0/Recipes/snippets.md delete mode 100644 versioned_docs/version-1.9.0/Recipes/telescope_theme.md delete mode 100644 versioned_docs/version-1.9.0/Recipes/unattended_install.md delete mode 100644 versioned_docs/version-1.9.0/acknowledgements.md delete mode 100644 versioned_docs/version-1.9.0/intro.md delete mode 100644 versioned_sidebars/version-1.7.0-sidebars.json delete mode 100644 versioned_sidebars/version-1.8.0-sidebars.json delete mode 100644 versioned_sidebars/version-1.9.0-sidebars.json delete mode 100644 versions.json diff --git a/docusaurus.config.js b/docusaurus.config.js index a1d86ff62..9dde9b2b4 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -95,7 +95,7 @@ const oneDarkTheme = { /** @type {import('@docusaurus/types').Config} */ const config = { - title: "AstroNvim", + title: "AstroNvim v1", tagline: "An aesthetic and feature-rich neovim config that is extensible and easy to use with a great set of plugins", url: "https://astronvim.github.io", @@ -117,9 +117,6 @@ const config = { docs: { sidebarPath: require.resolve("./sidebars.js"), routeBasePath: "/", - versions: { - current: { label: "nightly", path: "nightly" }, - }, }, blog: false, theme: { @@ -140,16 +137,12 @@ const config = { }, ], navbar: { - title: "AstroNvim", + title: "AstroNvim v1", logo: { alt: "AstroNvim Logo", src: "img/logo/astronvim.svg", }, items: [ - { - type: "docsVersionDropdown", - position: "left", - }, { href: "https://github.com/AstroNvim/AstroNvim", position: "right", diff --git a/versioned_docs/version-1.7.0/acknowledgements.md b/versioned_docs/version-1.7.0/acknowledgements.md deleted file mode 100644 index e1f798bc9..000000000 --- a/versioned_docs/version-1.7.0/acknowledgements.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -id: acknowledgements -title: Acknowledgements ---- - -## โญ Credits - -Sincere appreciation to the following repositories, plugin authors and the entire neovim community out there that made the development of AstroNvim possible. - -- [NvChad](https://github.com/NvChad/NvChad) -- [LunarVim](https://github.com/LunarVim) -- [CosmicVim](https://github.com/CosmicNvim/CosmicNvim) - -## ๐Ÿ”Œ Plugins used in AstroNvim - -| Plugin | Git Repository | -| -------------------------- | -------------------------------------------------------------- | -| Plugin Manager | https://github.com/wbthomason/packer.nvim | -| Session Manager | https://github.com/Shatur/neovim-session-manager | -| Optimiser | https://github.com/lewis6991/impatient.nvim | -| Lua Functions | https://github.com/nvim-lua/plenary.nvim | -| Popup API | https://github.com/nvim-lua/popup.nvim | -| Notifications | https://github.com/rcarriga/nvim-notify | -| Neovim UI Enhancer | https://github.com/MunifTanjim/nui.nvim | -| Automatic Indent Detection | https://github.com/Darazaki/indent-o-matic | -| Curshold Fix | https://github.com/antoinemadec/FixCursorHold.nvim | -| Smarter Splits | https://github.com/mrjones2014/smart-splits.nvim | -| Icons | https://github.com/ryanoasis/vim-devicons | -| Bufferline | https://github.com/akinsho/bufferline.nvim | -| Buffer Closing | https://github.com/famiu/bufdelete.nvim | -| File Explorer | https://github.com/nvim-neo-tree/neo-tree.nvim | -| Statusline | https://github.com/feline-nvim/feline.nvim | -| Syntax Highlighting | https://github.com/nvim-treesitter/nvim-treesitter | -| Parenthesis Highlighting | https://github.com/p00f/nvim-ts-rainbow | -| Autoclose tags | https://github.com/windwp/nvim-ts-autotag | -| Context Commenting | https://github.com/JoosepAlviste/nvim-ts-context-commentstring | -| Snippet Engine | https://github.com/L3MON4D3/LuaSnip | -| Snnipet Collections | https://github.com/rafamadriz/friendly-snippets | -| Completion Engine | https://github.com/hrsh7th/nvim-cmp | -| Snippet Completion | https://github.com/saadparwaiz1/cmp_luasnip | -| Buffer Completion | https://github.com/hrsh7th/cmp-buffer | -| Path Completion | https://github.com/hrsh7th/cmp-path | -| LSP Completion | https://github.com/hrsh7th/nvim-cmp | -| LSP Manager | https://github.com/williamboman/nvim-lsp-installer | -| Built-in LSP | https://github.com/neovim/nvim-lspconfig | -| LSP Symbols | https://github.com/stevearc/aerial.nvim | -| Formatting & Linting | https://github.com/jose-elias-alvarez/null-ls.nvim | -| Fuzzy Finder | https://github.com/nvim-telescope/telescope.nvim | -| Fuzzy Finder Syntax | https://github.com/nvim-telescope/telescope-fzf-native.nvim | -| Git Integration | https://github.com/lewis6991/gitsigns.nvim | -| Start Screen | https://github.com/goolord/alpha-nvim | -| Color Highlighting | https://github.com/norcalli/nvim-colorizer.lua | -| Autopairs | https://github.com/windwp/nvim-autopairs | -| Terminal | https://github.com/akinsho/toggleterm.nvim | -| Commenting | https://github.com/numToStr/Comment.nvim | -| Indentation | https://github.com/lukas-reineke/indent-blankline.nvim | -| Keymaps Popup | https://github.com/folke/which-key.nvim | -| Smooth Scrollilng | https://github.com/declancm/cinnamon.nvim | -| Smooth Escaping | https://github.com/max397574/better-escape.nvim | - -
- -[![Lua](https://img.shields.io/badge/Made%20with%20Lua-blue.svg?style=for-the-badge&logo=lua)](https://lua.org) - -
diff --git a/versioned_docs/version-1.7.0/configuration/basic_configuration.md b/versioned_docs/version-1.7.0/configuration/basic_configuration.md deleted file mode 100644 index 394a21811..000000000 --- a/versioned_docs/version-1.7.0/configuration/basic_configuration.md +++ /dev/null @@ -1,302 +0,0 @@ ---- -id: basic_configuration -title: Basic Configuration ---- - -## Set Up User Configuration - -To begin making custom user configurations you must create a `user/` folder. The provided example can be created with (please note the trailing slashes after the directory names) - -```sh -cp -r ~/.config/nvim/lua/user_example/ ~/.config/nvim/lua/user/ -``` - -:::tip - -If you want to keep your user configuration completely separate from the cloned repository, you can also put this folder in `$XDG_CONFIG_HOME/astronvim/lua/user`. AstroNvim adds the folder `$XDG_CONFIG_HOME/astronvim` to the `runtimepath` so any `vimscript` or `lua` files in there can be sourced. - -::: - -### Example User Configuration - -Below is the provided user configuration template found at `~/.config/nvim/lua/user/init.lua` after the `cp` command above. - -:::tip - -For more details of the provided defaults for each plugin please refer to [Default Plugin Configurations](/configuration/plugin_defaults) - -For an exhaustive list of all available options in the `user/init.lua` file please refer to [Available User Options](/configuration/config_options) - -::: - -```lua -local config = { - - -- Configure AstroNvim updates - updater = { - remote = "origin", -- remote to use - channel = "nightly", -- "stable" or "nightly" - version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY) - branch = "main", -- branch name (NIGHTLY ONLY) - commit = nil, -- commit hash (NIGHTLY ONLY) - pin_plugins = true, -- true, false, or a string for a specific AstroNvim snapshot to use (true will only track the current version if channel is "stable") - skip_prompts = false, -- skip prompts about breaking changes - show_changelog = true, -- show the changelog after performing an update - -- remotes = { -- easily add new remotes to track - -- ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url - -- ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut, - -- ["remote3"] = "github_user", -- GitHub user assume AstroNvim fork - -- }, - }, - - -- Set colorscheme - colorscheme = "default_theme", - - -- set vim options here (vim.. = value) - options = { - opt = { - relativenumber = true, -- sets vim.opt.relativenumber - }, - g = { - mapleader = " ", -- sets vim.g.mapleader - }, - }, - - -- Set dashboard header - header = { - " ", - " ", - " ", - " ", - " ", - " โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ", - "โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ", - "โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ", - "โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ", - "โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ", - " ", - " โ–ˆโ–ˆโ–ˆโ€ โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€ โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€โ–ˆโ–ˆโ–ˆโ€ โ–ˆโ–ˆโ–ˆ", - " โ–ˆโ–ˆโ–ˆโ–ˆโ€ โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€ โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€โ–ˆโ–ˆโ–ˆโ–ˆโ€ โ–ˆโ–ˆโ–ˆโ–ˆ", - " โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€ โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€ โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€โ–ˆโ–ˆโ–ˆโ–ˆโ€โ–ˆโ–ˆ", - " โ–ˆโ–ˆโ€โ€โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€โ€โ–ˆโ–ˆโ€ โ–ˆโ–ˆโ€โ€โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€โ€โ–ˆโ–ˆโ€โ€โ–ˆโ–ˆ", - " โ–ˆโ–ˆโ€ โ€โ–ˆโ–ˆโ–ˆโ–ˆโ€ โ€โ–ˆโ–ˆโ–ˆโ–ˆโ€โ€ โ–ˆโ–ˆโ€โ–ˆโ–ˆโ€ โ€โ€โ€ โ–ˆโ–ˆ", - " ", - " ", - " ", - }, - - -- Default theme configuration - default_theme = { - diagnostics_style = "none", - -- Modify the color table - colors = { - fg = "#abb2bf", - }, - -- Modify the highlight groups - highlights = function(highlights) - local C = require "default_theme.colors" - - highlights.Normal = { fg = C.fg, bg = C.bg } - return highlights - end, - -- enable or disable highlighting for supported plugins - plugins = { - aerial = true, - beacon = false, - bufferline = true, - dashboard = true, - highlighturl = true, - hop = false, - indent_blankline = true, - lightspeed = false, - ["neo-tree"] = true, - notify = true, - ["nvim-tree"] = false, - ["nvim-web-devicons"] = true, - rainbow = true, - symbols_outline = false, - telescope = true, - vimwiki = false, - ["which-key"] = true, - }, - }, - - -- Disable AstroNvim ui features - ui = { - nui_input = true, - telescope_select = true, - }, - - -- Configure plugins - plugins = { - -- Add plugins, the packer syntax without the "use" - init = { - -- ["goolord/alpha-nvim"] = { disable = true }, -- New method for disbaling a default plugin - -- { "andweeb/presence.nvim" }, - -- { - -- "ray-x/lsp_signature.nvim", - -- event = "BufRead", - -- config = function() - -- require("lsp_signature").setup() - -- end, - -- }, - }, - -- All other entries override the setup() call for default plugins - -- override require("null-ls").setup() options - ["null-ls"] = function(config) - local null_ls = require "null-ls" - -- Check supported formatters and linters - -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting - -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics - config.sources = { - -- Set a formatter - null_ls.builtins.formatting.rufo, - -- Set a linter - null_ls.builtins.diagnostics.rubocop, - } - -- set up null-ls's on_attach function - config.on_attach = function(client) - -- NOTE: You can remove this on attach function to disable format on save - if client.resolved_capabilities.document_formatting then - vim.api.nvim_create_autocmd("BufWritePre", { - desc = "Auto format before save", - pattern = "", - callback = vim.lsp.buf.formatting_sync, - }) - end - end - return config -- return final config table - end, - -- override require("nvim-treesitter.configs").setup() options - treesitter = { - -- ensure_installed = { "lua" }, - }, - -- override require("packer").setup() configuration options - packer = { - compile_path = vim.fn.stdpath "config" .. "/lua/packer_compiled.lua", - }, - }, - - -- Add paths for including more VS Code style snippets in luasnip - luasnip = { - vscode_snippet_paths = {}, - }, - - -- Modify which-key registration - ["which-key"] = { - -- Add bindings - register_mappings = { - -- first key is the mode, n == normal mode - n = { - -- second key is the prefix, prefixes - [""] = { - -- which-key registration table for normal mode, leader prefix - -- ["N"] = { "tabnew", "New Buffer" }, - }, - }, - }, - }, - - -- CMP Source Priorities - -- modify here the priorities of default cmp sources - -- higher value == higher priority - -- The value can also be set to a boolean for disabling default sources: - -- false == disabled - -- true == 1000 - cmp = { - source_priority = { - nvim_lsp = 1000, - luasnip = 750, - buffer = 500, - path = 250, - }, - }, - - -- Extend LSP configuration - lsp = { - -- enable servers that you already have installed without lsp-installer - servers = { - -- "pyright" - }, - -- easily add or disable built in mappings added during LSP attaching - mappings = { - n = { - -- ["lf"] = false -- disable formatting keymap - }, - }, - -- add to the server on_attach function - -- on_attach = function(client, bufnr) - -- if client.name == "sqls" then - -- require("sqls").on_attach(client, bufnr) - -- end - -- end, - - -- override the lsp installer server-registration function - -- server_registration = function(server, opts) - -- require("lspconfig")[server].setup(opts) - -- end, - - -- Add overrides for LSP server settings, the keys are the name of the server - -- ["server-settings"] = { - -- example for addings schemas to yamlls - -- yamlls = { - -- settings = { - -- yaml = { - -- schemas = { - -- ["http://json.schemastore.org/github-workflow"] = ".github/workflows/*.{yml,yaml}", - -- ["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}", - -- ["http://json.schemastore.org/ansible-stable-2.9"] = "roles/tasks/*.{yml,yaml}", - -- }, - -- }, - -- }, - -- }, - -- }, - }, - - -- Diagnostics configuration (for vim.diagnostics.config()) - diagnostics = { - virtual_text = true, - underline = true, - }, - - mappings = { - -- first key is the mode - n = { - -- second key is the lefthand side of the map - [""] = { ":w!", desc = "Save File" }, - }, - t = { - -- setting a mapping to false will disable it - -- [""] = false, - }, - }, - - -- This function is run last - -- good place to configuring augroups/autocommands and custom filetypes - polish = function() - -- Set autocommands - vim.api.nvim_create_augroup("packer_conf", {}) - vim.api.nvim_create_autocmd("BufWritePost", { - desc = "Sync packer after modifying plugins.lua", - group = "packer_conf", - pattern = "plugins.lua", - command = "source | PackerSync", - }) - - -- Set up custom filetypes - -- vim.filetype.add { - -- extension = { - -- foo = "fooscript", - -- }, - -- filename = { - -- ["Foofile"] = "fooscript", - -- }, - -- pattern = { - -- ["~/%.config/foo/.*"] = "fooscript", - -- }, - -- } - end, -} - -return config -``` diff --git a/versioned_docs/version-1.7.0/configuration/config_options.md b/versioned_docs/version-1.7.0/configuration/config_options.md deleted file mode 100644 index ada219e6c..000000000 --- a/versioned_docs/version-1.7.0/configuration/config_options.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: config_options -title: Available User Options ---- - -| `init.lua` table key | Expected Format | Use Case | Alternate File Path (in `user/` folder) | -| --------------------------------- | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | -| `updater` | `table` or `function(table)...end` | The configuration for the AstroNvim updater | `updater.lua` | -| `colorscheme` | `string` | The colorscheme to be set | `colorscheme.lua` | -| `highlights.` | `table` or `function(table)...end` | Custom highlight groups for the specified theme, replace `` with colorscheme name | `highlights/.lua` | -| `options` | `table` or `function(table)...end` | The `vim.x.y` variables to be set | `options.lua` | -| `header` | table of `string`s | The header to be displayed on the Dashboard | `header.lua` | -| `ui` | `table` or `function(table)...end` | Toggle custom UI elements (`nui_input` controls NUI for inputs, `telescope_select` controls Telescope for selections) | `ui.lua` | -| `polish` | `function()...end` | Lua function to be run last. Good place for setting vim options and adding mappings | `polish.lua` | -| `default_theme.diagnostics_style` | `table` or `string` | Set highlight style options for virtual text | `default_theme/diagnostics_style.lua` | -| `default_theme.colors` | `table` or `function(table)...end` | Modify the default theme's color table | `default_theme/colors.lua` | -| `default_theme.highlights` | `table` or `function(table)...end` | Modify the default theme's highlight groups | `default_theme/highlights.lua` | -| `default_theme.plugins` | `table` or `function(table)...end` | Modify the default theme's enabled plugin highlight groups | `default_theme/plugins.lua` | -| `diagnostics` | `table` or `function(table)...end` | Modify the default vim diagnostics options | `diagnostics.lua` | -| `luasnip` | `table` or `function(table)...end` | Modify available `luasnip` options | `luasnip.lua` | -| `plugins.init` | `table` or `function(table)...end` | Modify the default plugins table such as adding new plugins | `plugins/init.lua` | -| `plugins.aerial` | `table` or `function(table)...end` | Modify the `aerial.setup()` options | `plugins/aerial.lua` | -| `plugins.autopairs` | `table` or `function(table)...end` | Modify the `autopairs.setup()` options | `plugins/autopairs.lua` | -| `plugins.better_escape` | `table` or `function(table)...end` | Modify the `better_escape.setup()` options | `plugins/better_escape.lua` | -| `plugins.bufferline` | `table` or `function(table)...end` | Modify the `bufferline.setup()` options | `plugins/bufferline.lua` | -| `plugins.cmp` | `table` or `function(table)...end` | Modify the `cmp.setup()` options | `plugins/cmp.lua` | -| `plugins.colorizer` | `table` or `function(table)...end` | Modify the `colorizer.setup()` options | `plugins/colorizer.lua` | -| `plugins.Comment` | `table` or `function(table)...end` | Modify the `Comment.setup()` options | `plugins/Comment.lua` | -| `plugins.gitsigns` | `table` or `function(table)...end` | Modify the `gitsigns.setup()` options | `plugins/gitsigns.lua` | -| `plugins.nvim-web-devicons` | `table` or `function(table)...end` | Modify the `nvim-web-devicons.setup()` options | `plugins/nvim-web-devicons.lua` | -| `plugins.indent_blankline` | `table` or `function(table)...end` | Modify the `indent_blankline.setup()` options | `plugins/indent_blankline.lua` | -| `plugins.indent-o-matic` | `table` or `function(table)...end` | Modify the `indent-o-matic.setup()` options | `plugins/indent-o-matic.lua` | -| `plugins.feline` | `table` or `function(table)...end` | Modify the `feline.setup()` options | `plugins/feline.lua` | -| `plugins.cinnamon` | `table` or `function(table)...end` | Modify the `cinnamon.setup()` options | `plugins/cinnamon.lua` | -| `plugins.neo-tree` | `table` or `function(table)...end` | Modify the `neo-tree.setup()` options | `plugins/neo-tree.lua` | -| `plugins.null-ls` | `table` or `function(table)...end` | Modify the `null-ls.setup()` options | `plugins/null-ls.lua` | -| `plugins.telescope` | `table` or `function(table)...end` | Modify the `telescope.setup()` options | `plugins/telescope.lua` | -| `plugins.toggleterm` | `table` or `function(table)...end` | Modify the `toggleterm.setup()` options | `plugins/toggleterm.lua` | -| `plugins.treesitter` | `table` or `function(table)...end` | Modify the `treesitter.setup()` options | `plugins/treesitter.lua` | -| `plugins.which-key` | `table` or `function(table)...end` | Modify the `which-key.setup()` options | `plugins/which-key.lua` | -| `which-key.register_mappings` | `table` or `function(table)...end` | Modify the default which-key bindings | `which-key/register_mappings.lua` | -| `which-key.show` | `function(orig_show)...end` | Modify the default `which-key.show()` method. Must return `function(key, opts)...end` | `which-key/show.lua` | -| `cmp.source_priority` | `table` or `function(table)...end` | Modify the default cmp sources and their priorities | `cmp/source_priority.lua` | -| `cmp.setup` | `table` or `function(table)...end` | Modify the extended `cmp` setup calls | `cmp/setup.lua` | -| `lsp.servers` | `table` or `function(table)...end` | List of language servers to be set up that are already installed without `nvim-lsp-installer` | `lsp/servers.lua` | -| `lsp.skip_setup` | `table` or `function(table)...end` | List of language servers to guarantee the lspconfig setup is never called on automatically | `lsp/skip_setup.lua` | -| `lsp.server-settings.` | `table` or `function(table)...end` | Modify the LSP server settings, replace `` with server name | `lsp/server-settings/.lua` | -| `lsp.on_attach` | `function(client, bufnr)...end` | Modify the default LSP `on_attach` function | `lsp/on_attach.lua` | -| `lsp.capabilities` | `table` or `function(table)...end` | Modify the default LSP `capabilities` table | `lsp/capabilities.lua` | -| `lsp.flags` | `table` or `function(table)...end` | Modify the default LSP `flags` table | `lsp/flags.lua` | -| `lsp.server_registration` | `function(server, opts)...end` | Modify the `lsp-installer` `server_registration` function | `lsp/server_registration.lua` | diff --git a/versioned_docs/version-1.7.0/configuration/manage_user_config.md b/versioned_docs/version-1.7.0/configuration/manage_user_config.md deleted file mode 100644 index d4a0dcf94..000000000 --- a/versioned_docs/version-1.7.0/configuration/manage_user_config.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -id: manage_user_config -title: Managing User Configuration -sidebar_position: 1 ---- - -One of the best parts of separating the user configuration of AstroNvim away from modifying the system files is the ability to manage and track your own user configuration while maintaining the ability to still get AstroNvim updates. The easiest process to do this would be as follows: - -## Setting up a user configuration - -1. Create a new repository using whatever version control system you would like. For these steps we will assume you are using `git` with the repo `username/astronvim_config` -2. Clone AstroNvim (normal installation instructions) - -```sh -git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim -``` - -3. Clone your empty new repository to your `~/.config/nvim/lua` folder - -```sh -git clone https://github.com/username/astronvim_config.git ~/.config/nvim/lua/user -``` - -:::tip - -If you want to keep your user configuration completely separate from the cloned repository, you can also put this folder in `$XDG_CONFIG_HOME/astronvim/lua/user`. AstroNvim adds the folder `$XDG_CONFIG_HOME/astronvim` to the `runtimepath` so any `vimscript` or `lua` files in there can be sourced. - -::: - -4. Copy the example `init.lua` file provided with AstroNvim to your user directory: - -```sh -cp -r ~/.config/nvim/lua/user_example/ ~/.config/nvim/lua/user/ -``` - -5. Initlialize AstroNvim (this example is using the unattended installation as described above) - -```sh -nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync' -``` - -6. Modify the `~/.config/nvim/lua/user` folder and `user/init.lua` file to your liking and push the changes you make to your repository - -## Installing from an existing User Configuration - -If you have already created your user configuration and have it tracked in a repository, then the process of getting your system up and running is very easy: - -1. Clone AstroNvim (normal installation instructions) - -```sh -git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim -``` - -2. Clone your empty new repository to your `~/.config/nvim/lua` folder - -```sh -git clone https://github.com/username/astronvim_config.git ~/.config/nvim/lua/user -``` - -3. Initialize AstroNvim - -```sh -nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync' -``` diff --git a/versioned_docs/version-1.7.0/configuration/override_formats.md b/versioned_docs/version-1.7.0/configuration/override_formats.md deleted file mode 100644 index 386c2f7d0..000000000 --- a/versioned_docs/version-1.7.0/configuration/override_formats.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -id: override_formats -title: Override Formats ---- - -This applies to all `init.lua` fields except those that expect specific -function definitions such as `lsp.on_attach`, `lsp.server_registration`, and `polish`. - -Anywhere where you want to override a default provided lua table such as -`plugins.init` (specifying user plugins) or `plugins.X` where `X` is a default -plugin where you want to override the `setup()` call. - -### Override Table - -For most use cases, supplying a table is more than enough for supplying your -own configuration changes to a default table. This is done by simply providing -a new table and we merge the table with the default table where the user table -takes precedence. - -For example, the `plugins.init` table can be used to add new plugins to be -installed along side the default plugins: - -```lua -plugins = { - init = { - { "andweeb/presence.nvim" }, -- each table entry is a plugin using the Packer syntax without the "use" - { - "ray-x/lsp_signature.nvim", - event = "BufRead", - config = function() - require("lsp_signature").setup() - end, - }, - }, -}, -``` - -Or adding new bindings to `which-key`: - -```lua -["which-key"] = { - register_mappings = { - n = { -- normal mode - [""] = { -- leader prefix - ["N"] = { "tabnew", "New Buffer" }, -- normal mode, N - }, - } - }, -}, -``` - -### Override Function - -There may be cases where you want to have more control over the default tables -when overriding them. For these situations we also provide the ability to use a -`function` that takes one parameter (the default table) and returns a new table -to be used in it's place. This method is a lot more advanced and requires -knowledge of the Lua programming language. - -For example with `plugins.init`, you may want to disable lazy-loading for a default plugin while also providing your own plugins: - -```lua -plugins = { - init = function(default_plugins) - -- A table for your own plugins to load - local my_plugins = { - { "andweeb/presence.nvim" }, - { - "ray-x/lsp_signature.nvim", - event = "BufRead", - config = function() - require("lsp_signature").setup() - end, - }, - } - - -- The default plugin table is indexable by the package github username/repository - -- You can directly modify the default table and remove the Packer "cmd" configuration - default_plugins["akinsho/nvim-toggleterm.lua"]["cmd"] = nil - - -- Finally you will want to add the my_plugins table to the default table and return it - return vim.tbl_deep_extend("force", plugins, my_plugins) - end, -}, -``` - -_Note_: These functions are called when they are needed are are lazy-loaded, so -for example if you are using `plugins.cmp` with a function -(`function(table)...end`), this will be run after `cmp` is loaded and you will -be able to do `cmp = require("cmp")` within the function. diff --git a/versioned_docs/version-1.7.0/configuration/plugin_defaults.md b/versioned_docs/version-1.7.0/configuration/plugin_defaults.md deleted file mode 100644 index fa79590dc..000000000 --- a/versioned_docs/version-1.7.0/configuration/plugin_defaults.md +++ /dev/null @@ -1,942 +0,0 @@ ---- -id: plugin_defaults -title: Default Plugin Configurations ---- - -This page documents the default options that are set by AstroNvim for each individual plugin. All of these options would go in the `plugins` table in the `user/init.lua` configuration file. - -## Autopairs - -```lua -autopairs = { - check_ts = true, - ts_config = { - lua = { "string", "source" }, - javascript = { "string", "template_string" }, - java = false, - }, - disable_filetype = { "TelescopePrompt", "spectre_panel" }, - fast_wrap = { - map = "", - chars = { "{", "[", "(", '"', "'" }, - pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), - offset = 0, - end_key = "$", - keys = "qwertyuiopzxcvbnmasdfghjkl", - check_comma = true, - highlight = "PmenuSel", - highlight_grey = "LineNr", - }, -}, -``` - -## Better Escape - -```lua -better_escape = {}, -``` - -## Bufferline - -```lua -bufferline = { - options = { - offsets = { - { filetype = "NvimTree", text = "", padding = 1 }, - { filetype = "neo-tree", text = "", padding = 1 }, - { filetype = "Outline", text = "", padding = 1 }, - }, - buffer_close_icon = "๏™•", - modified_icon = "๏‘„", - close_icon = "๏™˜", - show_close_icon = true, - left_trunc_marker = "๏‚จ", - right_trunc_marker = "๏‚ฉ", - max_name_length = 14, - max_prefix_length = 13, - tab_size = 20, - show_tab_indicators = true, - enforce_regular_tabs = false, - view = "multiwindow", - show_buffer_close_icons = true, - separator_style = "thin", - always_show_bufferline = true, - diagnostics = false, - }, -}, -``` - -## cmp - -```lua -cmp = { - preselect = cmp.PreselectMode.None, - formatting = { - fields = { "kind", "abbr", "menu" }, - format = function(_, vim_item) - vim_item.kind = string.format("%s", kind_icons[vim_item.kind]) - return vim_item - end, - }, - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - duplicates = { - nvim_lsp = 1, - luasnip = 1, - cmp_tabnine = 1, - buffer = 1, - path = 1, - }, - confirm_opts = { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, - documentation = { - border = { "โ•ญ", "โ”€", "โ•ฎ", "โ”‚", "โ•ฏ", "โ”€", "โ•ฐ", "โ”‚" }, - }, - experimental = { - ghost_text = false, - }, - completion = { - keyword_length = 1, - }, - mapping = { - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), - [""] = cmp.config.disable, - [""] = cmp.mapping { - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }, - [""] = cmp.mapping.confirm { select = true }, - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expandable() then - luasnip.expand() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { - "i", - "s", - }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { - "i", - "s", - }), - }, -}, -``` - -## Colorizer - -```lua -colorizer = { - { "*" }, - { - RGB = true, -- #RGB hex codes - RRGGBB = true, -- #RRGGBB hex codes - names = false, -- "Name" codes like Blue - RRGGBBAA = false, -- #RRGGBBAA hex codes - rgb_fn = false, -- CSS rgb() and rgba() functions - hsl_fn = false, -- CSS hsl() and hsla() functions - css = false, -- Enable all css features: rgb_fn, hsl_fn, names, RGB, RRGGBB - css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn - mode = "background", -- Set the display mode - }, -}, -``` - -## Comment - -```lua -comment = { - pre_hook = function(ctx) - local U = require "Comment.utils" - - local location = nil - if ctx.ctype == U.ctype.block then - location = require("ts_context_commentstring.utils").get_cursor_location() - elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then - location = require("ts_context_commentstring.utils").get_visual_start_location() - end - - return require("ts_context_commentstring.internal").calculate_commentstring { - key = ctx.ctype == U.ctype.line and "__default" or "__multiline", - location = location, - } - end, -}, -``` - -## GitSigns - -```lua -gitsigns = { - signs = { - add = { hl = "GitSignsAdd", text = "โ–Ž", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, - change = { hl = "GitSignsChange", text = "โ–Ž", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, - delete = { hl = "GitSignsDelete", text = "โ–Ž", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, - topdelete = { - hl = "GitSignsDelete", - text = "๏ค‰", - numhl = "GitSignsDeleteNr", - linehl = "GitSignsDeleteLn", - }, - changedelete = { - hl = "GitSignsChange", - text = "โ–Ž", - numhl = "GitSignsChangeNr", - linehl = "GitSignsChangeLn", - }, - }, - signcolumn = true, - numhl = false, - linehl = false, - word_diff = false, - watch_gitdir = { - interval = 1000, - follow_files = true, - }, - attach_to_untracked = true, - current_line_blame = false, - current_line_blame_opts = { - virt_text = true, - virt_text_pos = "eol", - delay = 1000, - ignore_whitespace = false, - }, - current_line_blame_formatter_opts = { - relative_time = false, - }, - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, - max_file_length = 40000, - preview_config = { - border = "single", - style = "minimal", - relative = "cursor", - row = 0, - col = 1, - }, - yadm = { - enable = false, - }, -}, -``` - -## Web Devicons - -```lua -["nvim-web-devicons"] = { - c = { - icon = "๎˜ž", - color = colors.c, - name = "c", - }, - css = { - icon = "๎‰", - color = colors.css, - name = "css", - }, - deb = { - icon = "๏Œ†", - color = colors.deb, - name = "deb", - }, - Dockerfile = { - icon = "๏Œˆ", - color = colors.docker, - name = "Dockerfile", - }, - html = { - icon = "๏„ป", - color = colors.html, - name = "html", - }, - js = { - icon = "๎Ž", - color = colors.js, - name = "js", - }, - kt = { - icon = "๓ฑˆ™", - color = colors.kt, - name = "kt", - }, - lock = { - icon = "๏ ฝ", - color = colors.lock, - name = "lock", - }, - lua = { - icon = "๎˜ ", - color = colors.lua, - name = "lua", - }, - mp3 = { - icon = "๏ข…", - color = colors.mp3, - name = "mp3", - }, - mp4 = { - icon = "๏…„", - color = colors.mp4, - name = "mp4", - }, - out = { - icon = "๎˜’", - color = colors.out, - name = "out", - }, - py = { - icon = "๎˜†", - color = colors.py, - name = "py", - }, - ["robots.txt"] = { - icon = "๏ฎง", - color = colors.robot, - name = "robots", - }, - toml = { - icon = "๏€“", - color = colors.toml, - name = "toml", - }, - ts = { - icon = "๎˜จ", - color = colors.ts, - name = "ts", - }, - ttf = { - icon = "๏€ฑ", - color = colors.ttf, - name = "TrueTypeFont", - }, - rb = { - icon = "๎ž‘", - color = colors.rb, - name = "rb", - }, - rpm = { - icon = "๏Œ–", - color = colors.rpm, - name = "rpm", - }, - vue = { - icon = "๏ต‚", - color = colors.vue, - name = "vue", - }, - woff = { - icon = "๏€ฑ", - color = colors.woff, - name = "WebOpenFontFormat", - }, - woff2 = { - icon = "๏€ฑ", - color = colors.woff2, - name = "WebOpenFontFormat2", - }, - xz = { - icon = "๏‡†", - color = colors.zip, - name = "xz", - }, - zip = { - icon = "๏‡†", - color = colors.zip, - name = "zip", - }, - jsx = { - icon = "๏ฐ†", - color = colors.jsx, - name = "jsx", - }, - rust = { - icon = "๎žจ", - color = colors.rs, - name = "rs", - }, - jpg = { - icon = "๏Ž", - color = colors.jpg, - name = "jpg", - }, - png = { - icon = "๏Ž", - color = colors.png, - name = "png", - }, - jpeg = { - icon = "๏Ž", - color = colors.jpeg, - name = "jpeg", - }, -}, -``` - -## Indent Blankline - -```lua -indent_blankline = { - show_current_context = true, - show_current_context_start = false, -}, -``` - -## Indent-o-Matic - -```lua -["indent-o-matic"] = { - max_lines = 2048, - standard_widths = { 2, 4, 8 }, -}, -``` - -## Feline - -```lua -feline = { - disable = { filetypes = { "^NvimTree$", "^neo%-tree$", "^dashboard$", "^Outline$", "^aerial$" } }, - theme = { - fg = status.get_hl_prop("Feline", "foreground", colors.fg), - bg = status.get_hl_prop("Feline", "background", colors.bg_1), - }, - components = { - active = { - { - status.colored_spacer(1), - status.spacer(2), - { - provider = "git_branch", - hl = status.fg_hl(colors.purple_1, "Conditional", "foreground", { style = "bold" }), - icon = "๎œฅ ", - }, - status.spacer(3, status.git_head_available), - { - provider = { name = "file_type", opts = { filetype_icon = true, case = "lowercase" } }, - enabled = status.filetype_available, - }, - status.spacer(2, status.filetype_available), - { provider = "git_diff_added", hl = status.fg_hl(colors.green, "GitSignsAdd"), icon = " ๏ƒพ " }, - { provider = "git_diff_changed", hl = status.fg_hl(colors.orange_1, "GitSignsChange"), icon = " ๏ง‰" }, - { provider = "git_diff_removed", hl = status.fg_hl(colors.red_1, "GitSignsDelete"), icon = " ๏…† " }, - status.spacer(2, status.git_changed), - { - provider = "diagnostic_errors", - enabled = status.diagnostic_exists "ERROR", - hl = status.fg_hl(colors.red_1, "DiagnosticError"), - icon = " ๏— ", - }, - { - provider = "diagnostic_warnings", - enabled = status.diagnostic_exists "WARN", - hl = status.fg_hl(colors.orange_1, "DiagnosticWarn"), - icon = " ๏ฑ ", - }, - { - provider = "diagnostic_info", - enabled = status.diagnostic_exists "INFO", - hl = status.fg_hl(colors.white_2, "DiagnosticInfo"), - icon = " ๏Ÿป ", - }, - { - provider = "diagnostic_hints", - enabled = status.diagnostic_exists "HINT", - hl = status.fg_hl(colors.yellow_1, "DiagnosticHint"), - icon = " ๏ ด ", - }, - }, - { - { provider = status.lsp_progress, hl = { gui = "none" }, enabled = status.hide_in_width }, - { provider = "lsp_client_names", hl = { gui = "none" }, icon = " ๏‚… ", enabled = status.hide_in_width }, - status.spacer(2, status.hide_in_width), - { - provider = status.treesitter_status, - hl = status.fg_hl(colors.green, "GitSignsAdd"), - enabled = status.hide_in_width, - }, - status.spacer(2), - { provider = "position" }, - status.spacer(2), - { provider = "line_percentage" }, - status.spacer(1), - { provider = "scroll_bar", hl = status.fg_hl(colors.yellow, "TypeDef") }, - status.spacer(2), - status.colored_spacer(1), - }, - }, - }, -}, -``` - -## Cinnamon - -```lua -cinnamon = { - extra_keymaps = true, - extended_keymaps = true, -}, -``` - -## Neo-Tree - -```lua -["neo-tree"] = { - close_if_last_window = true, - popup_border_style = "rounded", - enable_git_status = true, - enable_diagnostics = false, - default_component_configs = { - indent = { - indent_size = 2, - padding = 0, - with_markers = true, - indent_marker = "โ”‚", - last_indent_marker = "โ””", - highlight = "NeoTreeIndentMarker", - with_expanders = false, - expander_collapsed = "๏‘ ", - expander_expanded = "๏‘ผ", - expander_highlight = "NeoTreeExpander", - }, - icon = { - folder_closed = "๎—ฟ", - folder_open = "๎—พ", - folder_empty = "๏”", - default = "๎˜’", - }, - name = { - trailing_slash = false, - use_git_status_colors = true, - }, - git_status = { - symbols = { - added = "๏†–", - deleted = "๏‘˜", - modified = "๏‘„", - renamed = "โžœ", - untracked = "โ˜…", - ignored = "โ—Œ", - unstaged = "โœ—", - staged = "โœ“", - conflict = "๎œง", - }, - }, - }, - window = { - position = "left", - width = 25, - mappings = { - ["<2-LeftMouse>"] = "open", - [""] = "open", - ["o"] = "open", - ["S"] = "open_split", - ["s"] = "open_vsplit", - ["C"] = "close_node", - [""] = "navigate_up", - ["."] = "set_root", - ["H"] = "toggle_hidden", - ["R"] = "refresh", - ["/"] = "fuzzy_finder", - ["f"] = "filter_on_submit", - [""] = "clear_filter", - ["a"] = "add", - ["d"] = "delete", - ["r"] = "rename", - ["y"] = "copy_to_clipboard", - ["x"] = "cut_to_clipboard", - ["p"] = "paste_from_clipboard", - ["c"] = "copy", - ["m"] = "move", - ["q"] = "close_window", - }, - }, - nesting_rules = {}, - filesystem = { - filtered_items = { - visible = false, - hide_dotfiles = true, - hide_gitignored = false, - hide_by_name = { - ".DS_Store", - "thumbs.db", - "node_modules", - "__pycache__", - }, - }, - follow_current_file = true, - hijack_netrw_behavior = "open_current", - use_libuv_file_watcher = true, - }, - buffers = { - show_unloaded = true, - window = { - mappings = { - ["bd"] = "buffer_delete", - }, - }, - }, - git_status = { - window = { - position = "float", - mappings = { - ["A"] = "git_add_all", - ["gu"] = "git_unstage_file", - ["ga"] = "git_add_file", - ["gr"] = "git_revert_file", - ["gc"] = "git_commit", - ["gp"] = "git_push", - ["gg"] = "git_commit_and_push", - }, - }, - }, - event_handlers = { - { - event = "vim_buffer_enter", - handler = function(_) - if vim.bo.filetype == "neo-tree" then - vim.wo.signcolumn = "auto" - end - end, - }, - }, -}, -``` - -## Packer - -```lua -packer = { - compile_path = vim.fn.stdpath "config" .. "/lua/packer_compiled.lua", - display = { - open_fn = function() - return require("packer.util").float { border = "rounded" } - end, - }, - profile = { - enable = true, - threshold = 0.0001, - }, - git = { - clone_timeout = 300, - subcommands = { - update = "pull --ff-only --progress --rebase=true", - }, - }, - auto_clean = true, - compile_on_sync = true, -}, -``` - -## Aerial - -```lua -aerial = { - close_behavior = "global", - backends = { "lsp", "treesitter", "markdown" }, - min_width = 28, - show_guides = true, - filter_kind = { - "Array", - "Boolean", - "Class", - "Constant", - "Constructor", - "Enum", - "EnumMember", - "Event", - "Field", - "File", - "Function", - "Interface", - "Key", - "Method", - "Module", - "Namespace", - "Null", - "Number", - "Object", - "Operator", - "Package", - "Property", - "String", - "Struct", - "TypeParameter", - "Variable", - }, - icons = { - Array = "๏™ฉ", - Boolean = "โŠจ", - Class = "๏ –", - Constant = "๎ˆฌ", - Constructor = "๎ˆ", - Key = "๏ …", - Function = "๏‚š", - Method = "ฦ’", - Namespace = "๏™ฉ", - Null = "NULL", - Number = "#", - Object = "โฆฟ", - Property = "๏‚ญ", - TypeParameter = "๐™", - Variable = "๎ž›", - Enum = "โ„ฐ", - Package = "๏ฃ–", - EnumMember = "๏…", - File = "๏œ“", - Module = "๏šฆ", - Field = "๏šง", - Interface = "๏ฐฎ", - String = "๐“", - Struct = "๐“ข", - Event = "๏ƒง", - Operator = "+", - }, - guides = { - mid_item = "โ”œ ", - last_item = "โ”” ", - nested_top = "โ”‚ ", - whitespace = " ", - }, - on_attach = function(bufnr) - -- Jump forwards/backwards with '{' and '}' - vim.keymap.set("n", "{", "AerialPrev", { buffer = bufnr, desc = "Jump backwards in Aerial" }) - vim.keymap.set("n", "}", "AerialNext", { buffer = bufnr, desc = "Jump forwards in Aerial" }) - -- Jump up the tree with '[[' or ']]' - vim.keymap.set("n", "[[", "AerialPrevUp", { buffer = bufnr, desc = "Jump up and backwards in Aerial" }) - vim.keymap.set("n", "]]", "AerialNextUp", { buffer = bufnr, desc = "Jump up and forwards in Aerial" }) - end, -}, -``` - -## Telescope - -```lua -telescope = { - defaults = { - - prompt_prefix = "๏€‚ ", - selection_caret = "โฏ ", - path_display = { "truncate" }, - selection_strategy = "reset", - sorting_strategy = "ascending", - layout_strategy = "horizontal", - layout_config = { - horizontal = { - prompt_position = "top", - preview_width = 0.55, - results_width = 0.8, - }, - vertical = { - mirror = false, - }, - width = 0.87, - height = 0.80, - preview_cutoff = 120, - }, - - mappings = { - i = { - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - - [""] = actions.close, - - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - - [""] = actions.select_default, - [""] = actions.select_horizontal, - [""] = actions.select_vertical, - [""] = actions.select_tab, - - [""] = actions.preview_scrolling_up, - [""] = actions.preview_scrolling_down, - - [""] = actions.results_scrolling_up, - [""] = actions.results_scrolling_down, - - [""] = actions.toggle_selection + actions.move_selection_worse, - [""] = actions.toggle_selection + actions.move_selection_better, - [""] = actions.send_to_qflist + actions.open_qflist, - [""] = actions.send_selected_to_qflist + actions.open_qflist, - [""] = actions.complete_tag, - }, - - n = { - [""] = actions.close, - [""] = actions.select_default, - [""] = actions.select_horizontal, - [""] = actions.select_vertical, - [""] = actions.select_tab, - - [""] = actions.toggle_selection + actions.move_selection_worse, - [""] = actions.toggle_selection + actions.move_selection_better, - [""] = actions.send_to_qflist + actions.open_qflist, - [""] = actions.send_selected_to_qflist + actions.open_qflist, - - ["j"] = actions.move_selection_next, - ["k"] = actions.move_selection_previous, - ["H"] = actions.move_to_top, - ["M"] = actions.move_to_middle, - ["L"] = actions.move_to_bottom, - - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - ["gg"] = actions.move_to_top, - ["G"] = actions.move_to_bottom, - - [""] = actions.preview_scrolling_up, - [""] = actions.preview_scrolling_down, - - [""] = actions.results_scrolling_up, - [""] = actions.results_scrolling_down, - }, - }, - }, - pickers = {}, - extensions = {}, -}, -``` - -## ToggleTerm - -```lua -toggleterm = { - size = 10, - open_mapping = [[]], - hide_numbers = true, - shade_filetypes = {}, - shade_terminals = true, - shading_factor = 2, - start_in_insert = true, - insert_mappings = true, - persist_size = true, - direction = "float", - close_on_exit = true, - shell = vim.o.shell, - float_opts = { - border = "curved", - winblend = 0, - highlights = { - border = "Normal", - background = "Normal", - }, - }, -}, -``` - -## Treesitter - -```lua -treesitter = { - ensure_installed = {}, - sync_install = false, - ignore_install = {}, - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, - context_commentstring = { - enable = true, - enable_autocmd = false, - }, - autopairs = { - enable = true, - }, - incremental_selection = { - enable = true, - }, - indent = { - enable = false, - }, - rainbow = { - enable = true, - disable = { "html" }, - extended_mode = false, - max_file_lines = nil, - }, - autotag = { - enable = true, - }, -}, -``` - -## Which-Key - -```lua -["which-key"] = { - plugins = { - marks = true, - registers = true, - spelling = { - enabled = true, - suggestions = 20, - }, - presets = { - operators = false, - motions = true, - text_objects = true, - windows = true, - nav = true, - z = true, - g = true, - }, - }, - key_labels = {}, - icons = { - breadcrumb = "ยป", - separator = "โžœ", - group = "+", - }, - popup_mappings = { - scroll_down = "", - scroll_up = "", - }, - window = { - border = "rounded", - position = "bottom", - margin = { 1, 0, 1, 0 }, - padding = { 2, 2, 2, 2 }, - winblend = 0, - }, - layout = { - height = { min = 4, max = 25 }, - width = { min = 20, max = 50 }, - spacing = 3, - align = "left", - }, - ignore_missing = true, - hidden = { "", "", "", "", "call", "lua", "^:", "^ " }, - show_help = true, - triggers = "auto", - triggers_blacklist = { - i = { "j", "k" }, - v = { "j", "k" }, - }, -}, -``` diff --git a/versioned_docs/version-1.7.0/configuration/splitting_up.md b/versioned_docs/version-1.7.0/configuration/splitting_up.md deleted file mode 100644 index 2b748323e..000000000 --- a/versioned_docs/version-1.7.0/configuration/splitting_up.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -id: splitting_up -title: Splitting Up Configuration ---- - -AstroNvim can be fully configured using just the `user/init.lua` file, but also -supports easily being configured with separate files. These files will be -automatically detected if the file location corresponds to the location in the -`init.lua` table. - -For example the plugins `plugins.init` override table (or -`function(table)...end`) can be placed in the file `user/plugins/init.lua` -which would be a `lua` file that returns the override `table` or -`function(table)...end`. - -Example `user/plugins/init.lua` file: - -```lua -return { - { "andweeb/presence.nvim" }, - { - "ray-x/lsp_signature.nvim", - event = "BufRead", - config = function() - require("lsp_signature").setup() - end, - }, -} -``` - -Another example would be adding a custom `lsp.on_attach` function, this could -be in a file `lsp/on_attach.lua` that returns a `function(client, bufnr)...end` -for example, if you wanted to enable document formatting for the `sumneko_lua` -LSP: - -```lua -return function(client, bufnr) - if client.name == "sumneko_lua" then - client.resolved_capabilities.document_formatting = true - end -end -``` - -## Lazy Loaded Files - -When separating these files into separate files they are lazy loaded by AstroNvim and only called when they are needed. This is particularly useful when configuring plugins when you may want to `require` them. - -For example if you want to add bindings to `nvim-tree` that use the `nvim_tree_callback` function. This can be easily achieved with the file `plugins/nvim-tree.lua` with the contents: - -```lua -local tree_cb = require("nvim-tree.config").nvim_tree_callback - -return { - view = { - mappings = { - custom_only = false, - list = { - { key = { "l", "", "o" }, cb = tree_cb "edit" }, - { key = "h", cb = tree_cb "close_node" }, - { key = "v", cb = tree_cb "vsplit" }, - }, - }, - }, -} -``` - -## Example File Tree - -A heavily modified AstroNvim setup that leverages these separate files could have a file structure as such: - -``` -user/ -โ”œโ”€โ”€ init.lua -โ”œโ”€โ”€ default_theme/ -โ”‚ โ”œโ”€โ”€ init.lua -โ”‚ โ”œโ”€โ”€ colors.lua -โ”‚ โ””โ”€โ”€ highlights.lua -โ”œโ”€โ”€ diagnostics.lua -โ”œโ”€โ”€ lsp/ -โ”‚ โ”œโ”€โ”€ on_attach.lua -โ”‚ โ”œโ”€โ”€ server_registration.lua -โ”‚ โ””โ”€โ”€ server-settings/ -โ”‚ โ”œโ”€โ”€ texlab.lua -โ”‚ โ””โ”€โ”€ yamlls.lua -โ”œโ”€โ”€ luasnip.lua -โ”œโ”€โ”€ plugins/ -| โ”œโ”€โ”€ init.lua -| โ”œโ”€โ”€ null-ls.lua -โ”‚ โ”œโ”€โ”€ bufferline.lua -โ”‚ โ”œโ”€โ”€ which-key.lua -| โ”œโ”€โ”€ packer.lua -| โ”œโ”€โ”€ aerial.lua -| โ”œโ”€โ”€ telescope.lua -| โ”œโ”€โ”€ toggleterm.lua -| โ”œโ”€โ”€ treesitter.lua -โ”‚ โ””โ”€โ”€ nvim-tree.lua -โ””โ”€โ”€ which-key/ - โ””โ”€โ”€ register_n_leader.lua -``` diff --git a/versioned_docs/version-1.7.0/configuration/updater.md b/versioned_docs/version-1.7.0/configuration/updater.md deleted file mode 100644 index 12e5690b1..000000000 --- a/versioned_docs/version-1.7.0/configuration/updater.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -id: updater -title: Managing AstroNvim Updates ---- - -:::caution - -AstroNvim v1.4.0 has added `stable` and `nightly` update channels. For the time being we have kept the default update channel to `nightly` so that the behavior of AstroNvim doesn't change (this could be considered a breaking change to some). We are planning to make the `stable` channel the default update channel when Neovim v0.8 is released and we tag AstroNvim v2.0.0 to incorporate this "breaking" change. - -::: - -## Features - -- `stable` and `nightly` update channels -- pinning your updater to a specific commit/branch/stable version -- allow AstroNvim to completely manage updates for core provided plugins in a stable way -- will prompt the user if there are breaking changes before updating as well as show the full changelog after a successful update -- setting and managing custom remote repositories -- show the changelog at the end of an update - -## Update Channels - -As of AstroNvim `v1.4.0` we have adopted a release model using two channels: `stable` and `nightly`. They each have a few different features and goals: - -**Stable** - -The `stable` update channel is meant to provide tracking of officially tagged releases that should be the most stable experience that you can achieve with no fear of plugin updates breaking your editor or anything. With each stable release we release a snapshot of the core provided plugins and their latest working commit at the time of release. By default on the `stable` channel AstroNvim will use these snapshots to pin all of the core plugins to these commits and keep them from updating and potentially bringing in breaking changes. These tagged releases also will happen a lot less frequently and each update will come with several changes/bug fixes/features/etc. There is also the ability to filter what versions you want to update to for example if you only want to stay in `v1.X` and never upate to `v2` whenever it gets released that can be configured. The updater will also warn you if there are any breaking changes included in the update that may require manual updating of your user configuration, and ask if you want to continue or abort the process. - -**Stable** - -The `nightly` update channel is meant for people who want more regular updates and follow the latest and greatest features real time. This also by default does not track pinned plugin versions and the core plugins are able to update freely with `:PackerSync`. - -## Configuration - -Here is the complete set of configuration options for the `updater` table in your `user/init.lua` file as well as the default values: - -```lua -updater = { - channel = "nightly", - remote = "origin", - version = "latest", - branch = "main", - commit = nil, - pin_plugins = nil, - skip_prompts = false, - show_changelog = true, - -- remotes = { -- easily add new remotes to track - -- ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url - -- ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut, - -- ["remote3"] = "github_user", -- GitHub user assumes user/AstroNvim.git - -- }, -}, -``` - -### Options - -- `channel`: This can be either `"nightly"` or `"stable"` and those two options are described above -- `remote`: This lets you choose to use a separate remote outside of the `origin` which can be useful for checking out other forks and testing PRs from community members -- `version`: (`stable` only) This allows you to apply a filter for searching for versions. `"latest"` is automatically treated as `"v*"`, other examples can be exact versions (`v1.4.0`) or search filters (`v1.*`) -- `branch`: (`nightly` only) This allows you to check out a different branch on the specified `remote` -- `commit`: (`nightly` only) This allows you to pin the `nightly` updates to a specific commit -- `pin_plugins`: This value controls the automatic management of core plugin commits. This can either be `nil` (default) which will pin plugin commits only on `stable`, `false` which completely disables it, `true` which enables it for both `stable` and `nightly`. -- `skip_prompts`: This lets you skip the confirmation prompts in the update process and automatically accept each one -- `show_changelog`: This allows you to skip the printing of the complete changelog at the end of the update -- `remotes`: This is a configuration table for easily setting up more remotes for AstroNvim to pull from. The above example shows the different formats for the URL that are supported and once a remote is defined, the key can be used in the `remote` option field. diff --git a/versioned_docs/version-1.7.0/intro.md b/versioned_docs/version-1.7.0/intro.md deleted file mode 100644 index 06e453b7c..000000000 --- a/versioned_docs/version-1.7.0/intro.md +++ /dev/null @@ -1,115 +0,0 @@ ---- -id: intro -title: Getting Started -slug: / ---- - -![AstroNvim Screenshot](/img/overview.png) - -:::caution - -AstroNvim v1.4.0 has added `stable` and `nightly` update channels. For the time being we have kept the default update channel to `nightly` so that the behavior of AstroNvim doesn't change (this could be considered a breaking change to some). We are planning to make the `stable` channel the default update channel when Neovim v0.8 is released and we tag AstroNvim v2.0.0 to incorporate this "breaking" change. - -::: - -## โšก Requirements - -- [Nerd Fonts](https://www.nerdfonts.com/font-downloads) -- [Neovim 0.7+](https://github.com/neovim/neovim/releases/tag/v0.7.0) -- Terminal with true color support (for the default theme, otherwise it is dependent on the theme you are using) -- Optional Requirements: - - [ripgrep](https://github.com/BurntSushi/ripgrep) - live grep telescope search (`fw`) - - [lazygit](https://github.com/jesseduffield/lazygit) - git ui toggle terminal (`tl` or `gg`) - - [NCDU](https://dev.yorhel.nl/ncdu) - disk usage toggle terminal (`tu`) - - [Htop](https://htop.dev/) - process viewer toggle terminal (`tt`) - - [Python](https://www.python.org/) - python repl toggle terminal (`tp`) - - [Node](https://nodejs.org/en/) - node repl toggle terminal (`tn`) - -:::info - -When using default theme: For MacOS, the default terminal does not have true color support. You wil need to use [iTerm2](https://iterm2.com/) or another [terminal emulator](https://gist.github.com/XVilka/8346728#terminal-emulators) that has true color support. - -::: - -## ๐Ÿ› ๏ธ Installation - -#### Make a backup of your current nvim folder - -```sh -mv ~/.config/nvim ~/.config/nvim.bak -``` - -#### Clean old plugins (Optional but recommended) - -```sh -mv ~/.local/share/nvim/site ~/.local/share/nvim/site.bak -``` - -#### Clone the repository - -```sh -git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim -nvim +PackerSync -``` - -:::info - -If you are still using Neovim v0.6 you can still use the last version of AstroNvim prior to the Neovim v0.7 release. After running the `git clone` command above please checkout the `nvim-0.6` branch like so: - -``` -git -C ~/.config/nvim checkout nvim-0.6 -``` - -_Note:_ This branch will not be updated after the Neovim v0.7 release and will not get any new features or bug fixes. - -::: - -## ๐Ÿ“ฆ Setup - -#### Install LSP - -Enter `:LspInstall` followed by the name of the server you want to install - -> Example: `:LspInstall pyright` - -#### Install language parser - -Enter `:TSInstall` followed by the name of the language you want to install - -> Example: `:TSInstall python` - -#### Manage plugins - -Run `:PackerClean` to remove any disabled or unused plugins - -Run `:PackerSync` to update and clean plugins - -#### Update AstroNvim - -Run `:AstroUpdate` to get the latest updates from the repository - -## โœจ Features - -- File explorer with [Neo-tree](https://github.com/nvim-neo-tree/neo-tree.nvim) -- Autocompletion with [Cmp](https://github.com/hrsh7th/nvim-cmp) -- Git integration with [Gitsigns](https://github.com/lewis6991/gitsigns.nvim) -- Statusline with [Feline](https://github.com/feline-nvim/feline.nvim) -- Terminal with [Toggleterm](https://github.com/akinsho/toggleterm.nvim) -- Fuzzy finding with [Telescope](https://github.com/nvim-telescope/telescope.nvim) -- Syntax highlighting with [Treesitter](https://github.com/nvim-treesitter/nvim-treesitter) -- Formatting and linting with [Null-ls](https://github.com/jose-elias-alvarez/null-ls.nvim) -- Language Server Protocol with [Native LSP](https://github.com/neovim/nvim-lspconfig) - -## โš™๏ธ Configuration - -To begin making custom user configurations you must create a `user/` folder. The provided example can be created with (please note the trailing slashes after the directory names) - -```sh -cp -r ~/.config/nvim/lua/user_example/ ~/.config/nvim/lua/user/ -``` - -The provided example -[user_example](https://github.com/AstroNvim/AstroNvim/blob/main/lua/user_example) -contains an `init.lua` file which can be used for all user configuration. After -running the `cp` command above this file can be found in -`~/.config/nvim/lua/user/init.lua`. diff --git a/versioned_docs/version-1.7.0/recipes/advanced_lsp.md b/versioned_docs/version-1.7.0/recipes/advanced_lsp.md deleted file mode 100644 index c20c37c7f..000000000 --- a/versioned_docs/version-1.7.0/recipes/advanced_lsp.md +++ /dev/null @@ -1,137 +0,0 @@ ---- -id: advanced_lsp -title: Advanced LSP Setup ---- - -### LSP Setup Without Installer - -AstroNvim comes with [nvim-lsp-installer](https://github.com/williamboman/nvim-lsp-installer) as an easy interface for setting up and installing language servers, but this might not be adequate for all users. The LSP installer doesn't support all of the language servers that Neovim's LSP config supports and some users may already have the language servers installed on their machine and don't want to reinstall it separately. In these cases we have added an easy interface for setting up these servers. The following is a minimal `user/init.lua` file that simply sets up `pyright` language server for a user with `pyright` already available on their system: - -```lua -return { - lsp = { - servers = { - "pyright", - }, - }, -} -``` - -If the user wants to configure server specific settings and configurations then they can do this with the `lsp.server-settings` table as well. For example if the user wants to use `pyright` that is already available on their system and disable the single file support then can do the following: - -```lua -return { - lsp = { - servers = { - "pyright", - }, - ["server-settings"] = { - pyright = { - single_filesupport = false, - }, - }, - }, -} -``` - -### LSP Specific Plugins - -There are some plugins available for doing advanced setup of language servers that require the user to not use the `lspconfig` setup call and instead use their own plugin setup for handling this. AstroNvim provides a nice way to do this while still using `nvim-lsp-installer` for installing the language servers. You can use the `lsp.skip_setup` table for specifying which language servers to guarantee AstroNvim will not automatically call the `lspconfig` setup for. We also provide a helper function for getting the AstroNvim default server configuration like our built in `capabilities`, `on_attach`, as well as the user defined options in `lsp.server-settings`. Here is a couple examples for some common LSP plugins: - -**[typescript.nvim](https://github.com/jose-elias-alvarez/typescript.nvim)** - -```lua -return { - lsp = { - skip_setup = { "tsserver" }, - }, - plugins = { - init = { - { - "jose-elias-alvarez/typescript.nvim", - after = "nvim-lsp-installer", -- make sure to load after nvim-lsp-installer - config = function() - require("typescript").setup { - server = astronvim.lsp.server_settings "tsserver", - } - end, - }, - }, - ["nvim-lsp-installer"] = { - ensure_installed = { "tsserver" }, - }, - }, -} -``` - -**[clangd_extensions.nvim](https://github.com/p00f/clangd_extensions.nvim)** - -```lua -return { - lsp = { - skip_setup = { "clangd" }, - ["server-settings"] = { - clangd = { - capabilities = { - offsetEncoding = "utf-8", - }, - }, - }, - }, - plugins = { - init = { - { - "p00f/clangd_extensions.nvim", - after = "nvim-lsp-installer", -- make sure to load after nvim-lsp-installer - config = function() - require("clangd_extensions").setup { - server = astronvim.lsp.server_settings "clangd", - } - end, - }, - }, - ["nvim-lsp-installer"] = { - ensure_installed = { "clangd" }, - }, - }, -} -``` - -**[flutter-tools.nvim](https://github.com/akinsho/flutter-tools.nvim)** - -```lua -return { - lsp = { - skip_setup = { "dartls" }, -- skip lsp setup because flutter-tools will do it itself - ["server-settings"] = { - dartls = { - -- any changes you want to make to the LSP setup, for example - color = { - enabled = true, - }, - settings = { - showTodos = true, - completeFunctionCalls = true, - }, - }, - }, - }, - plugins = { - init = { - { - "akinsho/flutter-tools.nvim", - requires = "nvim-lua/plenary.nvim", - after = "nvim-lsp-installer", -- make sure to load after nvim-lsp-installer - config = function() - require("flutter-tools").setup { - lsp = astronvim.lsp.server_settings "dartls", -- get the server settings and built in capabilities/on_attach - } - end, - }, - }, - ["nvim-lsp-installer"] = { - ensure_installed = { "dartls" }, -- install dartls - }, - }, -} -``` diff --git a/versioned_docs/version-1.7.0/recipes/alpha.md b/versioned_docs/version-1.7.0/recipes/alpha.md deleted file mode 100644 index 6b0243afc..000000000 --- a/versioned_docs/version-1.7.0/recipes/alpha.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -id: alpha -title: Dashboard Customizations ---- - -### Customize Alpha Header - -If you want to customize your header on the dashboard you can do this easily in the `user/init.lua`: - -```lua -return { - header = { - " My Custom ", - " Dashboard Header", - }, -} -``` - -### Open Alpha Automatically When No More Buffers - -If you want to make the Alpha dashboard open automatically when you close the last buffer in your session you can add the following in your `user/init.lua` in your `polish` function: - -```lua -return { - polish = function() - local function alpha_on_bye(cmd) - local bufs = vim.fn.getbufinfo { buflisted = true } - vim.cmd(cmd) - if require("core.utils").is_available "alpha-nvim" and not bufs[2] then - require("alpha").start(true) - end - end - vim.keymap.del("n", "c") - if require("core.utils").is_available "bufdelete.nvim" then - vim.keymap.set("n", "c", function() - alpha_on_bye "Bdelete!" - end, { desc = "Close buffer" }) - else - vim.keymap.set("n", "c", function() - alpha_on_bye "bdelete!" - end, { desc = "Close buffer" }) - end - end, -} -``` diff --git a/versioned_docs/version-1.7.0/recipes/black_belt.md b/versioned_docs/version-1.7.0/recipes/black_belt.md deleted file mode 100644 index 7d34eb540..000000000 --- a/versioned_docs/version-1.7.0/recipes/black_belt.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -id: black_belt -title: Black Belt Example User Configs -sidebar_position: 1 ---- - -This is a collection of advanced fully complete AstroNvim user configurations for reference: - -- [mehalter](https://code.mehalter.com/projects/68) -- [datamonsterr](https://github.com/datamonsterr/astronvim_config) -- [hunger](https://github.com/hunger/AstroVim/tree/my_config/lua/user) -- [thieung](https://github.com/thieung/dotfiles/tree/main/config/nvim) diff --git a/versioned_docs/version-1.7.0/recipes/cmp.md b/versioned_docs/version-1.7.0/recipes/cmp.md deleted file mode 100644 index 15b30a242..000000000 --- a/versioned_docs/version-1.7.0/recipes/cmp.md +++ /dev/null @@ -1,257 +0,0 @@ ---- -id: cmp -title: Customize cmp Completion ---- - -### Customize Keybindings - -Some overrides require access to the plugin itself that you are overriding. This comes up a lot in things adding custom mappings to `cmp`. This can be achieved with the following in your `user/init.lua`: - -```lua -return { - plugins = { - cmp = function(opts) - -- opts parameter is the default options table - -- the function is lazy loaded so cmp is able to be required - local cmp = require "cmp" - -- modify the mapping part of the table - opts.mapping[""] = cmp.mapping.select_next_item() - - -- return the new table to be used - return opts - end, - }, -} -``` - -### Customize Source Priority - -We have provided a default set up for prioritizing different completions for `cmp`. These can be easily modified in the `user/init.lua` file: - -:::tip - -This table is an override table and the example below shows the defaults we have provided, so by listing only one of thse sources with a priority will make the others just assume the default value. - -::: - -```lua -return { - cmp = { - source_priority = { - nvim_lsp = 1000, - luasnip = 750, - buffer = 500, - path = 250, - }, - }, -} -``` - -By changing the number values you can change the priority (higher number == higher preference). These can also be controlled with boolean values for easily disabling a default source. In this case, `true` translates to high priority of 1000 and `false` translates to disabling a source. For example we can do a simple enable for `luasnip` and `nvim_lsp` which puts them both at equal hight priority, make `path` less of a priority, and disable `buffer`: - -```lua -return { - cmp = { - source_priority = { - nvim_lsp = true, - luasnip = true, - path = 500, - buffer = false, - }, - }, -} -``` - -### Modify Existing Source Options - -You may want to modify the options for the default provided `cmp` sources. This can be done by overriding the plugin's `config` function in the `plugin.init`. For example, if you want to make the `buffer` source display completions from all available buffers you could have a `user/init.lua` file like this: - -```lua -return { - plugins = { - ["hrsh7th/cmp-buffer"] = { - config = function() - astronvim.add_user_cmp_source { - name = "buffer", - option = { - get_bufnrs = function() - return vim.api.nvim_list_bufs() - end, - }, - } - end, - }, - }, -} -``` - -### Add More Sources - -A user may want to include several new sources. We have provided a couple different easy ways to do this using the `plugins.init` table to install a `cmp` source plugin and some provided helper functions to add the source and it's priority. This is an example of a `user/init.lua` that adds emoji autocompletion: - -```lua -return { - plugins = { - init = { - { - "hrsh7th/cmp-emoji", - after = "nvim-cmp", - config = function() - astronvim.add_cmp_source("emoji", 700) - end, - }, - }, - }, -} -``` - -:::tip - -Instead of passing a string and a number to `add_cmp_source` you can pass a single table parameter with a full table with options - -```lua -config = function() - astronvim.add_cmp_source({ name = "emoji", priority = 700, keyword_length = 2, max_item_count = 7 }) -end, -``` - -Here `priority` is optional as the `cmp.source_priority` table can be used to set the priority. If priority is specified in the `add_cmp_source` and the `cmp.source_priority` table the `cmp.source_priority` will take precedence. - -::: - -If you are adding several new sources in your `plugins.init` table this can make it hard to keep track of all of the priorities and how they are in relation to each other, so you can also use a helper function we have provided to extend the `cmp.source_priority` table. For example you can use the following code which adds both `emoji` and `pandoc_references` completions to `cmp`: - -```lua -return { - plugins = { - init = { - { - "hrsh7th/cmp-emoji", - after = "nvim-cmp", - config = function() - astronvim.add_user_cmp_source "emoji" - end, - }, - { - "mehalter/cmp-pandoc-references", - after = "nvim-cmp", - config = function() - astronvim.add_user_cmp_source "pandoc_references" - end, - }, - }, - }, - - cmp = { - source_priority = { - nvim_lsp = 1000, - luasnip = 750, - emoji = 700, - pandoc_references = 600, - buffer = 500, - path = 250, - }, - }, -} -``` - -:::tip - -The default `cmp` sources are optional to provide here because they have default values tied to them, so using the following table would provide the same effect: - -```lua -source_priority = { - emoji = 700, - pandoc_references = 600, -}, -``` - -::: - -### Advanced Setup For Filetype and Cmdline - -`cmp` offers setting up custom sources for both `filetype` and `cmdline` (`cmp.setup.filetype()` and `cmp.setup.cmdline()` respectively). We have added a simple API for this as well in the user configuration. Here is a complete example for customizing these as well as getting the sources with the sources defined in the `user/init.lua` `cmp.source_priority` table: - -:::caution - -From my experience, the filetype detection does not work well with our lazy loading, so it's recommended to disable `cmp` lazy loading if you are using this feature. The way it works in our set up is `friendly-snippets` is lazy loaded when the user goes into insert mode and then `LuaSnip` and `cmp` follow in sequence. Therefore, you want to disable the lazy loading of `friendly-snippets` to get `cmp` to load on startup. This is included in the example below in the `plugins.init` table. - -::: - -```lua -return { - plugins = { - init = { - -- disable lazy loading for friendly snippets - -- that triggers the loading of cmp - ["rafamadriz/friendly-snippets"] = { event = { nil } }, - -- add more custom sources - { - "hrsh7th/cmp-emoji", - after = "nvim-cmp", - config = function() - astronvim.add_user_cmp_source "emoji" - end, - }, - }, - }, - cmp = { - -- set cmp source priorities - source_priority = { - nvim_lsp = 1000, - luasnip = 750, - emoji = 700, - buffer = 500, - path = 250, - }, - setup = function() - -- load cmp to access it's internal functions - local cmp = require "cmp" - local user_source = astronvim.get_user_cmp_source - - -- store a local variable with a source list to share between filetypes - local prose_sources = { - user_source "luasnip", - user_source "buffer", - user_source "emoji", - } - local config = { - -- configure cmp.setup.filetype(filetype, options) - filetype = { - -- first key is the filetype that you are setting up - lua = { -- for lua only load lsp sources and buffer sources as a fallback - sources = cmp.config.sources({ - user_source "nvim_lsp", - }, { - user_source "buffer", - }), - }, - -- markdown and latex share the same sources - markdown = { sources = prose_sources }, - latex = { sources = prose_sources }, - }, - -- configure cmp.setup.cmd(source, options) - cmdline = { - -- first key is the source that you are setting up - ["/"] = { - -- set up custom mappings - mapping = cmp.mapping.preset.cmdline(), - -- configure sources normally without getting priority from cmp.source_priority - sources = { { name = "buffer" } }, - }, - [":"] = { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - user_source "path", - }, { - { name = "cmdline" }, - }), - }, - }, - } - -- return config - return config - end, - }, -} -``` diff --git a/versioned_docs/version-1.7.0/recipes/colorscheme.md b/versioned_docs/version-1.7.0/recipes/colorscheme.md deleted file mode 100644 index a56ceb8be..000000000 --- a/versioned_docs/version-1.7.0/recipes/colorscheme.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -id: colorscheme -title: Custom Colorscheme ---- - -## Using a Custom Colorscheme - -Example setting a custom colorscheme with `catppuccin` in your `user/init.lua`: - -```lua -return { - colorscheme = "catppuccin", - - plugins = { - init = { - { - "catppuccin/nvim", - as = "catppuccin", - config = function() - require("catppuccin").setup {} - end, - }, - }, - }, -} -``` - -:::tip - -There used to be a recommended trick to check for your colorscheme before setting it. We have improved the base installation to do this checking automatically. So no more need for user side checking. - -::: - -## Using a Custom Colorscheme Configured with Global Variables - -Some colorscheme plugins are configured through global variables rather than Lua functions like `config()` so they require a slightly different setup in Packer to get them working correctly. For example if we want to use [Sonokai](https://github.com/sainnhe/sonokai): - -```lua -return { - colorscheme = "sonokai", - options = { - g = { - sonokai_style = "shusia" - } - }, - plugins = { - init = { - { "sainnhe/sonokai" }, - }, - }, -} -``` - -:::tip - -This approach also handles the case when the colorscheme is not installed yet and AstroNvim will not try to set it. - -::: diff --git a/versioned_docs/version-1.7.0/recipes/globalstatus.md b/versioned_docs/version-1.7.0/recipes/globalstatus.md deleted file mode 100644 index 3306df3f0..000000000 --- a/versioned_docs/version-1.7.0/recipes/globalstatus.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -id: globalstatus -title: Disable Global Statusbar ---- - -By default AstroNvim enables the new global statusbar that comes with Neovim v0.7+. Some users may not like this behavior and prefer the traditional per-buffer status bar. The following code block is a minimal `user/init.lua` that will disable the global statusbar with lualine. If you are using Dashboard.nvim as well you will also need to override the autocommands that we include with this plugin as well which are the changes made to the `polish()` function. If you have disabled or removed the Dashboard.nvim plugin then you can ignore the `polish` function changes below. - -```lua -return { - options = { opt = { laststatus = 2 } } -} -``` diff --git a/versioned_docs/version-1.7.0/recipes/snippets.md b/versioned_docs/version-1.7.0/recipes/snippets.md deleted file mode 100644 index dc84fd666..000000000 --- a/versioned_docs/version-1.7.0/recipes/snippets.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -id: snippets -title: Custom VS Code Style Snippets ---- - -`user/init.lua`: - -```lua -return { - luasnip = { - vscode_snippet_paths = { - "./lua/user/snippets", - }, - }, -} -``` - -Create a folder inside of your `user/` folder called `snippets`. Add snippets to that folder that follow the vscode style as described in the [Documentation](https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md#vscode-snippets-loader) - -Necessary configuration file in `user/snippets/package.json`: - -```json -{ - "name": "user snippets", - "engines": { - "vscode": "^1.11.0" - }, - "contributes": { - "snippets": [ - { - "language": "vue", - "path": "./vue.json" - } - ] - } -} -``` - -Example Vue snippet in `user/snippets/vue.json`: - -```json -{ - "setup": { - "prefix": ["setup", "template"], - "body": [ - "", - "", - "", - "", - "", - "" - ], - "description": "My standard setup Vue3 + TS" - } -} -``` diff --git a/versioned_docs/version-1.7.0/recipes/telescope_theme.md b/versioned_docs/version-1.7.0/recipes/telescope_theme.md deleted file mode 100644 index 51adb7d02..000000000 --- a/versioned_docs/version-1.7.0/recipes/telescope_theme.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: telescope_theme -title: NvChad Telescope Theme ---- - -This code snippet make the default theme telescope look like the default NvChad telescope theme: - -![Screenshot of telescope theme](/img/recipes/telescope_theme.png) - -`user/init.lua`: - -```lua -return { - default_theme = { - colors = function(C) - C.telescope_green = C.green - C.telescope_red = C.red - C.telescope_fg = C.fg - C.telescope_bg = C.black_1 - C.telescope_bg_alt = C.bg_1 - return C - end, - highlights = function(hl) - local C = require "default_theme.colors" - hl.TelescopeBorder = { fg = C.telescope_bg_alt, bg = C.telescope_bg } - hl.TelescopeNormal = { bg = C.telescope_bg } - hl.TelescopePreviewBorder = { fg = C.telescope_bg, bg = C.telescope_bg } - hl.TelescopePreviewNormal = { bg = C.telescope_bg } - hl.TelescopePreviewTitle = { fg = C.telescope_bg, bg = C.telescope_green } - hl.TelescopePromptBorder = { fg = C.telescope_bg_alt, bg = C.telescope_bg_alt } - hl.TelescopePromptNormal = { fg = C.telescope_fg, bg = C.telescope_bg_alt } - hl.TelescopePromptPrefix = { fg = C.telescope_red, bg = C.telescope_bg_alt } - hl.TelescopePromptTitle = { fg = C.telescope_bg, bg = C.telescope_red } - hl.TelescopeResultsBorder = { fg = C.telescope_bg, bg = C.telescope_bg } - hl.TelescopeResultsNormal = { bg = C.telescope_bg } - hl.TelescopeResultsTitle = { fg = C.telescope_bg, bg = C.telescope_bg } - return hl - end, - }, -} -``` diff --git a/versioned_docs/version-1.7.0/recipes/unattended_install.md b/versioned_docs/version-1.7.0/recipes/unattended_install.md deleted file mode 100644 index 6442c7bfa..000000000 --- a/versioned_docs/version-1.7.0/recipes/unattended_install.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -id: unattended_install -title: Unattended Installation ---- - -Instead of running `nvim +PackerSync` to initialize AstroNvim you can run the -following command to do a fully headless initialization: - -```sh -nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync' -``` - -Full Steps: - -1. `git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim` -2. (Optional) `git clone`/copy over user configuration to `~/.config/nvim/user` -3. `nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'` diff --git a/versioned_docs/version-1.7.0/usage/mappings.md b/versioned_docs/version-1.7.0/usage/mappings.md deleted file mode 100644 index 1862514b9..000000000 --- a/versioned_docs/version-1.7.0/usage/mappings.md +++ /dev/null @@ -1,141 +0,0 @@ ---- -id: mappings -title: Default Mappings ---- - -## General Mappings - -| Action | Mappings | -| ----------------------- | -------------- | -| Leader key | `Space` | -| Escape key | `jj`, `jk` | -| Resize up | `Ctrl + Up` | -| Resize Down | `Ctrl + Down` | -| Resize Left | `Ctrl + Left` | -| Resize Right | `Ctrl + Right` | -| Up Window | `Ctrl + k` | -| Down Window | `Ctrl + j` | -| Left Window | `Ctrl + h` | -| Right Window | `Ctrl + l` | -| Force Write | `Ctrl + s` | -| Force Quit | `Ctrl + q` | -| New File | `Space + fn` | -| Close Buffer | `Space + c` | -| Terminal | `Ctrl + \` | -| Next Buffer | `Shift + l` | -| Previous Buffer | `Shift + h` | -| Comment | `Space + /` | -| Toggle URL Highlighting | `Space + u` | - -## Bufferline - -| Action | Mappings | -| ----------------- | -------- | -| Move Buffer Right | `>b` | -| Move Buffer Left | `