system/home/progs/nvim/lua/plugins.lua

93 lines
2 KiB
Lua
Raw Normal View History

-------------------------------------------------------------------------------
--
-- NerdTree
--
2022-08-29 15:40:41 +03:00
vim.g.NERDTreeDirArrowExpandable = ""
vim.g.NERDTreeDirArrowCollapsible = ""
vim.g.NERDTreeMiniamlUI = 1
vim.g.NERDTreeDirArrows = 1
-- Nerdtree git plugin symbols
vim.g.NERDTreeGitStatusIndicatorMapCustom = {
2022-08-29 15:40:41 +03:00
Modified = "",
Staged = "ˢ",
Untracked = "",
Renamed = "ʳ",
Unmerged = "",
Deleted = "ˣ",
Dirty = "˜",
Clean = "",
Unknown = "?",
}
2022-08-29 15:40:41 +03:00
vim.keymap.set("n", "<leader>nt", ":NERDTreeToggle<CR>")
vim.keymap.set("n", "<leader>nf", ":NERDTreeFind<CR>")
-------------------------------------------------------------------------------
--
-- NeoFormat
--
vim.g.neoformat_try_node_exe = 1
vim.g.neoformat_only_msg_on_error = 1
2022-08-29 15:40:41 +03:00
vim.g.neoformat_enabled_markdown = { "denofmt" }
2022-08-29 15:40:41 +03:00
vim.cmd([[
aug fmt
au!
au BufWritePre * try | undojoin | Neoformat | catch /E790/ | Neoformat | endtry
aug END
2022-08-29 15:40:41 +03:00
]])
--[[ TODO: need to investigate how implement it in lua
local format_augroup = vim.api.nvim_create_augroup('format', {})
vim.api.nvim_create_autocmd('BufWritePre', {
pattern = '*',
group = spell_check_augroup,
callback = function ()
local ok, _ = pcall(function ()
vim.fn.undojoin();
vim.cmd'NeoFormat';
end)
if not ok then vim.cmd'NeoFormat' end
end
})
2022-08-29 15:40:41 +03:00
]]
--
-------------------------------------------------------------------------------
--
-- GitGutter
--
vim.g.gitgutter_sign_priority = 1
vim.g.gitgutter_set_sign_backgrounds = 0
vim.g.gitgutter_map_keys = 0
2022-08-29 15:40:41 +03:00
vim.keymap.set("n", "<leader>ghp", ":GitGutterPreviewHunk<CR>")
-------------------------------------------------------------------------------
--
-- TreeSitter
--
2022-08-29 15:40:41 +03:00
require("nvim-treesitter.configs").setup({
-- A list of parser names, or "all"
ensure_installed = {
"typescript",
"tsx",
"rust",
"haskell",
},
2022-08-29 15:40:41 +03:00
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
2022-08-29 15:40:41 +03:00
highlight = {
enable = true,
},
2022-08-29 15:40:41 +03:00
indent = {
enable = true,
},
})