Questions tagged [ftplugin]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

How to have placeholder text when Opening some filetypes

I would like to have a reminder of my mappings when I open say tex files. Idealy I would like something like the vim screen that shows vim version and stuff but I don't think that gonna be possible/...
2 votes
1 answer
65 views

Why is there an ftplugin directory for each plugin?

I am trying to get started with VimTeX. I am reading through a guide (https://www.ejmastnak.com/tutorials/vim-latex/vimtex.html) and using vim-plug to manage plugins. I am very new to Vim generally, ...
  • 21
0 votes
0 answers
18 views

BufReadPre only with vimdiff OR regex to ignore

I am trying to ignore hardcoded line numbers when running vimdiff on files. The regex ^\s*\d\+: properly identifies all the line numbers (which are only on some lines, not all lines). So far I've ...
0 votes
0 answers
40 views

Do I need the contents of the indent and ftplugin directories in my configuration?

While I have been using nvim (on Linux) for some time, I have only recently started using gvim (on Linux and Windows). I have noticed that on the Windows version of gvim there are directories amongst ...
  • 229
1 vote
1 answer
59 views

How can I make `.vim/after/ftplugin/markdown.vim` take effect immediately?

I change this file, but it seems that I have to restart Vim to make it take effect. Is there any way to make .vim/after/ftplugin/markdown.vim take effect immediately? I already tried :source and :...
  • 167
1 vote
1 answer
118 views

How to properly set up ftplugin files for working with different filetypes in different windows?

$ vim --version VIM - Vi IMproved 8.1 I set up the following vim configuration files: " .vim/ftplugin/text.vim set textwidth = 0 " .vim/ftplugin/python.vim set textwidth = 99 set ...
  • 53
1 vote
2 answers
94 views

Open buffer without loading ftplugins

I have huge file and quite slow plugin (loaded by vim-plug) for corresponding filetype. I want following: Plugin is loaded by default Option to fast open this file without loading plugin. Something ...
  • 243
0 votes
0 answers
153 views

Filetype inheritance

I know that it's not very common, but there are few cases in which I would really like to inherit the configurations for one filetype in another. Example: whatever I set for sh I would like to inherit ...
  • 101
0 votes
1 answer
54 views

modules installed again and again

Here is a part of my ftplugin/fortran_state.vim " Check python modules and install{{{1 if !executable('fprettify') || !executable('fortls') || !executable('unidecode') :let choice =confirm(&...
  • 461
1 vote
1 answer
123 views

Execute normal command after opening email in Mutt

I'd like to use ftplugin/mail.vim to execute a normal command after opening an email in Mutt. Specifically, when replying to an email, I'd like move the cursor after the header fields (I have set ...
1 vote
2 answers
318 views

Where should I put filetype specific options for indentation?

At moment, mostly for random reasons, I have $ cat ~/.vim/ftplugin/c.vim set tabstop=2 softtabstop=2 expandtab shiftwidth=2 smarttab smartindent autoindent cinoptions=g2 and this $ cat ~/.vim/...
  • 2,014
1 vote
1 answer
216 views

How can I make vim ignore a filetype plugin's makeprg setting?

I am using a plugin that sets makeprg to some value specific to the filetype's programming language. I want to use my global setting instead, because I also use Makefiles. How can I do this? Thank you!...
3 votes
1 answer
2k views

Neovim automatically run command when opening a filetype from ftplugin file

I have Neovim setup with configurations for file types separated into ftplugin files. I would like to have Neovim start the Goyo plugin when I open a markdown file. However, I would like to keep this ...
3 votes
1 answer
430 views

Why won't vim source my ftplugin_after.vim file?

I have a file called ~/.config/nvim/after/ftplugin_after.vim, which contains set incsearch ignorecase smartcase number relativenumber autoindent shiftwidth=8 tabstop=8 softtabstop=8 expandtab ...
  • 69
1 vote
1 answer
48 views

Buffer opened when compiling succeeds

I am writing a vim plugin for the fortran filetype. In an autoload script, I have done: " File Name: autoload/makes.vim let s:Compiler = get(g:, "fortran_compiler", "gfortran"...
  • 461
1 vote
1 answer
46 views

pluging value to override vimrc

in my ftplugin, I have code: if executable('fprettify') au BufWritePre <buffer> :silent %!fprettify --silent else :let choice=confirm("fprettify doesn't exists! Install ...
  • 461
8 votes
1 answer
2k views

Difference between adding "vim/after/ftplugin" vs "vim/ftplugin"

I'd like to configure Vim 8.2 on Ubuntu 18 so that when I open code in different programming languages, different settings load. Eg. indentation, color-theme, plugins etc. I found ftplugin to be the ...
0 votes
1 answer
554 views

Organize plugins and .vimrc settings for different filetypes using ftplugins?

I'm new to vim (8.2) and have been learning how to set it up on my computer (Ubuntu 18) for the past few days. I'd like to configure VIM so that when I open code in different programming languages, ...
0 votes
1 answer
139 views

Why are files in after/ftplugin/ run on every save, and can I work around it?

I have a variety of vimscripts for different filetypes in ~/.vim/after/ftplugin, e.g. text.vim, vim.vim, etc. These contain a variety of settings, mappings, etc. Only recently, I've noticed (not sure ...
0 votes
1 answer
49 views

Highlight group in `.vim/after/ftplugin` not highlighting patterns

While highlight group in .vimrc highlights patterns just fine, highlight groups in .vim/after/ftplugin folder does not seem to do anything. Is it normal?
  • 562
2 votes
1 answer
167 views

Why do FileType autocommands not appear to work when using multiple filetypes?

Not everyone considers setting b:undo_ftplugin to be a "best practice" the way I do, but as far as I can tell, the behavior described in this question depends on it being set as part of the ...
  • 23.4k