1 Introduction to the project plugin for VIM
The purpose of the project plugin is to help users manage the source code in the form of projects.
2 Download the project pluginA) Official website: http://www.vim.org/scripts/script.php?script_id=69.
b) This installation csdn download: http://download.csdn.net/detail/clevercode/9515570.
3 Installation
(Upload project-1.4.1.tar.gz to/usr/local/src/vim/plugin/project directory)
Extract:
# mkdir-p/usr/local/src/vim/plugin/project
# Cd/usr/local/src/vim/plugin/project
# TAR-ZXVF Project-1.4.1.tar.gz
Find Vim
# Whereis Vim
Copy Plugin
# cp/usr/local/src/vim/plugin/project/plugin/project.vim/usr/share/vim/vim74/plugin/
Copy the Help file
# cp/usr/local/src/vim/plugin/project/doc/project.txt/usr/share/vim/vim74/doc/
4 Use4.1 First time use
If the project address is:/home/test/mywork.
Enter the VIM command at the command line, then enter: Project, and then \c to create a project.
$ vim
:P roject
\c. Enter the Name of the Entry:mywork
Enter the Absolute Directory to Load:/home/test/mywork
Enter the CD parameter:/home/test/mywork
Enter the File Filter: *.csv *.php *.js *.sh *.sql *.conf *.xslt *.xml *.avatar *.tpl *.dev *.prd crontab.* *.cfg.* *.html *.htm *.intftest *.vim *.PLX *.txt
Save
: W
4.2 Re-useWay One
$ vim
:P roject
Way Two
$ Vim-c ' project/home/test/.vimprojects '
5 Adding items5.1 added in existing project, if required in/home/test/mywork project. Add the Conn folder to the DB directory.
A
$ Vim-c ' project/home/test/.vimprojects '
b) Move the cursor to the A.txt line in the DB directory. Conn will be established below the a.txt.
c) Command mode input: \c. Add Conn
Enter the Name of the Entry:conn
Enter the Directory to Load:conn
Enter the CD parameter:
Enter the File Filter:
5.2 Adding new items
Just move the cursor to the last line. Then follow section 4.1 to create a new project.
6 ~/.vimprojects
All of the project's document directories are saved in ~/.vimprojects. The format is as follows:
Mywork=/home/test/mywork cd=/home/test/mywork filter= "*.csv *.php *.js *.sh *.sql *.conf *.xslt *.xml *.avatar *.tpl *.dev *.PRD crontab.* *.cfg.* *.html *.htm *.intftest *.vim *.plx *.txt "{index.php config=config {} css=css {} db=db { A.txt conn=conn { mysql.php } b.txt}}mywork2=/home/test/mywork2 cd=/home/test/mywork2 {a.txt b.txt }
7 Some other operations
When you start the project plug-in, some commands are supported relative to it. Enter in normal mode (note case sensitive):
\ r updates the collapsed file according to the item filter.
\ r recursive execution \ r.
\c Create a project. But does not include subdirectories under the specified directory.
\c executes the \c recursively, including all subdirectories under the specified directory.
<Return> Open the file, or turn the collapse on or off.
<S-Return> Shift+return
\s with <Return> Open file, split the window horizontally when opening the file.
\s load all files into the current window, the current window will be split horizontally to display all the files.
<C-Return> Ctrl+return
\o opens the specified file into a window, and closes all other windows,
<M-Return> Alt+return
\v just open the file, the cursor remains in the list of items.
<CTRL-Up>
\<up> moves the text or collapses to the previous line of the current cursor.
<CTRL-Down>
\<down> moves the text or collapses to the next line of the current cursor.
\I displays the full parameters of the collapsed cursor and the inheritance parameters in the status bar.
\I Displays the full path of the file in the status bar.
\l loads all the files of the current project layer into the current vim. During the loading process, any key presses cause a stop.
\l Loads the current project and the files in the subproject into the current vim. Use sparingly.
\g executes grep at the current project level.
\g executes grep at the current project level and sub-project.
<F12> when the flag bit ' g ' is used in the variable g:proj_flags, the key is used to toggle open and close the Project window.
See Project.txt for other operations.
Vim in the project plugin installation and use