scinotes
Scinotes: Embedded Scilab text editor
Syntax
scinotes() scinotes(file) scinotes([file1, file2]) scinotes(file, line_number) scinotes(file, line_number, macro_name) scinotes([file1, file2], [line_number1, line_number2]) scinotes(file, 'readonly') scinotes(file, ['indent','trailing','quote']) scinotes([file1, file2], 'readonly') scinotes([file1, file2], ['indent','trailing','quote'])
Arguments
- file
a string, the file to be opened.
- [file1, file2]
a matrix of string, files to be opened.
- line_number
An integer, the number of the line to be highlighted at the opening of the file.
- macro_name
a string, the line number would be relative to the definition of the function macro_name
- [line_number1, line_number2]
a matrix of integer, each opened file will have its corresponding line highlighted.
Description
Scinotes is an embedded Scilab text editor.
It can be started with a fresh text buffer pressing the "Editor"
button on top of the main Scilab window, or from Scilab command line with
the instruction editor(), or it can open specific files
if invoked with any of the syntaxes above (without any
parameters, it opens editor with a blank file).
The same invocation adds further files to an already opened Editor.
With the option 'readonly', files are opened in read-only mode so they cannot be modified.
With the options 'indent', 'quote' or 'trailing', the editor will not be opened and the file(s) will be treated consequently to the actions. The actions are the following:
The action 'indent' will indent correctly the file.
The action 'trailing' will remove the trailing white spaces.
The action 'quote' will replace all simple quoted strings by double quoted ones.
One or several actions can be used at the same time, e.g. 'trailing' or ['indent','quote'].
Keyboard shortcuts are defined for most possible editing actions and reported by the menu entries.
Scinotes can be started in the following ways :
By the menu Applications. Choose Applications => Editor
From the command line:
scinotes()
scinotes(file)
scinotes([file1, file2])
scinotes(file, line_number)
scinotes([file1, file2], [line_number1, line_number2])
Menus and Shortcuts
The shortcuts below are the default ones. On macOS, Ctrl is replaced
by Cmd. All of them can be customized in the Shortcuts section
of the Scilab preferences.
Menu File
Command
Shortcut
Description
New Ctrl+N Open a new empty file
Open Ctrl+O Open an existing file
Open recent Reopen a recently opened file
Working directories Add or remove favorite directories
Open file in ... Open a file located in the current or in a favorite directory
Save file in ... Save the file in the current or in a favorite directory
Reload Ctrl+Shift+R Reload the file from the disk
Restore opened files on start-up Reopen at start-up the files opened at the end of the previous session
Open function source file Ctrl+Shift+O Open the source file of the function under the caret
Open URL Ctrl+U Open the URL under the caret
Save Ctrl+S Save the file
Save as Ctrl+Shift+S Save the file under a new name
Save All Save all the opened files
Overwrite Save the file even if it has been modified on the disk
Export Export the file to HTML, PDF, PNG, ...
Page Setup Setup the page for printing
Print Preview Ctrl+Shift+P Open a print preview window
Print Ctrl+P Print the file
Close Ctrl+W Close the file
Close All Close all the files
Close All But This Close all the files except the current one
Exit Scinotes Ctrl+Q Close the editor
Menu Edit
Command
Shortcut
Description
Undo Ctrl+Z Undo the last action
Redo Ctrl+Y Redo the last undone action
Cut Ctrl+X Cut the selection
Copy Ctrl+C Copy the selection
Copy as HTML with line number Ctrl+Shift+C Copy the selection as colorized HTML, with line numbers
Paste Ctrl+V Paste the clipboard content
Delete Delete Delete the selection
Columns actions > Paste Column Ctrl+Shift+V Paste the clipboard lines as a column at the caret position
Columns actions > Repeat on the Column Ctrl+Shift+Z Repeat the selection on the column
Select All Ctrl+A Select the whole document
Select current block Ctrl+B Select the block (function, loop, ...) containing the caret
Search > Find/Replace Ctrl+F Find and/or replace a text
Search > Find Next Ctrl+K Find the next occurrence
Search > Find Previous Ctrl+Shift+K Find the previous occurrence
Search > Incremental Search F3 Search while typing, in a bar at the bottom of the editor
Search > Find files Ctrl+Shift+B Search files by name in a directory
Search > Find word in files Ctrl+Shift+F Search a word in the files of a directory
Search > Set anchor Ctrl+M Set an anchor on the current line
Search > Go to next anchor Ctrl+Shift+< Move the caret to the next anchor
Search > Go to previous anchor Ctrl+< Move the caret to the previous anchor
Search > Remove anchor Ctrl+Shift+M Remove the anchor of the current line
Search > Code Navigator Ctrl+G Navigate through functions and anchors, or go to a given line
Menu Format
Command
Shortcut
Description
Shift Right Tab Indent the selected lines
Shift Left Shift+Tab Unindent the selected lines
Correct Indentation Ctrl+I Indent the selected lines according to the Scilab syntax
Remove trailing spaces Ctrl+Shift+W Remove the trailing white spaces
Generate comments for help_from_sci Ctrl+Shift+G Insert a help comments template for the function (see help_from_sci)
Comment Selection Ctrl+D Comment the selected lines
Uncomment Selection Ctrl+Shift+D Uncomment the selected lines
Change the case > Make Selection Lowercase Ctrl+J Convert the selection to lowercase
Change the case > Make Selection Uppercase Ctrl+Shift+J Convert the selection to uppercase
Change the case > Capitalize Selection Ctrl+Shift+A Capitalize the selection
Single to double quote strings Replace all simple quoted strings by double quoted ones
Menu Options
Command
Shortcut
Description
Current file encoding Encoding of the file (default is UTF-8)
Line Endings End of line characters of the file (Windows, Unix, Mac)
Preferences > Set font Font settings
Preferences > Set colors Color settings
Preferences > Scinotes General settings Open the SciNotes preferences
Auto-completion on > (, [, ... Ctrl+H Automatically close parentheses, brackets and quotes
Auto-completion on > if, function, ... Ctrl+Shift+H Automatically close blocks (end, endfunction, ...)
Line numbering Hide the line numbers, or display them as normal or local (relative to the current function) numbering
Menu Window
Command
Shortcut
Description
Copy tab in new window Ctrl+Shift+T Open the current file in a new SciNotes window
Detach tab in new window Ctrl+Shift+X Move the current tab to a new SciNotes window
Copy selection in a new tab Create a new file containing the selection
Split View Split the current view in two columns or in two rows
Assistant Show or hide the AI assistant panel (see scinotes_assistant)
Menu Execute
Command
Shortcut
Description
... file with no echo Ctrl+Shift+E Execute the file without displaying its instructions in the console
... file with echo Ctrl+L Execute the file, displaying its instructions in the console
... the selection with echo Ctrl+E Execute the selection, or the text until the caret when nothing is selected
Save and execute Ctrl+F5 Save the file, then execute it
Save and execute all files Save all the files, then execute them
Menu Debug (see scinotes_debugger)
Command
Shortcut
Description
Debug or resume F5 Start debugging the file, or resume the execution
Pause F6 Pause the execution
Step Over F10 Execute the current line
Step In F11 Enter the function called on the current line
Step Out Shift+F11 Run until the current function returns
Run to Cursor Ctrl+F10 Run until the line of the caret
Stop Debugging Shift+F5 Abort the debugging session
Toggle Breakpoint F9 Set or remove a breakpoint on the current line
Enable All Breakpoints Enable all the breakpoints
Disable All Breakpoints Disable all the breakpoints
Remove All Breakpoints Remove all the breakpoints
Menu ?
Command
Shortcut
Description
Scinotes help F1 Open this help page
Help on ... Ctrl+F1 Open the help page of the keyword under the caret, or of the selection
About Shift+F1 Display information about SciNotes
Other shortcuts
Command
Shortcut
Description
Complete Ctrl+Space Complete the word under the caret (also in the contextual menu)
Next tab Ctrl+Page Down Go to the next tab
Previous tab Ctrl+Page Up Go to the previous tab
Next paragraph Ctrl+Down Move the caret to the next paragraph
Previous paragraph Ctrl+Up Move the caret to the previous paragraph
Remarks
- Document :
The default text colorization is the Scilab's syntax colorization.
The
auto-indentmode indent a line according to Scilab's syntax (after a return action).
Examples
// editor without parameters scinotes(); // editor with a file name scinotes('SCI/modules/time/macros/datenum.sci'); // editor with a matrix of files name scinotes(['SCI/modules/time/macros/datenum.sci','SCI/modules/time/macros/datevec.sci']); // editor with a file name and the line number to highlight scinotes('SCI/modules/time/macros/datenum.sci', 5); // editor with a file name and the line number to highlight scinotes('SCI/modules/time/macros/datenum.sci', 8, 'datenum'); // editor with a matrix of files name and the corresponding matrix of lines to highlight // the files name matrix and the lines to highlight matrix should have the same size scinotes(['SCI/modules/time/macros/datenum.sci','SCI/modules/time/macros/datevec.sci'], [5,10]);
Indent some Scilab code
f=TMPDIR + "/file_to_correct.sci"; mputl(["a=''abcdef'' "; "if a==1"; " b=1+""abcdef'' "; " c=2"; " d=3 "; " if "; "a=''abcdef"""""""; " end"; " end "], f); scinotes(f, ["indent" "trailing" "quote"]); // Show the results write(%io(2), mgetl(f))
--> write(%io(2),mgetl(f))
a="abcdef"
if a==1
b=1+"abcdef"
c=2
d=3
if
a="abcdef"""
end
end
See Also
- edit — edits a given Scilab function or file
- editvar — Scilab variable editor
- ged — Interactive edition of hierarchical properties of graphic objects
- ieditor — Interactive plot editor
- console — Keyboard shortcuts predefined in the console window
- scinotes_debugger — SciNotes debugger: breakpoints, step by step execution and values of the variables in the editor
- scinotes_assistant — SciNotes AI assistant: chat with an AI coding agent that reads your code, runs it in Scilab and edits your files
History
| Version | Description |
| 5.4.1 | ['indent','trailing','quote'] options added. |
| Report an issue | ||
| << editor | Script editor | scinotes_assistant >> |