个人工具

UbuntuHelp:Vfu

来自Ubuntu中文

Oneleaf讨论 | 贡献2007年5月24日 (四) 14:30的版本 (新页面: {{From|https://help.ubuntu.com/community/Vfu}} {{Languages|UbuntuHelp:Vfu}} vfu ia a nifty little text-based file-manager which can be run from a terminal. === Helpful Commands: === *...)

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索

vfu ia a nifty little text-based file-manager which can be run from a terminal.



Helpful Commands:

  • h - help
  • q - exit
  • ENTER - view file or enter folder
  • BKSPACE - up a level
  • e - erase file/folder
  • c - copy files
  • m - move files
  • i - edit file
  • 0 - switch between simple and detailed listings
  • ~ - to home directory
  • . - show/hide hidden files
  • F - mask files
  • u - user menu
  • TAB - edit file name/properties


Changing location of config file:

To change where the configuration file is stored ( such as moving it to .config so that it does not clutter the home folder) add

# to get vfu to put config file into ~/.conf
# have to export $RC_PREFIX as .conf
export RC_PREFIX=.config

into the file .bashrc. The configiuraton file can now be found in ~/.config/vfu/vfu.conf

If you decide not to change the location of the config file, it will be stored in ~/.vfu/vfu.conf


Custom File Editor:

To change the text editor used by vfu find, within the vfu.conf file, the line (near the top):

Editor=vim %f

and change it so that `vim` is the editor of your choice, such as `gedit`, `kwrite`, `mousepad`, `vi`, `vim`, `nano`, `emacs`. You may have to turn off the 'use internal editor' option in the options menu (press `o` to bring up menu and `SPACE` to turn off option). It is also possible to use a different viewer if you so wish.


Custom File Associations:

Vfu can be customised to open different files with different programs; Entrys are put in the comma separated format such as:

ux=SEE DOC,ENTER,.doc.DOC.odt.sxw.,ooffice2 -writer "%f" &

Where:

  • `SEE DOC` is just a short descriptive name
  • `ENTER` is the action on the file
  • `.ext.ext.ext.ext.` the file extentions to which the actions apply (dot separated list)
  • `ooffice2 -writer "%f"` is the command to use on the file, "%f" is the location of the file
  • `&` indicates that you whish to continue using vfu whist the file is open

Thus, vfu will open ooffice2 -writer when I press ENTER on a .odt file (or .doc , .sxw etc).

Example section:

# view pictures
ux=SEE JPEG,ENTER,.JPG.jpg.JPEG.jpeg.gif.xpm.png.,feh "%f" 2> /dev/null &

# view HTML documents -- now moved to SEE filters below
ux=SEE HTML,ENTER,.htm.html.shtml.,firefox "%F" &
#ux=SEE HTM,ENTER,.htm.html.,w3m "%F"
ux=SEE HTML,INSERT,.htm.html.shtml.,w3m "%F"

# office document viewing
ux=SEE DOC,ENTER,.doc.DOC.odt.sxw.,ooffice2 -writer "%f" &
ux=SEE SHEET,ENTER,.ods.sxc.xls.,ooffice2 -calc "%f" &
ux=SEE PRESENTATION,ENTER,.odp.ppt.sxi.,ooffice2 -impress "%f" &
ux=SEE DRAW,ENTER,.odg.sxd.sda.sdd.,ooffice2 -draw "%f" &

#music
x=PLAY MP3,ENTER,.ogg.mp3.wav.wma.,vlc -I skins2 "%f" %i 1> /dev/null 2> /dev/null &
ux=PLAY MP3,INSERT,*,xmms *.mp3 *.wav 1> /dev/null 2> /dev/null &

# view PDF and PS document
ux=VIEW PDF,ENTER,.pdf.PDF.,acroread "%f"&
ux=VIEW PS,ENTER,.ps.,gv "%f"&

#
ux=VIEW TAR,INS,.gz.,gunzip -c "%f" | tar tvf - | less

# view man pages -- note you can add and see filter for this
ux=VIEW MAN,ENTER,.1.2.3.4.5.6.7.8.,man "%F"

# play mpeg's
ux=PLAY MPEG,ENTER,.mpg.MPG.mpeg.asf.avi.mov.wmv.,vlc -I skins2 "%f"  1> /dev/null 2> /dev/null &
ux=PLAY MPEG,INS,.mpg.MPG.mpeg.asf.avi.mov.wmv.,vlc -I skins2 "%f" 1> /dev/null 2> /dev/null &

Custom User Menu:

The user menu is reached by pressing the `u` key. Custom options in this menu can be added by finding the section;

#
# following user commands are bound to the UserMenu -- key `u'
# note that instead of keyname there's `menu' string!
# first letter is hotkey!
#
ux=lLocate file,menu,*,locate %? %w
ux=---,menu,*,
ux=ompg123: Stop,menu,*,killall -TERM mpg123 1> /dev/null 2> /dev/null &
ux=smpg123: Suspend,menu,*,killall -STOP mpg123 1> /dev/null 2> /dev/null &
ux=cmpg123: Continue,menu,*,killall -CONT mpg123 1> /dev/null 2> /dev/null &
ux=vmpg123: View running/queue,menu,*,ps xeo "%%p %%a" | grep mpg123 | grep -v grep | less

The format is of comma separated fields:

ux=kname,menu,*,command

where:

  • `k` is the shortcut key in the menu.
  • `name` is the name of the entry in the menu.
  • `menu` states that it is a menu item.
  • `*` is the filetype filter - leave it as an asterix to enable it to be performed on all files/folders.
  • `command` is the command to be performed the variable "%f" is used to add in the location of the file/folder. An '&' can be added on at the end if you want to continue using vfu whilst the action is being performed.

Example menu section:

#
# following user commands are bound to the UserMenu -- key `u`
# note that instead of keyname there's `menu` string!
# first letter is hotkey!
#
ux=lLocate file,menu,*,locate %? %w
ux=---,menu,*,
ux=ffeh: show pics in feh,menu,*,feh "%f" &
ux=gfeh: show pics fullscreen,menu,*,feh -F "%f"
ux=pplay: play in xfmedia,menu,*,xfmedia "%f" &
ux=wwatch: play in vlc,menu,*,vlc -I skins2 "%f" 1> /dev/null 2> /dev/null &
ux=---,menu,*,
ux=ompg123: Stop,menu,*,killall -TERM mpg123 1> /dev/null 2> /dev/null &
ux=smpg123: Suspend,menu,*,killall -STOP mpg123 1> /dev/null 2> /dev/null &
ux=cmpg123: Continue,menu,*,killall -CONT mpg123 1> /dev/null 2> /dev/null &
ux=vmpg123: View running/queue,menu,*,ps xeo "%%p %%a" | grep mpg123 | grep -v grep | less

Where extra options have been added to play music/videos in xfmedia or vlc and to show pictures in feh. i.e. It is now possible to open a folder of pictures using feh or a folder of music using vlc (with the options for a nice skin)

But the best way to find out about vfu (and most other programs) is to make a backup of the file and then play arround with it to see what you can get it to do.

Links

vfu homepage