Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NikitaRevenco opened this issue Oct 11, 2024 · 0 comments

Comments

@NikitaRevenco
Copy link

NikitaRevenco commented Oct 11, 2024

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:

{
		"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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant