Skip to content

Instantly share code, notes, and snippets.

@RayZ0rr
Created January 13, 2022 21:29
Show Gist options
  • Save RayZ0rr/a56ec0dc47b81726e3a6b4e7366196c6 to your computer and use it in GitHub Desktop.
Save RayZ0rr/a56ec0dc47b81726e3a6b4e7366196c6 to your computer and use it in GitHub Desktop.
Minimal neovim rc file to test 'syntax enable' bug
if has('vim_starting')
set encoding=utf-8
endif
scriptencoding utf-8
if &compatible
set nocompatible
endif
let s:plug_dir = expand('/tmp/plugged/vim-plug')
if !filereadable(s:plug_dir .. '/plug.vim')
execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir)
end
execute 'set runtimepath+=' . s:plug_dir
call plug#begin(s:plug_dir)
Plug 'nvim-treesitter/nvim-treesitter'
call plug#end()
PlugInstall | quit
lua << EOF
-- #########################################################
-- PROBLEM COMMANDS
-- #########################################################
-- vim.opt.syntax = 'enable' -- THIS WORKS
vim.cmd [[ syntax enable ]] -- THIS DOESN'T
-- #########################################################
-- Treesitter configuration
vim.cmd([[
set foldmethod=expr
set foldexpr=nvim_treesitter#foldexpr()
set foldlevel=99
]])
require('nvim-treesitter.configs').setup {
ensure_installed = {
"bash",
"c",
"cpp",
"lua",
"python",
"rust",
"html",
"css",
"toml",
"vim",
-- for `nvim-treesitter/playground`
"query",
},
-- Install languages synchronously (only applied to `ensure_installed`)
sync_install = false,
highlight = {
enable = true, -- false will disable the whole extension
additional_vim_regex_highlighting = false,
},
incremental_selection = {
enable = true,
keymaps = {
-- init_selection = 'gnn',
init_selection = '<cr>',
node_incremental = '<tab>',
scope_incremental = 'grc',
node_decremental = '<s-tab>',
},
},
indent = {
enable = true,
},
}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment