From 1a3744d95edca035d786f91049c8dbd3c0ca6443 Mon Sep 17 00:00:00 2001 From: fiplox Date: Tue, 3 Jan 2023 15:18:25 +0000 Subject: [PATCH] change test for automap (do not execute lsusb on ssh) --- lua/config/mappings.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lua/config/mappings.lua b/lua/config/mappings.lua index 5acce7b..104bbf9 100644 --- a/lua/config/mappings.lua +++ b/lua/config/mappings.lua @@ -86,12 +86,15 @@ function UnMapDHM() vim.api.nvim_del_keymap('n', 'N') end -local handle = io.popen 'lsusb | grep -c Sofle' -local automap = handle:read '*n' -handle:close() - -if not automap or os.getenv 'SSH_TTY' then +if os.getenv 'SSH_TTY' then MapDHM() +else + local handle = io.popen 'lsusb | grep -c Sofle' + local automap = handle:read '*n' + handle:close() + if not automap then + MapDHM() + end end local wk = require 'which-key'