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

321
init.lua
View file

@ -16,32 +16,32 @@ vim.o.termguicolors = true
vim.o.cursorline = true
vim.o.swapfile = false
vim.o.mouse = 'a'
vim.o.mouse = "a"
vim.o.undofile = true
-- diagnostic config
vim.diagnostic.config({
virtual_text = false,
float = { source = 'always', border = 'rounded' }
virtual_text = false,
float = { source = "always", border = "rounded" },
})
-- Highlight On Yank
vim.api.nvim_create_autocmd('TextYankPost', {
desc = 'Highlight when yanking (copying) text',
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
callback = function()
vim.hl.on_yank()
end,
vim.api.nvim_create_autocmd("TextYankPost", {
desc = "Highlight when yanking (copying) text",
group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }),
callback = function()
vim.hl.on_yank()
end,
})
-- unset space so it can be used as leader
vim.keymap.set("n", " ", "", { silent = true, remap = false })
-- move around windows
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-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-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-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" })
-- move lines up and down
vim.keymap.set("n", "<A-j>", ":m .+1<CR>==")
@ -60,139 +60,162 @@ vim.keymap.set("n", "<A-l>", ":BufferNext<CR>")
vim.keymap.set("n", "<A-,>", "<Cmd>BufferPrevious<CR>")
vim.keymap.set("n", "<A-.>", "<Cmd>BufferNext<CR>")
-- format
vim.keymap.set("n", "<leader>f", ":lua vim.lsp.buf.format()<CR>")
-- diagnostics
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>dp", function() vim.diagnostic.jump({ count = -1 }) end)
vim.keymap.set("n", "<leader>dn", function()
vim.diagnostic.jump({ count = 1 })
end)
vim.keymap.set("n", "<leader>dp", function()
vim.diagnostic.jump({ count = -1 })
end)
-- VIM PACKS
vim.pack.add({
-- theme
{ src = "https://github.com/neanias/everforest-nvim.git" },
-- theme
{ src = "https://github.com/neanias/everforest-nvim.git" },
-- lsp
{ src = 'https://github.com/neovim/nvim-lspconfig' },
{ src = 'https://github.com/mason-org/mason.nvim' },
{ src = 'https://github.com/mason-org/mason-lspconfig.nvim' },
{ src = 'https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim' },
-- lsp
{ src = "https://github.com/neovim/nvim-lspconfig" },
{ src = "https://github.com/mason-org/mason.nvim" },
{ src = "https://github.com/mason-org/mason-lspconfig.nvim" },
{ src = "https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim" },
-- treesitter
{ src = 'https://github.com/nvim-treesitter/nvim-treesitter', branch = "main", build = ":TSUpdate", lazy = false},
-- treesitter
{
src = "https://github.com/nvim-treesitter/nvim-treesitter",
branch = "main",
build = ":TSUpdate",
lazy = false,
},
-- bar and icons at the top
{ src = 'https://github.com/nvim-tree/nvim-web-devicons' },
{ src = 'https://github.com/romgrk/barbar.nvim' },
-- bar and icons at the top
{ src = "https://github.com/nvim-tree/nvim-web-devicons" },
{ src = "https://github.com/romgrk/barbar.nvim" },
-- file tree
{ src = 'https://github.com/nvim-tree/nvim-tree.lua' },
-- file tree
{ src = "https://github.com/nvim-tree/nvim-tree.lua" },
-- auto save
{ src = 'https://github.com/Pocco81/auto-save.nvim' },
-- auto save
{ src = "https://github.com/Pocco81/auto-save.nvim" },
-- completion
{ src = 'https://github.com/saghen/blink.cmp' },
-- completion
{ src = "https://github.com/saghen/blink.cmp" },
-- lualine
{ src = 'https://github.com/nvim-lualine/lualine.nvim' },
-- lualine
{ src = "https://github.com/nvim-lualine/lualine.nvim" },
-- surround
{ src = 'https://github.com/echasnovski/nvim-mini/mini.nvim' },
-- mini.nvim
{ src = "https://github.com/echasnovski/nvim-mini/mini.nvim" },
-- telescope
{ src = 'https://github.com/nvim-lua/plenary.nvim' },
{ src = 'https://github.com/nvim-telescope/telescope.nvim' },
-- telescope
{ src = "https://github.com/nvim-lua/plenary.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)
local builtin = require('telescope.builtin')
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>fb', builtin.buffers, { desc = 'Telescope buffers' })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
local builtin = require("telescope.builtin")
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>fb", builtin.buffers, { desc = "Telescope buffers" })
vim.keymap.set("n", "<leader>fh", builtin.help_tags, { desc = "Telescope help tags" })
require('nvim-treesitter.configs').setup {
ensure_installed = {},
modules = {},
sync_install = false,
auto_install = true,
ignore_install = {},
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
}
vim.cmd("colorscheme everforest")
require "barbar".setup()
require "mini.ai".setup()
require "mini.surround".setup()
require "mini.pairs".setup()
require "nvim-tree".setup()
require "auto-save".setup()
require "blink.cmp".setup({
keymap = {
preset = "enter",
["<CR>"] = { "select_and_accept", "fallback" },
require("nvim-treesitter.configs").setup({
ensure_installed = {},
modules = {},
sync_install = false,
auto_install = true,
ignore_install = {},
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
})
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'everforest',
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
always_show_tabline = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
refresh_time = 16, -- ~60fps
events = {
'WinEnter',
'BufEnter',
'BufWritePost',
'SessionLoadPost',
'FileChangedShellPost', 'VimResized', 'Filetype',
'CursorMoved',
'CursorMovedI',
'ModeChanged',
},
}
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {}
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
}
vim.cmd("colorscheme everforest")
require('mason').setup()
require('mason-lspconfig').setup()
require('mason-tool-installer').setup({
require("barbar").setup()
require("mini.ai").setup()
require("mini.surround").setup()
require("mini.pairs").setup({
modes = {
insert = true,
command = true,
terminal = false,
},
})
require("nvim-tree").setup()
require("auto-save").setup()
require("blink.cmp").setup({
keymap = {
preset = "enter",
["<CR>"] = { "select_and_accept", "fallback" },
},
})
require("lualine").setup({
options = {
icons_enabled = true,
theme = "everforest",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
always_show_tabline = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
refresh_time = 16, -- ~60fps
events = {
"WinEnter",
"BufEnter",
"BufWritePost",
"SessionLoadPost",
"FileChangedShellPost",
"VimResized",
"Filetype",
"CursorMoved",
"CursorMovedI",
"ModeChanged",
},
},
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "filename" },
lualine_x = { "encoding", "fileformat", "filetype" },
lualine_y = { "progress" },
lualine_z = { "location" },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {},
})
require("mason").setup()
require("mason-lspconfig").setup()
require("mason-tool-installer").setup({
ensure_installed = {
"biome",
"djlint",
@ -204,24 +227,23 @@ require('mason-tool-installer').setup({
"prettier",
"prettierd",
"python-lsp-server",
"roslyn",
"ruff",
"selene",
"stylua",
"typescript-language-server",
}
},
})
vim.lsp.config('lua_ls', {
vim.lsp.config("lua_ls", {
settings = {
Lua = {
runtime = {
version = 'LuaJIT',
version = "LuaJIT",
},
diagnostics = {
globals = {
'vim',
'require'
"vim",
"require",
},
},
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,
},
})