diff --git a/README.md b/README.md index 7abc3d6..5981642 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ https://github.com/user-attachments/assets/865112c1-8514-4920-a531-b2204194f749 ## Installation +You can install this plugin using a plugin manager. Most plugin managers are supported. Below are some examples + ### Using lazy.nvim (recommended) ```lua @@ -57,6 +59,20 @@ let g:livepreview_config = {} " Optional configuration lua require('livepreview').setup(vim.g.livepreview_config) ``` +### Native package (without a plugin manager) + +#### Linux, MacOS, Unix-based + +```sh +git clone https://github.com/brianhuster/live-preview.nvim ~/.config/nvim/pack/brianhuster/start/live-preview.nvim +``` + +#### Windows (Powershell) + +```powershell +git clone https://github.com/brianhuster/live-preview.nvim "$HOME/AppData/Local/nvim/pack/brianhuster/start/live-preview.nvim" +``` + ## Setup You can customize the plugin by passing a table to the `opts` variable or the function `require('livepreview').setup()`. Here is the default configuration: diff --git a/README.vi.md b/README.vi.md index 2cf93f3..21349a1 100644 --- a/README.vi.md +++ b/README.vi.md @@ -55,6 +55,20 @@ Plug 'brianhuster/autosave.nvim' " Not required, but recomended for autosaving let g:livepreview_config = {} " Cấu hình tùy chọn lua require('livepreview').setup(vim.g.livepreview_config) ``` +### Cài đặt thủ công (không dùng trình quản lý plugin) + +#### Linux, MacOS, Unix-based + +```sh +git clone https://github.com/brianhuster/live-preview.nvim ~/.config/nvim/pack/brianhuster/start/live-preview.nvim +``` + +#### Windows (Powershell) + +```powershell +git clone https://github.com/brianhuster/live-preview.nvim "$HOME/AppData/Local/nvim/pack/brianhuster/start/live-preview.nvim" +``` + ## Thiết lập diff --git a/plugin/livepreview.lua b/plugin/livepreview.lua index bc40ef3..a193bcf 100644 --- a/plugin/livepreview.lua +++ b/plugin/livepreview.lua @@ -14,3 +14,9 @@ vim.filetype.add({ [".*/live%-preview%.nvim/doc/.+%.txt"] = "help" }, }) + +local plugin_path = require('livepreview.utils').get_plugin_path() +if plugin_path and plugin_path:match("/nvim/pack") then + require('livepreview').setup() +end +