Skip to content

Commit

Permalink
Merge pull request #98 from brianhuster/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
brianhuster authored Oct 9, 2024
2 parents 522ea7c + 0fe53e4 commit 7a0bf2c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 5 deletions.
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
22 changes: 20 additions & 2 deletions README.vi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion plugin/livepreview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ end

vim.filetype.add({
pattern = {
[".*/livepreview%.nvim/doc/.+%.txt"] = "help"
[".*/live%-preview%.nvim/doc/.+%.txt"] = "help"
},
})

0 comments on commit 7a0bf2c

Please sign in to comment.