Giter Club home page Giter Club logo

Comments (3)

tmhedberg avatar tmhedberg commented on July 20, 2024

Without having an Ubuntu machine on hand, it's difficult to know what to suggest.

foldexpr is set in the ftplugin scripts, which depend on Vim detecting your file type as python or cython. If your configuration on Ubuntu results in a different detected filetype, then it won't be set properly.

Try running :scriptnames after opening a Python file and see whether SimpylFold scripts appear in the list.

If foldexpr is being set correctly by SimpylFold but then is later overridden with a 0 by some other script, then :verbose set foldexpr? should reveal the location where it was last set.

Finally, maybe it's obvious, but your Vim has to be compiled with folding support for folding to work at all. Check the output of :version for +folding to see if the feature is enabled.

from simpylfold.

tbrandysky avatar tbrandysky commented on July 20, 2024

Thank you for the hints.

:set filetype? returns:
filetype=python

:scriptnames returns:
1: /usr/share/vim/vimrc
2: /usr/share/vim/vim81/debian.vim
3: /usr/share/vim/vim81/syntax/syntax.vim
4: /usr/share/vim/vim81/syntax/synload.vim
5: /usr/share/vim/vim81/syntax/syncolor.vim
6: /usr/share/vim/vim81/filetype.vim
7: ~/.vim/vimrc
8: /usr/share/vim/vim81/syntax/nosyntax.vim
9: /usr/share/vim/vim81/plugin/getscriptPlugin.vim
10: /usr/share/vim/vim81/plugin/gzip.vim
11: /usr/share/vim/vim81/plugin/logiPat.vim
12: /usr/share/vim/vim81/plugin/manpager.vim
13: /usr/share/vim/vim81/plugin/matchparen.vim
14: /usr/share/vim/vim81/plugin/netrwPlugin.vim
15: /usr/share/vim/vim81/plugin/rrhelper.vim
16: /usr/share/vim/vim81/plugin/spellfile.vim
17: /usr/share/vim/vim81/plugin/tarPlugin.vim
18: /usr/share/vim/vim81/plugin/tohtml.vim
19: /usr/share/vim/vim81/plugin/vimballPlugin.vim
20: /usr/share/vim/vim81/plugin/zipPlugin.vim
21: ~/.vim/pack/plugins/start/SimpylFold/plugin/SimpylFold.vim
22: /usr/share/vim/vim81/syntax/python.vim

SimpylFold is loaded on line 21

:verbose set foldexpr? returns:
foldexpr=0

My vim supports folding

But Simpylfold is still not working. Once I try to fold I get this error:
E490: No fold found

:version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Sep 20 2021 11:42:42)
Included patches: 1-2269
Modified by [email protected]
Compiled by [email protected]
Huge version without GUI. Features included (+) or not (-):
+acl +cindent +cursorshape +file_in_path +jumplist +mksession +mouse_xterm +printer +sound +terminal +virtualedit -xim
+arabic -clientserver +dialog_con +find_in_path +keymap +modify_fname +multi_byte +profile +spell +terminfo +visual -xpm
+autocmd -clipboard +diff +float +lambda +mouse +multi_lang -python +startuptime +termresponse +visualextra -xsmp
+autochdir +cmdline_compl +digraphs +folding +langmap -mouseshape -mzscheme +python3 +statusline +textobjects +viminfo -xterm_clipboard
-autoservername +cmdline_hist -dnd -footer +libcall +mouse_dec +netbeans_intg +quickfix -sun_workshop +textprop +vreplace -xterm_save
-balloon_eval +cmdline_info -ebcdic +fork() +linebreak +mouse_gpm +num64 +reltime +syntax +timers +wildignore
+balloon_eval_term +comments +emacs_tags +gettext +lispindent -mouse_jsbterm +packages +rightleft +tag_binary +title +wildmenu
-browse +conceal +eval -hangul_input +listcmds +mouse_netterm +path_extra -ruby -tag_old_static -toolbar +windows
++builtin_terms +cryptv +ex_extra +iconv +localmap +mouse_sgr -perl +scrollbind -tag_any_white +user_commands +writebackup
+byte_offset +cscope +extra_search +insert_expand -lua -mouse_sysmouse +persistent_undo +signs -tcl +vartabs -X11
+channel +cursorbind -farsi +job +menu +mouse_urxvt +postscript +smartindent +termguicolors +vertsplit -xfontset

from simpylfold.

tmhedberg avatar tmhedberg commented on July 20, 2024

Your Vim doesn't seem to be loading the ftplugin script (ftplugin/python/SimpylFold.vim), which is what sets foldexpr to the correct value for SimpylFold. You may have turned ftplugins off, or maybe the default configuration on Ubuntu is doing so. Try :filetype plugin on (or put that in your .vimrc) and then load/reload a Python buffer.

from simpylfold.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.