diff --git a/init.lua b/init.lua index 818b2a7..6e3527f 100644 --- a/init.lua +++ b/init.lua @@ -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', '', '', { 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' }) +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==") @@ -60,139 +60,162 @@ 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.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" }, + -- 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', '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 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" }) -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", - [""] = { "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", + [""] = { "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, + }, +})