In the same spirit as ftplugin, this plugin enables language-specific configurations. It allows its user to configure a function to be called when a buffer is launched. Here is a sample setup:
require'ftconf'.setup{
go = function(bufnr, winid)
-- Set window options
vim.api.vim_win_set_option(1000, 'colorcolumn', '80,120')
-- Set buffer options
buf_set_keymap('n', '<Leader>p', '<cmd>lua echo"go!"', { noremap = true, silent = true })
end,
lua = function(bufnr, winid)
-- Set window options
vim.api.vim_win_set_option(1000, 'colorcolumn', '80')
-- Set buffer options
buf_set_keymap('n', '<Leader>p', '<cmd>lua echo"lua!"', { noremap = true, silent = true })
end,
}
ftconf requires Neovim and follows the standard runtime package structure. It is possible to install it with all popular package managers:
The documentation can be found at doc/ftconf.txt. You can
also use the :help ftconf.nvim
command inside of Neovim.