diff --git a/nvim/dpp.ts b/nvim/dpp.ts index 37fb8cd..cdaae52 100644 --- a/nvim/dpp.ts +++ b/nvim/dpp.ts @@ -83,21 +83,21 @@ export class Config extends BaseConfig { ) as Toml, ); - //tomls.push( - // await args.dpp.extAction( - // args.denops, - // context, - // options, - // "toml", - // "load", - // { - // path: await fn.expand(args.denops, dotfilesDir + "tomls/treesitter.toml"), - // options: { - // lazy: true, - // }, - // }, - // ) as Toml, - //); + tomls.push( + await args.dpp.extAction( + args.denops, + context, + options, + "toml", + "load", + { + path: await fn.expand(args.denops, dotfilesDir + "tomls/treesitter.toml"), + options: { + lazy: false, + }, + }, + ) as Toml, + ); tomls.push( await args.dpp.extAction( diff --git a/nvim/init.lua b/nvim/init.lua index aa85a8f..94402cc 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -59,38 +59,38 @@ for k, v in pairs(options) do vim.opt[k] = v end ---local global_options = { --- loaded_2html_plugin = true, --- loaded_gzip = true, --- loaded_tar = true, --- loaded_tarPlugin = true, --- loaded_zip = true, --- loaded_zipPlugin = true, --- loaded_vimball = true, --- loaded_vimballPlugin = true, --- loaded_netrw = true, --- loaded_netrwPlugin = true, --- loaded_netrwSettings = true, --- loaded_netrwFileHandlers = true, --- loaded_getscript = true, --- loaded_getscriptPlugin = true, --- loaded_man = true, --- loaded_matchit = true, --- loaded_matchparen = true, --- loaded_shada_plugin = true, --- loaded_spellfile_plugin = true, --- loaded_tutor_mode_plugin = true, --- did_install_default_menus = true, --- did_install_syntax_menu = true, --- skip_loading_mswin = true, --- did_indent_on = true, --- did_load_ftplugin = true, --- loaded_rrhelper = true, ---} --- ---for k, v in pairs(global_options) do --- vim.g[k] = v ---end +local global_options = { + loaded_2html_plugin = true, + loaded_gzip = true, + loaded_tar = true, + loaded_tarPlugin = true, + loaded_zip = true, + loaded_zipPlugin = true, + loaded_vimball = true, + loaded_vimballPlugin = true, + loaded_netrw = true, + loaded_netrwPlugin = true, + loaded_netrwSettings = true, + loaded_netrwFileHandlers = true, + loaded_getscript = true, + loaded_getscriptPlugin = true, + loaded_man = true, + loaded_matchit = true, + loaded_matchparen = true, + loaded_shada_plugin = true, + loaded_spellfile_plugin = true, + loaded_tutor_mode_plugin = true, + did_install_default_menus = true, + did_install_syntax_menu = true, + skip_loading_mswin = true, + did_indent_on = true, + did_load_ftplugin = true, + loaded_rrhelper = true, +} + +for k, v in pairs(global_options) do + vim.g[k] = v +end ------------- diff --git a/nvim/tomls/go.toml b/nvim/tomls/go.toml index e494334..708cb50 100644 --- a/nvim/tomls/go.toml +++ b/nvim/tomls/go.toml @@ -17,6 +17,6 @@ on_ft = ['go'] [[plugins]] repo = 'mattn/vim-goimports' on_ft = ['go'] -lua_add = ''' - vim.g,goimports = 1 -''' +#lua_add = ''' +# vim.g.goimports = 1 +#''' diff --git a/nvim/tomls/treesitter.toml b/nvim/tomls/treesitter.toml index 8c257bb..aaef883 100644 --- a/nvim/tomls/treesitter.toml +++ b/nvim/tomls/treesitter.toml @@ -1,75 +1,75 @@ -#[[plugins]] -#repo = 'nvim-treesitter/nvim-treesitter' -#on_event = 'BufRead' -#hook_post_update = 'TSUpdate' -#lua_source = ''' -# require 'nvim-treesitter.configs'.setup { -# ensure_installed = { "lua", "go", "python", "bash", "typescript", "yaml", "toml", "json", "vim", "hcl", "rust" }, -# sync_install = false, -# auto_install = true, -# highlight = { -# enable = true, -# -- filesize で現状そんなに問題がないので一旦コメントアウトして様子を見る。問題なかったら完全に消す。 -# -- disable = function(_, buf) -# -- local max_filesize = 100 * 1024 -- 100 KB -# -- local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) -# -- if ok and stats and stats.size > max_filesize then -# -- return true -# -- end -# -- end, -# additional_vim_regex_highlighting = false, -# }, -# indent = { -# enable = true, -# } -# } -#''' -# -#[[plugins]] -#repo = 'm-demare/hlargs.nvim' -#depends = ['nvim-treesitter'] -#lua_post_source = ''' -# require('hlargs').setup() -#''' -# -#[[plugins]] -#repo = 'nvim-treesitter/nvim-treesitter-context' -#depends = ['nvim-treesitter'] -#lua_source = ''' -# vim.cmd("hi TreesitterContextBottom gui=underline guisp=Grey") -# require 'treesitter-context'.setup { -# patterns = { -# default = { -# 'class', -# 'function', -# 'method', -# 'interface', -# 'struct', -# }, -# haskell = { -# 'adt' -# }, -# rust = { -# 'impl_item', -# -# }, -# terraform = { -# 'block', -# 'object_elem', -# 'attribute', -# }, -# markdown = { -# 'section', -# }, -# json = { -# 'pair', -# }, -# typescript = { -# 'export_statement', -# }, -# yaml = { -# 'block_mapping_pair', -# }, -# }, -# } -#''' +[[plugins]] +repo = 'nvim-treesitter/nvim-treesitter' +on_event = 'BufRead' +hook_post_update = 'TSUpdate' +lua_source = ''' + require 'nvim-treesitter.configs'.setup { + ensure_installed = { "lua", "go", "python", "bash", "typescript", "yaml", "toml", "json", "vim", "hcl", "rust" }, + sync_install = false, + auto_install = true, + highlight = { + enable = true, + -- filesize で現状そんなに問題がないので一旦コメントアウトして様子を見る。問題なかったら完全に消す。 + -- disable = function(_, buf) + -- local max_filesize = 100 * 1024 -- 100 KB + -- local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + -- if ok and stats and stats.size > max_filesize then + -- return true + -- end + -- end, + additional_vim_regex_highlighting = false, + }, + indent = { + enable = true, + } + } +''' + +[[plugins]] +repo = 'm-demare/hlargs.nvim' +depends = ['nvim-treesitter'] +lua_post_source = ''' + require('hlargs').setup() +''' + +[[plugins]] +repo = 'nvim-treesitter/nvim-treesitter-context' +depends = ['nvim-treesitter'] +lua_source = ''' + vim.cmd("hi TreesitterContextBottom gui=underline guisp=Grey") + require 'treesitter-context'.setup { + patterns = { + default = { + 'class', + 'function', + 'method', + 'interface', + 'struct', + }, + haskell = { + 'adt' + }, + rust = { + 'impl_item', + + }, + terraform = { + 'block', + 'object_elem', + 'attribute', + }, + markdown = { + 'section', + }, + json = { + 'pair', + }, + typescript = { + 'export_statement', + }, + yaml = { + 'block_mapping_pair', + }, + }, + } +'''