system/nix/progs/nvim/lua/plugins.lua

93 lines
2 KiB
Lua
Raw Normal View History

-------------------------------------------------------------------------------
--
-- NerdTree
--
vim.g.NERDTreeDirArrowExpandable = ''
vim.g.NERDTreeDirArrowCollapsible = ''
vim.g.NERDTreeMiniamlUI = 1
vim.g.NERDTreeDirArrows = 1
-- Nerdtree git plugin symbols
vim.g.NERDTreeGitStatusIndicatorMapCustom = {
Modified = '',
Staged = 'ˢ',
Untracked = '',
Renamed = 'ʳ',
Unmerged = '',
Deleted = 'ˣ',
Dirty = '˜',
Clean = '',
Unknown = '?',
}
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
vim.g.neoformat_enabled_markdown = {"denofmt"}
vim.cmd [[
aug fmt
au!
au BufWritePre * try | undojoin | Neoformat | catch /E790/ | Neoformat | endtry
aug END
]]
--[[ 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
})
]]--
-------------------------------------------------------------------------------
--
-- GitGutter
--
vim.g.gitgutter_sign_priority = 1
vim.g.gitgutter_set_sign_backgrounds = 0
vim.g.gitgutter_map_keys = 0
vim.keymap.set('n', '<leader>ghp', ':GitGutterPreviewHunk<CR>')
-------------------------------------------------------------------------------
--
-- TreeSitter
--
require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all"
ensure_installed = {
"typescript",
"tsx",
"rust",
"haskell",
},
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
highlight = {
enable = true,
},
indent = {
enable = true,
},
}