From 79459a7de63fbf626cd2125eacea5badc0d27d5a Mon Sep 17 00:00:00 2001 From: Shun Git Date: Sat, 12 Dec 2020 16:23:56 +0800 Subject: [PATCH] load plugins only on filetype --- .gitignore | 2 ++ .gitmodules | 2 +- vim/coc/extensions/package.json | 2 +- vim/ftdetect/jsx.vim | 1 + vim/ftdetect/typescript.vim | 2 ++ vim/ftplugin/javascriptreact.vim | 1 + vim/ftplugin/typescript.vim | 2 ++ vim/{plugin/jsx.vim => ftplugin/typescriptreact.vim} | 1 + vim/pack/plugins/{start => opt}/coc.nvim | 0 9 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 vim/ftdetect/jsx.vim create mode 100644 vim/ftdetect/typescript.vim create mode 100644 vim/ftplugin/javascriptreact.vim create mode 100644 vim/ftplugin/typescript.vim rename vim/{plugin/jsx.vim => ftplugin/typescriptreact.vim} (70%) rename vim/pack/plugins/{start => opt}/coc.nvim (100%) diff --git a/.gitignore b/.gitignore index e54ed2d..158d44b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ vim/.netrwhist jupyter/ node_modules/ +package-lock.json +vim/coc/extensions/db.json diff --git a/.gitmodules b/.gitmodules index d7686d1..682edb2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -20,5 +20,5 @@ path = vim/pack/plugins/opt/vim-jsx-pretty url = https://github.com/MaxMEllon/vim-jsx-pretty [submodule "vim/pack/plugins/start/coc.nvim"] - path = vim/pack/plugins/start/coc.nvim + path = vim/pack/plugins/opt/coc.nvim url = https://github.com/neoclide/coc.nvim diff --git a/vim/coc/extensions/package.json b/vim/coc/extensions/package.json index b6a9ef3..31b8e9c 100644 --- a/vim/coc/extensions/package.json +++ b/vim/coc/extensions/package.json @@ -2,4 +2,4 @@ "dependencies": { "coc-tsserver": ">=1.6.1" } -} \ No newline at end of file +} diff --git a/vim/ftdetect/jsx.vim b/vim/ftdetect/jsx.vim new file mode 100644 index 0000000..744d573 --- /dev/null +++ b/vim/ftdetect/jsx.vim @@ -0,0 +1 @@ +au BufNewFile,BufRead *.jsx set filetype=javascriptreact diff --git a/vim/ftdetect/typescript.vim b/vim/ftdetect/typescript.vim new file mode 100644 index 0000000..3c7b828 --- /dev/null +++ b/vim/ftdetect/typescript.vim @@ -0,0 +1,2 @@ +au BufNewFile,BufRead *.ts set filetype=typescript +au BufNewFile,BufRead *.tsx set filetype=typescriptreact diff --git a/vim/ftplugin/javascriptreact.vim b/vim/ftplugin/javascriptreact.vim new file mode 100644 index 0000000..24c07d1 --- /dev/null +++ b/vim/ftplugin/javascriptreact.vim @@ -0,0 +1 @@ +packadd vim-jsx-pretty diff --git a/vim/ftplugin/typescript.vim b/vim/ftplugin/typescript.vim new file mode 100644 index 0000000..26df815 --- /dev/null +++ b/vim/ftplugin/typescript.vim @@ -0,0 +1,2 @@ +packadd yats.vim +packadd coc.nvim diff --git a/vim/plugin/jsx.vim b/vim/ftplugin/typescriptreact.vim similarity index 70% rename from vim/plugin/jsx.vim rename to vim/ftplugin/typescriptreact.vim index 9a5bde4..2806c23 100644 --- a/vim/plugin/jsx.vim +++ b/vim/ftplugin/typescriptreact.vim @@ -1,2 +1,3 @@ packadd yats.vim packadd vim-jsx-pretty +packadd coc.nvim diff --git a/vim/pack/plugins/start/coc.nvim b/vim/pack/plugins/opt/coc.nvim similarity index 100% rename from vim/pack/plugins/start/coc.nvim rename to vim/pack/plugins/opt/coc.nvim