This is a holiday and I am bored at home. So I read books and write programs every day, and, of course, I like VIM in my Ubuntu9.10 ,,, supports some quick operations and runs some external commands. However, it is troublesome to use VIM to edit a file. Each time you open a terminal and then enter the file directory... Later, I naturally thought of adding the command for opening a file to the right-click menu... I wrote a SHELL. Of course, this SHELL is very simple. It doesn't use this regular expression, either.
This is a holiday, so I am bored at home, so I read books and write programs every day, and, of course, in my Ubuntu 9.10, I still like the VIM ,,, supports some quick operations and runs some external commands. However, it is troublesome to use VIM to edit a file. Each time you open a terminal and then enter the file directory... Later, I naturally thought of adding the command for opening a file to the right-click menu... I wrote a SHELL. Of course, this SHELL is very simple. It is useless to use this regular expression, and there are not many commands. As follows:
#! /Bin/bash # This is a script program that calls the VI editor through Shell to open # selected files. # Author: wangshui # Email: csauthor@gmail.com # personal website: http://www.oscoder.cn # Distributed under the terms of gnu gpl version2 or later # install in ~ /. Gnome2/nautilus-scripts or ~ /Nautilus/scripts # You need to be running Nautilus 1.0.3 + to use scripts. # When a directory is selected, go there. otherwise go to current # directory. if more than one directory is selected, show error. if [-n "$ NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"]; thenset $ NAUTILUS_SCRIPT_SELECTED_FILE_PATHSif [$ #-eq 1]; thendestination = "$1" if [-f "$ destination"]; thendestination = "$1" elsezenity -- error -- titl E = "Error-Open Vi here" \ -- text = "You can only select a file that Vi supported! "Exit 1 fielsezenity -- error -- title =" Error-Open Vi here "\ -- text =" Only select the one file. "exit 1 unzip iexec x-terminal-emulator-e vi" $ destination"