diff --git a/nvim/dpp.ts b/nvim/dpp.ts index 3bace3c..02ffbb9 100644 --- a/nvim/dpp.ts +++ b/nvim/dpp.ts @@ -83,6 +83,22 @@ 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: false, + }, + }, + ) as Toml, + ); + const recordPlugins: Record = {}; const ftplugins: Record = {}; const hooksFiles: string[] = []; diff --git a/nvim/init.lua b/nvim/init.lua index 3b688a8..7b1719b 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,4 +1,4 @@ -vim.loader.enable() +-- vim.loader.enable() local options = { -- file encoding diff --git a/nvim/tomls/dein.toml b/nvim/tomls/dein.toml index 897aae6..0524e1d 100644 --- a/nvim/tomls/dein.toml +++ b/nvim/tomls/dein.toml @@ -1,2 +1,5 @@ [[plugins]] repo = 'Shougo/context_filetype.vim' + +[[plugins]] +repo = 'vim-denops/denops.vim' diff --git a/nvim/tomls/dein_lazy.toml b/nvim/tomls/dein_lazy.toml index 10fb625..875ec0f 100644 --- a/nvim/tomls/dein_lazy.toml +++ b/nvim/tomls/dein_lazy.toml @@ -134,3 +134,10 @@ lua_post_source = ''' }, }) ''' + +[[plugins]] +repo = 'kamykn/spelunker.vim' +lua_add = ''' + vim.g.enable_spelunker_vim = 1 + vim.g.spelunker_check_type = 2 +''' diff --git a/nvim/tomls/treesitter.toml b/nvim/tomls/treesitter.toml new file mode 100644 index 0000000..7f4ae38 --- /dev/null +++ b/nvim/tomls/treesitter.toml @@ -0,0 +1,75 @@ +[[plugins]] +repo = 'nvim-treesitter/nvim-treesitter' +lua_post_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'] +hook_add = ''' + hi TreesitterContextBottom gui=underline guisp=Grey +''' +lua_post_source = ''' + 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', + }, + }, + } +'''