From ce5fe028bc6d987386e6aa41994d497d20d31481 Mon Sep 17 00:00:00 2001 From: brianhuster Date: Wed, 9 Oct 2024 16:44:20 +0700 Subject: [PATCH 1/2] update --- README.md | 22 ++++++++++++++++++++-- README.vi.md | 22 ++++++++++++++++++++-- plugin/livepreview.lua | 2 +- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 38db1d8..94d5e39 100644 --- a/README.md +++ b/README.md @@ -37,12 +37,30 @@ require("lazy").setup({ }) ``` +### mini.deps +```lua +add({ + source = 'brianhuster/live-preview.nvim', + depends = { 'brianhuster/autosave.nvim' }, -- Not required, but recomended for autosaving +}) +require('livepreview').setup() +``` + +### vim-plug +```vim +Plug 'brianhuster/live-preview.nvim' +Plug 'brianhuster/autosave.nvim' " Not required, but recomended for autosaving +lua EOF +require('livepreview').setup() +EOF +``` + ## Setup -You can customize the plugin by passing a table to the opts variable. Here is an example of how to customize the plugin +You can customize the plugin by passing a table to the `opts` variable or the function `require('livepreview').setup()`. Here is an example of how to customize the plugin: ```lua -opts = { +{ commands = { start = 'LivePreview', -- Command to start the live preview server and open the default browser. Default is 'LivePreview' stop = 'StopPreview', -- Command to stop the live preview. Default is 'StopPreview' diff --git a/README.vi.md b/README.vi.md index 88ff2ad..ec6d288 100644 --- a/README.vi.md +++ b/README.vi.md @@ -37,12 +37,30 @@ require("lazy").setup({ }) ``` +### mini.deps +```lua +add({ + source = 'brianhuster/live-preview.nvim', + depends = { 'brianhuster/autosave.nvim' }, -- Not required, but recomended for autosaving +}) +require('livepreview').setup() +``` + +### vim-plug +```vim +Plug 'brianhuster/live-preview.nvim' +Plug 'brianhuster/autosave.nvim' " Not required, but recomended for autosaving +lua EOF +require('livepreview').setup() +EOF +``` + ## Thiết lập -Bạn có thể tùy chỉnh plugin. Dưới đây là cấu hình mặc định +Bạn có thể tùy chỉnh plugin bằng cách đưa 1 bảng vào biến `opts` hoặc hàm `require('livepreview`).setup()`. Dưới đây là cấu hình mặc định ```lua -opts = { +{ commands = { start = 'LivePreview', -- Lệnh khởi động máy chủ live-preview. stop = 'StopPreview', -- Lệnh để dừng máy chủ live-preview. diff --git a/plugin/livepreview.lua b/plugin/livepreview.lua index 9b4e4ff..6c19656 100644 --- a/plugin/livepreview.lua +++ b/plugin/livepreview.lua @@ -10,6 +10,6 @@ end vim.filetype.add({ pattern = { - [".*/livepreview%.nvim/doc/.+%.txt"] = "help" + [".*/live-preview%.nvim/doc/.+%.txt"] = "help" }, }) From 0fe53e4cb23db01adc609e9b56e3dbd089feb518 Mon Sep 17 00:00:00 2001 From: brianhuster Date: Wed, 9 Oct 2024 16:44:42 +0700 Subject: [PATCH 2/2] update --- plugin/livepreview.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/livepreview.lua b/plugin/livepreview.lua index 6c19656..5b6afba 100644 --- a/plugin/livepreview.lua +++ b/plugin/livepreview.lua @@ -10,6 +10,6 @@ end vim.filetype.add({ pattern = { - [".*/live-preview%.nvim/doc/.+%.txt"] = "help" + [".*/live%-preview%.nvim/doc/.+%.txt"] = "help" }, })