mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[nvim] Add a fix for Treesitter on macOS
This commit is contained in:
parent
36c7aa8e26
commit
f9c86ee14d
1 changed files with 12 additions and 0 deletions
|
@ -1,6 +1,18 @@
|
||||||
local ok, parser_configs = pcall(require, 'nvim-treesitter.parsers')
|
local ok, parser_configs = pcall(require, 'nvim-treesitter.parsers')
|
||||||
if not ok then return end
|
if not ok then return end
|
||||||
|
|
||||||
|
-- Should only really run on my Macbook, as it is my only macOS device.
|
||||||
|
-- Apple's C compilers seem to not want to compile any of Treesitter's
|
||||||
|
-- dialects.
|
||||||
|
-- That is, `cc`, `gcc`, `g++`, andsoforth. Funnily enough, they are all
|
||||||
|
-- aliases to the same program.
|
||||||
|
-- So, the nix-darwin configuration specifies the installation of zig as a
|
||||||
|
-- replacement compiler solely so the Treesitter dialects compile. Very
|
||||||
|
-- intuitive.
|
||||||
|
if vim.loop.os_uname().sysname == 'Darwin' then
|
||||||
|
require('nvim-treesitter.install').compilers = { "zig" }
|
||||||
|
end
|
||||||
|
|
||||||
local parser_configs = parser_configs.get_parser_configs()
|
local parser_configs = parser_configs.get_parser_configs()
|
||||||
|
|
||||||
parser_configs.norg = {
|
parser_configs.norg = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue