Moayad Mardini
Moayad Mardini

Reputation: 7341

Vim script not loaded?

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?

Upvotes: 3

Views: 451

Answers (1)

xaizek
xaizek

Reputation: 5252

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.

Upvotes: 5

Related Questions