Update generated neovim config
This commit is contained in:
@ -1,2 +1,2 @@
|
||||
github: ['windwp']
|
||||
custom: https://paypal.me/trieule1vn
|
||||
patreon: windwp
|
||||
|
||||
25
config/neovim/store/lazy-plugins/nvim-autopairs/.github/workflows/sponsors.yml
vendored
Normal file
25
config/neovim/store/lazy-plugins/nvim-autopairs/.github/workflows/sponsors.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
name: Generate Sponsors README
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: 0 0 1 */3 *
|
||||
permissions:
|
||||
contents: write
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout 🛎️
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Generate Sponsors 💖
|
||||
uses: JamesIves/github-sponsors-readme-action@v1
|
||||
with:
|
||||
token: ${{ secrets.PAT }}
|
||||
file: 'README.md'
|
||||
|
||||
- name: Deploy to GitHub Pages 🚀
|
||||
uses: JamesIves/github-pages-deploy-action@v4
|
||||
with:
|
||||
branch: master
|
||||
folder: '.'
|
||||
@ -16,7 +16,7 @@ Install the plugin with your preferred package manager:
|
||||
event = "InsertEnter",
|
||||
config = true
|
||||
-- use opts = {} for passing setup options
|
||||
-- this is equalent to setup({}) function
|
||||
-- this is equivalent to setup({}) function
|
||||
}
|
||||
```
|
||||
|
||||
@ -357,6 +357,7 @@ Before Input After
|
||||
``` lua
|
||||
require('nvim-autopairs').disable()
|
||||
require('nvim-autopairs').enable()
|
||||
require('nvim-autopairs').toggle()
|
||||
require('nvim-autopairs').remove_rule('(') -- remove rule (
|
||||
require('nvim-autopairs').clear_rules() -- clear all rules
|
||||
require('nvim-autopairs').get_rules('"')
|
||||
@ -419,4 +420,5 @@ npairs.setup({
|
||||
## Sponsors
|
||||
|
||||
Thanks to everyone who sponsors my projects and makes continued development maintenance possible!
|
||||
<!-- patreon --><a href="https://github.com/t4t5"><img src="https://github.com/t4t5.png" width="60px" alt="" /></a><!-- patreon-->
|
||||
|
||||
<!-- sponsors --><a href="https://github.com/looshch"><img src="https://github.com/looshch.png" width="60px" alt="george looshch" /></a><!-- sponsors -->
|
||||
|
||||
@ -56,11 +56,13 @@ M.setup = function(opt)
|
||||
M.force_attach()
|
||||
local group = api.nvim_create_augroup('autopairs_buf', { clear = true })
|
||||
api.nvim_create_autocmd({ 'BufEnter', 'BufWinEnter' }, {
|
||||
group = group, pattern = '*',
|
||||
group = group,
|
||||
pattern = '*',
|
||||
callback = function() M.on_attach() end
|
||||
})
|
||||
api.nvim_create_autocmd('BufDelete', {
|
||||
group = group, pattern = '*',
|
||||
group = group,
|
||||
pattern = '*',
|
||||
callback = function(data)
|
||||
local cur = api.nvim_get_current_buf()
|
||||
local bufnr = tonumber(data.buf) or 0
|
||||
@ -70,7 +72,8 @@ M.setup = function(opt)
|
||||
end,
|
||||
})
|
||||
api.nvim_create_autocmd('FileType', {
|
||||
group = group, pattern = '*',
|
||||
group = group,
|
||||
pattern = '*',
|
||||
callback = function() M.force_attach() end
|
||||
})
|
||||
end
|
||||
@ -140,6 +143,10 @@ M.enable = function()
|
||||
M.state.disabled = false
|
||||
end
|
||||
|
||||
M.toggle = function()
|
||||
M.state.disabled = not M.state.disabled
|
||||
end
|
||||
|
||||
--- force remap key to buffer
|
||||
M.force_attach = function(bufnr)
|
||||
utils.set_attach(bufnr, 0)
|
||||
@ -205,6 +212,7 @@ M.set_buf_rule = function(rules, bufnr)
|
||||
M.state.rules[bufnr] = rules
|
||||
end
|
||||
|
||||
|
||||
M.on_attach = function(bufnr)
|
||||
-- log.debug('on_attach' .. vim.bo.filetype)
|
||||
if is_disable() then
|
||||
@ -643,7 +651,7 @@ M.check_break_line_char = function()
|
||||
return M.autopairs_cr()
|
||||
end
|
||||
|
||||
M.completion_confirm =function ()
|
||||
M.completion_confirm = function()
|
||||
if vim.fn.pumvisible() ~= 0 then
|
||||
return M.esc("<cr>")
|
||||
else
|
||||
@ -656,7 +664,7 @@ M.map_cr = function()
|
||||
'i',
|
||||
'<CR>',
|
||||
"v:lua.require'nvim-autopairs'.completion_confirm()",
|
||||
{ expr = true, noremap = true }
|
||||
{ expr = true, noremap = true }
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@ -51,7 +51,8 @@ M.filetypes = {
|
||||
purescript = false,
|
||||
sh = false,
|
||||
bash = false,
|
||||
nix = false
|
||||
nix = false,
|
||||
helm = false
|
||||
}
|
||||
|
||||
M.on_confirm_done = function(opts)
|
||||
|
||||
@ -189,6 +189,10 @@ M.highlight_wrap = function(tbl_pos, row, col, end_col, whitespace_line)
|
||||
if config.use_virt_lines then
|
||||
local virt_lines = {}
|
||||
local start = 0
|
||||
local left_col = vim.fn.winsaveview().leftcol
|
||||
if left_col > 0 then
|
||||
vim.fn.winrestview({ leftcol = 0 })
|
||||
end
|
||||
for _, pos in ipairs(tbl_pos) do
|
||||
virt_lines[#virt_lines + 1] = { whitespace_line:sub(start + 1, pos.pos - 1), 'Normal' }
|
||||
virt_lines[#virt_lines + 1] = { pos.key, config.highlight }
|
||||
|
||||
@ -13,7 +13,6 @@ local Cond = require('nvim-autopairs.conds')
|
||||
--- @field is_multibyte boolean
|
||||
--- @field is_endwise boolean only use on end_wise
|
||||
--- @field is_undo boolean add break undo sequence
|
||||
|
||||
local Rule = setmetatable({}, {
|
||||
__call = function(self, ...)
|
||||
return self.new(...)
|
||||
@ -172,7 +171,11 @@ end
|
||||
---@return Rule
|
||||
function Rule:with_pair(cond, pos)
|
||||
if self.pair_cond == nil then self.pair_cond = {} end
|
||||
self.pair_cond[pos or (#self.pair_cond + 1)] = cond
|
||||
if pos then
|
||||
table.insert(self.pair_cond, pos, cond)
|
||||
else
|
||||
table.insert(self.pair_cond, cond)
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ local utils = require('nvim-autopairs.utils')
|
||||
local function quote_creator(opt)
|
||||
local quote = function(...)
|
||||
local move_func = opt.enable_moveright and cond.move_right or cond.none
|
||||
---@type Rule
|
||||
local rule = Rule(...)
|
||||
:with_move(move_func())
|
||||
:with_pair(cond.not_add_quote_inside_quote())
|
||||
|
||||
Reference in New Issue
Block a user