How to open txt file with Gvim on default when "Shift+F4" creats new txt file?
Moderators: white, Hacker, petermad, Stefan2
How to open txt file with Gvim on default when "Shift+F4" creats new txt file?
Every time I create a new txt file with "Shift+F4" hotkey, TC open it with notepad on default, but I want to open it with Gvim, how to do it?
Re: How to open txt file with Gvim on default when "Shift+F4" creats new txt file?
Notepad is hardcoded in TC.
I use NotepadReplacer to make my favorite editor (SynWrite / Syn2) the system default for any calls to notepad.
https://www.binaryfortress.com/NotepadReplacer/
I use NotepadReplacer to make my favorite editor (SynWrite / Syn2) the system default for any calls to notepad.
https://www.binaryfortress.com/NotepadReplacer/
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1375a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.78
QAP 11.6.3.3 x64
TC 11.03 x64 / x86
Everything 1.5.0.1375a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.78
QAP 11.6.3.3 x64
Re: How to open txt file with Gvim on default when "Shift+F4" creats new txt file?
Huh? No, it isn't. I've been using ConTEXT editor with Shift+F4 for over a decade now. The only place where TC uses a hardcoded editor is Settings > Change Settings File Directly which has been a discussion for many years.
@Joeyy:
See Options > Edit/View > Editor for F4, and set the editor you wish. The same editor will be used for Shift+F4 hotkey.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: How to open txt file with Gvim on default when "Shift+F4" creats new txt file?
Hi Joeyy
there are several approach.
A:
change your default Editor in TC:
Menu Configuration > Options... > Edit/View > Editor for F4
Editor: TOOLs\NotePad2\notepad2.exe "%1"
((("TOOLs" is a sub folder in my TC folder)))
B:
1.) Create a user defined command in usercmd.ini
[em_F4_VBS] ;NewFile like Shift+F4
cmd="TOOLs\CMDs\CreateNewTextFile.vbs"
Param="%O.%E"
'2.) Assign a keyboard shortcut in wincmd.ini
[Shortcuts]
CS+F4=em_F4_VBS ;Ctrl+Shift+F4
'3.) Write a script, like this "CreateNewTextFile.vbs"
C:
Use external tools, like "putfile" from our member m^2
https://www.ghisler.ch/board/viewtopic.php?p=136366#p136366
Also there are some other tools for the "F4"-button to handle different extensions:
viewtopic.php?p=293272#p293272
HTH?
there are several approach.
A:
change your default Editor in TC:
Menu Configuration > Options... > Edit/View > Editor for F4
Editor: TOOLs\NotePad2\notepad2.exe "%1"
((("TOOLs" is a sub folder in my TC folder)))
B:
create a user defined command
1.) Create a user defined command in usercmd.ini
[em_F4_VBS] ;NewFile like Shift+F4
cmd="TOOLs\CMDs\CreateNewTextFile.vbs"
Param="%O.%E"
'2.) Assign a keyboard shortcut in wincmd.ini
[Shortcuts]
CS+F4=em_F4_VBS ;Ctrl+Shift+F4
'3.) Write a script, like this "CreateNewTextFile.vbs"
Code: Select all
'On Error Resume Next
'If WScript.Arguments.Count = 0 Then WScript.Quit
strPara = "New Text file.txt"
SET ARGs = WScript.Arguments
IF args.count > 0 Then strPara = args(0)
strTimestamp = year(now) &"-"& right( "0" & month(now), 2) &"-"& right( "0" & day(now), 2)
strNewFileName = strTimestamp & "_" & strPara
NewFileName = InputBox("Enter file name to create new:","Total Commander",strNewFileName)
If NewFileName="" Then
WScript.Quit
Else
'//TRICK: use "?" sign in new file name to open the text file after creation:
IF (InStr(NewFileName,"?")) Then
bOpenTextFileAfterwards = TRUE
NewFileName = Replace(NewFileName,"?","")
End If
CreateObject("Scripting.FileSystemObject").CreateTextFile(NewFileName)
End If
IF (bOpenTextFileAfterwards) Then
SET WSO = WScript.CreateObject("WScript.Shell")
TCPath = WSO.ExpandEnvironmentStrings("%Commander_Path%")
'//WSO.Run strCommand [,intWindowStyle 0=Hide 1=Activate 2=minimize 3=maximize ...] [,bWaitTillFinish? True/defaultFalse]
WSO.run TCPath & "\TOOLs\NotePad2\notepad2.exe " & NewFileName
SET WSO = Nothing
End IF '(bOpenTextFileAfterwards)
C:
Use external tools, like "putfile" from our member m^2
https://www.ghisler.ch/board/viewtopic.php?p=136366#p136366
Also there are some other tools for the "F4"-button to handle different extensions:
viewtopic.php?p=293272#p293272
HTH?
Re: How to open txt file with Gvim on default when "Shift+F4" creats new txt file?
Ops, sorry, I confused it with the Change setting issue.Dalai wrote: ↑2019-03-25, 15:05 UTCHuh? No, it isn't. I've been using ConTEXT editor with Shift+F4 for over a decade now. The only place where TC uses a hardcoded editor is Settings > Change Settings File Directly which has been a discussion for many years.
@Joeyy:
See Options > Edit/View > Editor for F4, and set the editor you wish. The same editor will be used for Shift+F4 hotkey.
Regards
Dalai
But in my case NodepadReplacer fixed that also.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1375a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.78
QAP 11.6.3.3 x64
TC 11.03 x64 / x86
Everything 1.5.0.1375a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.78
QAP 11.6.3.3 x64
Re: How to open txt file with Gvim on default when "Shift+F4" creats new txt file?
@Dalai@Stefan2@Horst.Epp
Thanks!
Thanks!