2026/10/02

토탈커맨더 F4 편집기에 Neovim 연결




wt 개별 터미널로 실행:
wt.exe -p "Zsh" nvim.exe "%1"


이미 실행중인 wt의 새탭에 추가:
wt.exe -w 0 new-tab -p "Zsh" nvim.exe "%1"


이미 실행중인 nvim의 버퍼에 추가(실행중인 nvim이 없으면 새탭에 추가):
conhost.exe --headless nvim.exe --server \\.\pipe\neovim --remote "%1"
또는
wt.exe -w 0 nvim.exe --server \\.\pipe\neovim --remote "%1"

** 실행중인 nvim이 없다면 wt에 새탭을 추가한 후 실행되고 RPC서버를 listen 상태로 실행한 nvim이 있으면 버퍼에 추가됨.
** 기존 nvim은  RPC서버를 listen 상태로 실행해야 해당서버에 추가할 수 있음(nvim --listen \\.\pipe\neovim)
** 또 다른 탭의 쉘에서 nvim을 실행할 때는 RPC서버 없이 실행하는게 관리하기 편함.



** Windows Terminal 실행시 3개의 프로파일을 탭으로 열고 포커스는 두번째 탭으로 하려면:
settings.json
{
    "startupActions": "new-tab -p PowerShell; new-tab -p Zsh ; new-tab -p Zsh nvim.exe --listen //./pipe/neovim; focus-tab -t 1",
}

** Windows Terminal에 Neovim프로파일로 쉘을 지정해 새로 만들면 터미널도 cmd가 아닌걸로 지정 가능함. 프로필 종료동작은 자동으로 닫지 않음으로 설정하는 게 편의성이 높음.
            {
                "adjustIndistinguishableColors": "indexed",
                "closeOnExit": "never",
                "colorScheme": "One Half Dark",
                "commandline": "C:\\msys64\\msys2_shell.cmd -defterm -here -no-start -ucrt64 -shell zsh -ic 'nvim --listen //./pipe/neovim'",
                "elevate": false,
                "experimental.retroTerminalEffect": false,
                "font": 
                {
                    "face": "Sarasa Fixed K Nerd Font",
                    "size": 12,
                    "weight": "medium"
                },
                "hidden": false,
                "historySize": 5000,
                "icon": "C:\\Utilities\\Icons\\neovim.png",
                "name": "NeoVIM",
                "opacity": 82,
                "pathTranslationStyle": "msys2",
                "scrollbarState": "hidden",
                "snapOnInput": true,
                "startingDirectory": null,
                "useAcrylic": false
            },



26/10/21 토탈커맨더 편집기 설정: 로딩 후 포커싱 가능하도록.

** 토탈커맨더 편집기 등록: conhost.exe --headless pwsh.exe -NoProfile -ExecutionPolicy Bypass -File "C:\Utilities\nvim-open.ps1" "%1"

** 파워쉘 스크립트: c:\utilities\nvim-open.ps1
param( [Parameter(Mandatory = $true)] [string]$File ) Add-Type @" using System; using System.Runtime.InteropServices; public class Win { [DllImport("user32.dll")] public static extern bool SetForegroundWindow(IntPtr h); [DllImport("user32.dll")] public static extern bool ShowWindow(IntPtr h, int n); [DllImport("user32.dll")] public static extern bool IsIconic(IntPtr h); [DllImport("user32.dll")] public static extern void keybd_event(byte vk, byte scan, int flags, int extra); } "@ $p = Get-Process WindowsTerminal -ErrorAction SilentlyContinue | Where-Object { $_.MainWindowHandle -ne 0 } | Select-Object -First 1 if ($p) { $h = $p.MainWindowHandle if ([Win]::IsIconic($h)) { [Win]::ShowWindow($h, 9) | Out-Null } [Win]::keybd_event(0x12, 0, 0, 0) [Win]::keybd_event(0x12, 0, 2, 0) [Win]::SetForegroundWindow($h) | Out-Null } # 3번째 탭으로 이동 (0부터 시작) wt.exe -w 0 focus-tab -t 2 & nvim.exe --server '\\.\pipe\neovim' --remote-silent $File