Comments (19)
Has anyone got this to work? I've always used vim-surround in vim and badly miss it. I'm trying out lunarvim but there's no way to get it to work properly.
I tried out your suggestion @rosborn . Didn't have any effect. (I'm trying to do cs"'
)
@ChristianChiarulli not sure if this is high on your todolist but would appreciate any pointers that helps me understand the underlying issue so I can maybe debug it myself.
Also tried a number of suggestions from here: #1525 to no avail.
from lunarvim.
Thanks @pviniciusfm. I changed the timeoutlen to 1000 and it works perfectly fine.
from lunarvim.
@fairulazmin In my case, it was caused by this property https://github.com/ChristianChiarulli/nvim/blob/master/general/settings.vim#L35 after I increased it everything worked fine.
from lunarvim.
@martisj specifying the keys
attribute makes it so vim-surround does not start when neovim starts. Instead, it will be lazy loaded until certain keys are pressed. I've found it to be more reliable to not lazy load vim-surround.
{ "tpope/vim-surround" },
This is my complete config if you're curious. https://github.com/rebuilt/lvim/blob/master/lua/user/plugins.lua
I've updated the docs to remove the lazy loading statement.
from lunarvim.
I don't think I have vim surround working right now. I'll leave this open until I fix it.
from lunarvim.
@fairulazmin Yes, it works, but space leader key
cause too much time to respond.
I have tried many times(binary search), and I decide to change it to 285, which is suit for my speed...
from lunarvim.
Do I need to include all the keys that vim-surround
supports for this to work?
I have
{
"tpope/vim-surround",
keys = { 'd', 'c', 'y' },
},
and set timeoutlen?
is set to 2000
.
However ysiw"
does not work in normal mode. I expect it to surround the current inner word with "
.
from lunarvim.
Me too have this issue. Is it because I using WSL2?
from lunarvim.
tracking solution to issue here: liuchengxu/vim-which-key#158
from lunarvim.
Closing because of inactivity.
from lunarvim.
Encountered this same problem. The fix that worked for me was setting keys
properly when loading the plugin. For some reason this page suggests the wrong mapping for keys
. Here is the correct mapping which should give you the behavior you are looking for.
keys = {
{ 'n', 'ds' },
{ 'n', 'cs' },
{ 'n', 'cS' },
{ 'n', 'ys' },
{ 'n', 'yS' },
{ 'n', 'yss' },
{ 'n', 'ySs' },
{ 'n', 'ySS' },
{ 'x', 'S' },
{ 'x', 'gS' },
{ 'i', '<C-S>' },
{ 'i', '<C-G>s' },
{ 'i', '<C-G>S' }
}
from lunarvim.
It worked for me for some time with @rosborn suggestion, but now it's not working again. It's a shame because everything else works so well.
from lunarvim.
Earlier versions of Lunarvim had timeoutlen set very low. This made it impossible to type out all the vim-surround keybinds within the specified time. I'm not sure which version of Lunarvim you're using but check your timeoutlen with:
set timeoutlen?
The default is 1000 which gives you 1 second to type everything out.
You can set the timeoutlen with:
vim.opt.timeoutlen = 1000
from lunarvim.
I have already set it to that unfortunately, and no luck
from lunarvim.
That does work for me (occasionally). I'll play with it some more.
from lunarvim.
(I set it to 2000)
from lunarvim.
I was getting the same issue and after setting timeoutlen = 300, everything is working now even netrw.
from lunarvim.
Can someone share their working lvim config? I simply can't get vim-surround
to work.
from lunarvim.
@martisj specifying the
keys
attribute makes it so vim-surround does not start when neovim starts. Instead, it will be lazy loaded until certain keys are pressed. I've found it to be more reliable to not lazy load vim-surround.{ "tpope/vim-surround" },
This is my complete config if you're curious. rebuilt/lvim@
master
/lua/user/plugins.luaI've updated the docs to remove the lazy loading statement.
Thank you so much for sharing! Turns out, removing keys was all that was needed. The plugin was not installed with keys
in my config 🤔 No wonder it didn't work 😅
from lunarvim.
Related Issues (20)
- Prompt delay HOT 2
- line moving when enteringnormal mode HOT 5
- LunarVim as MANPAGER - HOT 1
- Telescope theme / layouts are broken HOT 2
- lsp.log grows insanely HOT 4
- - ERROR c(locals): ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 1032 for language c HOT 1
- Dead project? HOT 3
- Lazygit bottom toolbar / helper visibility
- Unable to guarantee data integrity while updating. Please run :LvimUpdate manually instead. HOT 2
- Find File searching my entire home directory, including zsh terminal sessions HOT 1
- Feature request HOT 3
- Icons are Broken HOT 3
- Lunarvim Problems with LSP in general in ubuntu 22.04 docker HOT 1
- Using LunarVim as git editor on Windows HOT 1
- Telescope's Ctrl + / on open panel throwing error "Invalid 'event': 'User TelescopeKeymap'" HOT 4
- Crystalline (Crystal LSP) isn't doing anything HOT 3
- Go to definition (gd) on a C# project throws an error. HOT 5
- Fresh LunarVim install has tree-sitter errors HOT 3
- nvim tree fails to remove files from explorer when deleting HOT 4
- Nightly version does not show styled text(in help) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lunarvim.