an ordinary senior high school student who loves programming.🌟
xxiaoa / ns-textobject.nvim Goto Github PK
View Code? Open in Web Editor NEWAwesome textobject plugin works with nvim-surround
License: GNU General Public License v3.0
Awesome textobject plugin works with nvim-surround
License: GNU General Public License v3.0
an ordinary senior high school student who loves programming.🌟
Enter insert mode although find nothing to change
I'm thinking something is wrong with the behavior in visual mode.
When editing the following text
end, { desc = "around the quote" })
-- current cursor position is | `"|around`
Execute the following commands in normal mode. viq
The execution result will look like this
end, { desc = ""inside the quote" })
My settings are as follows.
vim.keymap.set({ "x", "o" }, "aq", function()
nstextobject.create_textobj("q", "a")
end, { desc = "around the quote" })
vim.keymap.set({ "x", "o" }, "iq", function()
nstextobject.create_textobj("q", "i")
end, { desc = "inside the quote" })
Breaking commits will be flagged with a !
, e.g. refactor!: something
etc. Therefore, if you notice one of those commit messages when updating, refer to this issue.
Hi there, author of nvim-surround
here. It's very cool to see a project like this pop up as a result of nvim-surround
! I was browsing through the codebase, and had a few questions/suggestions:
get_nearest_selections
? If possible, I think it would make more sense to use that directly from nvim-surround
and just process the outputs of ita[char]
and i[char]
. See this issue for more detailsOverall this seems like a promising start; I also think that pulling out this functionality into a separate plugin makes quite a bit of sense. I'm excited to see where this ends up! If you ever have any questions about the codebase or just writing this plugin in general, feel free to tag me.
Hi,
The plugin looks really cool, great work! I would like to give it a try, but I haven't been able to get it working. Is this the right setup?
require('nvim-surround').setup()
require('ns-textobject').setup()
The plugin seems to load, but trying the example from the README ysiwl
only adds an l
around the word, as if I was only using nvim-surround
. Is this keymap something I need to manually configure?
Thanks.
I am trying to use this operator(https://github.com/gbprod/substitute.nvim) in combination with the text object iq
but it does not work.
I feel like the processing of substitute operator is stopped inside this function.
minimal configuration
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
local plugins = {
{"XXiaoA/ns-textobject.nvim", config=true},
{"kylechui/nvim-surround", config=true},
{"folke/which-key.nvim", config=true},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
It seems broken now. Do more test after going back
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.