diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 1e75fd9..d563a78 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -16,7 +16,10 @@ vim.keymap.set('n', 'q', vim.diagnostic.setqflist, { desc = 'Open diagno vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) -- Open terminal in current window -vim.keymap.set({ 'n', 'v' }, 'to', 'term', { desc = '[T]erminal [O]pen' }) +local use_ps = vim.fn.has 'win32' == 1 or vim.fn.has 'wsl' == 1 +local shellname = vim.fn.executable 'pwsh' == 1 and 'pwsh' or 'powershell' +local cond_str = use_ps and (' ' .. shellname .. '.exe') or '' +vim.keymap.set({ 'n', 'v' }, 'to', 'term' .. cond_str .. '', { desc = '[T]erminal [O]pen' }) -- Disable arrow keys in normal mode vim.keymap.set({ 'n', 'v' }, '', 'echo "Use h to move!!"')