Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim script not loaded?

Tags:

vim

When I work with some Python files, and run :set filetype? in Vim, I get filetype=python, so the file is recognized correctly as Python code.

I've downloaded this plugin: http://www.vim.org/scripts/script.php?script_id=1494 and put it in ftplugin folder, but its f/F keys bindings are not working, and running its :call ReFold() gives E117: Unknown Function indicating that the plugin hasn't been loaded.

Any troubleshooting tips on how to load the plugin?

like image 280
Moayad Mardini Avatar asked Sep 02 '26 08:09

Moayad Mardini


1 Answers

Try removing this part at the top of the script:

if exists("b:did_ftplugin")
    finish
endif
let b:did_ftplugin = 1

And possibly moving the script to after/ftplugin directory (:help after-directory).

I think you have another python specific plugin that comes first at 'runtimepath' and defines b:did_ftplugin, which is OK, but this python script (python_editing.vim) shouldn't check for and define b:did_ftplugin since it doesn't implement the functionality of original plugin, it just extends it.

So the script is loaded, but does nothing. By running :script command without arguments one can check if some script is loaded at all.

like image 61
xaizek Avatar answered Sep 03 '26 22:09

xaizek