feat: fixed .nix commentstring
This commit is contained in:
parent
8ea7367442
commit
611e8c3075
|
@ -2,15 +2,17 @@ local M = {}
|
||||||
|
|
||||||
-- Update comments for certain languages
|
-- Update comments for certain languages
|
||||||
local function setCommentString(extension, commentString)
|
local function setCommentString(extension, commentString)
|
||||||
vim.cmd('autocmd BufEnter '.. extension .. ' :lua vim.api.nvim_buf_set_option(0, "commentstring", "' .. commentString .. '")')
|
vim.cmd('augroup set-commentstring-' .. extension)
|
||||||
vim.cmd('autocmd BufFilePost '.. extension .. ' :lua vim.api.nvim_buf_set_option(0, "commentstring", "' .. commentString ..'")')
|
vim.cmd('autocmd!')
|
||||||
|
vim.cmd('autocmd BufEnter *.' .. extension .. ' :lua vim.api.nvim_buf_set_option(0, "commentstring", "' .. commentString .. '")')
|
||||||
|
vim.cmd('autocmd BufFilePost *.' .. extension .. ' :lua vim.api.nvim_buf_set_option(0, "commentstring", "' .. commentString .. '")')
|
||||||
|
vim.cmd('augroup END')
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.setup()
|
function M.setup()
|
||||||
require('nvim_comment').setup()
|
require('nvim_comment').setup()
|
||||||
|
|
||||||
setCommentString(".nix", "# %s")
|
setCommentString("nix", "# %s")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
Loading…
Reference in a new issue