Add autoformatting for ruby (#305)

This commit is contained in:
rebuilt 2021-04-27 06:59:23 +02:00 committed by GitHub
parent 9bd32d7f95
commit 1eb8339a47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -18,6 +18,9 @@ if O.lua.autoformat then table.insert(auto_formatters, lua_format) end
local json_format = {'BufWritePre', '*.json', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} local json_format = {'BufWritePre', '*.json', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}
if O.json.autoformat then table.insert(auto_formatters, json_format) end if O.json.autoformat then table.insert(auto_formatters, json_format) end
local ruby_format = {'BufWritePre', '*.rb', 'lua vim.lsp.buf.formatting_sync(nil,1000)'}
if O.ruby.autoformat then table.insert(auto_formatters, ruby_format) end
utils.define_augroups({ utils.define_augroups({
_general_settings = { _general_settings = {
{'TextYankPost', '*', 'lua require(\'vim.highlight\').on_yank({higroup = \'Search\', timeout = 200})'}, {'TextYankPost', '*', 'lua require(\'vim.highlight\').on_yank({higroup = \'Search\', timeout = 200})'},

View file

@ -49,4 +49,6 @@ O.tsserver.autoformat = true
-- json -- json
O.json.autoformat = true O.json.autoformat = true
-- ruby
O.ruby.autoformat = true
-- create custom autocommand field (This would be easy with lua) -- create custom autocommand field (This would be easy with lua)