my first commit
This commit is contained in:
67
nvim/lua/plugins/editor.lua
Normal file
67
nvim/lua/plugins/editor.lua
Normal file
@@ -0,0 +1,67 @@
|
||||
return {
|
||||
-- File explorer
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
opts = {
|
||||
view = {
|
||||
width = 30,
|
||||
side = "left",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Fuzzy finder
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- Treesitter
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
enabled = false,
|
||||
},
|
||||
|
||||
-- Git integration
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- Terminal
|
||||
{
|
||||
"akinsho/toggleterm.nvim",
|
||||
version = "*",
|
||||
opts = {
|
||||
open_mapping = [[<c-\>]],
|
||||
direction = "float",
|
||||
},
|
||||
},
|
||||
|
||||
-- Comments
|
||||
{ "numToStr/Comment.nvim", opts = {} },
|
||||
|
||||
-- Autopairs
|
||||
{ "windwp/nvim-autopairs", opts = {} },
|
||||
|
||||
{
|
||||
"gruvw/strudel.nvim",
|
||||
build = "npm ci",
|
||||
keys = {
|
||||
{ "<leader>sl", "<cmd>StrudelLaunch<CR>", desc = "Strudel Launch" },
|
||||
{ "<leader>k", "<cmd>StrudelToggle<CR>", desc = "Strudel Toggle (Play/Stop)" },
|
||||
{ "<leader>su", "<cmd>StrudelUpdate<CR>", desc = "Strudel Update" },
|
||||
{ "<leader><leader>", "<cmd>StrudelUpdate<CR>", desc = "Strudel Update" },
|
||||
{ "<leader>sq", "<cmd>StrudelQuit<CR>", desc = "Strudel Quit" },
|
||||
},
|
||||
config = function()
|
||||
require("strudel").setup({
|
||||
browser_exec_path = "/run/current-system/sw/bin/chromium",
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
}
|
||||
85
nvim/lua/plugins/lsp.lua
Normal file
85
nvim/lua/plugins/lsp.lua
Normal file
@@ -0,0 +1,85 @@
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"hrsh7th/nvim-cmp",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"L3MON4D3/LuaSnip",
|
||||
},
|
||||
config = function()
|
||||
local on_attach = function(_, bufnr)
|
||||
local opts = { buffer = bufnr }
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
|
||||
end
|
||||
|
||||
-- Setup LSPs using new vim.lsp.config API (Nvim 0.11+)
|
||||
-- These assume the language servers are installed on your system PATH via Nix
|
||||
local servers = { "lua_ls", "bashls", "ansiblels", "yamlls", "pyright", "nil_ls", "powershell_es", "ts_ls", "clangd" }
|
||||
for _, lsp in ipairs(servers) do
|
||||
vim.lsp.config(lsp, {
|
||||
on_attach = on_attach,
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- Autocompletion
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump(1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
68
nvim/lua/plugins/ui.lua
Normal file
68
nvim/lua/plugins/ui.lua
Normal file
@@ -0,0 +1,68 @@
|
||||
return {
|
||||
-- Colorscheme
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require("catppuccin").setup({
|
||||
flavour = "mocha", -- latte, frappe, macchiato, mocha
|
||||
})
|
||||
vim.cmd([[colorscheme catppuccin]])
|
||||
end,
|
||||
},
|
||||
|
||||
-- Statusline
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
opts = {
|
||||
options = {
|
||||
theme = "catppuccin",
|
||||
component_separators = "|",
|
||||
section_separators = "",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Bufferline
|
||||
{
|
||||
"akinsho/bufferline.nvim",
|
||||
version = "*",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
opts = {
|
||||
options = {
|
||||
mode = "buffers",
|
||||
separator_style = "slant",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Dashboard
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
config = function()
|
||||
local alpha = require("alpha")
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
dashboard.section.header.val = {
|
||||
" [ ███╗ ███╗██╗██████╗ ██████╗ ██████╗ ██╗ ]",
|
||||
" [ ████╗ ████║██║██╔══██╗██╔═══██╗██╔══██╗██║ ]",
|
||||
" [ ██╔████╔██║██║██║ ██║██║ ██║██████╔╝██║ ]",
|
||||
" [ ██║╚██╔╝██║██║██║ ██║██║ ██║██╔══██╗██║ ]",
|
||||
" [ ██║ ╚═╝ ██║██║██████╔╝╚██████╔╝██║ ██║██║ ]",
|
||||
" [ ╚═╝ ╚═╝╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ]",
|
||||
}
|
||||
alpha.setup(dashboard.config)
|
||||
end,
|
||||
},
|
||||
|
||||
-- Which-key
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- Icons
|
||||
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
||||
}
|
||||
13
nvim/lua/plugins/which-key.lua
Normal file
13
nvim/lua/plugins/which-key.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
end,
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user