mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-12-25 12:51:45 +00:00
simply apply pwsh as shell for wsl instead of f7e7530
This commit is contained in:
parent
7404b85ee4
commit
44b45b7c11
@ -16,10 +16,7 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setqflist, { desc = 'Open diagno
|
|||||||
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
||||||
|
|
||||||
-- Open terminal in current window
|
-- Open terminal in current window
|
||||||
local use_ps = vim.fn.has 'win32' == 1 or vim.fn.has 'wsl' == 1
|
vim.keymap.set({ 'n', 'v' }, '<leader>to', '<cmd>term<cr>', { desc = '[T]erminal [O]pen' })
|
||||||
local shellname = vim.fn.executable 'pwsh.exe' == 1 and 'pwsh' or 'powershell'
|
|
||||||
local cond_str = use_ps and (' ' .. shellname .. '.exe') or ''
|
|
||||||
vim.keymap.set({ 'n', 'v' }, '<leader>to', '<cmd>term' .. cond_str .. '<cr>', { desc = '[T]erminal [O]pen' })
|
|
||||||
|
|
||||||
-- Disable arrow keys in normal mode
|
-- Disable arrow keys in normal mode
|
||||||
vim.keymap.set({ 'n', 'v' }, '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
vim.keymap.set({ 'n', 'v' }, '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
vim.cmd 'silent! language en_US'
|
vim.cmd 'silent! language en_US'
|
||||||
|
|
||||||
-- Shell options
|
-- Shell options
|
||||||
-- Sets the shell to use for system() and ! commands in windows
|
-- Sets the shell to use for system() and ! commands in windows and wsl
|
||||||
if vim.fn.has 'win32' == 1 and vim.fn.has 'wsl' == 0 then
|
if vim.fn.has 'win32' == 1 or vim.fn.has 'wsl' == 1 then
|
||||||
vim.opt.shell = vim.fn.executable 'pwsh.exe' == 1 and 'pwsh' or 'powershell'
|
vim.opt.shell = vim.fn.executable 'pwsh.exe' == 1 and 'pwsh.exe' or 'powershell.exe'
|
||||||
vim.opt.shellcmdflag = '-NoLogo -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;'
|
vim.opt.shellcmdflag = '-NoLogo -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;'
|
||||||
vim.opt.shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait'
|
vim.opt.shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait'
|
||||||
vim.opt.shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
|
vim.opt.shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
|
||||||
|
Loading…
Reference in New Issue
Block a user