irongit

A readme explaining how to make neovim work fast

hygo-vim/lua/utils/formatting.lua
23 lines485 BLua
1local M = {}
2
3-- tabs function
4function M.set_tabs(length)
5 vim.bo.tabstop = length
6 vim.bo.shiftwidth = length
7 vim.bo.softtabstop = length
8 vim.bo.expandtab = true
9end
10
11-- configure a language
12function M.config_lang(filetype, func)
13 if vim.bo.filetype == filetype then
14 func()
15 end
16 local augroup = vim.api.nvim_create_augroup(filetype .. "Options", { clear = true })
17 vim.api.nvim_create_autocmd("Filetype", {
18 group = augroup,
19 callback = func,
20 })
21end
22
23return M