akinsho / akinsho/toggleterm.nvim

Toggleterm.nvim: Using cmd.exe with clink on Windows (More performant than Windows Terminal)

未关闭
#613 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Lua
星标
5.6k
派生
206
PR 合并指标
30 天内没有已合并 PR

描述

[`clink`](https://github.com/chrisant996/clink) is a tool which transforms `cmd.exe` on Windows to give it the power and customization of Windows Terminal while preserving the native speed of cmd.exe. Really good out-of-the-box experience including syntax highlighting, autosuggestions and other stuff.

Here's how I'm using it in my config to run cmd.exe with clink:

```lua
{
"akinsho/toggleterm.nvim",
opts = {
shell = package.config:sub(1, 1) == "\\"
and 'cmd.exe /s /k "clink inject -q && %userprofile%\\dotfiles\\doskeys.cmd"'
or vim.o.shell,
},
}
```

Explanation:
- `package.config:sub(1, 1) == "\\"`: Checks the path separator, if its a backslash we are on Windows, otherwise do not change the shell
- `/s`: Suppress cmd.exe copyright information that launches on start up
- `/k`: Runs the following string as a command
- `clink inject -q`: Starts clink
- `%userprofile%\\dotfiles\\doskeys.cmd`: Since cmd.exe doesn't have something like `.bashrc`, I use a `.cmd` file which contains a bunch of `doskey`, `doskey` is similar to `alias` in bash. That file is being run and activates my "aliases" to work within the terminal

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。