Questions tagged [ftplugin]

ftplugin is the Vim editor's mechanism for running a set of commands based on the filetype of the file being edited (for instance, html, C, javascript, etc).

A file type plugin (ftplugin) is a script that is run automatically when Vim detects the type of file when the file is created or opened. The type can be detected from the file name (for example, file sample.c has file type c), or from the file contents.

Source: Vim The Editor: File type plugins

33 questions
1
vote
2 answers

Vim - ftplugin settings changes not updating for existing file

It seems like there's some odd caching-like behavior going on for files that I have already opened once in Vim. I have a file foo.txt that I opened, and then I change some of the settings in ~/.vim/after/ftplugin/text.vim, but those new settings do…
Kvass
  • 8,294
  • 12
  • 65
  • 108
1
vote
2 answers

Why does vim default markdown ftplugin source html ftplugins? Is there any ways to avoid it?

all is in the title... I did a ftplugin to live preview an html file (php and css also) with a browser, but now, when I open a markdown file, the browser opens too... I saw why: there is this line in the default ftplugin/markdown.vim: runtime!…
hl037_
  • 3,520
  • 1
  • 27
  • 58
1
vote
1 answer

MacVim not loading ftplugins

I've been wrestling with macvim for the past few days using an ftplugin. I can't seem to solve my issue, despite numerous attempts. MacVim is installed on my computer (via Homebrew) and is using the proper python. bash-3.2# mvim --version …
cooper
  • 315
  • 1
  • 16
1
vote
1 answer

How do I avoid cumulative filetype commands in vim?

Let's say I load up a python file in vim. A quick check of :scriptnames shows that my ~/.vim/ftplugin/python/python.vim file loads as expected. One of the commands in this file highlights all characters that are past the 80th column. Now lets say I…
kamek
  • 2,390
  • 2
  • 19
  • 15
1
vote
1 answer

Vim 7.3 on Ubuntu 12.10 doesn't have 'ftplugin' directory anywhere

Vim 7.3 on Ubuntu 12.10 I recently installed vim from the Ubuntu software center. So far, I've installed the following vim plugins: NERDTree, rails and ack. I'm taking a course on python and another one on Ruby on Rails. I was surprised that vim…
Colin Keenan
  • 1,089
  • 12
  • 20
1
vote
1 answer

How can you load ftplugins from other filetypes in VIM?

I'm using Pathogen, and am using git clones of xmledit and sparkup as bundles. These two plugins are automatically enabled for HTML, but I want to enable them for other HTML-like filetypes, such as Handlebars. How can I automatically load ftplugins…
David
  • 23
  • 3
0
votes
2 answers

Which configuration does Vim finally apply after setting values in .vimrc, ftplugin, after/ftplugin etc.?

I am editing a python file. My current settings for tabstop are as follows(just experimenting things): ~/.vimrc: set tabstop=4 ~/.vim/ftplugin/python.vim: set tabstop=2 There is no ~/.vim/after/plugin/python.vim file set tabstop? shows…
Haris Muzaffar
  • 404
  • 6
  • 17
0
votes
0 answers

Vim filetype plugin executed twice when enter in insert mode?

I am editing a file of filetype=help and want to do something when entering in insert mode. So I put a new ftplugin in ~/.vim/ftplugin/help.vim: " ~/.vim/ftplugin/help.vim echom 'execute help ftplugin' augroup filetype_help autocmd! " or…
Run
  • 876
  • 6
  • 21
0
votes
1 answer

Why is the formatting in my ftplugin applying to all files in every format?

I'm created a custom file format, .cheat, for my cheat sheets, and in that format only I am highlighting alternating rows to make it easy to see which keystroke combo triggers each command. Why is the formatting in my ftplugin applying to all files…
steven_noble
  • 4,133
  • 10
  • 44
  • 77
0
votes
1 answer

vundle not working properly with ftplugin

I started to use the ftplugin. This is basically working, except for bundle. If I start gvim with a file that has no specific filetype I can use all my plugins (:VundleInstall lists all the plugins specified in the .vimrc) But when I open a file…
Natjo
  • 2,005
  • 29
  • 75
0
votes
1 answer

Vim: split specific filetype by default

When editing Git commits in Vim, I'd like to automatically split the window on open so that I can edit the commit message in the top pane while keeping the commit change list in the bottom panel. I have the ftplugin with a gitcommit.vim file for…
Inductiveload
  • 6,094
  • 4
  • 29
  • 55
0
votes
1 answer

looking for a vim windows .inf ftplugin file

the ftplugin for vim *.inf files defaults to inform which says something about a Z-machine. Needless to say, this provides the wrong syntax highlighting etc for a windows .inf device driver file. does anyone know of a vim syntax highlight file…
swinman
  • 391
  • 3
  • 10
0
votes
1 answer

Use common code for filetype plugin

I have a common set of commands that I want to run in several different Vim filetype plugins. For instance, for html, xml, and xhtml, there are several settings I want to use in common. Where is the best place to put this common code and how do I…
brianmearns
  • 9,581
  • 10
  • 52
  • 79
0
votes
1 answer

Vim runs all Filetype-Plugins that start with the same name

just found out, that vim runs all ftplugins that starts with the same name. For example: Detected filetype = ocr These files have different versions. Therefore I have different ftplugins: ocr => Base (Checks the file-version and sets the correct…
sfx2k
  • 73
  • 4
0
votes
1 answer

perlomni.vim installation fail using pathogen or vundle

I am tyring to install perlomni.vim so I can use auto function lookup in a gvim window. I have tried using pathhogen and vundle for trying to configure this bundle. I think the problem I am running into is how I am install perlomni.vim I have a…
user2479059
  • 63
  • 1
  • 6