From 9c3e8ec512781e450638527a94d7e61e7b773d10 Mon Sep 17 00:00:00 2001 From: Dominic DiTaranto Date: Tue, 25 Nov 2025 16:16:39 -0500 Subject: [PATCH] modularization --- init.lua | 333 +++----------------------- lua/config/keymaps.lua | 47 ++++ lua/config/plugins/autosave.lua | 3 + lua/config/plugins/barbar.lua | 6 + lua/config/plugins/blink.lua | 8 + lua/config/plugins/dashboard.lua | 41 ++++ lua/config/plugins/lualine.lua | 57 +++++ lua/config/plugins/mason.lua | 27 +++ lua/config/plugins/mini.lua | 11 + lua/config/plugins/nvim-lspconfig.lua | 1 + lua/config/plugins/nvim-tree.lua | 3 + lua/config/plugins/prettier.lua | 19 ++ lua/config/plugins/telescope.lua | 10 + lua/config/plugins/theme.lua | 3 + lua/config/plugins/treesitter.lua | 20 ++ lua/config/plugins/venv-selector.lua | 19 ++ 16 files changed, 306 insertions(+), 302 deletions(-) create mode 100644 lua/config/keymaps.lua create mode 100644 lua/config/plugins/autosave.lua create mode 100644 lua/config/plugins/barbar.lua create mode 100644 lua/config/plugins/blink.lua create mode 100644 lua/config/plugins/dashboard.lua create mode 100644 lua/config/plugins/lualine.lua create mode 100644 lua/config/plugins/mason.lua create mode 100644 lua/config/plugins/mini.lua create mode 100644 lua/config/plugins/nvim-lspconfig.lua create mode 100644 lua/config/plugins/nvim-tree.lua create mode 100644 lua/config/plugins/prettier.lua create mode 100644 lua/config/plugins/telescope.lua create mode 100644 lua/config/plugins/theme.lua create mode 100644 lua/config/plugins/treesitter.lua create mode 100644 lua/config/plugins/venv-selector.lua diff --git a/init.lua b/init.lua index ff847ad..d23e03c 100644 --- a/init.lua +++ b/init.lua @@ -14,7 +14,8 @@ vim.o.inccommand = 'split' vim.o.cursorline = true vim.o.showmode = true vim.o.hlsearch = false -vim.o.tabstop = 4 +vim.o.tabstop = 2 +vim.o.shiftwidth = 2 vim.g.have_nerd_font = true vim.o.scrolloff = 10 vim.g.border = "rounded" @@ -25,12 +26,27 @@ vim.o.mouse = "a" vim.o.undofile = true vim.o.spell = false --- diagnostic config vim.diagnostic.config({ virtual_text = false, float = { source = "always", border = "rounded" }, }) +require("config.keymaps") +require("config.plugins.autosave") +require("config.plugins.barbar") +require("config.plugins.blink") +require("config.plugins.dashboard") +require("config.plugins.lualine") +require("config.plugins.mason") +require("config.plugins.mini") +require("config.plugins.nvim-lspconfig") +require("config.plugins.nvim-tree") +require("config.plugins.prettier") +require("config.plugins.telescope") +require("config.plugins.theme") +require("config.plugins.treesitter") +require("config.plugins.venv-selector") + -- Highlight On Yank vim.api.nvim_create_autocmd("TextYankPost", { desc = "Highlight when yanking (copying) text", @@ -40,237 +56,24 @@ vim.api.nvim_create_autocmd("TextYankPost", { end, }) --- unset space so it can be used as leader -vim.keymap.set("n", " ", "", { silent = true, remap = false }) - --- source config -vim.keymap.set("n", "o", ":source $HOME/.config/nvim/init.lua") - --- move around windows -vim.keymap.set("n", "", "", { desc = "focus to l window" }) -vim.keymap.set("n", "", "", { desc = "focus to r window" }) -vim.keymap.set("n", "", "", { desc = "focus to dwn window" }) -vim.keymap.set("n", "", "", { desc = "focus to up window" }) - --- move lines up and down -vim.keymap.set("n", "", ":m .+1==") -vim.keymap.set("n", "", ":m .-2==") -vim.keymap.set("v", "", ":m '>+1gv=gv") -vim.keymap.set("v", "", ":m '<-2gv=gv") - --- quote around highlighted words -vim.keymap.set('v', "'", "c''P") -vim.keymap.set('v', '"', 'c""P') - --- non-floating terminal -vim.keymap.set('n', 'T', ":belowright split | terminal | :resize 8i") - --- toggle spellcheck -vim.keymap.set('n', 'st', ':set spell!') - --- toggle nvim tree -vim.keymap.set("n", "e", ":NvimTreeToggle") - --- barbar -vim.keymap.set("n", "x", ":BufferClose") --- (I need both options, one for windows, one for linux) -vim.keymap.set("n", "", ":BufferPrevious") -vim.keymap.set("n", "", ":BufferNext") -vim.keymap.set("n", "", "BufferPrevious") -vim.keymap.set("n", "", "BufferNext") - --- format -vim.keymap.set("n", "f", ":lua vim.lsp.buf.format()") - --- diagnostics -vim.keymap.set("n", "ds", ":lua vim.diagnostic.open_float()") -vim.keymap.set("n", "dn", function() vim.diagnostic.jump({ count = 1 }) end) -vim.keymap.set("n", "dp", function() vim.diagnostic.jump({ count = -1 }) end) - --- VIM PACKS -vim.pack.add({ - -- 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" }, - - -- 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" }, - - -- file tree - { src = "https://github.com/nvim-tree/nvim-tree.lua" }, - - -- auto save - { src = "https://github.com/Pocco81/auto-save.nvim" }, - - -- completion - { src = "https://github.com/saghen/blink.cmp" }, - - -- lualine - { src = "https://github.com/nvim-lualine/lualine.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" }, - - -- venv-selector - { src = "https://github.com/mfussenegger/nvim-dap" }, - { src = "https://github.com/mfussenegger/nvim-dap-python" }, - { src = "https://github.com/linux-cultist/venv-selector.nvim" }, - - -- dashboard - { src = "https://github.com/nvimdev/dashboard-nvim" }, - - -- prettier - { src = "https://github.com/MunifTanjim/prettier.nvim" }, +-- python specific +vim.api.nvim_create_autocmd("FileType", { + pattern = "python", + command = "setlocal shiftwidth=4 tabstop=4" }) --- telescope (sadly these configs need to be after vimpack) -local builtin = require("telescope.builtin") -vim.keymap.set("n", "ff", builtin.find_files, { desc = "Telescope find files" }) -vim.keymap.set("n", "fg", builtin.live_grep, { desc = "Telescope live grep" }) -vim.keymap.set("n", "fb", builtin.buffers, { desc = "Telescope buffers" }) -vim.keymap.set("n", "fh", builtin.help_tags, { desc = "Telescope help tags" }) +local enable_providers = { + "python3_provider", +} -require("dap-python").setup("python3") -require("venv-selector").setup({ - -- Optional: Customize search paths for virtual environments - search = { - -- Example: Add a custom search path - -- { path = "~/my_projects/venvs", depth = 1 }, - }, - -- Optional: Customize plugin options - options = { - -- Example: Set a default picker (e.g., "telescope") - -- picker = "telescope", - }, -}) -require("nvim-treesitter.configs").setup({ - ensure_installed = {}, - modules = {}, - sync_install = false, - auto_install = true, - ignore_install = {}, - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, -}) +for _, plugin in pairs(enable_providers) do + vim.g["loaded_" .. plugin] = nil + vim.cmd("runtime " .. plugin) +end -vim.cmd("colorscheme everforest") - -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", - [""] = { "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 = { - "basedpyright", - "biome", - "djlint", - "emmet-language-server", - "html-lsp", - "lua-language-server", - "lwc-language-server", - "omnisharp", - "prettier", - "prettierd", - "python-lsp-server", - "ruff", - "selene", - "stylua", - "typescript-language-server", - }, -}) +vim.g.loaded_python3_provider = nil +-- lua... I need to move this vim.lsp.config("lua_ls", { settings = { Lua = { @@ -292,77 +95,3 @@ 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, - }, -}) - -local enable_providers = { - "python3_provider", -} - -for _, plugin in pairs(enable_providers) do - vim.g["loaded_" .. plugin] = nil - vim.cmd("runtime " .. plugin) -end - -vim.g.loaded_python3_provider = nil - -require("prettier").setup({ - bin = 'prettier', -- or `'prettierd'` (v0.23.3+) - filetypes = { - "css", - "graphql", - "html", - "javascript", - "javascriptreact", - "json", - "less", - "markdown", - "scss", - "typescript", - "typescriptreact", - "yaml", - }, -}) - -vim.api.nvim_create_autocmd("FileType", { - pattern = "htmldjango", - command = "setlocal shiftwidth=2 tabstop=2" -}) diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua new file mode 100644 index 0000000..bbfd6c7 --- /dev/null +++ b/lua/config/keymaps.lua @@ -0,0 +1,47 @@ +-- unset space so it can be used as leader +vim.keymap.set("n", " ", "", { silent = true, remap = false }) + +-- source config +vim.keymap.set("n", "o", ":source $HOME/.config/nvim/init.lua") + +-- move around windows +vim.keymap.set("n", "", "", { desc = "focus to l window" }) +vim.keymap.set("n", "", "", { desc = "focus to r window" }) +vim.keymap.set("n", "", "", { desc = "focus to dwn window" }) +vim.keymap.set("n", "", "", { desc = "focus to up window" }) + +-- move lines up and down +vim.keymap.set("n", "", ":m .+1==") +vim.keymap.set("n", "", ":m .-2==") +vim.keymap.set("v", "", ":m '>+1gv=gv") +vim.keymap.set("v", "", ":m '<-2gv=gv") + +-- quote around highlighted words +vim.keymap.set('v', "'", "c''P") +vim.keymap.set('v', '"', 'c""P') + +-- non-floating terminal +vim.keymap.set('n', 'T', ":belowright split | terminal | :resize 8i") + +-- toggle spellcheck +vim.keymap.set('n', 'st', ':set spell!') + +-- toggle nvim tree +vim.keymap.set("n", "e", ":NvimTreeToggle") + +-- barbar +vim.keymap.set("n", "x", ":BufferClose") +-- (I need both options, one for windows, one for linux) +vim.keymap.set("n", "", ":BufferPrevious") +vim.keymap.set("n", "", ":BufferNext") +vim.keymap.set("n", "", "BufferPrevious") +vim.keymap.set("n", "", "BufferNext") + +-- format +vim.keymap.set("n", "f", ":lua vim.lsp.buf.format()") + +-- diagnostics +vim.keymap.set("n", "ds", ":lua vim.diagnostic.open_float()") +vim.keymap.set("n", "dn", function() vim.diagnostic.jump({ count = 1 }) end) +vim.keymap.set("n", "dp", function() vim.diagnostic.jump({ count = -1 }) end) + diff --git a/lua/config/plugins/autosave.lua b/lua/config/plugins/autosave.lua new file mode 100644 index 0000000..1e54ebe --- /dev/null +++ b/lua/config/plugins/autosave.lua @@ -0,0 +1,3 @@ +vim.pack.add{"https://github.com/Pocco81/auto-save.nvim"} + +require("auto-save").setup() diff --git a/lua/config/plugins/barbar.lua b/lua/config/plugins/barbar.lua new file mode 100644 index 0000000..c555fd3 --- /dev/null +++ b/lua/config/plugins/barbar.lua @@ -0,0 +1,6 @@ +vim.pack.add({ + { src = "https://github.com/nvim-tree/nvim-web-devicons" }, + { src = "https://github.com/romgrk/barbar.nvim" }, +}) + +require("barbar").setup() diff --git a/lua/config/plugins/blink.lua b/lua/config/plugins/blink.lua new file mode 100644 index 0000000..2d0879e --- /dev/null +++ b/lua/config/plugins/blink.lua @@ -0,0 +1,8 @@ +vim.pack.add{"https://github.com/saghen/blink.cmp"} + +require("blink.cmp").setup({ + keymap = { + preset = "enter", + [""] = { "select_and_accept", "fallback" }, + }, +}) diff --git a/lua/config/plugins/dashboard.lua b/lua/config/plugins/dashboard.lua new file mode 100644 index 0000000..d2252e7 --- /dev/null +++ b/lua/config/plugins/dashboard.lua @@ -0,0 +1,41 @@ +vim.pack.add{"https://github.com/nvimdev/dashboard-nvim"} + +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, + }, +}) diff --git a/lua/config/plugins/lualine.lua b/lua/config/plugins/lualine.lua new file mode 100644 index 0000000..b171a91 --- /dev/null +++ b/lua/config/plugins/lualine.lua @@ -0,0 +1,57 @@ +vim.pack.add{"https://github.com/nvim-lualine/lualine.nvim"} + +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 = {}, +}) + diff --git a/lua/config/plugins/mason.lua b/lua/config/plugins/mason.lua new file mode 100644 index 0000000..34aae30 --- /dev/null +++ b/lua/config/plugins/mason.lua @@ -0,0 +1,27 @@ +vim.pack.add({ + { 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" }, +}) + +require("mason").setup() +require("mason-lspconfig").setup() +require("mason-tool-installer").setup({ + ensure_installed = { + "basedpyright", + "biome", + "djlint", + "emmet-language-server", + "html-lsp", + "lua-language-server", + "lwc-language-server", + "omnisharp", + "prettier", + "prettierd", + "python-lsp-server", + "ruff", + "selene", + "stylua", + "typescript-language-server", + }, +}) diff --git a/lua/config/plugins/mini.lua b/lua/config/plugins/mini.lua new file mode 100644 index 0000000..2082c84 --- /dev/null +++ b/lua/config/plugins/mini.lua @@ -0,0 +1,11 @@ +vim.pack.add{"https://github.com/echasnovski/nvim-mini/mini.nvim"} + +require("mini.ai").setup() +require("mini.surround").setup() +require("mini.pairs").setup({ + modes = { + insert = true, + command = true, + terminal = false, + }, +}) diff --git a/lua/config/plugins/nvim-lspconfig.lua b/lua/config/plugins/nvim-lspconfig.lua new file mode 100644 index 0000000..d741eae --- /dev/null +++ b/lua/config/plugins/nvim-lspconfig.lua @@ -0,0 +1 @@ +vim.pack.add{"https://github.com/neovim/nvim-lspconfig"} diff --git a/lua/config/plugins/nvim-tree.lua b/lua/config/plugins/nvim-tree.lua new file mode 100644 index 0000000..888d02a --- /dev/null +++ b/lua/config/plugins/nvim-tree.lua @@ -0,0 +1,3 @@ +vim.pack.add{"https://github.com/nvim-tree/nvim-tree.lua"} + +require("nvim-tree").setup() diff --git a/lua/config/plugins/prettier.lua b/lua/config/plugins/prettier.lua new file mode 100644 index 0000000..588c105 --- /dev/null +++ b/lua/config/plugins/prettier.lua @@ -0,0 +1,19 @@ +vim.pack.add{"https://github.com/MunifTanjim/prettier.nvim"} + +require("prettier").setup({ + bin = 'prettier', -- or `'prettierd'` (v0.23.3+) + filetypes = { + "css", + "graphql", + "html", + "javascript", + "javascriptreact", + "json", + "less", + "markdown", + "scss", + "typescript", + "typescriptreact", + "yaml", + }, +}) diff --git a/lua/config/plugins/telescope.lua b/lua/config/plugins/telescope.lua new file mode 100644 index 0000000..4f30ba6 --- /dev/null +++ b/lua/config/plugins/telescope.lua @@ -0,0 +1,10 @@ +vim.pack.add({ + { src = "https://github.com/nvim-lua/plenary.nvim" }, + { src = "https://github.com/nvim-telescope/telescope.nvim" }, +}) + +local builtin = require("telescope.builtin") +vim.keymap.set("n", "ff", builtin.find_files, { desc = "Telescope find files" }) +vim.keymap.set("n", "fg", builtin.live_grep, { desc = "Telescope live grep" }) +vim.keymap.set("n", "fb", builtin.buffers, { desc = "Telescope buffers" }) +vim.keymap.set("n", "fh", builtin.help_tags, { desc = "Telescope help tags" }) diff --git a/lua/config/plugins/theme.lua b/lua/config/plugins/theme.lua new file mode 100644 index 0000000..d512875 --- /dev/null +++ b/lua/config/plugins/theme.lua @@ -0,0 +1,3 @@ +vim.pack.add{"https://github.com/neanias/everforest-nvim.git"} + +vim.cmd("colorscheme everforest") diff --git a/lua/config/plugins/treesitter.lua b/lua/config/plugins/treesitter.lua new file mode 100644 index 0000000..cadf445 --- /dev/null +++ b/lua/config/plugins/treesitter.lua @@ -0,0 +1,20 @@ +vim.pack.add({ + { + src = "https://github.com/nvim-treesitter/nvim-treesitter", + branch = "main", + build = ":TSUpdate", + lazy = false, + }, +}) + +require("nvim-treesitter.configs").setup({ + ensure_installed = {}, + modules = {}, + sync_install = false, + auto_install = true, + ignore_install = {}, + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, +}) diff --git a/lua/config/plugins/venv-selector.lua b/lua/config/plugins/venv-selector.lua new file mode 100644 index 0000000..7bc3dc9 --- /dev/null +++ b/lua/config/plugins/venv-selector.lua @@ -0,0 +1,19 @@ +vim.pack.add({ + { src = "https://github.com/mfussenegger/nvim-dap" }, + { src = "https://github.com/mfussenegger/nvim-dap-python" }, + { src = "https://github.com/linux-cultist/venv-selector.nvim" }, +}) + +require("dap-python").setup("python3") +require("venv-selector").setup({ + -- Optional: Customize search paths for virtual environments + search = { + -- Example: Add a custom search path + -- { path = "~/my_projects/venvs", depth = 1 }, + }, + -- Optional: Customize plugin options + options = { + -- Example: Set a default picker (e.g., "telescope") + -- picker = "telescope", + }, +})