1
Fork 0

feat: worked on nvim config more

This commit is contained in:
Matei Adriel 2022-02-07 12:47:03 +02:00
parent 441844b0c5
commit 8ea7367442
6 changed files with 42 additions and 17 deletions
dotfiles/neovim/lua/my/plugins

View file

@ -0,0 +1,16 @@
local M = {}
-- Update comments for certain languages
local function setCommentString(extension, commentString)
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 ..'")')
end
function M.setup()
require('nvim_comment').setup()
setCommentString(".nix", "# %s")
end
return M

View file

@ -4,10 +4,10 @@ function M.setup()
require("my.plugins.lspconfig").setup()
require("my.plugins.fzf-lua").setup()
require("my.plugins.treesitter").setup()
require("my.plugins.comment").setup()
-- Other unconfigured plugins
require('nvim-autopairs').setup()
require('nvim_comment').setup()
require("startup").setup({theme = "dashboard"})
end

View file

@ -92,22 +92,17 @@ function M.setup()
end
local efmLanguages = {
typescript = {
formatCommand = 'prettierd "${INPUT}"',
formatStdin = true,
env = {string.format('PRETTIERD_DEFAULT_CONFIG=%s', vim.fn.expand('~/.config/nvim/utils/linter-config/.prettierrc.json'))}
},
lua = {{formatCommand = formatLua, formatStdin = true}}
}
-- Setup auto-formatting
require"lspconfig".efm.setup {
init_options = {documentFormatting = true},
filetypes = {"lua", "ts", "js", "tsx", "jsx"},
filetypes = {"lua"},
settings = {rootMarkers = {".git/"}, languages = efmLanguages}
}
local autoFormatOn = {lua = 100, purs = 1000, nix = 100, js = 100, ts = 100, tsx = 100, jsx = 100}
local autoFormatOn = {lua = 200, purs = 1000, nix = 200, js = 300, ts = 300, tsx = 300, jsx = 300}
-- Auto format
for extension, timeout in pairs(autoFormatOn) do