Comments (6)
The solution I use:
autocmd BufRead * autocmd BufWinEnter * ++once normal! zx
or the same but with new autocmd API:
vim.api.nvim_create_autocmd('BufRead', {
callback = function()
vim.api.nvim_create_autocmd('BufWinEnter', {
once = true,
command = 'normal! zx'
})
end
})
BufWinEnter
needed to take into account the modeline settings.
And why it not used alone but after BufRead
, because BufWinEnter
need to be executed only once for each buffer.
from simpylfold.
This appears to be a bug in Telescope: nvim-telescope/telescope.nvim#1277.
As a temporary workaround, maybe you could add an autocommand that updates folds after the file is loaded:
autocmd BufRead *.py normal zx
or perhaps
autocmd FileType python normal zx
I don't use nvim, nor am I familiar with Telescope, so it's not easy for me to test this myself, but something like that may help if you can't live with typing zx
manually.
from simpylfold.
Knowing that's an active bug with telescope is answer enough for me!
Thank you for finding the telescope issue that i apparently couldn't find,
and I'll try out your temporary solution asap.
from simpylfold.
autocmd BufRead *.py normal zx zR
works perfectly, opening the file with all folds open. Thanks again!
from simpylfold.
telescope.setup({
pickers = {
find_files = {
hidden = true,
attach_mappings = function(_)
action_set.select:enhance({
post = function()
vim.cmd(":normal! zx")
end,
})
return true
end,
},
},
...
from simpylfold.
@danielnehrig your solution, unfortunately, does not work.
from simpylfold.
Related Issues (20)
- Not clear how to use this plugin HOT 2
- Folds are invalid after running formatter with ale HOT 3
- Releases Support HOT 1
- More configuration HOT 2
- SimpylFold with large modules makes basic operations slow HOT 3
- Auto close fold include current line after delete line HOT 5
- Comment BLOCKS (in file licenses)
- Plugin ceases to work if a module is named after its parent directory HOT 1
- docstring folding not working with empty line HOT 2
- Support folding long block of code by indentation? HOT 4
- Plugin is not working on Ubuntu Vi IMproved 8.0 HOT 3
- Support for other languages? HOT 1
- is it possible to have only 1 line separating folds ? HOT 2
- the function/class names should have an higher contrast than the lines numbers HOT 3
- Possibility of defining custom folds? HOT 1
- Repository not found HOT 1
- Folding Code in Child Classes HOT 2
- SimpylFold won't indent top level functions HOT 4
- Can't turn off docstring folding HOT 5
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 simpylfold.