mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 09:27:44 -04:00
Dashboard & completions
This commit is contained in:
parent
8633ef27dc
commit
2af59c0072
3 changed files with 111 additions and 23 deletions
32
modules/home-manager/files/nvim/lua/plugins/alpha.lua
Normal file
32
modules/home-manager/files/nvim/lua/plugins/alpha.lua
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
return {
|
||||||
|
"goolord/alpha-nvim",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
},
|
||||||
|
|
||||||
|
config = function()
|
||||||
|
local alpha = require("alpha")
|
||||||
|
local dashboard = require("alpha.themes.startify")
|
||||||
|
|
||||||
|
dashboard.section.header.val = {
|
||||||
|
[[ ]],
|
||||||
|
[[ ]],
|
||||||
|
[[ ]],
|
||||||
|
[[ ]],
|
||||||
|
[[ ]],
|
||||||
|
[[ ████ ██████ █████ ██ ]],
|
||||||
|
[[ ███████████ █████ ]],
|
||||||
|
[[ █████████ ███████████████████ ███ ███████████ ]],
|
||||||
|
[[ █████████ ███ █████████████ █████ ██████████████ ]],
|
||||||
|
[[ █████████ ██████████ █████████ █████ █████ ████ █████ ]],
|
||||||
|
[[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]],
|
||||||
|
[[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]],
|
||||||
|
[[ ]],
|
||||||
|
[[ ]],
|
||||||
|
[[ ]],
|
||||||
|
}
|
||||||
|
|
||||||
|
alpha.setup(dashboard.opts)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
44
modules/home-manager/files/nvim/lua/plugins/completions.lua
Normal file
44
modules/home-manager/files/nvim/lua/plugins/completions.lua
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
config = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require("luasnip").lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
completion = cmp.config.window.bordered(),
|
||||||
|
documentation = cmp.config.window.bordered(),
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
["<C-e>"] = cmp.mapping.abort(),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "luasnip" }, -- For luasnip users.
|
||||||
|
}, {
|
||||||
|
{ name = "buffer" },
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
dependencies = {
|
||||||
|
"saadparwaiz1/cmp_luasnip",
|
||||||
|
"rafamadriz/friendly-snippets",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -1,26 +1,38 @@
|
||||||
return {
|
return {
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
config = function ()
|
config = function()
|
||||||
local on_attach = function(_, _)
|
local on_attach = function(_, _)
|
||||||
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, {})
|
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, {})
|
||||||
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, {})
|
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, {})
|
||||||
|
|
||||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
|
vim.keymap.set("n", "gd", vim.lsp.buf.definition, {})
|
||||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, {})
|
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, {})
|
||||||
vim.keymap.set('n', 'gr', require('telescope.builtin').lsp_references, {})
|
vim.keymap.set("n", "gr", require("telescope.builtin").lsp_references, {})
|
||||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, {})
|
vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
|
||||||
end
|
|
||||||
local lspconfig = require("lspconfig")
|
|
||||||
lspconfig.lua_ls.setup {
|
|
||||||
on_attach = on_attach,
|
|
||||||
settings = { Lua = { diagnostics = { globals = {'vim'} } } },
|
|
||||||
}
|
|
||||||
lspconfig.nil_ls.setup { on_attach = on_attach }
|
|
||||||
local puppet_languageserver = vim.fn.expand("$HOME/.local/share/nvim/mason/packages/puppet-editor-services/libexec/puppet-languageserver")
|
|
||||||
lspconfig.puppet.setup {
|
|
||||||
on_attach = on_attach,
|
|
||||||
cmd = { puppet_languageserver }
|
|
||||||
}
|
|
||||||
lspconfig.ruff_lsp.setup { on_attach = on_attach }
|
|
||||||
end
|
end
|
||||||
}
|
|
||||||
|
local lspconfig = require("lspconfig")
|
||||||
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
|
lspconfig.lua_ls.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
settings = { Lua = { diagnostics = { globals = { "vim" } } } },
|
||||||
|
})
|
||||||
|
|
||||||
|
lspconfig.nil_ls.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
local puppet_languageserver =
|
||||||
|
vim.fn.expand("$HOME/.local/share/nvim/mason/packages/puppet-editor-services/libexec/puppet-languageserver")
|
||||||
|
|
||||||
|
lspconfig.puppet.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
cmd = { puppet_languageserver },
|
||||||
|
})
|
||||||
|
lspconfig.ruff_lsp.setup({ on_attach = on_attach })
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue