mirror of
https://github.com/ilyakooo0/nvim-autopairs.git
synced 2024-09-11 07:15:44 +03:00
chore: generated vimdoc
This commit is contained in:
parent
8d5e46cd27
commit
fba2503bd8
@ -8,7 +8,7 @@ Table of Contents *nvim-autopairs-table-of-contents*
|
||||
|
||||
NVIM-AUTOPAIRS *nvim-autopairs-nvim-autopairs*
|
||||
|
||||
A super powerful autopair for Neovim. It supports multiple characters.
|
||||
A super powerful autopair plugin for Neovim that supports multiple characters.
|
||||
|
||||
Requires neovim 0.5+
|
||||
|
||||
@ -30,7 +30,7 @@ DEFAULT VALUES *nvim-autopairs-default-values*
|
||||
local enable_check_bracket_line = true --- check bracket in same line
|
||||
local check_ts = false
|
||||
local map_bs = true -- map the <BS> key
|
||||
local map_c_w = false -- map <c-w> to delete an pair if possible
|
||||
local map_c_w = false -- map <c-w> to delete a pair if possible
|
||||
<
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ nvim-cmp ~
|
||||
<h3>
|
||||
|
||||
You need to add mapping `CR` on nvim-cmp setup.
|
||||
check readme.md on nvim-cmp repo.
|
||||
Check readme.md on nvim-cmp repo.
|
||||
|
||||
</h3>
|
||||
|
||||
@ -131,12 +131,13 @@ Mapping `<CR>` another completion plugin
|
||||
<https://github.com/windwp/nvim-autopairs/wiki/Completion-plugin>
|
||||
|
||||
|
||||
If you have a problem with indent after press `<CR>` Please check setting of
|
||||
treesitter indent or install plugin support indent on your filetype
|
||||
If you have a problem with indent after you press `<CR>` please check the
|
||||
settings of treesitter indent or install a plugin that has indent support for
|
||||
your filetype.
|
||||
|
||||
RULE ~
|
||||
|
||||
nvim-autopairs use rule with condition to check pair.
|
||||
nvim-autopairs uses rules with conditions to check pairs.
|
||||
|
||||
>
|
||||
local Rule = require('nvim-autopairs.rule')
|
||||
@ -144,7 +145,7 @@ nvim-autopairs use rule with condition to check pair.
|
||||
|
||||
npairs.add_rule(Rule("$$","$$","tex"))
|
||||
|
||||
-- you can use some built-in condition
|
||||
-- you can use some built-in conditions
|
||||
|
||||
local cond = require('nvim-autopairs.conds')
|
||||
print(vim.inspect(cond))
|
||||
@ -159,10 +160,10 @@ nvim-autopairs use rule with condition to check pair.
|
||||
:with_move(cond.none())
|
||||
-- don't delete if the next character is xx
|
||||
:with_del(cond.not_after_regex_check("xx"))
|
||||
-- disable add newline when press <cr>
|
||||
-- disable adding a newline when you press <cr>
|
||||
:with_cr(cond.none())
|
||||
},
|
||||
--it is not working on .vim but it working on another filetype
|
||||
-- disable for .vim files, but it work for another filetypes
|
||||
Rule("a","a","-vim")
|
||||
)
|
||||
|
||||
@ -179,7 +180,7 @@ nvim-autopairs use rule with condition to check pair.
|
||||
)
|
||||
|
||||
-- you can use regex
|
||||
-- press u1234 => u1234number
|
||||
-- press u1234 => u1234number
|
||||
npairs.add_rules({
|
||||
Rule("u%d%d%d%d$", "number", "lua")
|
||||
:use_regex(true)
|
||||
@ -187,7 +188,7 @@ nvim-autopairs use rule with condition to check pair.
|
||||
|
||||
|
||||
|
||||
-- press x1234 => x12341234
|
||||
-- press x1234 => x12341234
|
||||
npairs.add_rules({
|
||||
Rule("x%d%d%d%d$", "number", "lua")
|
||||
:use_regex(true)
|
||||
@ -199,7 +200,7 @@ nvim-autopairs use rule with condition to check pair.
|
||||
|
||||
|
||||
-- you can do anything with regex +special key
|
||||
-- example press tab will upper text
|
||||
-- example press tab to uppercase text:
|
||||
-- press b1234s<tab> => B1234S1234S
|
||||
|
||||
npairs.add_rules({
|
||||
@ -225,7 +226,7 @@ Rules API <https://github.com/windwp/nvim-autopairs/wiki/Rules-API>
|
||||
|
||||
TREESITTER ~
|
||||
|
||||
You can use treesitter to check for a pair
|
||||
You can use treesitter to check for a pair.
|
||||
|
||||
>
|
||||
local npairs = require("nvim-autopairs")
|
||||
@ -242,7 +243,7 @@ You can use treesitter to check for a pair
|
||||
local ts_conds = require('nvim-autopairs.ts-conds')
|
||||
|
||||
|
||||
-- press % => %% is only inside comment or string
|
||||
-- press % => %% only while inside a comment or string
|
||||
npairs.add_rules({
|
||||
Rule("%", "%", "lua")
|
||||
:with_pair(ts_conds.is_ts_node({'string','comment'})),
|
||||
@ -297,7 +298,7 @@ PLUGIN INTEGRATION ~
|
||||
require('nvim-autopairs').disable()
|
||||
require('nvim-autopairs').enable()
|
||||
require('nvim-autopairs').remove_rule('(') -- remove rule (
|
||||
require('nvim-autopairs').clear_rules() -- clear all rule
|
||||
require('nvim-autopairs').clear_rules() -- clear all rules
|
||||
require('nvim-autopairs').get_rule('"') -- get rule " then modify it
|
||||
<
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user