Compare commits

...

9 Commits

Author SHA1 Message Date
poslop
8ccc729ce7 yaml 2026-02-10 13:58:39 -06:00
be94adda8a cmp 2026-02-09 14:01:52 -06:00
4f8489bfdb lua lsp edits 2026-02-09 13:35:50 -06:00
d0e94ed5a7 lsp lua 2026-02-09 12:58:05 -06:00
3f2c2ce65f ts objects 2026-02-09 10:59:05 -06:00
73dfaec988 clip and ts 2026-02-09 10:49:50 -06:00
bf77f1563b treesitter 2026-02-09 09:48:46 -06:00
fd3266912a bufferline binds 2026-02-09 09:44:37 -06:00
5238f24acf stylua 2026-02-09 09:41:09 -06:00
12 changed files with 224 additions and 33 deletions

View File

@@ -1 +1 @@
require("config.lazy") require "config.lazy"

9
lsp/lua_ls.lua Normal file
View File

@@ -0,0 +1,9 @@
return {
settings = {
Lua = {
diagnostics = { globals = { "vim" } },
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
},
}

View File

@@ -1,7 +1,7 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git" local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) local out = vim.fn.system { "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }
if vim.v.shell_error ~= 0 then if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({ vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" }, { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
@@ -12,22 +12,22 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
os.exit(1) os.exit(1)
end end
end end
vim.opt.rtp:prepend(lazypath)
vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = " " vim.g.mapleader = " "
vim.g.maplocalleader = " " vim.g.maplocalleader = " "
require("config.maps") require "config.maps"
require("config.opts") require "config.opts"
require("lazy").setup({ require("lazy").setup {
spec = { spec = {
{ import = "plugins" }, { import = "plugins" },
}, },
install = { colorscheme = { "tokyonight" } }, install = { colorscheme = { "tokyonight" } },
checker = { enabled = true }, checker = { enabled = true },
}) }
vim.cmd[[colorscheme tokyonight]] vim.cmd [[colorscheme tokyonight]]
require("bufferline").setup{} require("bufferline").setup {}

View File

@@ -26,4 +26,35 @@ map("n", "<leader>tf", "<cmd>ToggleTerm direction=float<cr>", { desc = "ToggleTe
map("n", "<Tab>", "<cmd>BufferLineCycleNext<cr>", { desc = "Next buffer" }) map("n", "<Tab>", "<cmd>BufferLineCycleNext<cr>", { desc = "Next buffer" })
map("n", "<S-Tab>", "<cmd>BufferLineCyclePrev<cr>", { desc = "Previous buffer" }) map("n", "<S-Tab>", "<cmd>BufferLineCyclePrev<cr>", { desc = "Previous buffer" })
map("n", "<leader>ba", "<cmd>BufferLineCloseOthers<CR>", { desc = "Close other buffers" }) map("n", "<leader>ba", "<cmd>BufferLineCloseOthers<CR>", { desc = "Close other buffers" })
map("n", "<leader>x", "<cmd>bdelete<CR>", { desc = "Close buffer" }) map("n", "<leader>x", "<cmd>BufferLinePickClose<CR>", { desc = "Close buffer" })
map("n", "<leader>bc", "<cmd>BufferLinePick<CR>", { desc = "Close buffer" })
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(ev)
local bufnr = ev.buf
local opts = function(desc)
return { buffer = bufnr, silent = true, desc = desc }
end
map("n", "gd", vim.lsp.buf.definition, opts "LSP: Go to definition")
map("n", "gD", vim.lsp.buf.declaration, opts "LSP: Go to declaration")
map("n", "gi", vim.lsp.buf.implementation, opts "LSP: Go to implementation")
map("n", "gr", vim.lsp.buf.references, opts "LSP: References")
map("n", "K", vim.lsp.buf.hover, opts "LSP: Hover")
map("n", "<leader>rn", vim.lsp.buf.rename, opts "LSP: Rename")
map("n", "<leader>ca", vim.lsp.buf.code_action, opts "LSP: Code action")
map("n", "[d", function()
vim.diagnostic.jump { count = -1, float = true }
end, opts "Diag: Prev")
map("n", "]d", function()
vim.diagnostic.jump { count = 1, float = true }
end, opts "Diag: Next")
map("n", "<leader>dd", vim.diagnostic.open_float, opts "Diag: Line diagnostics")
map("n", "<leader>lf", function()
vim.lsp.buf.format { async = true }
end, opts "LSP: Format (server)")
end,
})

View File

@@ -1,3 +1,5 @@
vim.opt.clipboard = "unnamedplus"
vim.opt.termguicolors = true vim.opt.termguicolors = true
vim.opt.expandtab = true vim.opt.expandtab = true

70
lua/plugins/cmp.lua Normal file
View File

@@ -0,0 +1,70 @@
return {
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
},
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-Space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm { 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()
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 = cmp.config.sources {
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "path" },
{ name = "buffer" },
},
}
cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(),
sources = { { name = "buffer" } },
})
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({ { name = "path" } }, { { name = "cmdline" } }),
})
end,
},
}

View File

@@ -1,8 +1,8 @@
return { return {
{ {
'windwp/nvim-autopairs', "windwp/nvim-autopairs",
event = "InsertEnter", event = "InsertEnter",
config = true config = true,
}, },
{ {
"folke/ts-comments.nvim", "folke/ts-comments.nvim",
@@ -13,10 +13,12 @@ return {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
}, },
{ {
'stevearc/conform.nvim', "stevearc/conform.nvim",
opts = { opts = {
formatters_by_ft = { formatters_by_ft = {
lua = { "stylua" }, lua = { "stylua" },
yml = { "yamlfmt" },
yaml = { "yamlfmt" },
}, },
default_format_opts = { default_format_opts = {
lsp_format = "fallback", lsp_format = "fallback",
@@ -28,5 +30,5 @@ return {
}, },
}, },
}, },
} },
} }

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

@@ -0,0 +1,18 @@
return {
{
"neovim/nvim-lspconfig",
dependencies = {
{ "hrsh7th/nvim-cmp" },
{ "j-hui/fidget.nvim", opts = {} },
},
config = function()
local caps = vim.lsp.protocol.make_client_capabilities()
caps = require("cmp_nvim_lsp").default_capabilities(caps)
vim.lsp.config("*", { capabilities = caps })
vim.lsp.enable {
"lua_ls",
}
end,
},
}

View File

@@ -1,5 +1,5 @@
return { return {
{ {
"iamcco/markdown-preview.nvim" "iamcco/markdown-preview.nvim",
} },
} }

53
lua/plugins/syntax.lua Normal file
View File

@@ -0,0 +1,53 @@
return {
{
"nvim-treesitter/nvim-treesitter",
lazy = false,
build = ":TSUpdate",
opts = {
indent = { enable = true },
highlight = { enable = true },
folds = { enable = true },
ensure_installed = {
"bash",
"diff",
"html",
"json",
"lua",
"luadoc",
"luap",
"markdown",
"markdown_inline",
"printf",
"regex",
"toml",
"vim",
"vimdoc",
"xml",
"yaml",
},
},
config = function(_, opts)
local ts = require "nvim-treesitter"
if type(opts.ensure_installed) == "table" and #opts.ensure_installed > 0 then
ts.install(opts.ensure_installed)
end
end,
},
{
"nvim-treesitter/nvim-treesitter-textobjects",
opts = {
move = {
enable = true,
set_jumps = true,
keys = {
goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer", ["]a"] = "@parameter.inner" },
goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer", ["]A"] = "@parameter.inner" },
goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer", ["[a"] = "@parameter.inner" },
goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer", ["[A"] = "@parameter.inner" },
},
},
},
},
}

View File

@@ -6,10 +6,10 @@ return {
{ {
"<leader>?", "<leader>?",
function() function()
require("which-key").show({ global = false }) require("which-key").show { global = false }
end, end,
desc = "Buffer Local Keymaps (which-key)", desc = "Buffer Local Keymaps (which-key)",
}, },
}, },
} },
} }

View File

@@ -1,7 +1,13 @@
### Dependencies ## Dependencies
Formatters
### **Lua**
``` ```
lua-language-server
stylua stylua
``` ```
### **Yaml**
```
yamlfmt
```