Initial config divergence from luka

Minor customizations for keybinds and adds luau-lsp support.
This commit is contained in:
Erica Marigold 2025-02-05 00:39:41 +05:30
commit ebcb199805
Signed by: DevComp
SSH key fingerprint: SHA256:jD3oMT4WL3WHPJQbrjC3l5feNCnkv7ndW8nYaHX5wFw
15 changed files with 423 additions and 0 deletions

2
after/ftplugin/lua.lua Normal file
View file

@ -0,0 +1,2 @@
vim.opt_local.tabstop = 4
vim.opt_local.shiftwidth = 4

11
after/ftplugin/rust.lua Normal file
View file

@ -0,0 +1,11 @@
-- disable autopairs for ' in rust since they're used in lifetimes
vim.keymap.set("i", "'", "'", { buffer = true })
-- Rustaceanvim
local bufnr = vim.api.nvim_get_current_buf()
vim.keymap.set("n", "<leader>a", function()
vim.cmd.RustLsp("codeAction")
end, { silent = true, buffer = bufnr })
vim.keymap.set("n", "K", function()
vim.cmd.RustLsp({ "hover", "actions" })
end, { silent = true, buffer = bufnr })

1
init.lua Normal file
View file

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

27
lazy-lock.json Normal file
View file

@ -0,0 +1,27 @@
{
"blink.cmp": { "branch": "main", "commit": "b6f11a0aa33e601c469a126e3ed6e35208fe3ea3" },
"catppuccin": { "branch": "main", "commit": "4965db2d6155c25db4e8417465fc2703fdf4c2b7" },
"gitsigns.nvim": { "branch": "main", "commit": "9b36d497495436c135659902054ee637e0ba6021" },
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
"lazydev.nvim": { "branch": "main", "commit": "a1b78b2ac6f978c72e76ea90ae92a94edf380cfc" },
"luau-lsp.nvim": { "branch": "main", "commit": "f81c6c713e4598abc484cbeabca918475d176c54" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "f75e877f5266e87523eb5a18fcde2081820d087b" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.ai": { "branch": "main", "commit": "25f598f5bcfa247de0be783882d0e02ae5432eb1" },
"mini.icons": { "branch": "main", "commit": "ec61af6e606fc89ee3b1d8f2f20166a3ca917a36" },
"mini.pairs": { "branch": "main", "commit": "1a3e73649c0eaef2f6c48ce1e761c6f0a7c11918" },
"mini.statusline": { "branch": "main", "commit": "d6dbc163cc5ab2892a249c4c6060f1f088cc988f" },
"mini.surround": { "branch": "main", "commit": "ceddea5fe862f13b279d9bbe81c3327a0e66d56b" },
"noice.nvim": { "branch": "main", "commit": "e3c68a4d2275a01268a52e2931bfccfbfb693d15" },
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
"nvim-lspconfig": { "branch": "master", "commit": "66bc018936c6ff76beb75f89d986af6442db4001" },
"nvim-notify": { "branch": "master", "commit": "22f29093eae7785773ee9d543f8750348b1a195c" },
"nvim-treesitter": { "branch": "master", "commit": "53a6b3993f5803378d4d031bf114c0b125a52ba8" },
"oil.nvim": { "branch": "master", "commit": "add50252b5e9147c0a09d36480d418c7e2737472" },
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
"rustaceanvim": { "branch": "master", "commit": "f03035fa03ccb36cd26d0792c946fbacba1d1a39" },
"snacks.nvim": { "branch": "main", "commit": "e3c5944421dfc4639d42456fe6d5a0b6be8b646f" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" },
"telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" },
"which-key.nvim": { "branch": "main", "commit": "0e76a87ac51772569aec678dc74baa8e2a86100c" }
}

27
lua/config/lazy.lua Normal file
View file

@ -0,0 +1,27 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("config.options")
-- Setup lazy.nvim
require("lazy").setup({
spec = {
{ import = "config.plugins" },
},
install = { colorscheme = { "catppuccin", "default" } },
checker = { enabled = true },
})

25
lua/config/options.lua Normal file
View file

@ -0,0 +1,25 @@
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
vim.opt.expandtab = true
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.cursorline = true
vim.opt.signcolumn = "yes"
vim.opt.scrolloff = 8
-- vim.opt.clipboard = "unnamedplus"
vim.opt.pumblend = 5
vim.opt.winblend = 5
vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
vim.keymap.set("n", "<leader>ft", "<cmd>lua vim.lsp.buf.format()<CR>", { noremap = true, silent = true })
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function()
vim.highlight.on_yank()
end,
})

View file

@ -0,0 +1,44 @@
return {
{
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
config = function()
require("catppuccin").setup({
flavour = "mocha",
transparent_background = true,
no_italic = true,
custom_highlights = function(colors)
return {
MiniStatuslineDevinfo = { fg = colors.subtext1, bg = colors.surface0 },
MiniStatuslineFileinfo = { fg = colors.subtext1, bg = colors.surface0 },
SnacksIndent = { fg = colors.surface0 },
SnacksIndentScope = { fg = colors.surface2 },
BlinkCmpDocSeparator = { fg = colors.surface1 },
}
end,
integrations = {
blink_cmp = true,
fidget = true,
mason = true,
noice = true,
notify = true,
snacks = true,
which_key = true,
},
})
vim.cmd([[colorscheme catppuccin]])
-- Highlights horizontal rulers in rendered markdown in LSP hover docs.
vim.api.nvim_create_autocmd("BufWinEnter", {
pattern = "*",
callback = function()
if vim.bo.filetype == "markdown" then
vim.fn.matchadd("WinSeparator", "^─\\+$")
end
end,
})
end,
},
}

View file

@ -0,0 +1,26 @@
return {
{
"echasnovski/mini.ai",
opts = {},
},
{
"echasnovski/mini.surround",
opts = {},
},
{
"echasnovski/mini.pairs",
opts = {},
},
{
"folke/snacks.nvim",
opts = {
indent = {
enabled = true,
},
},
},
{
"lewis6991/gitsigns.nvim",
opts = {},
},
}

View file

@ -0,0 +1,14 @@
return {
{
"stevearc/oil.nvim",
lazy = false,
keys = {
{ "<leader>-", "<cmd>Oil<cr>", desc = "Oil" },
},
opts = {
win_options = {
signcolumn = "yes",
},
},
},
}

View file

@ -0,0 +1,31 @@
local function telescope_builtin(name)
return function()
require("telescope.builtin")[name]()
end
end
return {
{
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
},
keys = {
{ "<leader><leader>", telescope_builtin("find_files"), desc = "Telescope find files" },
{ "<leader>fh", telescope_builtin("help_tags"), desc = "Telescope find help" },
},
cmd = "Telescope",
config = function()
require("telescope").setup({
defaults = {
winblend = 0,
},
extensions = {
fzf = {},
},
})
require("telescope").load_extension("fzf")
end,
},
}

120
lua/config/plugins/lsp.lua Normal file
View file

@ -0,0 +1,120 @@
return {
{
"williamboman/mason.nvim",
opts = {},
},
{
"williamboman/mason-lspconfig.nvim",
dependencies = {
"williamboman/mason.nvim",
"neovim/nvim-lspconfig",
"saghen/blink.cmp",
},
opts = {
servers = {
lua_ls = {},
},
},
config = function(_, opts)
require("mason").setup()
require("mason-lspconfig").setup()
local lspconfig = require("lspconfig")
local function on_attach(_, buf)
local function map(keys, fn, desc)
vim.keymap.set("n", keys, fn, { buffer = buf, desc = "LSP: " .. desc })
end
map("<leader>cr", vim.lsp.buf.rename, "Rename")
map("<leader>ca", vim.lsp.buf.code_action, "Code Action")
map("gd", require("telescope.builtin").lsp_definitions, "Goto Definition")
map("gr", require("telescope.builtin").lsp_references, "Goto References")
end
for server, config in pairs(opts.servers) do
config.capabilities = require("blink.cmp").get_lsp_capabilities(config.capabilities)
config.on_attach = on_attach
lspconfig[server].setup(config)
end
end,
},
{
"saghen/blink.cmp",
version = "*",
opts = {
sources = {
default = { "lazydev", "lsp", "path", "snippets", "buffer" },
providers = {
lazydev = {
name = "LazyDev",
module = "lazydev.integrations.blink",
score_offset = 100,
},
},
},
signature = {
enabled = true,
},
keymap = {
-- ["<enter>"] = { "select_and_accept" },
["<tab>"] = {
function(cmp)
if cmp.snippet_active() then
return cmp.accept()
else
return cmp.select_and_accept()
end
end,
'snippet_forward',
'fallback'
},
["<c-enter>"] = { "show", "show_documentation", "hide_documentation" },
}
},
},
{
"folke/lazydev.nvim",
ft = "lua",
opts = {
library = {
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
},
},
},
{
"mrcjkb/rustaceanvim",
lazy = false,
},
{
"lopi-py/luau-lsp.nvim",
opts = {
server = {
settings = {
["luau-lsp"] = {
require = {
mode = "relativeToFile",
directoryAliases = {
["@lune"] = "~/.lune/.typedefs/0.8.6/",
["@lib"] = "./lib",
["@src"] = "./src",
},
},
completion = {
imports = {
enabled = true,
},
},
},
},
},
platform = {
type = "standard",
}
},
dependencies = {
"nvim-lua/plenary.nvim",
},
}
}

View file

@ -0,0 +1,16 @@
return {
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = { "lua", "rust", "typescript", "javascript", "html", "css" },
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
end,
},
}

62
lua/config/plugins/ui.lua Normal file
View file

@ -0,0 +1,62 @@
return {
{
"echasnovski/mini.statusline",
opts = {},
},
{
"echasnovski/mini.icons",
opts = {
default = {
directory = {
hl = "MiniIconsBlue",
},
},
},
},
{
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
"MunifTanjim/nui.nvim",
{
"rcarriga/nvim-notify",
opts = {
on_open = function(win)
vim.api.nvim_set_option_value("winblend", 0, { win = win })
end,
},
}
},
opts = {
views = {
mini = {
win_options = {
winblend = 0,
},
},
cmdline_popup = {
win_options = {
winblend = 0,
},
},
notify = {
win_options = {
winblend = 0,
},
},
},
lsp = {
signature = {
enabled = false,
},
},
format = {
lsp_progress_done = {
{ "󰄬 ", hl_group = "NoiceLspProgressSpinner" },
{ "{data.progress.title} ", hl_group = "NoiceLspProgressTitle" },
{ "{data.progress.client} ", hl_group = "NoiceLspProgressClient" },
},
}
},
}
}

View file

@ -0,0 +1,16 @@
return {
{
"folke/which-key.nvim",
event = "VeryLazy",
keys = {
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Buffer Local Keymaps (which-key)",
},
},
opts = {},
},
}

1
stylua.toml Normal file
View file

@ -0,0 +1 @@
indent_type = "Spaces"