mirror of
https://github.com/ivuorinen/astronvim_config.git
synced 2026-02-20 06:50:01 +00:00
Switched to nightly branch, formatting, plugins
This commit is contained in:
126
init.lua
126
init.lua
@@ -1,7 +1,8 @@
|
|||||||
-- AstroNvim Configuration Table
|
-- AstroNvim Configuration Table
|
||||||
-- All configuration changes should go inside of the table below
|
-- All configuration changes should go inside of the table below
|
||||||
--
|
--
|
||||||
-- A split up user configuration example can be found at: https://github.com/AstroNvim/split_user_example
|
-- A split up user configuration example can be found at:
|
||||||
|
-- https://github.com/AstroNvim/split_user_example
|
||||||
--
|
--
|
||||||
-- You can think of a Lua "table" as a dictionary like data structure the
|
-- You can think of a Lua "table" as a dictionary like data structure the
|
||||||
-- normal format is "key = value". These also handle array like data structures
|
-- normal format is "key = value". These also handle array like data structures
|
||||||
@@ -9,15 +10,15 @@
|
|||||||
local config = {
|
local config = {
|
||||||
-- Configure AstroNvim updates
|
-- Configure AstroNvim updates
|
||||||
updater = {
|
updater = {
|
||||||
remote = "origin", -- remote to use
|
remote = "origin", -- remote to use
|
||||||
channel = "nightly", -- "stable" or "nightly"
|
channel = "nightly", -- "stable" or "nightly"
|
||||||
version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY)
|
version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY)
|
||||||
branch = "v3", -- branch name (NIGHTLY ONLY)
|
branch = "nightly", -- branch name (NIGHTLY ONLY)
|
||||||
commit = nil, -- commit hash (NIGHTLY ONLY)
|
commit = nil, -- commit hash (NIGHTLY ONLY)
|
||||||
pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only)
|
pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only)
|
||||||
skip_prompts = false, -- skip prompts about breaking changes
|
skip_prompts = false, -- skip prompts about breaking changes
|
||||||
show_changelog = true, -- show the changelog after performing an update
|
show_changelog = true, -- show the changelog after performing an update
|
||||||
auto_quit = true, -- automatically quit the current session after a successful update
|
auto_quit = true, -- automatically quit the current session after a successful update
|
||||||
-- remotes = { -- easily add new remotes to track
|
-- remotes = { -- easily add new remotes to track
|
||||||
-- ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url
|
-- ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url
|
||||||
-- ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut,
|
-- ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut,
|
||||||
@@ -40,20 +41,28 @@ local config = {
|
|||||||
opt = {
|
opt = {
|
||||||
-- set to true or false etc.
|
-- set to true or false etc.
|
||||||
relativenumber = true, -- sets vim.opt.relativenumber
|
relativenumber = true, -- sets vim.opt.relativenumber
|
||||||
number = true, -- sets vim.opt.number
|
number = true, -- sets vim.opt.number
|
||||||
spell = false, -- sets vim.opt.spell
|
spell = false, -- sets vim.opt.spell
|
||||||
signcolumn = "auto", -- sets vim.opt.signcolumn to auto
|
signcolumn = "auto", -- sets vim.opt.signcolumn to auto
|
||||||
wrap = true, -- sets vim.opt.wrap
|
wrap = true, -- sets vim.opt.wrap
|
||||||
},
|
},
|
||||||
g = {
|
g = {
|
||||||
mapleader = " ", -- sets vim.g.mapleader
|
--- sets vim.g.mapleader
|
||||||
autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled)
|
mapleader = " ",
|
||||||
cmp_enabled = true, -- enable completion at start
|
--- toggle auto formatting at start (lsp.formatting.format_on_save must be enabled)
|
||||||
autopairs_enabled = true, -- enable autopairs at start
|
autoformat_enabled = true,
|
||||||
diagnostics_enabled = true, -- enable diagnostics at start
|
--- enable completion at start
|
||||||
status_diagnostics_enabled = true, -- enable diagnostics in statusline
|
cmp_enabled = true,
|
||||||
icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing)
|
--- enable autopairs at start
|
||||||
ui_notifications_enabled = true, -- disable notifications when toggling UI elements
|
autopairs_enabled = true,
|
||||||
|
--- enable diagnostics at start
|
||||||
|
diagnostics_enabled = true,
|
||||||
|
--- enable diagnostics in statusline
|
||||||
|
status_diagnostics_enabled = true,
|
||||||
|
-- disable icons in the UI (disable if no nerd font available, requires :PackerSync after)
|
||||||
|
icons_enabled = true,
|
||||||
|
-- disable notifications when toggling UI elements
|
||||||
|
ui_notifications_enabled = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- If you need more control, you can use the function()...end notation
|
-- If you need more control, you can use the function()...end notation
|
||||||
@@ -67,7 +76,7 @@ local config = {
|
|||||||
-- end,
|
-- end,
|
||||||
-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
|
-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
virtual_text = true,
|
virtual_text = false,
|
||||||
underline = true,
|
underline = true,
|
||||||
},
|
},
|
||||||
-- Extend LSP configuration
|
-- Extend LSP configuration
|
||||||
@@ -119,16 +128,17 @@ local config = {
|
|||||||
-- Add overrides for LSP server settings, the keys are the name of the server
|
-- Add overrides for LSP server settings, the keys are the name of the server
|
||||||
config = {
|
config = {
|
||||||
-- example for addings schemas to yamlls
|
-- example for addings schemas to yamlls
|
||||||
yamlls = { -- override table for require("lspconfig").yamlls.setup({...})
|
yamlls = {
|
||||||
settings = {
|
-- override table for require("lspconfig").yamlls.setup({...})
|
||||||
yaml = {
|
-- settings = {
|
||||||
schemas = {
|
-- yaml = {
|
||||||
["http://json.schemastore.org/github-workflow"] = ".github/workflows/*.{yml,yaml}",
|
-- schemas = {
|
||||||
["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}",
|
-- ["http://json.schemastore.org/github-workflow"] = ".github/workflows/*.{yml,yaml}",
|
||||||
["http://json.schemastore.org/ansible-stable-2.9"] = "roles/tasks/*.{yml,yaml}",
|
-- ["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}",
|
||||||
},
|
-- ["http://json.schemastore.org/ansible-stable-2.9"] = "roles/tasks/*.{yml,yaml}",
|
||||||
},
|
-- },
|
||||||
},
|
-- },
|
||||||
|
-- },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -142,13 +152,13 @@ local config = {
|
|||||||
n = {
|
n = {
|
||||||
-- second key is the lefthand side of the map
|
-- second key is the lefthand side of the map
|
||||||
-- mappings seen under group name "Buffer"
|
-- mappings seen under group name "Buffer"
|
||||||
["<leader>bb"] = { "<cmd>tabnew<cr>", desc = "New tab" },
|
["<leader>bb"] = { "<cmd>tabnew<cr>", desc = "New tab" },
|
||||||
["<leader>bc"] = { "<cmd>BufferLinePickClose<cr>", desc = "Pick to close" },
|
["<leader>bc"] = { "<cmd>BufferLinePickClose<cr>", desc = "Pick to close" },
|
||||||
["<leader>bj"] = { "<cmd>BufferLinePick<cr>", desc = "Pick to jump" },
|
["<leader>bj"] = { "<cmd>BufferLinePick<cr>", desc = "Pick to jump" },
|
||||||
["<leader>bt"] = { "<cmd>BufferLineSortByTabs<cr>", desc = "Sort by tabs" },
|
["<leader>bt"] = { "<cmd>BufferLineSortByTabs<cr>", desc = "Sort by tabs" },
|
||||||
-- tables with the `name` key will be registered with which-key if it's installed
|
-- tables with the `name` key will be registered with which-key if it's installed
|
||||||
-- this is useful for naming menus
|
-- this is useful for naming menus
|
||||||
["<leader>b"] = { name = "Buffers" },
|
["<leader>b"] = { name = "Buffers" },
|
||||||
-- quick save
|
-- quick save
|
||||||
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
|
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
|
||||||
},
|
},
|
||||||
@@ -169,6 +179,7 @@ local config = {
|
|||||||
},
|
},
|
||||||
-- Configure plugins
|
-- Configure plugins
|
||||||
plugins = {
|
plugins = {
|
||||||
|
"AstroNvim/astrocommunity",
|
||||||
-- You can disable default plugins as follows:
|
-- You can disable default plugins as follows:
|
||||||
-- { "max397574/better-escape.nvim", enabled = false },
|
-- { "max397574/better-escape.nvim", enabled = false },
|
||||||
--
|
--
|
||||||
@@ -176,7 +187,7 @@ local config = {
|
|||||||
-- {
|
-- {
|
||||||
-- "L3MON4D3/LuaSnip",
|
-- "L3MON4D3/LuaSnip",
|
||||||
-- config = function(plugin, opts)
|
-- config = function(plugin, opts)
|
||||||
-- require "plugins.configs.luasnip"(plugin, opts) -- include the default astronvim config that calls the setup call
|
-- require "plugins.configs.luasnip"(plugin, opts) -- inc. default astronvim config that calls the setup call
|
||||||
-- -- add more custom luasnip configuration such as filetype extend or custom snippets
|
-- -- add more custom luasnip configuration such as filetype extend or custom snippets
|
||||||
-- local luasnip = require "luasnip"
|
-- local luasnip = require "luasnip"
|
||||||
-- luasnip.filetype_extend("javascript", { "javascriptreact" })
|
-- luasnip.filetype_extend("javascript", { "javascriptreact" })
|
||||||
@@ -185,7 +196,7 @@ local config = {
|
|||||||
-- {
|
-- {
|
||||||
-- "windwp/nvim-autopairs",
|
-- "windwp/nvim-autopairs",
|
||||||
-- config = function(plugin, opts)
|
-- config = function(plugin, opts)
|
||||||
-- require "plugins.configs.nvim-autopairs"(plugin, opts) -- include the default astronvim config that calls the setup call
|
-- require "plugins.configs.nvim-autopairs"(plugin, opts) -- inc. default astronvim config
|
||||||
-- -- add more custom autopairs configuration such as custom rules
|
-- -- add more custom autopairs configuration such as custom rules
|
||||||
-- local npairs = require "nvim-autopairs"
|
-- local npairs = require "nvim-autopairs"
|
||||||
-- local Rule = require "nvim-autopairs.rule"
|
-- local Rule = require "nvim-autopairs.rule"
|
||||||
@@ -227,14 +238,13 @@ local config = {
|
|||||||
-- You can also add new plugins here as well:
|
-- You can also add new plugins here as well:
|
||||||
-- Add plugins, the lazy syntax
|
-- Add plugins, the lazy syntax
|
||||||
"andweeb/presence.nvim",
|
"andweeb/presence.nvim",
|
||||||
-- {
|
{
|
||||||
-- "ray-x/lsp_signature.nvim",
|
"ray-x/lsp_signature.nvim",
|
||||||
-- event = "BufRead",
|
event = "BufRead",
|
||||||
-- config = function()
|
config = function()
|
||||||
-- require("lsp_signature").setup()
|
require("lsp_signature").setup()
|
||||||
-- end,
|
end,
|
||||||
-- },
|
},
|
||||||
|
|
||||||
-- Plugin entries can also be used to override the default options for plugins as well
|
-- Plugin entries can also be used to override the default options for plugins as well
|
||||||
{
|
{
|
||||||
"goolord/alpha-nvim",
|
"goolord/alpha-nvim",
|
||||||
@@ -413,9 +423,29 @@ local config = {
|
|||||||
"jay-babu/mason-nvim-dap.nvim",
|
"jay-babu/mason-nvim-dap.nvim",
|
||||||
-- overrides `require("mason-nvim-dap").setup(...)`
|
-- overrides `require("mason-nvim-dap").setup(...)`
|
||||||
opts = {
|
opts = {
|
||||||
-- ensure_installed = { "python" },
|
automatic_installation = true,
|
||||||
|
automatic_setup = true,
|
||||||
|
ensure_installed = { "python", "php", "js", "bash" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{ import = "astrocommunity.bars-and-lines.smartcolumn-nvim" },
|
||||||
|
{
|
||||||
|
"m4xshen/smartcolumn.nvim",
|
||||||
|
opts = {
|
||||||
|
colorcolumn = { "80", "100", "120" },
|
||||||
|
disabled_filetypes = { "help", "text", "markdown" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ import = "astrocommunity.code-runner.overseer-nvim" },
|
||||||
|
{ import = "astrocommunity.diagnostics.lsp_lines-nvim" },
|
||||||
|
{ import = "astrocommunity.diagnostics.trouble-nvim" },
|
||||||
|
{ import = "astrocommunity.editing-support.refactoring-nvim" },
|
||||||
|
{ import = "astrocommunity.editing-support.neogen" },
|
||||||
|
{ import = "astrocommunity.markdown-and-latex.glow-nvim" },
|
||||||
|
{ import = "astrocommunity.pack.typescript" },
|
||||||
|
{ import = "astrocommunity.project.neoconf-nvim" },
|
||||||
|
{ import = "astrocommunity.test.neotest" },
|
||||||
|
{ import = "astrocommunity.utility.neodim" },
|
||||||
{
|
{
|
||||||
"wakatime/vim-wakatime",
|
"wakatime/vim-wakatime",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
|||||||
Reference in New Issue
Block a user