if i create a new file with shift + f4 the file will always created with ANSI and with Windows Line endings, which is quite outdated.
would be great having a way to configure it, like in notepad++
Image: http://i.imgur.com/R6fsAdb.png
Make new file Format configurable (shift + F4)
Moderators: white, Hacker, petermad, Stefan2
- consistency
- Junior Member
- Posts: 24
- Joined: 2006-03-18, 15:11 UTC
Make new file Format configurable (shift + F4)
macOS? Linux? als Desktop Ersatz?
nö da gibts keinen Totalcommander.
Clone? ich sagte _Totalcommander_
nö da gibts keinen Totalcommander.
Clone? ich sagte _Totalcommander_
Re: Make new file Format configurable (shift + F4)
Till then you could us work around like:consistency wrote:...would be great having a way to configure it, ...
REM 1.) create the "template.txt" with your settings and this batch:
Code: Select all
@ECHO OFF
SET myPath=%1
SET /P myName=Dateiname:
COPY "%Commander_Path%\ShellNew\template.txt" "%myPath%\%myName%"
REM Start "" path\to\my\editor.exe %myPath%\%myName%
Start "" notepad2.exe "%myPath%\%myName%"
REM 2.) create usercmd with the batch as command and "%P" as parameter
usercmd.ini
[em_e]
cmd=%Commander_Path%\ShiftF4Proxy.cmd
param="%P"
REM Tip: Try in TC command line: em_e
REM 3.) set Shift+F4 to execute that usercmd em_e
WINCMD.INI
[Shortcuts]
S+F4=em_e
Of course there are better (nicer) ways to implement this work around.
There can be found many example in the forum.
Without using the "Start" command this is also an example to create a new file without launching an editor after it.
I have such command as Shift+Ctrl+F4 for such cases. ( if I only would remember that more often )
Re: Make new file Format configurable (shift + F4)
No, it just creates an empty file.consistency wrote:if i create a new file with shift + f4 the file will always created with ANSI and with Windows Line endings, which is quite outdated.
It exclusively depends on your editor how things are treated, in case of an empty (zero byte) file.
You can select e.g. Notepad2 as the default editor:
Options -> Edit/View -> Editor for F4
and insert e.g.
Code: Select all
%COMMANDER_PATH%\tools\notepad2\Notepad2.exe /utf8 /crlf
and existing files will still be recognized and opened in their correct encoding (Unicode detection).
Use /lf switch for Unix line endings, and so on.
I'm sure that there are also similar command line switches for Notepad++.
While I agree that TC could (optionally) insert an Unicode BOM for newly created files,
pre-selecting the line endings is not a thing that makes sense, because you'd need to insert empty lines for that,
in order to make the editor recognize what endings should be used.
TC plugins: PCREsearch and RegXtract
- consistency
- Junior Member
- Posts: 24
- Joined: 2006-03-18, 15:11 UTC
forgot to write in english, here the english version:
thanks for the helpful infos.
i opened an issue for notepad++ https://github.com/notepad-plus-plus/notepad-plus-plus/issues/228
unfortunately notepad++ has no option for forcing formats via commandline switches.
i havn't tested the option to create a custom cmd script yet but i will test it in the near future.
thanks anyway.
orginal post:
thanks for the helpful infos.
i opened an issue for notepad++ https://github.com/notepad-plus-plus/notepad-plus-plus/issues/228
unfortunately notepad++ has no option for forcing formats via commandline switches.
i havn't tested the option to create a custom cmd script yet but i will test it in the near future.
thanks anyway.
orginal post:
Code: Select all
danke für die hilfreichen infos.
habe mal bei notepad++ ein issue geöffnet https://github.com/notepad-plus-plus/notepad-plus-plus/issues/228
leider hat notepad++ keine möglichkeit diese einstellungen über command line zu erzwingen.
die möglichkeit es über eine eigenes cmd script zu machen muss ich noch testen. auf jeden fall vielen dank.
Last edited by consistency on 2015-06-27, 12:00 UTC, edited 1 time in total.
macOS? Linux? als Desktop Ersatz?
nö da gibts keinen Totalcommander.
Clone? ich sagte _Totalcommander_
nö da gibts keinen Totalcommander.
Clone? ich sagte _Totalcommander_