AstroNvim / AstroNvim

AstroNvim is an aesthetic and feature-rich neovim config that is extensible and easy to use with a great set of plugins
https://AstroNvim.com
GNU General Public License v3.0
12.67k stars 926 forks source link

Announcements #427

Closed mehalter closed 2 years ago

mehalter commented 2 years ago

This is a general purpose thread for announcements so users can subscribe to them and we will try to post updates here for improvements to the user configurations and API. This will also help us make change logs when we tag new releases and allow users to see progress more frequently and easier.

Note: This includes announcements starting after the v1.2.0 release.

mehalter commented 2 years ago

426 - Cleaner user vim option settings

We have improved the setting of user options for stuff like vim.opt and vim.g to have a nicer API in the user/init.lua file. This is not a breaking change and old code will work.

Instead of putting options in the polish function the user can now put them in an options table in the user/init.lua like the following:

return {
  options = {
    opt = {
      conceallevel = 2, -- set vim.opt.conceallevel
    },
    g = {
      mapleader = "\\", -- set vim.g.mapleader
    }
  },
}
mehalter commented 2 years ago

426 - Custom colorscheme automatic error checking

Previously we asked users who are using custom colorschemes to include their own code for checking if their plugin is loaded themselves. We have found a good general purpose solution for this, so now you can simply do the following and if the colorscheme is not available, it will default to default_theme:

return {
  colorscheme = "catppuccin",
}
mehalter commented 2 years ago

462 - Remove TermMappings autocmd group BREAKING CHANGE

If you are using vim.api.nvim_delete_augroup "TermMappings in your config to delete the terminal mappings, these are now normal bindings. So each one can be disabled individually with something like this in the polish function:

vim.keymap.del("t", "<esc>")
mehalter commented 2 years ago

469 - Deprecated the disabled table in the user settings BREAKING CHANGE

For a while we have been slowly deprecating the disabled table in the user settings and we haven't been recommending it as a way to disable plugins for a while. As we have been moving to better plugins that table has been slowly going away anyway, so we have decided to just do away with it all together. If you want to disable a plugin please use the new method that is a lot more streamlined and utilizes Packer features that already exist:

return {
  plugins = {
    init = {
      ["goolord/alpha-nvim"] = { disable = true },

      -- ... more plugins go here
    },
  },
}

where the key is the plugin name entry repo_owner/repo_name

mehalter commented 2 years ago

Upcoming Breaking Change

None of these changes will cause errors on the user side so the editor will not break, but if you have a custom lualine set up this will no longer be used and null-ls will stop being set up until it is moved to the correct place in the config.

PR #519 is going to come with a couple breaking changes that make a lot of necessary improvements:

  1. We are moving from lualine to feline. This is showing a ~5x performance improvement with the exact same look and improved functionality
  2. We are restructuring how null-ls is configured. Previously it was set up how it is now because we didn't have the user config tooling that we have today. We are able now to have it configured the same as all of the other plugins which is better for maintaining and guaranteeing stability in the future.

For the upcoming null-ls change we are moving it to the plugins table in the user/init.lua. Here is a minimal example user/init.lua file that sets up null-ls:

return {
  plugins = {
    ["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 = "<buffer>",
            callback = vim.lsp.buf.formatting_sync,
          })
        end
      end
      return config -- return final config table
    end,
  },
}

We are terribly sorry for the breaking changes! As AstroNvim is maturing there are a bit of growing pains, but we are hopeful that breaking changes should become less and less frequent!

mehalter commented 2 years ago

PR #519 has been merged. Please refer to the previous announcement for the description of the breaking changes it included. Along with these changes also came a very large refactor that we are excited to release as well! This refactor didn't have any more breaking changes than what was described before, but had some very exciting stuff:

  1. AstroNvim startup time is now 2x faster!
  2. core.utils is now accessible as a global variable astronvim, so if you have require("core.utils") anywhere in your personal config it can be replaced with just astronvim
mehalter commented 2 years ago

It's been about a month since our last release and have had a lot of great changes so we have decided to tag AstroNvim Release v1.3.0

With this release we are also going to start including a PackerSnapshot_AstroNvim_vX.X.X file on the release assets: PackerSnapshot_AstroNvim_v1.3.0

This is in an attempt to be able to provide the most stable experience that we can. This provides known working commit tags for every plugin that comes with AstroNvim. I will add a section to the documentation soon describing how to use this file for future reference, but i'll put a few basic steps here:

  1. Go to the AstroNvim folder (~/.config/nvim) and run git checkout v1.3.0
  2. Download the PackerSnapshot_AstroNvim_v1.3.0 file
  3. Copy that file to the ~/.cache/nvim/packer.nvim/ folder
  4. Add the following snippet to your user/init.lua file:
return {
  plugins = {
    packer = {
      snapshot = "PackerSnapshot_AstroNvim_v1.3.0",
    },
  },
}
  1. Restart AstroNvim and run :PackerSync

Hopefully in the near future we can add some AstroNvim tooling to make this process easier and provide the most stable experience yet!

mehalter commented 2 years ago

PRs #582 and #583 add some new syntax to the user/init.lua file that make it easier to add LSP specific plugins nicely without having issues with the LSP configuration stuff that AstroNvim provides. The details of this new syntax are described in a new page on the docs: https://astronvim.github.io/recipes/advanced_lsp#lsp-specific-plugins

mehalter commented 2 years ago

PR #585 adds a nice new user command for checking your current version of AstroNvim as well as the commit you are currently on with :AstroVersion 2022-06-02_11:46:36_screenshot

When we tag a new version, if you have checked out that version in particular then it will not show the current commit, just the version number: 2022-06-02_11:51:24_screenshot

mehalter commented 2 years ago

PR #586 continues with our improvements to the inner workings of the LSP configuration. We have improved the ability for users to configure per-language server on_attach functions. It honestly should have been like this before and some people may consider this to have been a bug... but basically you can easily add an on_attach function to an LSP in the lsp.server-settings table and it be applied only to that language server.

This can be useful if you want to disable formatting for a specific language server such as what we do with sumneko_lua before the preferred method for doing this was:

return {
  lsp = {
    on_attach = function(client, bufnr)
      if client.name == "sumneko_lua" then
        client.resolved_capabilities.document_formatting = false
      end
    end,
  },
}

Now with the new improvements this can be done in the lsp.server-settings table in a much cleaner and manageable fashion:

return {
  lsp = {
    ["server-settings"] = {
      sumneko_lua = {
        on_attach = function(client, bufnr)
          client.resolved_capabilities.document_formatting = false
        end,
      },
    },
  },
}

Furthermore, some language servers have plugins for extending them such as sqls.nvim which requires being attached to the client when attaching the language server. This can also be achieved in a similar fashion much easier than before:

return {
  lsp = {
    ["server-settings"] = {
      sqls = {
        on_attach = function(client, bufnr)
          require("sqls").on_attach(client, bufnr)
        end,
      },
    },
  },
}

Also to note, the lsp.on_attach function is still an option that can be set and basically adds onto the global on_attach function that will run for all language servers.

mehalter commented 2 years ago

A very exciting rewrite for :AstroUpdate has just been merged with some MAJOR changes to the update process of AstroNvim (#590)

The main change is the splitting of stable and nightly update channels.

Notice: The first release that will be fully supported by the updater in the stable channel will be v1.4.0

This also comes with several new features for managing updates as well:

This update also comes with a new configuration table in user/init.lua file for configuring all of these new options:

return {
  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 = nil, -- nil, true, false (nil will pin plugins on stable only)
    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
    },
  },
}

New documentation page here: https://astronvim.github.io/configuration/updater

Here are a couple screenshots for example: 2022-06-06_11:45:08_screenshot

2022-06-06_11:53:59_screenshot

UPDATE: We made a slight change to the snapshot handling before the first release. I have updated the code here to reflect it

mehalter commented 2 years ago

With the finalization of the new updater, we have tagged Release v1.4.0. This officially starts the stable channel as well as our strict adherence to semantic versioning for all future updates. 🥳

Notice: 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.

mehalter commented 2 years ago

I am going to move this Announcement thread to the Discussions page on the GitHub repo. This will allow maintainers to be able to control Announcement posts while still allowing community members to comment as well as react to an announcement. I have also made a first post on this discussion thread explaining our use of the Discussions (why we have disabled other discussion threads) as well as instructions on how to subscribe to future Announcements: #663

Please check it out here: https://github.com/AstroNvim/AstroNvim/discussions/categories/announcements