tips and tricks

From DavinciWiki
Jump to: navigation, search

Description

Davinci has many features that are not apparent and many advanced users may not even know. The intention of this page is to help document some of these features. Most of the features are the same or have very close analogues to shell command line usages.

  • ! - this operator is used to execute an external shell command line command. For example, by typing "!ls", all of the contents of the directory will be listed just like the ls command on the shell. Any shell command line executable can be accessed this way, but no user defined aliases are preserved. So if you have an "emacs" alias to "e" in your .cshrc or .bashrc, typing "!e" will not work. The full "!emacs" must be typed for this to work. Things can also be put in the background by adding an "&" after the command just like on the shell command line.
  • tab - by hitting tab, davinci will try to auto-complete the rest of the path in your filename. This has the same functionality as the shell command line.
  • control - this operator has the exact same use as the command line. Several operators will be listed below in the format of "Ctrl-a" where "Ctrl" is the control key and "a" is the given letter. The control key must be hit first and held while the second key is entered.
    • Ctrl-a - used to go to the beginning of the line
    • Ctrl-e - used to go to the end of the line
    • Ctrl-u - clears the line before the cursor.
    • Ctrl-k - clears the line after the cursor
    • Ctrl-y - inserts either of the previous clear at the cursor
    • Ctrl-b - move the cursor backward
    • Ctrl-f - move the cursor forward
    • Ctrl-d - delete a character after the cursor and quits davinci when no characters are left
    • Ctrl-h - delete a character before the cursor
    • Ctrl-w - delete the last word
    • Ctrl-t - switch the order of the last two characters. For example "de" changes to "ed".
    • Ctrl-s - initiates the davinci forward search mode. Simply start to type the command you are looking for and if it exists after your current place in history, the command that matches will be found. Continue to type Ctrl-s to move to the next occurrence of the string for which you searched.
    • Ctrl-r - initiates the davinci reverse search mode. Simply start to type the command you are looking for and if it exists before your current place in history, the command that matches will be found. Continue to type Ctrl-r to move to the next occurrence of the string for which you searched.
    • Ctrl-l - clear the screen leaving one command prompt at the top
    • Ctrl-c - stops the current process and returns the dv> command prompt. NOTE: You get only one of these so make it count!
    • Ctrl-i(x2) - list everything in the current directory
  • escape-p - the escape key is very useful in davinci, mainly when used in conjunction with the p key. By typing the "esc" key and then hitting the "p" key while escape is not depressed, the last command you entered will appear. If you start to type a command like "a=read(" and then enter escape-p, the rest of the line containing the characters you entered will be found. You can continue to move throught the commands by entering "esc-p" again. NOTE: a file called ".inputrc" must exist in your home directory and contain the following line: "\M-p": history-search-backward
  • escape-n - this is basically the opposite of "esc-p". It searches forward for previous commands rather than backwards. NOTE: a file called ".inputrc" must exist in your home directory and contain the following line: "\M-n": history-search-forward
  • arrow keys - by using the up and down arrows, the last and next functions you have called in history can be browsed. This is similar to escape-p but without the preferential searching of the first letters of the desired command.


Here is a sample .inputrc file and .dvrc file

.inputrc .dvrc

 Wiki Navigation Bar

Last Updated: Feb-2011


More News

Personal tools