Compare commits
No commits in common. "613110fdce55765743db9c5431d1551b95806327" and "3b9aa845cafeff1d61325ef5e26755076b7d2952" have entirely different histories.
613110fdce
...
3b9aa845ca
|
@ -33,22 +33,14 @@ vim.api.nvim_create_autocmd({ "InsertEnter", "WinLeave" }, {
|
||||||
pattern = "*",
|
pattern = "*",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Auto install treesitter parser and start them
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
desc = "Enable Treesitter",
|
pattern = require("tools.highlight"),
|
||||||
group = vim.api.nvim_create_augroup("enable_treesitter", {}),
|
callback = function()
|
||||||
callback = function(event)
|
-- syntax highlighting, provided by Neovim
|
||||||
local has_treesitter, treesitter = pcall(require, "nvim-treesitter")
|
vim.treesitter.start()
|
||||||
if has_treesitter then
|
-- folds, provided by Neovim
|
||||||
local language = vim.treesitter.language.get_lang(event.match)
|
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||||
treesitter.install(language):await(function(a)
|
-- indentation, provided by nvim-treesitter
|
||||||
if pcall(vim.treesitter.start) then
|
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||||
-- Use Treesitter indentation and folds.
|
|
||||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
|
||||||
vim.wo.foldmethod = "expr"
|
|
||||||
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
|
@ -61,6 +61,3 @@ vim.o.scrolloff = 10
|
||||||
-- Highlight tabs and trailing whitespace
|
-- Highlight tabs and trailing whitespace
|
||||||
vim.o.listchars = "trail:~,tab:¦⁃,nbsp:␣"
|
vim.o.listchars = "trail:~,tab:¦⁃,nbsp:␣"
|
||||||
vim.o.list = true
|
vim.o.list = true
|
||||||
|
|
||||||
-- Fold settings
|
|
||||||
vim.o.foldlevelstart = 99
|
|
||||||
|
|
|
@ -11,8 +11,12 @@ return {
|
||||||
branch = "main",
|
branch = "main",
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
opts = {
|
opts = {
|
||||||
|
-- Add languages to be installed here that you want installed for treesitter
|
||||||
ensure_installed = require("tools.highlight"),
|
ensure_installed = require("tools.highlight"),
|
||||||
|
|
||||||
|
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
|
||||||
|
auto_install = true,
|
||||||
|
|
||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
incremental_selection = {
|
incremental_selection = {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user