Tapatalk

How to implement clang-format into UEX

How to implement clang-format into UEX

6
NewbieNewbie
6

PostDec 11, 2025#1

Can anyone point me to how one would implement clang-format into UltraEdit for Linux?

6,823625
Grand MasterGrand Master
6,823625

PostDec 13, 2025#2

Read the documentations about ClangFormat (tool) and Clang-Format Style Options. Next configure in UEX a user tool to run on active file clang-format with options specified by you in the user tool configuration. There is the UltraEdit Wiki page Configure tools explaining the user tool configuration options. But this page is mainly for configuring a user tool in UltraEdit for Windows. However, it should not be too difficult to configure a user tool running clang-format in UEX.

UltraEdit for Windows is installed with Artistic Style with built-in support for the options of this tool to reformat C/C++ source code files (and some other programming languages). The UltraEdit Wiki page Astyle reformat explains the options in this dialog window for the Artistic Style tool which is executed on the active file on first opening the Artistic Style Formatter window and clicking next on the button Reformat. UltraEdit remembers the current Artistic Style options on reformatting a file and reloads the options on next opening of the window. The options must be configured for that reason only once on running Artistic Style multiple times on same file or on multiple source code files. The command line options finally passed to the executable are even displayed at the bottom of the dialog window.

I do not use UltraEdit for Linux (or Linux) but there should be Artistic Style support built-in in UltraEdit for Linux according to the page UltraEdit Linux complete feature list listing under item “Tools” toolbar, including: the item Artistic Style (code beautifier / reformatter).

6
NewbieNewbie
6

PostDec 13, 2025#3

Well, thank you for that. Astyle options are close but not precisely what I desire. Nice to know it's included but I will pursue the clang-format as a tool. 

  

PostDec 13, 2025#4

A follow-up, if I may regarding files updated outside of UEX. My resolution for using clang-format turned out top be straight forward. Inasmuch as creating a tool or script seems to modify the .bashrc files used for GNOME terminal, I just added an entry for the application's Makefile as shown below:

Code: Select all

    fmt_ms:
        clear
        clang-format -i --style=Microsoft src/*.*
    
    fmt_gnu:
        clear
        clang-format -i --style=GNU src/*.*
    
    fmt_llvm:
        clear
        clang-format -i --style=LLVM src/*.*
    
    fmt_google:
        clear
        clang-format -i --style=Google src/*.*

These will update all of the files in place in the src directory which causes UEX to prompt for reloading each file individually. The earlier/windows versions on UltraEdit offered a dialog with the option to "reload all". Is there an equivalent option in UEX?
 
 Thank you.

6,823625
Grand MasterGrand Master
6,823625

PostDec 14, 2025#5

Do you mean the dialog window with the title UltraEdit - File changed, reload file? displayed on detection of a file change outside of UltraEdit with the additional buttons Yes to All and No to All or just All and None in very old versions of UltraEdit for Windows in addition to Yes and No?

There are in Configuration – Preferences in UEX – of UltraEdit for Windows at File handling - File change detection several configuration settings to determine reload behavior on detecting a file change done by another process on one or more files opened in UltraEdit. You should select Automatically update changed files if UEX has that setting in Preferences to. The option Prompt for update when files change for the setting File change detection causes opening the dialog window with the buttons on detection of a file change.

Note: A reload of a file changed by another process while opened in UltraEdit causes a deletion of the undo records made by UltraEdit for the reloaded file because UltraEdit cannot apply undo records if a file was changed outside UltraEdit by another application while opened and edited in UltraEdit.

6
NewbieNewbie
6

PostDec 14, 2025#6

Thank you very much! I would have never found that!
UEX is quite a different animal from the "old" UEdit I left off with -- and to be expected given the different OS and its idiosyncrasies.
Very grateful!