Skip to content

Commit

Permalink
Merge pull request #25 from mehalter/master
Browse files Browse the repository at this point in the history
nvim: update to AstroNvim v4
  • Loading branch information
20k-ultra authored Apr 15, 2024
2 parents 626107f + 6a47a8e commit 2632aaa
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 66 deletions.
20 changes: 20 additions & 0 deletions nvim/.neoconf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"neodev": {
"library": {
"enabled": true,
"plugins": true
}
},
"neoconf": {
"plugins": {
"lua_ls": {
"enabled": true
}
}
},
"lspconfig": {
"lua_ls": {
"Lua.format.enable": false
}
}
}
7 changes: 2 additions & 5 deletions nvim/config.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/bin/sh

git clone https://github.com/kabinspace/AstroVim ~/.config/nvim

mkdir ~/.config/nvim/lua/user
ln -sf ~/dotfiles/nvim/init.lua ~/.config/nvim/lua/user
nvim +PackerSync
ln -sf ~/dotfiles/nvim ~/.config/nvim
nvim --headless +q
143 changes: 82 additions & 61 deletions nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,72 +1,93 @@
return {
colorscheme = "sonokai",
mappings = {
n = {
["<S-l>"] = {
function() require("astronvim.utils.buffer").nav(vim.v.count > 0 and vim.v.count or 1) end,
desc = "Next buffer",
},
["<S-h>"] = {
function() require("astronvim.utils.buffer").nav(-(vim.v.count > 0 and vim.v.count or 1)) end,
desc = "Previous buffer",
-- bootstreap lazy package manager
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
-- stylua: ignore
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)

-- manage plugins
local plugins = {
{ "AstroNvim/AstroNvim", version = "^4", import = "astronvim.plugins" },

"AstroNvim/astrocommunity",
{ import = "astrocommunity.pack.cpp" },
{ import = "astrocommunity.pack.proto" },
{ import = "astrocommunity.pack.ansible" },
{ import = "astrocommunity.pack.prisma" },
{ import = "astrocommunity.pack.markdown" },
{ import = "astrocommunity.pack.go" },
{ import = "astrocommunity.pack.json" },
{ import = "astrocommunity.pack.terraform" },
{ import = "astrocommunity.pack.lua" },
{ import = "astrocommunity.pack.rust" },
{ import = "astrocommunity.pack.python" },
{ import = "astrocommunity.pack.typescript" },
{ import = "astrocommunity.pack.bash" },

{
"AstroNvim/astrocore",
---@type AstroCoreOpts
opts = {
mappings = {
n = {
L = {
function()
require("astrocore.buffer").nav(vim.v.count1)
end,
desc = "Next buffer",
},
H = {
function()
require("astrocore.buffer").nav(-vim.v.count1)
end,
desc = "Previous buffer",
},
},
},
},
},
lsp = {
config = {
clangd = {
capabilities = {
offsetEncoding = "utf-8",
options = {
opt = {
mouse = "",
listchars = { tab = "│→", extends = "", precedes = "", trail = "·", nbsp = "" },
showbreak = "",
wrap = true,
},
},
},
},
-- Add plugins
plugins = {
-- { "AstroNvim/astrocommunity", dev = true },
"AstroNvim/astrocommunity",
{ "20k-ultra/sonokai" },
{
"PratikBhusal/vim-grip",
event = "VeryLazy",
{
"AstroNvim/astroui",
---@type AstroUIOpts
opts = {
colorscheme = "sonokai",
},
{
"rebelot/heirline.nvim",
opts = function(_, opts)
local status = require "astronvim.utils.status"
opts.tabline[2] = status.heirline.make_buflist(status.component.tabline_file_info { close_button = false })
return opts
end,
},
{ "williamboman/mason.nvim", opts = { PATH = "append" } },
{ import = "astrocommunity.pack.cpp" },
{ import = "astrocommunity.pack.proto" },
{ import = "astrocommunity.pack.ansible" },
{ import = "astrocommunity.pack.prisma" },
{ import = "astrocommunity.pack.markdown" },
{ import = "astrocommunity.pack.go" },
{ import = "astrocommunity.pack.json" },
{ import = "astrocommunity.pack.terraform" },
{ import = "astrocommunity.pack.lua" },
{ import = "astrocommunity.pack.rust" },
{ import = "astrocommunity.pack.python" },
{ import = "astrocommunity.pack.typescript" },
{ import = "astrocommunity.pack.bash" },
},
options = {
opt = {
mouse = "",
list = false,
listchars = {
tab = "│→",
extends = "",
precedes = "",
trail = "·",
nbsp = "",

{ "20k-ultra/sonokai" },
{ "PratikBhusal/vim-grip", event = "VeryLazy" },
{ "williamboman/mason.nvim", opts = { PATH = "append" } },
{
"rebelot/heirline.nvim",
opts = function(_, opts)
local status = require "astroui.status"
opts.tabline[2] = status.heirline.make_buflist(status.component.tabline_file_info { close_button = false })
end,
},
}

-- initialize lazy
require("lazy").setup {
spec = plugins,
ui = { backdrop = 100 },
performance = {
rtp = {
disabled_plugins = {
"gzip",
"netrwPlugin",
"tarPlugin",
"tohtml",
"zipPlugin",
},
showbreak = "",
wrap = true,
linebreak = true,
},
},
}
6 changes: 6 additions & 0 deletions nvim/neovim.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
base: lua51

globals:
vim:
any: true
8 changes: 8 additions & 0 deletions nvim/selene.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
std = "neovim"

[rules]
global_usage = "allow"
if_same_then_else = "allow"
incorrect_standard_library_use = "allow"
mixed_table = "allow"
multiple_statements = "allow"

0 comments on commit 2632aaa

Please sign in to comment.