2022-08-19 11:43:01 +03:00
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
|
--
|
|
|
|
|
-- NerdTree
|
|
|
|
|
--
|
|
|
|
|
|
2022-08-29 15:40:41 +03:00
|
|
|
|
vim.g.NERDTreeDirArrowExpandable = "▸"
|
|
|
|
|
vim.g.NERDTreeDirArrowCollapsible = "▾"
|
2022-08-19 11:43:01 +03:00
|
|
|
|
|
|
|
|
|
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-19 11:43:01 +03:00
|
|
|
|
}
|
|
|
|
|
|
2022-08-29 15:40:41 +03:00
|
|
|
|
vim.keymap.set("n", "<leader>nt", ":NERDTreeToggle<CR>")
|
|
|
|
|
vim.keymap.set("n", "<leader>nf", ":NERDTreeFind<CR>")
|
2022-08-19 11:43:01 +03:00
|
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
|
--
|
|
|
|
|
-- 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-19 11:43:01 +03:00
|
|
|
|
|
2022-08-29 15:40:41 +03:00
|
|
|
|
vim.cmd([[
|
2022-08-19 16:36:49 +03:00
|
|
|
|
aug fmt
|
|
|
|
|
au!
|
|
|
|
|
au BufWritePre * try | undojoin | Neoformat | catch /E790/ | Neoformat | endtry
|
|
|
|
|
aug END
|
2022-08-29 15:40:41 +03:00
|
|
|
|
]])
|
2022-08-19 16:36:49 +03:00
|
|
|
|
--[[ TODO: need to investigate how implement it in lua
|
2022-08-19 11:43:01 +03:00
|
|
|
|
local format_augroup = vim.api.nvim_create_augroup('format', {})
|
|
|
|
|
vim.api.nvim_create_autocmd('BufWritePre', {
|
|
|
|
|
pattern = '*',
|
|
|
|
|
group = spell_check_augroup,
|
2022-08-19 16:36:49 +03:00
|
|
|
|
callback = function ()
|
|
|
|
|
local ok, _ = pcall(function ()
|
|
|
|
|
vim.fn.undojoin();
|
|
|
|
|
vim.cmd'NeoFormat';
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
if not ok then vim.cmd'NeoFormat' end
|
|
|
|
|
end
|
2022-08-19 11:43:01 +03:00
|
|
|
|
})
|
2022-08-29 15:40:41 +03:00
|
|
|
|
]]
|
|
|
|
|
--
|
2022-08-19 11:43:01 +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>")
|
2022-08-19 11:43:01 +03:00
|
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
|
--
|
|
|
|
|
-- 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-19 11:43:01 +03:00
|
|
|
|
|
2022-08-29 15:40:41 +03:00
|
|
|
|
-- Install parsers synchronously (only applied to `ensure_installed`)
|
|
|
|
|
sync_install = false,
|
2022-08-19 11:43:01 +03:00
|
|
|
|
|
2022-08-29 15:40:41 +03:00
|
|
|
|
highlight = {
|
|
|
|
|
enable = true,
|
|
|
|
|
},
|
2022-08-19 11:43:01 +03:00
|
|
|
|
|
2022-08-29 15:40:41 +03:00
|
|
|
|
indent = {
|
|
|
|
|
enable = true,
|
|
|
|
|
},
|
|
|
|
|
})
|