From 482f46a442738bd272fd63965b90db88dcabeb3b Mon Sep 17 00:00:00 2001 From: zapagenrevdale Date: Tue, 5 Aug 2025 17:51:35 +0800 Subject: [PATCH 1/4] chore: neotree plugin --- init.lua | 2 +- lua/custom/plugins/neotree.lua | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 lua/custom/plugins/neotree.lua diff --git a/init.lua b/init.lua index b98ffc6198a..ed464d6ec9f 100644 --- a/init.lua +++ b/init.lua @@ -984,7 +984,7 @@ require('lazy').setup({ -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! diff --git a/lua/custom/plugins/neotree.lua b/lua/custom/plugins/neotree.lua new file mode 100644 index 00000000000..bbb35a60c37 --- /dev/null +++ b/lua/custom/plugins/neotree.lua @@ -0,0 +1,16 @@ +return { + { + 'nvim-neo-tree/neo-tree.nvim', + branch = 'v3.x', + dependencies = { + 'nvim-lua/plenary.nvim', + 'MunifTanjim/nui.nvim', + 'nvim-tree/nvim-web-devicons', -- optional, but recommended + }, + lazy = false, -- neo-tree will lazily load itself + keys = { + { 'e', ':Neotree toggle', desc = 'Toggle NeoTree', silent = true }, + { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, + }, + }, +} From ec61e182d89d3e03065f102456d5fee17194dfcc Mon Sep 17 00:00:00 2001 From: zapagenrevdale Date: Tue, 5 Aug 2025 20:01:20 +0800 Subject: [PATCH 2/4] chore: dev coding setups --- init.lua | 22 ++++++++++++-- lua/custom/plugins/init.lua | 59 ++++++++++++++++++++++++++++++++++++- 2 files changed, 78 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index ed464d6ec9f..3c2dc059ef2 100644 --- a/init.lua +++ b/init.lua @@ -102,7 +102,7 @@ vim.g.have_nerd_font = false vim.o.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! --- vim.o.relativenumber = true +vim.o.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.o.mouse = 'a' @@ -205,6 +205,9 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the upper win -- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) -- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) +-- custom keymaps +vim.keymap.set('i', 'jj', '', { desc = 'Escape from Insert mode' }) + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -247,7 +250,20 @@ rtp:prepend(lazypath) -- NOTE: Here is where you install your plugins. require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). - 'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically + { + "NMAC427/guess-indent.nvim", + config = function() + require('guess-indent').setup({ + override_editorconfig = true, + filetype_exclude = {}, + }) + -- Set default indentation + vim.o.tabstop = 2 + vim.o.shiftwidth = 2 + vim.o.softtabstop = 2 + vim.o.expandtab = true + end, + }, -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following @@ -837,6 +853,8 @@ require('lazy').setup({ -- See :h blink-cmp-config-keymap for defining your own keymap preset = 'default', + -- [''] = { 'select_and_accept' }, + -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps }, diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8d7a..de86a12f59b 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,61 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + { + 'AndrewRadev/tagalong.vim', + }, + { + 'windwp/nvim-ts-autotag', + config = function() + require('nvim-ts-autotag').setup { + opts = { + -- Defaults + enable_close = true, -- Auto close tags + enable_rename = true, -- Auto rename pairs of tags + enable_close_on_slash = false, -- Auto close on trailing l', function() + conform.format({ + lsp_fallback = true, + async = false, + timeout_ms = 500, + }) + end, { desc = 'Format file or range (in visual mode)' }) + end, + }, +} From ba8cd681f4852c1c507a00f7891b343ae32f6e3e Mon Sep 17 00:00:00 2001 From: zapagenrevdale Date: Tue, 19 Aug 2025 19:02:53 +0800 Subject: [PATCH 3/4] chore: hurl --- init.lua | 20 +++--- lua/custom/plugins/init.lua | 101 +++++++++++++++++++++++++++-- lua/custom/plugins/neotree.lua | 28 ++++---- lua/kickstart/plugins/neo-tree.lua | 11 +--- 4 files changed, 120 insertions(+), 40 deletions(-) diff --git a/init.lua b/init.lua index 3c2dc059ef2..3d6a8cba971 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.o` @@ -314,7 +314,7 @@ require('lazy').setup({ -- Then, because we use the `opts` key (recommended), the configuration runs -- after the plugin has been loaded as `require(MODULE).setup(opts)`. - { -- Useful plugin to show you pending keybinds. + { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' opts = { @@ -395,7 +395,7 @@ require('lazy').setup({ { 'nvim-telescope/telescope-ui-select.nvim' }, -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -503,7 +503,7 @@ require('lazy').setup({ 'WhoIsSethDaniel/mason-tool-installer.nvim', -- Useful status updates for LSP. - { 'j-hui/fidget.nvim', opts = {} }, + { 'j-hui/fidget.nvim', opts = {} }, -- Allows extra capabilities provided by blink.cmp 'saghen/blink.cmp', @@ -689,7 +689,7 @@ require('lazy').setup({ local servers = { -- clangd = {}, -- gopls = {}, - -- pyright = {}, + pyright = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- @@ -851,9 +851,9 @@ require('lazy').setup({ -- : Toggle signature help -- -- See :h blink-cmp-config-keymap for defining your own keymap - preset = 'default', + preset = 'enter', - -- [''] = { 'select_and_accept' }, + [''] = { 'accept', 'fallback' }, -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps @@ -994,9 +994,9 @@ require('lazy').setup({ -- require 'kickstart.plugins.debug', -- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index de86a12f59b..143f6330ab0 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -3,6 +3,64 @@ -- -- See the kickstart.nvim README for more information return { + { + "jellydn/hurl.nvim", + dependencies = { + "MunifTanjim/nui.nvim", + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + -- Optional, for markdown rendering with render-markdown.nvim + { + 'MeanderingProgrammer/render-markdown.nvim', + opts = { + file_types = { "markdown" }, + }, + ft = { "markdown" }, + }, + }, + ft = "hurl", + opts = { + -- Show debugging info + debug = false, + -- Show notification on run + show_notification = false, + -- Show response in popup or split + mode = "split", + -- Default formatter + formatters = { + json = { 'jq' }, -- Make sure you have install jq in your system, e.g: brew install jq + html = { + 'prettier', -- Make sure you have install prettier in your system, e.g: npm install -g prettier + '--parser', + 'html', + }, + xml = { + 'tidy', -- Make sure you have installed tidy in your system, e.g: brew install tidy-html5 + '-xml', + '-i', + '-q', + }, + }, + -- Default mappings for the response popup or split views + mappings = { + close = 'q', -- Close the response popup or split view + next_panel = '', -- Move to the next response popup window + prev_panel = '', -- Move to the previous response popup window + }, + }, + keys = { + -- Run API request + { "A", "HurlRunner", desc = "Run All requests" }, + { "a", "HurlRunnerAt", desc = "Run Api request" }, + { "te", "HurlRunnerToEntry", desc = "Run Api request to entry" }, + { "tE", "HurlRunnerToEnd", desc = "Run Api request from current entry to end" }, + { "tm", "HurlToggleMode", desc = "Hurl Toggle Mode" }, + { "tv", "HurlVerbose", desc = "Run Api in verbose mode" }, + { "tV", "HurlVeryVerbose", desc = "Run Api in very verbose mode" }, + -- Run Hurl request in visual mode + { "h", ":HurlRunner", desc = "Hurl Runner", mode = "v" }, + }, + }, { 'AndrewRadev/tagalong.vim', }, @@ -39,14 +97,45 @@ return { conform.setup({ formatters_by_ft = { lua = { 'stylelua' }, - typescript = { 'prettierd', 'prettier', 'biome' }, - typescriptreact = { 'prettierd', 'prettier', 'biome' }, - javascript = { 'prettierd', 'prettier', 'biome' }, - javascriptreact = { 'prettierd', 'prettier', 'biome' }, + python = { 'black', 'flake8' }, + typescript = { 'biome', 'prettier' }, + typescriptreact = { 'biome', 'prettier' }, + javascript = { 'biome', 'prettier' }, + javascriptreact = { 'biome', 'prettier' }, + json = { 'biome', 'prettier' }, + yaml = { 'prettier' }, + markdown = { 'prettier' }, + css = { 'biome', 'prettier' }, + scss = { 'prettier' }, + html = { 'prettier' }, + }, + formatters = { + prettier = { + -- Use the project's prettier config by looking for it in parent directories + cwd = require('conform.util').root_file({ + 'package.json', + '.prettierrc', + '.prettierrc.json', + '.prettierrc.js', + '.prettierrc.mjs', + 'prettier.config.js', + 'prettier.config.mjs', + }), + require_cwd = true, + }, + biome = { + -- Use the project's biome config by looking for it in parent directories + cwd = require('conform.util').root_file({ + 'biome.json', + 'biome.jsonc', + 'package.json', + }), + require_cwd = true, + }, }, format_on_save = { lsp_fallback = true, - timeout_ms = 500, + timeout_ms = 1500, } }) @@ -54,7 +143,7 @@ return { conform.format({ lsp_fallback = true, async = false, - timeout_ms = 500, + timeout_ms = 1000, }) end, { desc = 'Format file or range (in visual mode)' }) end, diff --git a/lua/custom/plugins/neotree.lua b/lua/custom/plugins/neotree.lua index bbb35a60c37..7c6a6a7371d 100644 --- a/lua/custom/plugins/neotree.lua +++ b/lua/custom/plugins/neotree.lua @@ -1,16 +1,16 @@ return { - { - 'nvim-neo-tree/neo-tree.nvim', - branch = 'v3.x', - dependencies = { - 'nvim-lua/plenary.nvim', - 'MunifTanjim/nui.nvim', - 'nvim-tree/nvim-web-devicons', -- optional, but recommended - }, - lazy = false, -- neo-tree will lazily load itself - keys = { - { 'e', ':Neotree toggle', desc = 'Toggle NeoTree', silent = true }, - { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, - }, - }, + -- { + -- 'nvim-neo-tree/neo-tree.nvim', + -- branch = 'v3.x', + -- dependencies = { + -- 'nvim-lua/plenary.nvim', + -- 'MunifTanjim/nui.nvim', + -- 'nvim-tree/nvim-web-devicons', -- optional, but recommended + -- }, + -- lazy = false, -- neo-tree will lazily load itself + -- keys = { + -- { 'e', ':Neotree toggle', desc = 'Toggle NeoTree', silent = true }, + -- { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, + -- }, + -- }, } diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index c7067891df0..2b9050eef4f 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -11,15 +11,6 @@ return { }, lazy = false, keys = { - { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, - }, - opts = { - filesystem = { - window = { - mappings = { - ['\\'] = 'close_window', - }, - }, - }, + { 'e', ':Neotree toggle', desc = 'Toggle Neotree', silent = true }, }, } From 416623b504803741fdf585e2136c1e8f5c418d32 Mon Sep 17 00:00:00 2001 From: zapagenrevdale Date: Thu, 28 Aug 2025 12:55:07 +0800 Subject: [PATCH 4/4] feat: add diffview --- lua/custom/plugins/init.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 143f6330ab0..19b404f2e41 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -3,6 +3,16 @@ -- -- See the kickstart.nvim README for more information return { + { "sindrets/diffview.nvim" }, + { + "rachartier/tiny-inline-diagnostic.nvim", + event = "VeryLazy", + priority = 1000, + config = function() + require('tiny-inline-diagnostic').setup() + vim.diagnostic.config({ virtual_text = false }) -- Disable default virtual text + end + }, { "jellydn/hurl.nvim", dependencies = {