Skip to content

Commit

Permalink
doc(README): add jsregexp notice for Windows users
Browse files Browse the repository at this point in the history
  • Loading branch information
xudyang1 authored and L3MON4D3 committed Nov 11, 2024
1 parent ecdcfdb commit 6480eea
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .github/data/project-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,12 @@ there'd
truthy
varargs
vsnip
Unix
MinGW
CC's
usr
gcc
exe
Makefile's
MSYS
SHELLFLAGS
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Neovim >= 0.7 (extmarks)
`jsregexp` for `lsp-snippet-transformations` (see [here](https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md#transformations) for some tips on installing it).

# Setup
## Install
## Install
* With your preferred plugin manager i.e. [vim-plug](https://github.com/junegunn/vim-plug), [Packer](https://github.com/wbthomason/packer.nvim) or [lazy](https://github.com/folke/lazy.nvim)
**Packer**:
```lua
Expand Down Expand Up @@ -60,14 +60,27 @@ Neovim >= 0.7 (extmarks)
Releases will be tagged as `vMajor.Minor.Patch`, we recommend following the latest Major release.
Consider watching the repository's releases so you're notified when a new version becomes available.

> [!NOTE]
> On Windows, you need to use a shell that can run Unix commands (MinGW,MSYS2,etc).
> Luckily, Git offers a `sh.exe`, so you don't need to install a heavy MSYS2 environment.
> Other than Git, you also need a C compiler and `make` to install `jsregexp`.
> You may also need to change the build command: `make install_jsregexp CC=gcc.exe SHELL=C:/path/to/sh.exe .SHELLFLAGS=-c`:
```text
SHELL=C:/path/to/Git/usr/bin/sh.exe # if Git/MinGW/MSYS2 `sh.exe` is not in PATH
.SHELLFLAGS=-c # if Git/MinGW/MSYS2 `sh.exe` is not in PATH
CC=gcc.exe # if CC's default value cc is not set (when `which cc` fails to find the compiler command)
NEOVIM_BIN_PATH=C:/path/to/Neovim/bin # if the Makefile's fails to automatically detect the Neovim/bin path
```

## Keymaps
In Vim script, with `<Tab>` for jumping forward/expanding a snippet, `<Shift-Tab>` for
jumping backward, and `<Ctrl-E>` for changing the current choice when in a
`choiceNode`...
```vim
" press <Tab> to expand or jump in a snippet. These can also be mapped separately
" via <Plug>luasnip-expand-snippet and <Plug>luasnip-jump-next.
imap <silent><expr> <Tab> luasnip#expand_or_jumpable() ? '<Plug>luasnip-expand-or-jump' : '<Tab>'
imap <silent><expr> <Tab> luasnip#expand_or_jumpable() ? '<Plug>luasnip-expand-or-jump' : '<Tab>'
" -1 for jumping backwards.
inoremap <silent> <S-Tab> <cmd>lua require'luasnip'.jump(-1)<Cr>
Expand Down Expand Up @@ -177,7 +190,7 @@ Note: instead of immediately reading the official documentation, you may want to
- The [Wiki](https://github.com/L3MON4D3/LuaSnip/wiki) contains some useful LuaSnip extensions and some examples of advanced snippets and configs.
- Configuration is documented [in `DOC.md`](https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md#config-options) as well.

【中文版】DOC in Chinese is [here](https://zjp-cn.github.io/neovim0.6-blogs/nvim/luasnip/doc1.html).
【中文版】DOC in Chinese is [here](https://zjp-cn.github.io/neovim0.6-blogs/nvim/luasnip/doc1.html).

### Resources for new users
Here are some LuaSnip videos and tutorials on the Web:
Expand Down

0 comments on commit 6480eea

Please sign in to comment.