From 6012fd64610809e973dad236aa605d6275962089 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Sat, 24 Jun 2023 18:04:11 +0200 Subject: [PATCH] Add typescript-specific Optimize Imports binding --- after/ftplugin/typescript.lua | 4 ++++ after/ftplugin/typescriptreact.lua | 1 + 2 files changed, 5 insertions(+) create mode 100644 after/ftplugin/typescript.lua create mode 120000 after/ftplugin/typescriptreact.lua diff --git a/after/ftplugin/typescript.lua b/after/ftplugin/typescript.lua new file mode 100644 index 0000000..e5ad9bf --- /dev/null +++ b/after/ftplugin/typescript.lua @@ -0,0 +1,4 @@ +vim.keymap.set("n", "o", + function() vim.lsp.buf.execute_command({ command = "_typescript.organizeImports", arguments = { vim.fn.expand("%:p") } }) end, + { desc = "Organize imports" } +) diff --git a/after/ftplugin/typescriptreact.lua b/after/ftplugin/typescriptreact.lua new file mode 120000 index 0000000..ede1851 --- /dev/null +++ b/after/ftplugin/typescriptreact.lua @@ -0,0 +1 @@ +typescript.lua \ No newline at end of file