Switch to Astrov4

This commit is contained in:
2023-12-09 23:30:29 +01:00
parent 3b1035fd35
commit 5f86dedac9
29 changed files with 328 additions and 300 deletions

41
lua/config/lazy.lua Normal file
View File

@@ -0,0 +1,41 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.g.astronvim_first_install = true -- lets AstroNvim know that this is an initial installation
vim.fn.system {
"git",
"clone",
"--depth=1",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
}
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
-- TODO: set to true on release
-- Whether or not to use stable releases of AstroNvim
local USE_STABLE = false
require("lazy").setup {
spec = {
-- TODO: remove branch v4 on release
{ "AstroNvim/AstroNvim", branch = "v4", version = USE_STABLE and "^4" or nil, import = "astronvim.plugins" },
-- pin plugins to known working versions
{ import = "astronvim.lazy_snapshot", cond = USE_STABLE },
{ import = "plugins" },
},
install = { colorscheme = { "astrodark", "habamax" } },
performance = {
rtp = {
-- disable some rtp plugins, add more to your liking
disabled_plugins = {
"gzip",
"netrwPlugin",
"tarPlugin",
"tohtml",
"zipPlugin",
},
},
},
}

22
lua/config/options.lua Normal file
View File

@@ -0,0 +1,22 @@
vim.opt.background = "dark"
vim.opt.clipboard = ""
vim.opt.cmdheight = 1
vim.opt.expandtab = true
vim.opt.foldmethod = "syntax"
vim.opt.foldnestmax = 150
vim.opt.grepprg = vim.fn.executable("rg") and "rg --vimgrep" or nil
vim.opt.guifont = { "VictorMono NF", "Hack Nerd Font Mono", ":h10" }
vim.opt.listchars = { tab = "> ", extends = ">", precedes = "<", space = "·" }
vim.opt.number = true
vim.opt.relativenumber = false
vim.opt.shiftwidth = 4
vim.opt.signcolumn = "auto"
vim.opt.spell = false
vim.opt.tabstop = 4
vim.opt.textwidth = 120
vim.opt.wrap = true
vim.opt.path:append("**") -- recursive search for find
-- Globals
vim.g.rust_recommended_style = 0

0
lua/config/polish.lua Normal file
View File

14
lua/plugins/00-core.lua Normal file
View File

@@ -0,0 +1,14 @@
return {
-- Disable core plugins
-- { "goolord/alpha-nvim", enabled = false },
-- Which-key
-- {
-- "folke/which-key.nvim",
-- opts = {
-- plugins = {
-- registers = false,
-- },
-- },
-- }
}

View File

@@ -0,0 +1,26 @@
local home = vim.fn.hostname() == "comanche"
local work = not home
return {
{ "AstroNvim/astrocommunity", branch = "v4" },
-- Language packs
{ enabled = true, import = "astrocommunity.pack.cpp" },
{ enabled = true, import = "astrocommunity.pack.lua" },
{ enabled = true, import = "astrocommunity.pack.markdown" },
{ enabled = home, import = "astrocommunity.pack.rust" },
{ enabled = home, import = "astrocommunity.pack.bash" },
{ enabled = work, import = "astrocommunity.pack.cs" },
{ enabled = work, import = "astrocommunity.pack.ps1" },
{ enabled = false, import = "astrocommunity.pack.html-css" },
{ enabled = false, import = "astrocommunity.pack.java" },
{ enabled = false, import = "astrocommunity.pack.wgsl" }, -- WebGLShaderLanguage
-- DAP
-- Figure out if needed when you finaly try to use the DAP
-- { import = "astrocommunity.debugging.telescope-dap-nvim" },
-- { import = "astrocommunity.debugging.nvim-dap-virtual-text" },
-- { import = "astrocommunity.debugging.nvim-dap-repl-highlights" },
-- Others
-- { import = "astrocommunity.debugging.nvim-bqf" },
}

View File

@@ -0,0 +1,17 @@
return {
{
"AstroNvim/astroui",
dependencies = { "astrobox" },
opts = {
colorscheme = "astrobox",
},
},
{
name = "astrobox",
-- dir = "~/Workspace/astrobox/",
url = "https://git.niverton.tk/niverton/Astrobox.git",
opts = {
contrast = "hard"
}
},
}

View File

@@ -0,0 +1,16 @@
-- return {
-- "AstroNvim/astrocore",
-- ---@type AstroCoreOpts
-- opts = {
-- mappings = {
-- t = {
-- ["<Esc>"] = [[<C-\><C-n>]],
-- ["<A-h>"] = [[<C-\><C-N><C-w>h]],
-- ["<A-j>"] = [[<C-\><C-N><C-w>j]],
-- ["<A-k>"] = [[<C-\><C-N><C-w>k]],
-- ["<A-l>"] = [[<C-\><C-N><C-w>l]],
-- },
-- },
-- },
-- }
return {}

View File

@@ -0,0 +1,15 @@
return {
"AstroNvim/astrocore",
---@type AstroCoreOpts
opts = {
commands = {
TermOpen = {
function()
vim.bo.number = false
vim.bo.spell = false
end,
desc = "Remove linenumber in term buffers",
},
},
},
}

18
lua/plugins/20-lsp.lua Normal file
View File

@@ -0,0 +1,18 @@
return {
"AstroNvim/astrolsp",
---@type AstroLSPOpts
opts = {
features = {
autoformat = false,
inlay_hints = true,
},
formatting = {
format_on_save = {
enabled = false,
},
timeout_ms = 1000,
},
-- mappings to be set up on attaching of a language server
mappings = {},
},
}

12
lua/plugins/30-cvs.lua Normal file
View File

@@ -0,0 +1,12 @@
return {
--[[
{
"lewis6991/gitsigns.nvim",
opts = {
signcolumn = false,
numhl = true,
current_line_blame_opts = { ignore_whitespace = true },
},
},
]]
}

View File

@@ -0,0 +1,82 @@
return {
"rebelot/heirline.nvim",
optional = true,
opts = function(_, opts)
local status = require("astroui.status")
opts.statusline = {
hl = { fg = "fg", bg = "bg" },
status.component.mode { mode_text = { hl = { bold = true }, padding = { left = 1, right = 1 } } },
status.component.file_info {
filetype = false,
filename = {
modify = ":~:.",
},
file_modified = {},
},
status.component.diagnostics(),
status.component.fill(),
status.component.cmd_info(),
status.component.fill(),
status.component.lsp(),
status.component.treesitter { padding = { right = 1 } }, -- Extra space to separate from next component
status.component.git_diff(),
status.component.git_branch(),
status.component.nav { scrollbar = false },
}
local get_file_path = status.provider.filename {
modify = ":~:.:h", -- Relative path and cut filename
}
-- Fix path separation on windows
local path_func = get_file_path
if vim.fn.has("win32") then
path_func = function(self)
local str = get_file_path(self)
return string.gsub(str, "\\", "/")
end
end
opts.winbar = {
init = function(self) self.bufnr = vim.api.nvim_get_current_buf() end,
fallthrough = false,
{
condition = function() return not status.condition.is_active() end,
{
-- Set display priority to hide when component is too big to fit
flexible = 1,
status.component.separated_path {
flexible = 2,
max_depth = 5,
path_func = path_func,
},
status.component.separated_path {
flexible = 3,
max_depth = 3,
path_func = path_func,
},
status.component.separated_path {
flexible = 4,
max_depth = 1,
path_func = path_func,
},
{
-- Hide
provider = "",
},
},
status.component.file_info {
file_icon = { hl = status.hl.file_icon("winbar"), padding = { left = 0 } },
file_modified = false,
file_read_only = false,
hl = status.hl.get_attributes("winbarnc", true),
surround = false,
update = "BufEnter",
},
},
status.component.breadcrumbs(),
}
return opts
end,
}

View File

@@ -0,0 +1,55 @@
return {
{
"vimwiki/vimwiki",
init = function()
local default_settings = {
syntax = "markdown",
ext = ".md",
links_space_char = "_",
auto_tags = 1,
auto_diary_index = 1,
auto_generate_links = 1,
auto_generate_tags = 1,
}
local ext = vim.fn.extend
vim.g.vimwiki_list = {
ext({ path = "~/wiki/main/" }, default_settings),
ext({ path = "~/wiki/jdr/" }, default_settings),
ext({ path = "~/wiki/work/" }, default_settings),
}
-- vim.g.vimwiki_ext2syntax = { [".md"] = "markdown", [".markdown"] = "markdown", [".mdown"] = "markdown" }
vim.g.vimwiki_markdown_link_ext = 1
vim.g.vimwiki_conceal_pre = 0
vim.g.vimwiki_diary_months = {
["1"] = "Janvier",
["2"] = "Février",
["3"] = "Mars",
["4"] = "Avril",
["5"] = "Mai",
["6"] = "Juin",
["7"] = "Juillet",
["8"] = "Août",
["9"] = "Septembre",
["10"] = "Octobre",
["11"] = "Novembre",
["12"] = "Décembre",
}
end,
config = function() end,
keys = {
"<Leader>ww",
"<Leader>wt",
"<Leader>ws",
},
cmd = {
"VimwikiIndex",
"VimwikiTabIndex",
"VimwikiUISelect",
"VimwikiDiaryIndex",
"VimwikiMakeDiaryNote",
"VimwikiTabMakeDiaryNote",
"VimwikiMakeYesterdayDiaryNote",
"VimwikiMakeTomorrowDiaryNote",
},
},
}

4
lua/plugins/50-user.lua Normal file
View File

@@ -0,0 +1,4 @@
return {
{ "echasnovski/mini.align", event = "User AstroFile", config = function() require("mini.align").setup {} end },
{ "tpope/vim-abolish", event = "User AstroFile" },
}