This commit is contained in:
Dominic DiTaranto 2025-11-22 17:44:14 -05:00
parent 8512b8294c
commit 11b1a80529

207
init.lua
View file

@ -16,19 +16,19 @@ vim.o.termguicolors = true
vim.o.cursorline = true vim.o.cursorline = true
vim.o.swapfile = false vim.o.swapfile = false
vim.o.mouse = 'a' vim.o.mouse = "a"
vim.o.undofile = true vim.o.undofile = true
-- diagnostic config -- diagnostic config
vim.diagnostic.config({ vim.diagnostic.config({
virtual_text = false, virtual_text = false,
float = { source = 'always', border = 'rounded' } float = { source = "always", border = "rounded" },
}) })
-- Highlight On Yank -- Highlight On Yank
vim.api.nvim_create_autocmd('TextYankPost', { vim.api.nvim_create_autocmd("TextYankPost", {
desc = 'Highlight when yanking (copying) text', desc = "Highlight when yanking (copying) text",
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }),
callback = function() callback = function()
vim.hl.on_yank() vim.hl.on_yank()
end, end,
@ -38,10 +38,10 @@ vim.api.nvim_create_autocmd('TextYankPost', {
vim.keymap.set("n", " ", "", { silent = true, remap = false }) vim.keymap.set("n", " ", "", { silent = true, remap = false })
-- move around windows -- move around windows
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'focus to l window' }) vim.keymap.set("n", "<C-h>", "<C-w><C-h>", { desc = "focus to l window" })
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'focus to r window' }) vim.keymap.set("n", "<C-l>", "<C-w><C-l>", { desc = "focus to r window" })
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'focus to dwn window' }) vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "focus to dwn window" })
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'focus to up window' }) vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "focus to up window" })
-- move lines up and down -- move lines up and down
vim.keymap.set("n", "<A-j>", ":m .+1<CR>==") vim.keymap.set("n", "<A-j>", ":m .+1<CR>==")
@ -60,10 +60,17 @@ vim.keymap.set("n", "<A-l>", ":BufferNext<CR>")
vim.keymap.set("n", "<A-,>", "<Cmd>BufferPrevious<CR>") vim.keymap.set("n", "<A-,>", "<Cmd>BufferPrevious<CR>")
vim.keymap.set("n", "<A-.>", "<Cmd>BufferNext<CR>") vim.keymap.set("n", "<A-.>", "<Cmd>BufferNext<CR>")
-- format
vim.keymap.set("n", "<leader>f", ":lua vim.lsp.buf.format()<CR>")
-- diagnostics -- diagnostics
vim.keymap.set("n", "<leader>ds", ":lua vim.diagnostic.open_float()<CR>") vim.keymap.set("n", "<leader>ds", ":lua vim.diagnostic.open_float()<CR>")
vim.keymap.set("n", "<leader>dn", function() vim.diagnostic.jump({ count = 1 }) end) vim.keymap.set("n", "<leader>dn", function()
vim.keymap.set("n", "<leader>dp", function() vim.diagnostic.jump({ count = -1 }) end) vim.diagnostic.jump({ count = 1 })
end)
vim.keymap.set("n", "<leader>dp", function()
vim.diagnostic.jump({ count = -1 })
end)
-- VIM PACKS -- VIM PACKS
vim.pack.add({ vim.pack.add({
@ -71,46 +78,54 @@ vim.pack.add({
{ src = "https://github.com/neanias/everforest-nvim.git" }, { src = "https://github.com/neanias/everforest-nvim.git" },
-- lsp -- lsp
{ src = 'https://github.com/neovim/nvim-lspconfig' }, { src = "https://github.com/neovim/nvim-lspconfig" },
{ src = 'https://github.com/mason-org/mason.nvim' }, { src = "https://github.com/mason-org/mason.nvim" },
{ src = 'https://github.com/mason-org/mason-lspconfig.nvim' }, { src = "https://github.com/mason-org/mason-lspconfig.nvim" },
{ src = 'https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim' }, { src = "https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim" },
-- treesitter -- treesitter
{ src = 'https://github.com/nvim-treesitter/nvim-treesitter', branch = "main", build = ":TSUpdate", lazy = false}, {
src = "https://github.com/nvim-treesitter/nvim-treesitter",
branch = "main",
build = ":TSUpdate",
lazy = false,
},
-- bar and icons at the top -- bar and icons at the top
{ src = 'https://github.com/nvim-tree/nvim-web-devicons' }, { src = "https://github.com/nvim-tree/nvim-web-devicons" },
{ src = 'https://github.com/romgrk/barbar.nvim' }, { src = "https://github.com/romgrk/barbar.nvim" },
-- file tree -- file tree
{ src = 'https://github.com/nvim-tree/nvim-tree.lua' }, { src = "https://github.com/nvim-tree/nvim-tree.lua" },
-- auto save -- auto save
{ src = 'https://github.com/Pocco81/auto-save.nvim' }, { src = "https://github.com/Pocco81/auto-save.nvim" },
-- completion -- completion
{ src = 'https://github.com/saghen/blink.cmp' }, { src = "https://github.com/saghen/blink.cmp" },
-- lualine -- lualine
{ src = 'https://github.com/nvim-lualine/lualine.nvim' }, { src = "https://github.com/nvim-lualine/lualine.nvim" },
-- surround -- mini.nvim
{ src = 'https://github.com/echasnovski/nvim-mini/mini.nvim' }, { src = "https://github.com/echasnovski/nvim-mini/mini.nvim" },
-- telescope -- telescope
{ src = 'https://github.com/nvim-lua/plenary.nvim' }, { src = "https://github.com/nvim-lua/plenary.nvim" },
{ src = 'https://github.com/nvim-telescope/telescope.nvim' }, { src = "https://github.com/nvim-telescope/telescope.nvim" },
-- dashboard
{ src = "https://github.com/nvimdev/dashboard-nvim" },
}) })
-- telescope (sadly these configs need to be after vimpack) -- telescope (sadly these configs need to be after vimpack)
local builtin = require('telescope.builtin') local builtin = require("telescope.builtin")
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' }) vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Telescope find files" })
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' }) vim.keymap.set("n", "<leader>fg", builtin.live_grep, { desc = "Telescope live grep" })
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' }) vim.keymap.set("n", "<leader>fb", builtin.buffers, { desc = "Telescope buffers" })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' }) vim.keymap.set("n", "<leader>fh", builtin.help_tags, { desc = "Telescope help tags" })
require('nvim-treesitter.configs').setup { require("nvim-treesitter.configs").setup({
ensure_installed = {}, ensure_installed = {},
modules = {}, modules = {},
sync_install = false, sync_install = false,
@ -120,29 +135,35 @@ require('nvim-treesitter.configs').setup {
enable = true, enable = true,
additional_vim_regex_highlighting = false, additional_vim_regex_highlighting = false,
}, },
} })
vim.cmd("colorscheme everforest") vim.cmd("colorscheme everforest")
require "barbar".setup() require("barbar").setup()
require "mini.ai".setup() require("mini.ai").setup()
require "mini.surround".setup() require("mini.surround").setup()
require "mini.pairs".setup() require("mini.pairs").setup({
require "nvim-tree".setup() modes = {
require "auto-save".setup() insert = true,
require "blink.cmp".setup({ command = true,
terminal = false,
},
})
require("nvim-tree").setup()
require("auto-save").setup()
require("blink.cmp").setup({
keymap = { keymap = {
preset = "enter", preset = "enter",
["<CR>"] = { "select_and_accept", "fallback" }, ["<CR>"] = { "select_and_accept", "fallback" },
}, },
}) })
require('lualine').setup { require("lualine").setup({
options = { options = {
icons_enabled = true, icons_enabled = true,
theme = 'everforest', theme = "everforest",
component_separators = { left = '', right = ''}, component_separators = { left = "", right = "" },
section_separators = { left = '', right = ''}, section_separators = { left = "", right = "" },
disabled_filetypes = { disabled_filetypes = {
statusline = {}, statusline = {},
winbar = {}, winbar = {},
@ -157,42 +178,44 @@ require('lualine').setup {
winbar = 1000, winbar = 1000,
refresh_time = 16, -- ~60fps refresh_time = 16, -- ~60fps
events = { events = {
'WinEnter', "WinEnter",
'BufEnter', "BufEnter",
'BufWritePost', "BufWritePost",
'SessionLoadPost', "SessionLoadPost",
'FileChangedShellPost', 'VimResized', 'Filetype', "FileChangedShellPost",
'CursorMoved', "VimResized",
'CursorMovedI', "Filetype",
'ModeChanged', "CursorMoved",
"CursorMovedI",
"ModeChanged",
},
}, },
}
}, },
sections = { sections = {
lualine_a = {'mode'}, lualine_a = { "mode" },
lualine_b = {'branch', 'diff', 'diagnostics'}, lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = {'filename'}, lualine_c = { "filename" },
lualine_x = {'encoding', 'fileformat', 'filetype'}, lualine_x = { "encoding", "fileformat", "filetype" },
lualine_y = {'progress'}, lualine_y = { "progress" },
lualine_z = {'location'} lualine_z = { "location" },
}, },
inactive_sections = { inactive_sections = {
lualine_a = {}, lualine_a = {},
lualine_b = {}, lualine_b = {},
lualine_c = {'filename'}, lualine_c = { "filename" },
lualine_x = {'location'}, lualine_x = { "location" },
lualine_y = {}, lualine_y = {},
lualine_z = {} lualine_z = {},
}, },
tabline = {}, tabline = {},
winbar = {}, winbar = {},
inactive_winbar = {}, inactive_winbar = {},
extensions = {} extensions = {},
} })
require('mason').setup() require("mason").setup()
require('mason-lspconfig').setup() require("mason-lspconfig").setup()
require('mason-tool-installer').setup({ require("mason-tool-installer").setup({
ensure_installed = { ensure_installed = {
"biome", "biome",
"djlint", "djlint",
@ -204,24 +227,23 @@ require('mason-tool-installer').setup({
"prettier", "prettier",
"prettierd", "prettierd",
"python-lsp-server", "python-lsp-server",
"roslyn",
"ruff", "ruff",
"selene", "selene",
"stylua", "stylua",
"typescript-language-server", "typescript-language-server",
} },
}) })
vim.lsp.config('lua_ls', { vim.lsp.config("lua_ls", {
settings = { settings = {
Lua = { Lua = {
runtime = { runtime = {
version = 'LuaJIT', version = "LuaJIT",
}, },
diagnostics = { diagnostics = {
globals = { globals = {
'vim', "vim",
'require' "require",
}, },
}, },
workspace = { workspace = {
@ -233,3 +255,42 @@ vim.lsp.config('lua_ls', {
}, },
}, },
}) })
local logo = [[
]]
logo = string.rep("\n", 8) .. logo .. "\n\n"
require("dashboard").setup({
theme = "hyper",
hide = {
statusline = true,
tabline = true,
winbar = true,
},
config = {
shortcut = {
{ desc = "変わっていく季節、変わらない毎日。" },
},
header = vim.split(logo, "\n"),
packages = { enable = false },
project = { enable = false },
mru = { enable = true, limit = 10, label = "最近使ったファイル:", cwd_only = false },
footer = function()
return { "" }
end,
},
})