From 905711a0cbb67d51c92aac041e93ac650b24c050 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Mon, 26 Feb 2024 08:57:44 +0000 Subject: [PATCH] actually uses our `.stylua.toml` --- .stylelua.toml => .stylua.toml | 0 dot_config/nvim/init.lua | 62 ++++---- dot_config/nvim/lua/plugins/formatter.lua | 42 ++--- dot_config/nvim/lua/plugins/keybinds.lua | 18 +-- dot_config/nvim/lua/plugins/lsp.lua | 142 ++++++++--------- dot_config/nvim/lua/plugins/theme.lua | 20 +-- dot_config/nvim/lua/plugins/ui.lua | 182 +++++++++++----------- dot_config/nvim/lua/plugins/webdev.lua | 36 ++--- dot_config/wezterm/wezterm.lua | 14 +- 9 files changed, 258 insertions(+), 258 deletions(-) rename .stylelua.toml => .stylua.toml (100%) diff --git a/.stylelua.toml b/.stylua.toml similarity index 100% rename from .stylelua.toml rename to .stylua.toml diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index 0f57e24..1ccc1fb 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -2,14 +2,14 @@ vim.opt.number = true 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, - }) + 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) @@ -19,30 +19,30 @@ require("telescope").load_extension("file_browser") local wk = require("which-key") wk.register({ - f = { - name = "file", - f = { "Telescope find_files", "Find File" }, - g = { "Telescope live_grep", "Grep Files" }, - r = { "Telescope oldfiles", "Open Recent File" }, - }, - d = { - name = "dir", - f = { "Telescope file_browser", "Find Directory" }, - r = { "NvimTreeFindFile!", "Root Here" }, - t = { "NvimTreeToggle", "Toggle Tree" }, - }, - b = { - name = "browser", - o = { "BrowserPreview", "Open Browser" }, - }, - g = { - name = "git", - g = { "LazyGit", "LazyGit" }, - }, + f = { + name = "file", + f = { "Telescope find_files", "Find File" }, + g = { "Telescope live_grep", "Grep Files" }, + r = { "Telescope oldfiles", "Open Recent File" }, + }, + d = { + name = "dir", + f = { "Telescope file_browser", "Find Directory" }, + r = { "NvimTreeFindFile!", "Root Here" }, + t = { "NvimTreeToggle", "Toggle Tree" }, + }, + b = { + name = "browser", + o = { "BrowserPreview", "Open Browser" }, + }, + g = { + name = "git", + g = { "LazyGit", "LazyGit" }, + }, }, { prefix = "" }) wk.register({ - ["B"] = { name = "+buffer" }, - ["B,"] = { "BufferPrevious", "Previous Tab" }, - ["B."] = { "BufferNext", "Next Tab" }, + ["B"] = { name = "+buffer" }, + ["B,"] = { "BufferPrevious", "Previous Tab" }, + ["B."] = { "BufferNext", "Next Tab" }, }) diff --git a/dot_config/nvim/lua/plugins/formatter.lua b/dot_config/nvim/lua/plugins/formatter.lua index 49b0324..9a1f7a8 100644 --- a/dot_config/nvim/lua/plugins/formatter.lua +++ b/dot_config/nvim/lua/plugins/formatter.lua @@ -1,23 +1,23 @@ return { - "stevearc/conform.nvim", - lazy = true, - event = { "BufWritePre" }, - cmd = { "ConformInfo" }, - keys = { - { - -- Customize or remove this keymap to your liking - "c", - function() - require("conform").format({ async = true, lsp_fallback = true }) - end, - mode = "", - desc = "Format buffer", - }, - }, - opts = { - formatters_by_ft = { - lua = { "styleua" }, - }, - format_on_save = { timeout_ms = 500, lsp_fallback = true }, - }, + "stevearc/conform.nvim", + lazy = true, + event = { "BufWritePre" }, + cmd = { "ConformInfo" }, + keys = { + { + -- Customize or remove this keymap to your liking + "c", + function() + require("conform").format({ async = true, lsp_fallback = true }) + end, + mode = "", + desc = "Format buffer", + }, + }, + opts = { + formatters_by_ft = { + lua = { "styleua" }, + }, + format_on_save = { timeout_ms = 500, lsp_fallback = true }, + }, } diff --git a/dot_config/nvim/lua/plugins/keybinds.lua b/dot_config/nvim/lua/plugins/keybinds.lua index ea6ff85..d9c8f6e 100644 --- a/dot_config/nvim/lua/plugins/keybinds.lua +++ b/dot_config/nvim/lua/plugins/keybinds.lua @@ -1,11 +1,11 @@ return { - { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 300 - end, - opts = {}, - }, + { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + end, + opts = {}, + }, } diff --git a/dot_config/nvim/lua/plugins/lsp.lua b/dot_config/nvim/lua/plugins/lsp.lua index 807e228..f487201 100644 --- a/dot_config/nvim/lua/plugins/lsp.lua +++ b/dot_config/nvim/lua/plugins/lsp.lua @@ -1,77 +1,77 @@ return { - { - "neovim/nvim-lspconfig", - priority = 1, - config = function() - local lspconfig = require("lspconfig") - lspconfig.tsserver.setup({}) - lspconfig.rust_analyzer.setup({}) - lspconfig.html.setup({}) - end, - }, - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - { "williamboman/mason.nvim", priority = 51, opts = {} }, - { "williamboman/mason-lspconfig.nvim", opts = { automatic_installation = true } }, - { - "hrsh7th/nvim-cmp", - config = function() - local cmp = require("cmp") + { + "neovim/nvim-lspconfig", + priority = 1, + config = function() + local lspconfig = require("lspconfig") + lspconfig.tsserver.setup({}) + lspconfig.rust_analyzer.setup({}) + lspconfig.html.setup({}) + end, + }, + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + { "williamboman/mason.nvim", priority = 51, opts = {} }, + { "williamboman/mason-lspconfig.nvim", opts = { automatic_installation = true } }, + { + "hrsh7th/nvim-cmp", + config = function() + local cmp = require("cmp") - cmp.setup({ - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. - end, - }, - window = { - -- completion = cmp.config.window.bordered(), - -- documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "vsnip" }, -- For vsnip users. - { name = "buffer" }, - }), - }) + cmp.setup({ + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. + end, + }, + window = { + -- completion = cmp.config.window.bordered(), + -- documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "vsnip" }, -- For vsnip users. + { name = "buffer" }, + }), + }) - -- Set configuration for specific filetype. - cmp.setup.filetype("gitcommit", { - sources = cmp.config.sources({ - { name = "git" }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git). - }, { - { name = "buffer" }, - }), - }) + -- Set configuration for specific filetype. + cmp.setup.filetype("gitcommit", { + sources = cmp.config.sources({ + { name = "git" }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git). + }, { + { name = "buffer" }, + }), + }) - -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline({ "/", "?" }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = "buffer" }, - }, - }) + -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline({ "/", "?" }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = "buffer" }, + }, + }) - -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline(":", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "path" }, - }, { - { name = "cmdline" }, - }), - }) - end, - }, - { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(":", { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "path" }, + }, { + { name = "cmdline" }, + }), + }) + end, + }, + { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, } diff --git a/dot_config/nvim/lua/plugins/theme.lua b/dot_config/nvim/lua/plugins/theme.lua index 97cf2b3..53777a3 100644 --- a/dot_config/nvim/lua/plugins/theme.lua +++ b/dot_config/nvim/lua/plugins/theme.lua @@ -1,5 +1,5 @@ return { - --[[ + --[[ { "Mofiqul/vscode.nvim", lazy = false, priority = 1000, @@ -13,14 +13,14 @@ return { require('vscode').load() end }, ]] - -- - { - "EdenEast/nightfox.nvim", - init = function() - vim.cmd.colorscheme("nordfox") - end, - }, - --[[ + -- + { + "EdenEast/nightfox.nvim", + init = function() + vim.cmd.colorscheme("nordfox") + end, + }, + --[[ { "catppuccin/nvim", name = "catppuccin", priority = 1000, @@ -28,5 +28,5 @@ return { opts = { flavour = "frappe" } } ]] - -- + -- } diff --git a/dot_config/nvim/lua/plugins/ui.lua b/dot_config/nvim/lua/plugins/ui.lua index b998b25..d72e290 100644 --- a/dot_config/nvim/lua/plugins/ui.lua +++ b/dot_config/nvim/lua/plugins/ui.lua @@ -1,93 +1,93 @@ return { - { - "nvim-telescope/telescope.nvim", - tag = "0.1.5", - dependencies = { "nvim-lua/plenary.nvim" }, - opts = { - extensions = { - file_browser = { - hijack_netrw = true, - }, - }, - }, - }, - { - "nvim-telescope/telescope-file-browser.nvim", - dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" }, - }, - { "nvim-tree/nvim-tree.lua", dependencies = { "nvim-tree/nvim-web-devicons" }, config = true }, - { "lewis6991/gitsigns.nvim", config = true }, - { - "lukas-reineke/indent-blankline.nvim", - main = "ibl", - opts = { - exclude = { - filetypes = { - "lspinfo", - "packer", - "checkhealth", - "help", - "man", - "gitcommit", - "TelescopePrompt", - "TelescopeResults", - "dashboard", - }, - }, - }, - }, - { - "romgrk/barbar.nvim", - dependencies = { "lewis6991/gitsigns.nvim", "nvim-tree/nvim-web-devicons" }, - init = function() - vim.g.barbar_auto_setup = false - end, - config = true, - }, - { - "nvim-lualine/lualine.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - opts = { options = { icons_enabled = true, theme = "auto" } }, - }, - { - "nvimdev/dashboard-nvim", - event = "VimEnter", - config = true, - requires = { "nvim-tree/nvim-web-devicons" }, - opts = { - excludes = { - filetype = { "lspinfo", "packer", "checkhealth", "help", "", "dashboard" }, - }, - }, - }, - { - "kdheepak/lazygit.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - }, - { - "folke/noice.nvim", - event = "VeryLazy", - opts = { - presets = { - inc_rename = true, - lsp_doc_border = true, - command_palette = true, - }, - }, - dependencies = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify" }, - }, - { - "epwalsh/obsidian.nvim", - version = "*", - dependencies = { "nvim-lua/plenary.nvim" }, - opts = { - workspaces = { - { name = "mine", path = "~/Library/Mobile Documents/iCloud~md~Obsidian/Documents/harryob" }, - }, - ui = { enable = false }, - note_id_func = function(title) - return title - end, - }, - }, + { + "nvim-telescope/telescope.nvim", + tag = "0.1.5", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { + extensions = { + file_browser = { + hijack_netrw = true, + }, + }, + }, + }, + { + "nvim-telescope/telescope-file-browser.nvim", + dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" }, + }, + { "nvim-tree/nvim-tree.lua", dependencies = { "nvim-tree/nvim-web-devicons" }, config = true }, + { "lewis6991/gitsigns.nvim", config = true }, + { + "lukas-reineke/indent-blankline.nvim", + main = "ibl", + opts = { + exclude = { + filetypes = { + "lspinfo", + "packer", + "checkhealth", + "help", + "man", + "gitcommit", + "TelescopePrompt", + "TelescopeResults", + "dashboard", + }, + }, + }, + }, + { + "romgrk/barbar.nvim", + dependencies = { "lewis6991/gitsigns.nvim", "nvim-tree/nvim-web-devicons" }, + init = function() + vim.g.barbar_auto_setup = false + end, + config = true, + }, + { + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + opts = { options = { icons_enabled = true, theme = "auto" } }, + }, + { + "nvimdev/dashboard-nvim", + event = "VimEnter", + config = true, + requires = { "nvim-tree/nvim-web-devicons" }, + opts = { + excludes = { + filetype = { "lspinfo", "packer", "checkhealth", "help", "", "dashboard" }, + }, + }, + }, + { + "kdheepak/lazygit.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + }, + { + "folke/noice.nvim", + event = "VeryLazy", + opts = { + presets = { + inc_rename = true, + lsp_doc_border = true, + command_palette = true, + }, + }, + dependencies = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify" }, + }, + { + "epwalsh/obsidian.nvim", + version = "*", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { + workspaces = { + { name = "mine", path = "~/Library/Mobile Documents/iCloud~md~Obsidian/Documents/harryob" }, + }, + ui = { enable = false }, + note_id_func = function(title) + return title + end, + }, + }, } diff --git a/dot_config/nvim/lua/plugins/webdev.lua b/dot_config/nvim/lua/plugins/webdev.lua index 4ef80a8..594de66 100644 --- a/dot_config/nvim/lua/plugins/webdev.lua +++ b/dot_config/nvim/lua/plugins/webdev.lua @@ -1,20 +1,20 @@ return { - { - "ray-x/web-tools.nvim", - opts = { - keymaps = { - rename = nil, -- by default use same setup of lspconfig - repeat_rename = ".", -- . to repeat - }, - hurl = { -- hurl default - show_headers = false, -- do not show http headers - floating = false, -- use floating windows (need guihua.lua) - json5 = false, -- use json5 parser require json5 treesitter - formatters = { -- format the result by filetype - json = { "jq" }, - html = { "prettier", "--parser", "html" }, - }, - }, - }, - }, + { + "ray-x/web-tools.nvim", + opts = { + keymaps = { + rename = nil, -- by default use same setup of lspconfig + repeat_rename = ".", -- . to repeat + }, + hurl = { -- hurl default + show_headers = false, -- do not show http headers + floating = false, -- use floating windows (need guihua.lua) + json5 = false, -- use json5 parser require json5 treesitter + formatters = { -- format the result by filetype + json = { "jq" }, + html = { "prettier", "--parser", "html" }, + }, + }, + }, + }, } diff --git a/dot_config/wezterm/wezterm.lua b/dot_config/wezterm/wezterm.lua index 6b47f15..cd6cc41 100644 --- a/dot_config/wezterm/wezterm.lua +++ b/dot_config/wezterm/wezterm.lua @@ -3,11 +3,11 @@ local wezterm = require("wezterm") local colors = wezterm.color.load_scheme(wezterm.home_dir .. "/.theme/nightfox.nvim/extra/nordfox/wezterm.toml") return { - window_decorations = "RESIZE", - font = wezterm.font("JetBrains Mono"), - initial_cols = 100, - initial_rows = 25, - colors = colors, - use_fancy_tab_bar = false, - hide_tab_bar_if_only_one_tab = true, + window_decorations = "RESIZE", + font = wezterm.font("JetBrains Mono"), + initial_cols = 100, + initial_rows = 25, + colors = colors, + use_fancy_tab_bar = false, + hide_tab_bar_if_only_one_tab = true, }