Config updates

This commit is contained in:
Ismo Vuorinen
2023-02-16 16:19:49 +02:00
parent 6f246744d4
commit e3fa6772f0
9 changed files with 154 additions and 81 deletions

View File

@@ -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