fucking minecraft 😭

This commit is contained in:
2025-10-10 02:06:54 -05:00
parent 1e8039d1c1
commit dd896748ab
24 changed files with 629 additions and 10 deletions

View File

@@ -0,0 +1,34 @@
-- base/base.lua
-- Shorten vim.opt for ease of use
local o = vim.opt
-- General settings
o.number = true -- Show line numbers
o.relativenumber = true -- Relative line numbers
o.expandtab = true -- Use spaces instead of tabs
o.tabstop = 4 -- Number of spaces per tab
o.shiftwidth = 4 -- Number of spaces for indentation
o.smartindent = true -- Enable smart indentation
o.autoindent = true -- Enable auto indentation
o.wrap = false -- Disable line wrapping
o.scrolloff = 8 -- Keep 8 lines visible above and below the cursor
-- Search settings
o.ignorecase = true -- Ignore case in searches
o.smartcase = true -- Enable smart case search
-- Backups and undo
o.swapfile = false -- Disable swap file
o.undofile = true -- Enable persistent undo
-- Clipboard
o.clipboard = "unnamedplus" -- Use system clipboard
-- Cursor line and column
o.cursorline = true -- Highlight the current line
o.cursorcolumn = true -- Highlight the current column
-- Command line height
o.cmdheight = 2 -- Set command-line height

View File

@@ -0,0 +1,56 @@
-- Remap leader key to comma
vim.g.mapleader = " "
local keymap = vim.keymap.set
-- General keymaps
keymap('n', '<leader>w', ':w<CR>', { desc = 'Save file' })
keymap('n', '<leader>q', ':q<CR>', { desc = 'Quit' })
keymap('n', '<leader>qq', ':q!<CR>', { desc = 'Force quit' })
-- Split navigation
keymap('n', '<leader>vs', ':vsplit<CR>', { desc = 'Vertical Split' })
keymap('n', '<leader>hs', ':split<CR>', { desc = 'Horizontal Split' })
-- File searching
keymap('n', '<leader>ff', ':Telescope find_files<CR>', { desc = 'Find Files' })
keymap('n', '<leader>fg', ':Telescope live_grep<CR>', { desc = 'Live Grep' })
keymap('n', '<leader>fb', ':Telescope buffers<CR>', { desc = 'Buffers' })
-- Buffer management
keymap('n', '<leader>bd', ':bd<CR>', { desc = 'Delete Buffer' })
-- ╭───────────────────────────────╮
-- │ LSP Keymaps (Attach Hook) │
-- ╰───────────────────────────────╯
local M = {}
function M.on_attach(_, bufnr)
local opts = { noremap = true, silent = true, buffer = bufnr }
local keymap = vim.keymap.set
-- LSP: Go to
keymap('n', 'gd', vim.lsp.buf.definition, opts)
keymap('n', 'gD', vim.lsp.buf.declaration, opts)
keymap('n', 'gi', vim.lsp.buf.implementation, opts)
keymap('n', 'gr', vim.lsp.buf.references, opts)
keymap('n', 'K', vim.lsp.buf.hover, opts)
-- LSP: Actions
keymap('n', '<leader>rn', vim.lsp.buf.rename, opts)
keymap({ 'n', 'v' }, '<leader>ca', vim.lsp.buf.code_action, opts)
-- LSP: Diagnostics
keymap('n', '[d', vim.diagnostic.goto_prev, opts)
keymap('n', ']d', vim.diagnostic.goto_next, opts)
keymap('n', '<leader>e', vim.diagnostic.open_float, opts)
keymap('n', '<leader>q', vim.diagnostic.setloclist, opts)
-- LSP: Formatting
keymap('n', '<leader>f', function()
vim.lsp.buf.format({ async = true })
end, opts)
end
return M

View File

@@ -0,0 +1,9 @@
local lazypath = vim.fn.stdpath('data') .. '/site/pack/packer/start/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
'git', 'clone', '--filter=blob:none', 'https://github.com/folke/lazy.nvim.git', lazypath
})
end
vim.opt.runtimepath:prepend(lazypath)
require("lazy").setup("plugins")

View File

@@ -0,0 +1,72 @@
return {
'neovim/nvim-lspconfig',
dependencies = {
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
},
config = function()
-- Setup Mason
require('mason').setup()
require('mason-lspconfig').setup {
ensure_installed = { 'nixd', 'rust_analyzer', 'lua_ls', 'pyright' },
automatic_installation = true,
}
-- Nix
lspconfig.nixd.setup {
on_attach = on_attach,
settings = {
nixd = {
nixpkgs = {
expr = 'import <nixpkgs> {}',
},
formatting = {
command = { 'nixpkgs-fmt' },
},
},
},
}
-- Rust
lspconfig.rust_analyzer.setup {
on_attach = on_attach,
settings = {
['rust-analyzer'] = {
cargo = { allFeatures = true },
checkOnSave = { command = 'clippy' },
},
},
}
-- Lua
lspconfig.lua_ls.setup {
on_attach = on_attach,
settings = {
Lua = {
diagnostics = { globals = { 'vim' } },
workspace = {
library = vim.api.nvim_get_runtime_file('', true),
checkThirdParty = false,
},
telemetry = { enable = false },
},
},
}
-- Python
lspconfig.pyright.setup {
on_attach = on_attach,
}
-- Global diagnostic config
vim.diagnostic.config({
virtual_text = false,
signs = true,
update_in_insert = false,
underline = true,
severity_sort = true,
float = { border = 'rounded' },
})
end,
}

View File

@@ -0,0 +1,12 @@
-- plugins/mason.lua
return {
"williamboman/mason.nvim", -- Mason plugin for managing LSP servers
config = function()
require('mason').setup()
require('mason-lspconfig').setup({
ensure_installed = { 'rust_analyzer', 'pyright', 'lua_ls', 'nixd', 'nixfmt' }
})
end
}

View File

@@ -0,0 +1,14 @@
-- plugins/telescope.lua
return {
"nvim-telescope/telescope.nvim", -- Telescope plugin
dependencies = { "nvim-lua/plenary.nvim" }, -- Telescope dependencies
config = function()
require('telescope').setup{
defaults = {
file_ignore_patterns = { "node_modules" }
}
}
end
}

View File

@@ -0,0 +1,5 @@
askdjfkl

View File

@@ -0,0 +1,14 @@
-- plugins/theme.lua
return {
"folke/tokyonight.nvim", -- Tokyo Night theme plugin
config = function()
require('tokyonight').setup({
style = "night", -- You can also use 'storm' or 'day' if you prefer those.
transparent = true,
terminal_colors = true,
})
vim.cmd('colorscheme tokyonight')
end
}

View File

@@ -0,0 +1,14 @@
-- plugins/vimwiki.lua
return {
"vimwiki/vimwiki", -- Vimwiki plugin
config = function()
vim.g.vimwiki_list = {{
path = '~/vimwiki',
syntax = 'markdown',
ext = '.md',
}}
vim.g.vimwiki_global_ext = 0 -- Global extension
end
}

View File

@@ -0,0 +1,9 @@
-- plugins/whichkey.lua
return {
"folke/which-key.nvim", -- Which-key plugin for keybinding hints
config = function()
require('which-key').setup{}
end
}

View File

@@ -0,0 +1,64 @@
-- blake's nvim config in lua
-- base.base
-- general nvim settings
-- define functions for settings
local g = vim.g
local o = vim.o
local opt = vim.opt
-- clipboard
o.clipboard = "unnamedplus"
-- enable filetype detection
vim.cmd('filetype indent plugin on')
vim.cmd('syntax on')
-- o.nocompatible = true
-- line numbers
o.number = true
o.numberwidth = 2
o.relativenumber = true
vim.cmd('highlight LineNr ctermfg=054')
-- tabs
o.tabstop = 2
o.shiftwidth = 2
o.softtabstop = -1 -- if negative uses shift width
o.expandtab = true
o.smarttab = true
o.autoindent = true
-- improve search
o.ignorecase = true
o.smartcase = true
-- backup files
o.backup = false
o.writebackup = false
o.undofile = true
o.swapfile = true
-- auto-read file changes
o.autoread = true
-- spell checker
o.spelllang = 'en_us'
o.spell = false
-- word wrapping
o.wrap = true
o.linebreak = true
o.breakindent = true
-- visual line movement
vim.keymap.set({'i'}, '<Up>', '<C-o>gk', {desc = 'Visual Line Up (Insert)'})
vim.keymap.set({'i'}, '<Down>', '<C-o>gj', {desc = 'Visual Line Down (Insert)'})
vim.keymap.set({'n', 'v'}, '<Up>', 'g<Up>', {desc = 'Visual Line Up'})
vim.keymap.set({'n', 'v'}, '<Down>', 'g<Down>', {desc = 'Visual Line Down'})
-- set leader
g.mapleader = " "
g.maplocalleader = " "

View File

@@ -0,0 +1,41 @@
-- LSP Keymaps (applies when any LSP attaches)
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspKeymaps", { clear = true }),
callback = function(event)
local opts = { buffer = event.buf, silent = true, noremap = true }
-- 🧭 Navigation
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
-- 🧠 Info
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, opts)
-- 🛠️ Actions
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
-- 🧹 Formatting
vim.keymap.set("n", "<leader>f", function()
vim.lsp.buf.format({ async = false })
end, vim.tbl_extend("force", opts, { desc = "Format buffer with LSP" }))
-- 💡 Diagnostics
vim.keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts)
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, opts)
-- 🧩 Inlay hints (toggle)
if vim.lsp.inlay_hint then
vim.keymap.set("n", "<leader>h", function()
local enabled = vim.lsp.inlay_hint.is_enabled(event.buf)
vim.lsp.inlay_hint.enable(not enabled, { bufnr = event.buf })
end, vim.tbl_extend("force", opts, { desc = "Toggle inlay hints" }))
end
end,
})

View File

@@ -0,0 +1,19 @@
-- bootstrap lazy
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
-- load plugins
require("lazy").setup("plugins")

View File

@@ -0,0 +1,60 @@
return {
"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-Space>"] = cmp.mapping.complete(), -- Trigger completion
["<C-e>"] = cmp.mapping.abort(), -- Close completion
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Confirm selection
-- **Navigation**
["<Down>"] = cmp.mapping.select_next_item(), -- Arrow down
["<Up>"] = cmp.mapping.select_prev_item(), -- Arrow up
["<C-n>"] = cmp.mapping.select_next_item(), -- Ctrl+n (alternative)
["<C-p>"] = cmp.mapping.select_prev_item(), -- Ctrl+p (alternative)
["<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 = "buffer" },
{ name = "path" },
}),
})
end,
}

View File

@@ -0,0 +1,11 @@
-- return {
{
"willothy/nvim-cokeline",
dependencies = {
"nvim-lua/plenary.nvim", -- Required for v0.4.0+
"nvim-tree/nvim-web-devicons", -- If you want devicons
"stevearc/resession.nvim" -- Optional, for persistent history
},
config = true
}
}

View File

@@ -0,0 +1,3 @@
return {
'rafi/awesome-vim-colorschemes',
}

View File

@@ -0,0 +1,57 @@
return {
{
"3rd/image.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("image").setup({
backend = "kitty", -- or "ueberzug" or "sixel"
processor = "magick_cli", -- or "magick_rock"
integrations = {
markdown = {
enabled = true,
clear_in_insert_mode = false,
download_remote_images = true,
only_render_image_at_cursor = false,
only_render_image_at_cursor_mode = "popup", -- or "inline"
floating_windows = false, -- if true, images will be rendered in floating markdown windows
filetypes = { "markdown", "vimwiki" },
},
neorg = {
enabled = true,
filetypes = { "norg" },
},
typst = {
enabled = true,
filetypes = { "typst" },
},
html = { enabled = false },
css = { enabled = false },
},
max_width = nil,
max_height = nil,
max_width_window_percentage = nil,
max_height_window_percentage = 50,
scale_factor = 1.0,
window_overlap_clear_enabled = false,
window_overlap_clear_ft_ignore = {
"cmp_menu",
"cmp_docs",
"snacks_notif",
"scrollview",
"scrollview_sign",
},
editor_only_render_when_focused = false,
tmux_show_only_in_active_window = false,
hijack_file_patterns = {
"*.png",
"*.jpg",
"*.jpeg",
"*.gif",
"*.webp",
"*.avif",
},
})
end,
},
}

View File

@@ -0,0 +1,8 @@
return {
'EdenEast/nightfox.nvim',
opts = {
options = {
transparent = true,
}
}
}

View File

@@ -0,0 +1,15 @@
return {
'vimwiki/vimwiki',
init = function ()
vim.g.vimwiki_list = {
{
path = '~/holocron',
path_html = '~/holocron/html',
syntax = 'markdown',
ext = '.md',
diary_rel_path = 'journal/diary',
auto_diary_index = 1,
},
}
end
}