User Tools

Site Tools


ultraedit

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ultraedit [2014/10/03 09:32] – created dblumeultraedit [2023/11/05 20:43] (current) – removed dblume
Line 1: Line 1:
-====== UltraEdit ====== 
  
-Here are notes on configuring UltraEdit... 
- 
-===== Code on Linux Boxes ===== 
- 
-Have code on a Linux box that you want to share via SAMBA with a Windows box? 
- 
-On the Perforce client, Delete Host and use ALtRoot as per [[http://www.perforce.com/perforce/doc.current/manuals/p4guide/chapter.configuration.html|the Perforce documentation]]. There's a special rule that you have to specify Root for the Windows path, and then an AltRoot for your Linux path. 
- 
-  - Delete Host 
-  - Use Root for the Windows path, and AltRoots for the Linux path. 
- 
-Then, an additional trick to translate filepaths can be done on the Linux side like so: 
- 
-<code bash .bashrc> 
-# Used by the "convert_paths" command 
-export SAMBA_ROOT=$HOME/sandbox 
-</code> 
- 
-<code python convert_paths> 
-#!/usr/bin/python 
-import os 
-import sys 
-from subprocess import check_output 
- 
-samba_root = os.environ['SAMBA_ROOT'] 
-win_drive = 'Z' 
- 
-def win2nix(s): 
-    global win_drive 
-    if len(s) > 3 and s[1] == ':' and s[2] == '\\': 
-        win_drive = s[0] 
-        return "%s/%s" % (samba_root, s[3:].replace('\\', '/')) 
-    return s 
- 
-def nix2win(s): 
-    for line in s.splitlines(): 
-        if line.startswith(samba_root): 
-            print "%s:%s" % (win_drive, line.replace('/', '\\')) 
-        else: 
-            print line 
- 
-if __name__ == '__main__': 
-    params = [win2nix(i) for i in sys.argv[1:]] 
-    r = check_output(params) 
-    nix2win(r) 
-</code> 
- 
-===== Advanced User Tools ===== 
- 
-Use PuTTY plink to be able to send commands via ssh to a Linux workstation. Then... 
- 
-<code find-symbol> 
-plink.exe username@10.1.1.200 findsymbol '%p' "%sel%"  
-</code> 
- 
-<code p4-edit> 
-plink.exe username@10.1.1.200 convert_paths p4 edit '%f' 
-</code> 
- 
-Or, suppose you've configured a Perforce client to work on a Linux system, and for Windows to access it via a SAMBA share.  Use the Root/AltRoots/no Home trick. Then, you can have UltraEdit do a Perforce diff like so: 
- 
-<code p4-diff> 
-"C:\Program Files\Perforce\p4v.exe" -cmd 'prevdiff %f' 
-</code> 
- 
-===== Scripts ===== 
- 
-Assume you have a User Tool named "find-symbol" (as above) that outputs a list of files and line numbers like: 
- 
-<code> 
-Z:\sourcecode\main.cpp(204):  msgType, enum name of class:MainClass file: 
-</code> 
- 
-If there's only one line of results in the list, you could have a script that automatically goes to the symbol of that only result. 
- 
-<code javascript goto-symbol.js> 
-UltraEdit.runTool("find symbol"); 
- 
-// Get the output from the outputWindow via a "side" clipboard. 
-var prev_clipboard_index = UltraEdit.clipboardIdx; 
-var temp_clipboard_index = prev_clipboard_index + 1; 
-if (temp_clipboard_index > 9) { 
-    temp_clipboard_index = 1; 
-} 
-UltraEdit.selectClipboard(temp_clipboard_index); 
-UltraEdit.outputWindow.copy(); 
-var temp_lines = UltraEdit.clipboardContent.split("\n"); 
-UltraEdit.selectClipboard(prev_clipboard_index); 
- 
-var arrayLength = temp_lines.length; 
-if (arrayLength == 1 || (arrayLength == 2 && temp_lines[1].length == 0)) {     
-    // fields = temp_lines[0].split("): "); 
-    var file_and_line = temp_lines[0].substring(0, temp_lines[0].lastIndexOf(")")); 
-    var delimiter =file_and_line.lastIndexOf("("); 
-    if (delimiter != -1) { 
-        var file_to_open = file_and_line.substring(0, delimiter); 
-        var lowercase_file_to_open = file_to_open.toLowerCase(); 
-        var line_number = parseInt(file_and_line.substring(delimiter+1)); 
-        // UltraEdit.outputWindow.write("DCB: Going to process file_to_open " + file_to_open + " at line " + line_number); 
-     
-        if (file_to_open.length > 0) {  // Is there a header or source file for the active file? 
-         
-            var doc_index = 0; // Look if this file is already open. 
-            do { 
-                open_filename = UltraEdit.document[doc_index].path.toLowerCase(); 
-                if (open_filename == lowercase_file_to_open) { 
-                    UltraEdit.document[doc_index].setActive(); 
-                    break; 
-                } 
-            } while (++doc_index < UltraEdit.document.length) 
-             
-            if (doc_index >= UltraEdit.document.length) 
-                UltraEdit.open(file_to_open); 
-             
-            UltraEdit.activeDocument.gotoLine(line_number,0); 
-            UltraEdit.activeDocument.selectLine(); // does this take a parameter? 
-        } 
-    } 
-} 
-</code> 
ultraedit.1412353929.txt.gz · Last modified: 2023/04/12 20:44 (external edit)