mirror of
https://github.com/ivuorinen/astronvim_config.git
synced 2026-01-26 11:24:07 +00:00
Config updates
This commit is contained in:
85
init.lua
85
init.lua
@@ -1,11 +1,9 @@
|
||||
-- AstroNvim Configuration Table
|
||||
-- All configuration changes should go inside of the table below
|
||||
|
||||
-- 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
|
||||
-- where a value with no key simply has an implicit numeric key
|
||||
local config = {
|
||||
|
||||
-- Configure AstroNvim updates
|
||||
updater = {
|
||||
remote = "origin", -- remote to use
|
||||
@@ -17,17 +15,15 @@ local config = {
|
||||
skip_prompts = false, -- skip prompts about breaking changes
|
||||
show_changelog = true, -- show the changelog after performing an update
|
||||
auto_reload = false, -- automatically reload and sync packer after a successful update
|
||||
auto_quit = false, -- automatically quit the current session after a successful update
|
||||
auto_quit = false -- automatically quit the current session after a successful 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 to use
|
||||
colorscheme = "default_theme",
|
||||
|
||||
-- Add highlight groups in any theme
|
||||
highlights = {
|
||||
-- init = { -- this table overrides highlights in all themes
|
||||
@@ -37,7 +33,6 @@ local config = {
|
||||
-- Normal = { bg = "#000000" },
|
||||
-- },
|
||||
},
|
||||
|
||||
-- set vim options here (vim.<first_key>.<second_key> = value)
|
||||
options = {
|
||||
opt = {
|
||||
@@ -46,7 +41,7 @@ local config = {
|
||||
number = true, -- sets vim.opt.number
|
||||
spell = false, -- sets vim.opt.spell
|
||||
signcolumn = "auto", -- sets vim.opt.signcolumn to auto
|
||||
wrap = false, -- sets vim.opt.wrap
|
||||
wrap = false -- sets vim.opt.wrap
|
||||
},
|
||||
g = {
|
||||
mapleader = " ", -- sets vim.g.mapleader
|
||||
@@ -57,8 +52,8 @@ local config = {
|
||||
status_diagnostics_enabled = true, -- enable diagnostics in statusline
|
||||
icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing)
|
||||
ui_notifications_enabled = true, -- disable notifications when toggling UI elements
|
||||
heirline_bufferline = false, -- enable new heirline based bufferline (requires :PackerSync after changing)
|
||||
},
|
||||
heirline_bufferline = false -- enable new heirline based bufferline (requires :PackerSync after changing)
|
||||
}
|
||||
},
|
||||
-- If you need more control, you can use the function()...end notation
|
||||
-- options = function(local_vim)
|
||||
@@ -82,18 +77,14 @@ local config = {
|
||||
" ████ ██ ██ ██ ██ ████ ████",
|
||||
" ██ ██ ██ ██ ██ ██ ██ ████ ██",
|
||||
" ██ ██ ██ ██ ██ ██ ██ ██ ██",
|
||||
" ██ ████ ████ ██ ██ ██",
|
||||
" ██ ████ ████ ██ ██ ██"
|
||||
},
|
||||
|
||||
-- Default theme configuration
|
||||
default_theme = {
|
||||
-- Modify the color palette for the default theme
|
||||
colors = {
|
||||
fg = "#abb2bf",
|
||||
bg = "#1e222a",
|
||||
},
|
||||
colors = { fg = "#abb2bf", bg = "#1e222a" },
|
||||
highlights = function(hl) -- or a function that returns a new table of colors to set
|
||||
local C = require "default_theme.colors"
|
||||
local C = require("default_theme.colors")
|
||||
|
||||
hl.Normal = { fg = C.fg, bg = C.bg }
|
||||
|
||||
@@ -125,16 +116,11 @@ local config = {
|
||||
telescope = true,
|
||||
treesitter = true,
|
||||
vimwiki = false,
|
||||
["which-key"] = true,
|
||||
},
|
||||
["which-key"] = true
|
||||
}
|
||||
},
|
||||
|
||||
-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
|
||||
diagnostics = {
|
||||
virtual_text = true,
|
||||
underline = true,
|
||||
},
|
||||
|
||||
diagnostics = { virtual_text = true, underline = true },
|
||||
-- Extend LSP configuration
|
||||
lsp = {
|
||||
-- enable servers that you already have installed without mason
|
||||
@@ -150,12 +136,12 @@ local config = {
|
||||
},
|
||||
ignore_filetypes = { -- disable format on save for specified filetypes
|
||||
-- "python",
|
||||
},
|
||||
}
|
||||
},
|
||||
disabled = { -- disable formatting capabilities for the listed language servers
|
||||
-- "sumneko_lua",
|
||||
},
|
||||
timeout_ms = 1000, -- default format timeout
|
||||
timeout_ms = 1000 -- default format timeout
|
||||
-- filter = function(client) -- fully override the default formatting function
|
||||
-- return true
|
||||
-- end
|
||||
@@ -164,7 +150,7 @@ local config = {
|
||||
mappings = {
|
||||
n = {
|
||||
-- ["<leader>lf"] = false -- disable formatting keymap
|
||||
},
|
||||
}
|
||||
},
|
||||
-- add to the global LSP on_attach function
|
||||
-- on_attach = function(client, bufnr)
|
||||
@@ -189,9 +175,8 @@ local config = {
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
-- Mapping data with "desc" stored directly by vim.keymap.set().
|
||||
--
|
||||
-- Please use this mappings table to set keyboard mapping since this is the
|
||||
@@ -203,18 +188,23 @@ local config = {
|
||||
-- second key is the lefthand side of the map
|
||||
-- mappings seen under group name "Buffer"
|
||||
["<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>bt"] = { "<cmd>BufferLineSortByTabs<cr>", desc = "Sort by tabs" },
|
||||
["<leader>bt"] = {
|
||||
"<cmd>BufferLineSortByTabs<cr>",
|
||||
desc = "Sort by tabs"
|
||||
}
|
||||
-- quick save
|
||||
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
|
||||
},
|
||||
t = {
|
||||
-- setting a mapping to false will disable it
|
||||
-- ["<esc>"] = false,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
-- Configure plugins
|
||||
plugins = {
|
||||
init = {
|
||||
@@ -268,9 +258,8 @@ local config = {
|
||||
},
|
||||
["mason-nvim-dap"] = { -- overrides `require("mason-nvim-dap").setup(...)`
|
||||
-- ensure_installed = { "python" },
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
-- LuaSnip Options
|
||||
luasnip = {
|
||||
-- Extend filetypes
|
||||
@@ -280,10 +269,9 @@ local config = {
|
||||
-- Configure luasnip loaders (vscode, lua, and/or snipmate)
|
||||
vscode = {
|
||||
-- Add paths for including more VS Code style snippets in luasnip
|
||||
paths = {},
|
||||
},
|
||||
paths = {}
|
||||
}
|
||||
},
|
||||
|
||||
-- CMP Source Priorities
|
||||
-- modify here the priorities of default cmp sources
|
||||
-- higher value == higher priority
|
||||
@@ -295,12 +283,11 @@ local config = {
|
||||
nvim_lsp = 1000,
|
||||
luasnip = 750,
|
||||
buffer = 500,
|
||||
path = 250,
|
||||
},
|
||||
path = 250
|
||||
}
|
||||
},
|
||||
|
||||
-- Customize Heirline options
|
||||
heirline = {
|
||||
-- heirline = {
|
||||
-- -- Customize different separators between sections
|
||||
-- separators = {
|
||||
-- tab = { "", "" },
|
||||
@@ -323,8 +310,7 @@ local config = {
|
||||
-- statusline = true, -- Filetype icon in the statusline
|
||||
-- },
|
||||
-- },
|
||||
},
|
||||
|
||||
-- },
|
||||
-- Modify which-key registration (Use this with mappings table in the above.)
|
||||
["which-key"] = {
|
||||
-- Add bindings which show up as group name
|
||||
@@ -335,12 +321,11 @@ local config = {
|
||||
["<leader>"] = {
|
||||
-- third key is the key to bring up next level and its displayed
|
||||
-- group name in which-key top level menu
|
||||
["b"] = { name = "Buffer" },
|
||||
},
|
||||
},
|
||||
},
|
||||
["b"] = { name = "Buffer" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
-- This function is run last and is a good place to configuring
|
||||
-- augroups/autocommands and custom filetypes also this just pure lua so
|
||||
-- anything that doesn't fit in the normal config locations above can go here
|
||||
@@ -357,7 +342,7 @@ local config = {
|
||||
-- ["~/%.config/foo/.*"] = "fooscript",
|
||||
-- },
|
||||
-- }
|
||||
end,
|
||||
end
|
||||
}
|
||||
|
||||
return config
|
||||
|
||||
@@ -3,7 +3,9 @@ return function(client, bufnr)
|
||||
local inlayhints_avail, inlayhints = pcall(require, "lsp-inlayhints")
|
||||
if inlayhints_avail then
|
||||
inlayhints.on_attach(client, bufnr)
|
||||
vim.keymap.set("n", "<leader>uH", function() inlayhints.toggle() end, { desc = "Toggle inlay hints" })
|
||||
vim.keymap.set("n", "<leader>uH",
|
||||
function() inlayhints.toggle() end,
|
||||
{ desc = "Toggle inlay hints" })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -17,8 +17,8 @@ return {
|
||||
-- View treesitter highlight groups
|
||||
["<space>k"] = { ":TSHighlightCapturesUnderCursor<cr>", desc = "View Highlight Group" },
|
||||
-- Easy splits
|
||||
["\\"] = { "<cmd>split<cr>", desc = "Horizontal split" },
|
||||
["|"] = { "<cmd>vsplit<cr>", desc = "Vertical split" },
|
||||
-- ["\\"] = { "<cmd>split<cr>", desc = "Horizontal split" },
|
||||
-- ["|"] = { "<cmd>vsplit<cr>", desc = "Vertical split" },
|
||||
-- Search highlight groups
|
||||
["<space>sg"] = { "<cmd>Telescope highlights<cr>", desc = "Highlight groups" },
|
||||
-- quick save
|
||||
|
||||
18
options.lua
18
options.lua
@@ -13,16 +13,24 @@ return {
|
||||
foldmethod = "expr",
|
||||
linebreak = true, -- linebreak soft wrap at words
|
||||
list = true, -- show whitespace characters
|
||||
listchars = { tab = " ", extends = "⟩", precedes = "⟨", trail = "·", eol = "" },
|
||||
showbreak = " ",
|
||||
listchars = {
|
||||
tab = " ",
|
||||
extends = "⟩",
|
||||
precedes = "⟨",
|
||||
trail = "·",
|
||||
eol = ""
|
||||
},
|
||||
showbreak = " "
|
||||
},
|
||||
g = {
|
||||
mapleader = " ", -- sets vim.g.mapleader
|
||||
autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled)
|
||||
-- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled)
|
||||
autoformat_enabled = true,
|
||||
cmp_enabled = true, -- enable completion at start
|
||||
autopairs_enabled = true, -- enable autopairs at start
|
||||
diagnostics_enabled = true, -- enable diagnostics at start
|
||||
status_diagnostics_enabled = true, -- enable diagnostics in statusline
|
||||
icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing)
|
||||
},
|
||||
-- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing)
|
||||
icons_enabled = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
return {
|
||||
-- You can disable default plugins as follows:
|
||||
["goolord/alpha-nvim"] = { disable = true },
|
||||
["max397574/better-escape.nvim"] = { disable = true },
|
||||
["goolord/alpha-nvim"] = { disable = false },
|
||||
["max397574/better-escape.nvim"] = { disable = false },
|
||||
-- You can also add new plugins here as well:
|
||||
["wakatime/vim-wakatime"] = {
|
||||
opt = true,
|
||||
|
||||
@@ -2,15 +2,32 @@
|
||||
return {
|
||||
automatic_installation = true,
|
||||
ensure_installed = {
|
||||
"ansiblels",
|
||||
"bashls",
|
||||
"clangd",
|
||||
"codeqlls",
|
||||
"cssls",
|
||||
"diagnosticls",
|
||||
"docker_compose_language_service",
|
||||
"dockerls",
|
||||
"emmet_ls",
|
||||
"eslint",
|
||||
"graphql",
|
||||
"html",
|
||||
"marksman",
|
||||
"intelephense",
|
||||
"jsonls",
|
||||
"lua_ls",
|
||||
"marksman",
|
||||
"phpactor",
|
||||
"psalm",
|
||||
"pyright",
|
||||
"spectral",
|
||||
"stylelint_lsp",
|
||||
"sqls",
|
||||
"sumneko_lua",
|
||||
"tailwindcss",
|
||||
"terraformls",
|
||||
"tsserver",
|
||||
"yamlls",
|
||||
},
|
||||
"vuels",
|
||||
"yamlls"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,75 @@
|
||||
return function(config)
|
||||
local null_ls = require "null-ls"
|
||||
config.sources = {
|
||||
null_ls.builtins.code_actions.eslint,
|
||||
null_ls.builtins.code_actions.shellcheck,
|
||||
null_ls.builtins.code_actions.xo,
|
||||
|
||||
null_ls.builtins.formatting.stylua,
|
||||
null_ls.builtins.formatting.prettier,
|
||||
null_ls.builtins.diagnostics.actionlint,
|
||||
null_ls.builtins.diagnostics.ansiblelint,
|
||||
null_ls.builtins.diagnostics.dotenv_linter,
|
||||
null_ls.builtins.diagnostics.editorconfig_checker,
|
||||
null_ls.builtins.diagnostics.eslint,
|
||||
null_ls.builtins.diagnostics.flake8,
|
||||
null_ls.builtins.diagnostics.jsonlint,
|
||||
null_ls.builtins.diagnostics.luacheck,
|
||||
null_ls.builtins.diagnostics.markdownlint,
|
||||
null_ls.builtins.diagnostics.mypy,
|
||||
null_ls.builtins.diagnostics.php,
|
||||
null_ls.builtins.diagnostics.phpcs,
|
||||
null_ls.builtins.diagnostics.phpmd,
|
||||
null_ls.builtins.diagnostics.phpstan,
|
||||
null_ls.builtins.diagnostics.psalm,
|
||||
null_ls.builtins.diagnostics.pycodestyle,
|
||||
null_ls.builtins.diagnostics.pydocstyle,
|
||||
null_ls.builtins.diagnostics.pylint,
|
||||
null_ls.builtins.diagnostics.semgrep,
|
||||
null_ls.builtins.diagnostics.shellcheck,
|
||||
null_ls.builtins.diagnostics.standardjs,
|
||||
null_ls.builtins.diagnostics.stylelint,
|
||||
null_ls.builtins.diagnostics.tfsec,
|
||||
null_ls.builtins.diagnostics.trail_space,
|
||||
null_ls.builtins.diagnostics.tsc,
|
||||
null_ls.builtins.diagnostics.vacuum,
|
||||
null_ls.builtins.diagnostics.vint,
|
||||
null_ls.builtins.diagnostics.vulture,
|
||||
null_ls.builtins.diagnostics.xo,
|
||||
null_ls.builtins.diagnostics.yamllint,
|
||||
null_ls.builtins.diagnostics.zsh,
|
||||
|
||||
null_ls.builtins.formatting.autoflake,
|
||||
null_ls.builtins.formatting.autopep8,
|
||||
null_ls.builtins.formatting.black,
|
||||
null_ls.builtins.formatting.isort,
|
||||
null_ls.builtins.formatting.blade_formatter,
|
||||
null_ls.builtins.formatting.cbfmt,
|
||||
null_ls.builtins.formatting.clang_format,
|
||||
null_ls.builtins.formatting.eslint,
|
||||
null_ls.builtins.formatting.fixjson,
|
||||
null_ls.builtins.formatting.isort,
|
||||
null_ls.builtins.formatting.isort,
|
||||
null_ls.builtins.formatting.jq,
|
||||
null_ls.builtins.formatting.markdownlint,
|
||||
null_ls.builtins.formatting.nginx_beautifier,
|
||||
null_ls.builtins.formatting.pg_format,
|
||||
null_ls.builtins.formatting.phpcsfixer,
|
||||
null_ls.builtins.formatting.prettier_eslint,
|
||||
null_ls.builtins.formatting.prettier,
|
||||
null_ls.builtins.formatting.prettier,
|
||||
null_ls.builtins.formatting.puppet_lint,
|
||||
null_ls.builtins.formatting.rome,
|
||||
null_ls.builtins.formatting.rustfmt,
|
||||
null_ls.builtins.formatting.shfmt.with {
|
||||
args = { "-i", "2" },
|
||||
args = { "-i", "1", "-bn", "-ci", "-sr", "-kb", "-fn" }
|
||||
},
|
||||
null_ls.builtins.diagnostics.luacheck,
|
||||
null_ls.builtins.diagnostics.flake8,
|
||||
-- null_ls.builtins.diagnostics.pylint,
|
||||
null_ls.builtins.diagnostics.mypy,
|
||||
null_ls.builtins.formatting.stylelint,
|
||||
null_ls.builtins.formatting.stylua,
|
||||
null_ls.builtins.formatting.terrafmt,
|
||||
null_ls.builtins.formatting.terraform_fmt,
|
||||
null_ls.builtins.formatting.tidy,
|
||||
null_ls.builtins.formatting.yamlfmt,
|
||||
|
||||
null_ls.builtins.hover.dictionary,
|
||||
null_ls.builtins.hover.printenv,
|
||||
}
|
||||
return config
|
||||
end
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
return {
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
auto_install = true,
|
||||
ensure_installed = {
|
||||
"c", "help", "bash", "comment", "diff", "dockerfile", "html", "json",
|
||||
"json5", "javascript", "latex", "markdown", "php", "phpdoc", "python",
|
||||
"scss", "terraform", "todotxt", "toml", "typescript", "vim", "vue",
|
||||
"yaml"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
-- Add bindings which show up as group name
|
||||
return {
|
||||
-- first key is the mode, n == normal mode
|
||||
n = {
|
||||
-- second key is the prefix, <leader> prefixes
|
||||
["<leader>"] = {
|
||||
-- third key is the key to bring up next level and its displayed
|
||||
-- group name in which-key top level menu
|
||||
["n"] = { "<cmd>tabnew<cr>", "New Buffer" },
|
||||
["z"] = { "<cmd>ZenMode<cr>", "Zen Mode" },
|
||||
},
|
||||
},
|
||||
-- n = {
|
||||
-- second key is the prefix, <leader> prefixes
|
||||
-- ["<leader>"] = {
|
||||
-- third key is the key to bring up next level and its displayed
|
||||
-- group name in which-key top level menu
|
||||
-- ["n"] = { "<cmd>tabnew<cr>", "New Buffer" },
|
||||
-- ["z"] = { "<cmd>ZenMode<cr>", "Zen Mode" },
|
||||
-- },
|
||||
-- },
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user