Skip to content

Commit

Permalink
Merge pull request #107 from brianhuster/dev
Browse files Browse the repository at this point in the history
Add support for Neovim native package
  • Loading branch information
brianhuster authored Oct 10, 2024
2 parents 17c09dc + e84e0e9 commit 3bb5fce
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
14 changes: 14 additions & 0 deletions README.vi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions plugin/livepreview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3bb5fce

Please sign in to comment.