nvim

Personal nvim configurations
git clone https://git.kamikakushi.net/nvim.git
Log | Files | Refs | LICENSE

terminal.lua (823B)


      1 -- vim: expandtab:ts=2:sw=2
      2 
      3 vim.keymap.set('n', '<C-w><C-e>', ':tabe<CR>:terminal<CR>i')
      4 vim.keymap.set('t', [[<C-\><C-\>]], [[<C-\><C-n>]])
      5 
      6 vim.api.nvim_create_autocmd('TermClose', {
      7   pattern = '*',
      8   command = [[if !v:event.status | exe 'bdelete! '..expand('<abuf>') | endif]],
      9 })
     10 
     11 if vim.fn.has('win32') == 1 then
     12   -- @see :h shell-powershell
     13   if vim.fn.executable('pwsh') == 1 then
     14     vim.o.shell = 'pwsh'
     15   else
     16     vim.o.shell = 'powershell'
     17   end
     18   vim.o.shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;'
     19   vim.o.shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait'
     20   vim.o.shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'
     21   vim.o.shellquote = ''
     22   vim.o.shellxquote = ''
     23 end
     24