-
Notifications
You must be signed in to change notification settings - Fork 14
Configuration
This file is located in CyberNvim/lua/example_user_config.lua. When configuring, the idea is that for any relevant section of the example, you can copy-paste its contents into your own files and then change them as you see fit. I provide an example of this with my own configuration. Note that the naming of the user_config.lua
file and that of the modules defined in the example file are strict - any deviation will break your configuration.
For example, if you wanted to add your own plugins to the distribution, you can copy the following to your own user_config.lua
file:
M.plugins = {
{
"nvim-neotest/neotest",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"antoinemadec/FixCursorHold.nvim",
},
},
}
Then, you can simply use the same syntax to add your own.
There are a number of predefined sections in the config. With proper usage of these sections, it is possible to almost completely get rid of all of CyberNvim's default configuration and replace it entirely with your own. Of course, anything placed in your configuration will completely override CyberNvim.
M.setup_sources
is used to add extra sources to connect to Null-ls - you can find a list of sources here. The parameter b is just short for null_ls.builtins
.
M.ensure_installed
is used to define none_ls or dap sources you would like installed automatically on any machine. A full list of all sources available is here
M.formatting_servers
is used to setup auto formatting rules. You need to select the language server that will provide autoformatting capabilities. My config has it setup for most major languages already.
M.options
is where you can add/override any basic Neovim option. CyberNvim defines these here
M.autocommands
is where you can disable any default CyberNvim autocommand. They are defined here along with a short description of what they do.
M.enable_plugins
is where you can choose to disable CyberNvim plugins. This can also be helpful if you'd like to completely overhaul a plugin configuration and start from scratch. Note that if you just want to override/add some options, it is easier to directly change those like so:
require("neo-tree").setup({
close_if_last_window = false,
})
In this example, all I've done is set close_if_last_window
from true (default CyberNvim), to false (my preferred value) in my user config. You may find it helpful to take a look at the plugin configs CyberNvim has by default and the configuration pages for each individual plugin. You can access this easily from the plugins page on the wiki.
M.plugins
is where you will add your own plugin definitions.
M.user_conf
is the most important section of your user_conf. This is where you can define any autocommands, require any files, or otherwise completely port your current configuration. In my configuration, I use it to simply require an init file which then contains all my debugging setups, and any other misc configurations I need.