ultraedit
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ultraedit [2014/10/03 12:33] – dblume | ultraedit [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:// | ||
- | |||
- | - 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 " | ||
- | export SAMBA_ROOT=$HOME/ | ||
- | </ | ||
- | |||
- | <code python convert_paths> | ||
- | # | ||
- | import os | ||
- | import sys | ||
- | from subprocess import check_output | ||
- | |||
- | samba_root = os.environ[' | ||
- | win_drive = ' | ||
- | |||
- | def win2nix(s): | ||
- | global win_drive | ||
- | if len(s) > 3 and s[1] == ':' | ||
- | win_drive = s[0] | ||
- | return " | ||
- | return s | ||
- | |||
- | def nix2win(s): | ||
- | for line in s.splitlines(): | ||
- | if line.startswith(samba_root): | ||
- | print " | ||
- | else: | ||
- | print line | ||
- | |||
- | if __name__ == ' | ||
- | params = [win2nix(i) for i in sys.argv[1: | ||
- | r = check_output(params) | ||
- | nix2win(r) | ||
- | </ | ||
- | |||
- | ===== 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 ' | ||
- | </ | ||
- | |||
- | <code p4-edit> | ||
- | plink.exe username@10.1.1.200 convert_paths p4 edit ' | ||
- | </ | ||
- | |||
- | Or, suppose you've configured a Perforce client to work on a Linux system, and for Windows to access it via a SAMBA share. | ||
- | |||
- | <code p4-diff> | ||
- | " | ||
- | </ | ||
- | |||
- | ===== Scripts ===== | ||
- | |||
- | Assume you have a User Tool named " | ||
- | |||
- | < | ||
- | Z: | ||
- | </ | ||
- | |||
- | If there' | ||
- | |||
- | <code javascript goto-symbol.js> | ||
- | UltraEdit.runTool(" | ||
- | |||
- | // Get the output from the outputWindow via a " | ||
- | 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(" | ||
- | 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, | ||
- | var delimiter =file_and_line.lastIndexOf(" | ||
- | if (delimiter != -1) { | ||
- | var file_to_open = file_and_line.substring(0, | ||
- | var lowercase_file_to_open = file_to_open.toLowerCase(); | ||
- | var line_number = parseInt(file_and_line.substring(delimiter+1)); | ||
- | // UltraEdit.outputWindow.write(" | ||
- | | ||
- | if (file_to_open.length > 0) { | ||
- | for (var doc_index = 0; doc_index < UltraEdit.document.length; | ||
- | open_filename = UltraEdit.document[doc_index].path.toLowerCase(); | ||
- | if (open_filename == lowercase_file_to_open) { | ||
- | UltraEdit.document[doc_index].setActive(); | ||
- | break; | ||
- | } | ||
- | } | ||
- | |||
- | if (doc_index >= UltraEdit.document.length) { | ||
- | UltraEdit.outputWindow.write(" | ||
- | UltraEdit.open(file_to_open); | ||
- | } | ||
- | | ||
- | UltraEdit.activeDocument.gotoLine(line_number, | ||
- | UltraEdit.activeDocument.selectLine(); | ||
- | } | ||
- | } | ||
- | } | ||
- | </ |
ultraedit.1412364828.txt.gz · Last modified: 2023/04/12 20:44 (external edit)