Astronvim config from kabinspace/AstroNvim_user

This commit is contained in:
Ismo Vuorinen
2023-02-13 15:55:27 +02:00
parent f502b5458f
commit b1d979df34
33 changed files with 1646 additions and 19 deletions

105
plugins/bufferline.lua Normal file
View File

@@ -0,0 +1,105 @@
local colors = {
red = "#d47d85",
red_1 = "#ec5f67",
grey = "#abb2bf",
grey_1 = "#787e87",
grey_2 = "#D3D3D3",
black = "#1e222a",
black_1 = "#252931",
black_2 = "#2c323c",
green = "#95be76",
none = "NONE",
}
return {
highlights = {
background = {
fg = colors.grey_1,
bg = colors.black_2,
},
-- Buffers
buffer_selected = {
fg = colors.grey,
bg = colors.black,
},
buffer_visible = {
fg = colors.grey,
bg = colors.black,
},
-- Diagnostics
error = {
fg = colors.red_1,
bg = colors.red_1,
},
error_diagnostic = {
fg = colors.red_1,
bg = colors.red_1,
},
-- Close buttons
close_button = {
fg = colors.grey_1,
bg = colors.black_2,
},
close_button_visible = {
fg = colors.grey_2,
bg = colors.black,
},
close_button_selected = {
fg = colors.red,
bg = colors.black,
},
fill = {
fg = colors.grey_1,
bg = colors.black_2,
},
indicator_selected = {
fg = colors.black,
bg = colors.black,
},
-- Modified
modified = {
fg = colors.red,
bg = colors.black_2,
},
modified_visible = {
fg = colors.grey,
bg = colors.black,
},
modified_selected = {
fg = colors.green,
bg = colors.black,
},
-- Separators
separator = {
fg = colors.black_2,
bg = colors.black_2,
},
separator_visible = {
fg = colors.black,
bg = colors.black,
},
separator_selected = {
fg = colors.black_2,
bg = colors.black_2,
},
-- Tabs
tab = {
fg = colors.grey,
bg = colors.black,
},
tab_selected = {
fg = colors.black,
bg = colors.black,
},
tab_close = {
fg = colors.black,
bg = colors.black,
},
},
}

32
plugins/cmp.lua Normal file
View File

@@ -0,0 +1,32 @@
local cmp = require "cmp"
local luasnip = require "luasnip"
return {
completion = {
completeopt = "menu,menuone,noinsert",
},
window = {
documentation = {
max_width = 40,
},
},
mapping = {
["<C-p>"] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Select },
["<C-n>"] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Select },
["<C-k>"] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Select },
["<C-j>"] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Select },
["<Tab>"] = cmp.mapping(function(fallback)
if luasnip.jumpable(1) then
luasnip.jump(1)
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
},
}

26
plugins/init.lua Normal file
View File

@@ -0,0 +1,26 @@
return {
-- You can disable default plugins as follows:
["goolord/alpha-nvim"] = { disable = true },
["max397574/better-escape.nvim"] = { disable = true },
-- You can also add new plugins here as well:
["wakatime/vim-wakatime"] = {
opt = true,
setup = function() table.insert(astronvim.file_plugins, "vim-wakatime") end,
},
["folke/zen-mode.nvim"] = {
cmd = { "ZenMode" },
config = function() require("user.plugins.zen-mode").config() end,
},
["nvim-treesitter/playground"] = {
cmd = "TSHighlightCapturesUnderCursor",
},
["karb94/neoscroll.nvim"] = {
opt = true,
setup = function() table.insert(astronvim.file_plugins, "neoscroll.nvim") end,
config = function() require("user.plugins.neoscroll").config() end,
},
["lvimuser/lsp-inlayhints.nvim"] = {
module = "lsp-inlayhints",
config = function() require "user.plugins.lsp-inlayhints" end,
},
}

View File

@@ -0,0 +1 @@
require("lsp-inlayhints").setup()

31
plugins/lspkind.lua Normal file
View File

@@ -0,0 +1,31 @@
return function(config)
config.preset = "codicons"
config.symbol_map = {
Text = "",
Method = "",
Function = "",
Constructor = "",
Field = "",
Variable = "",
Class = "",
Interface = "",
Module = "",
Property = "",
Unit = "",
Value = "",
Enum = "",
Keyword = "",
Snippet = "",
Color = "",
File = "",
Reference = "",
Folder = "",
EnumMember = "",
Constant = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = "",
}
return config
end

View File

@@ -0,0 +1,16 @@
-- use mason-lspconfig to configure LSP installations
return {
automatic_installation = true,
ensure_installed = {
"clangd",
"cssls",
"html",
"marksman",
"jsonls",
"pyright",
"sqls",
"sumneko_lua",
"tsserver",
"yamlls",
},
}

21
plugins/neoscroll.lua Normal file
View File

@@ -0,0 +1,21 @@
local M = {}
function M.config()
local status_ok, neoscroll = pcall(require, "neoscroll")
if not status_ok then return end
neoscroll.setup(require("core.utils").user_plugin_opts("plugins.neoscroll", {
-- All these keys will be mapped to their corresponding default scrolling animation
mappings = { "<C-u>", "<C-d>", "<C-b>", "<C-f>", "<C-y>", "<C-e>", "zt", "zz", "zb" },
hide_cursor = true, -- Hide cursor while scrolling
stop_eof = true, -- Stop at <EOF> when scrolling downwards
use_local_scrolloff = false, -- Use the local scope of scrolloff instead of the global scope
respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file
cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further
easing_function = nil, -- Default easing function
pre_hook = nil, -- Function to run before the scrolling animation starts
post_hook = nil, -- Function to run after the scrolling animation ends
}))
end
return M

20
plugins/null-ls.lua Normal file
View File

@@ -0,0 +1,20 @@
return function(config)
local null_ls = require "null-ls"
config.sources = {
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.prettier,
null_ls.builtins.formatting.black,
null_ls.builtins.formatting.isort,
null_ls.builtins.formatting.clang_format,
null_ls.builtins.formatting.rustfmt,
null_ls.builtins.formatting.shfmt.with {
args = { "-i", "2" },
},
null_ls.builtins.diagnostics.luacheck,
null_ls.builtins.diagnostics.flake8,
-- null_ls.builtins.diagnostics.pylint,
null_ls.builtins.diagnostics.mypy,
}
return config
end

4
plugins/treesitter.lua Normal file
View File

@@ -0,0 +1,4 @@
return {
-- Automatically install missing parsers when entering buffer
auto_install = true,
}

51
plugins/zen-mode.lua Normal file
View File

@@ -0,0 +1,51 @@
local M = {}
function M.config()
local status_ok, zen_mode = pcall(require, "zen-mode")
if status_ok then
zen_mode.setup {
window = {
backdrop = 0.95, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal
-- height and width can be:
-- * an absolute number of cells when > 1
-- * a percentage of the width / height of the editor when <= 1
-- * a function that returns the width or the height
width = 120, -- width of the Zen window
height = 1, -- height of the Zen window
-- by default, no options are changed for the Zen window
-- uncomment any of the options below, or add other vim.wo options you want to apply
options = {
-- signcolumn = "no", -- disable signcolumn
-- number = false, -- disable number column
-- relativenumber = false, -- disable relative numbers
-- cursorline = false, -- disable cursorline
-- cursorcolumn = false, -- disable cursor column
-- foldcolumn = "0", -- disable fold column
-- list = false, -- disable whitespace characters
},
},
plugins = {
-- disable some global vim options (vim.o...)
-- comment the lines to not apply the options
options = {
enabled = true,
ruler = false, -- disables the ruler text in the cmd line area
showcmd = false, -- disables the command in the last line of the screen
},
twilight = { enabled = true }, -- enable to start Twilight when zen mode opens
gitsigns = { enabled = false }, -- disables git signs
tmux = { enabled = false }, -- disables the tmux statusline
-- this will change the font size on kitty when in zen mode
-- to make this work, you need to set the following kitty options:
-- - allow_remote_control socket-only
-- - listen_on unix:/tmp/kitty
kitty = {
enabled = false,
font = "+4", -- font size increment
},
},
}
end
end
return M