Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[editing] Integrate evil-vimish-fold via dotspacemacs-folding-method #14047

Merged
merged 1 commit into from
Oct 15, 2020

Conversation

Kazark
Copy link
Contributor

@Kazark Kazark commented Oct 14, 2020

Not confident that I have plugged this in everywhere that I should have. However
I tested locally and it seems to be working. Feedback coveted.

Not confident that I have plugged this in everywhere that I should have. However
I tested locally and it seems to be working.
Copy link
Collaborator

@smile13241324 smile13241324 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far, I think you have found all the places to change.

@smile13241324 smile13241324 merged commit f4a050b into syl20bnr:develop Oct 15, 2020
@smile13241324
Copy link
Collaborator

Thank you for contributing to spacemacs 💜, I have cherry picked your commit into develop.

@Kazark Kazark deleted the evil-vimish-fold branch October 15, 2020 21:42
@ECon87
Copy link

ECon87 commented Jul 5, 2021

New to emacs so probably an error on my part. I am on the develop branch but I can't seem to get this to work.

I am working on an R file; I enclose a snippet of code witin "# {{{" and "# }}}", however nothing gets folded after I press "z c".

In python only the line underneath gets folded (instead of the whole snippet of code).

Thanks.

@lebensterben
Copy link
Contributor

@ECon87 Can you post a minimum example R script so I can try to reproduce the bug?

@ECon87
Copy link

ECon87 commented Jul 5, 2021

@ECon87 Can you post a minimum example R script so I can try to reproduce the bug?

library(dplyr)

# ==================
# Directory Paths
# ==================

# {{{

Root0Dir <- "some/path/"
TabFigDir <- paste0(Root0Dir, "Tables_Figures/")
RootDir <- paste0(Root0Dir,"Empirical/")
DataDir <- paste0(RootDir, "Data/")


# }}}

The above snippet should it. When I press "z c" while it folds the area above "# {{{", and not below. If I remove the comment, then "zc" does not fold anything.

Thanks for the response.

@lebensterben
Copy link
Contributor

I can confirm this.
But I'm not sure this is bug.
Neither can Vim fold it.

Do you know any particular editor that folds them?

@ECon87
Copy link

ECon87 commented Jul 6, 2021

I can fold it in Vim. But just to make sure we are talking about identical items.

I have the following code in my vimrc

autocmd BufNewFile,BufRead *.r,*.R :set foldmethod=marker

Then, when I press "z R" (or z o, or z r or z a and so). The fold works as expected.

@lebensterben
Copy link
Contributor

@ECon87

https://github.com/alexmurray/evil-vimish-fold

This may work. In particular it folds {{{ }}}.

@ECon87
Copy link

ECon87 commented Jul 6, 2021

I might be wrong, but isn't this already working underneath the spacemacs fold functions?

@Kazark
Copy link
Contributor Author

Kazark commented Jul 6, 2021

@ECon87

  1. What is dotspacemacs-folding-method set to in your .spacemacs?
  2. Do you have this problem in other major modes?

@ECon87
Copy link

ECon87 commented Jul 6, 2021

Hey @Kazark,

  1. It's set to 'evil

  2. In Python too. I am only using R and Python to be honest, and i am new to emacs.

@Kazark
Copy link
Contributor Author

Kazark commented Jul 6, 2021

@ECon87 this will definitely not work with it set to 'evil. This is a bit confusing, but there is no folding package for Emacs that provides the full Vim functionality out of the box, so what this PR did was it gave the 'vimish option, which uses the package that @lebensterben linked to. Trying setting dotspacemacs-folding-method 'vimish and reloading your configuration (SPC f e R; you may also need to restart Spacemacs, not sure; SPC q r), then let us know if it's still not working.

@ECon87
Copy link

ECon87 commented Jul 6, 2021

@Kazark that worked like a charm. Thank you.

I checked the merged code above, and just noticed that the possible values for the dotspacemacs-folding-method are evil, origami, and vimish. My .spacemacs only listed evil and origami as possible values.

For anyone else on spacemacs develop branch, you might need to update via cd .emacs.d; pull --rebase.

@Kazark
Copy link
Contributor Author

Kazark commented Jul 6, 2021

@ECon87 you may need to learn about SPC f e D (diff your .spacemacs with the newest version).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants