Преглед изворни кода

nixpkgs/neovim: exclude import from typescript references

Thomas Dy пре 2 година
родитељ
комит
ae796553e8
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      .config/nixpkgs/neovim/lsp.lua

+ 5 - 0
.config/nixpkgs/neovim/lsp.lua

@@ -90,6 +90,11 @@ if vim.fn.executable("node_modules/.bin/tsc") == 1 then
       ts_utils.setup_client(client)
 
       on_attach(client, bufnr)
+
+      -- override mappings for typescript
+      local opts = { silent = true, buffer = bufnr }
+      -- exclude import statements from reference search (may have false positives)
+      vim.keymap.set('n', 'gr', '<cmd>Telescope lsp_references default_text=!import\\ <CR>', opts)
     end,
   })
 end