我是VIM的新手,将它用作IDE。我试图想象如何以简单的方式打开我的“项目”中的文件。VIM搜索 - FuzzyFinder搜索特定文件
我在.vimrc文件中这样配置:
colorscheme Tomorrow-Night
" nocompatible has to be the first of all (use the real vimpower)
set nocompatible
" backup rules
set backup " enable backup files (.txt~)
set undofile " enable persistent undo
silent execute '!mkdir -p $HOME/.vim/tmp/backup'
set backupdir=$HOME/.vim/tmp/backup " where to store backup
silent execute '!mkdir -p $HOME/.vim/tmp/swap'
set directory=$HOME/.vim/tmp/swap " where to store swap
silent execute '!mkdir -p $HOME/.vim/tmp/views'
set viewdir=$HOME/.vim/tmp/views " where to store view
silent execute '!mkdir -p $HOME/.vim/tmp/undo'
set undodir=$HOME/.vim/tmp/undo " where to store undo
" syntax
syntax on " enable syntax highlighting
" filetype
filetype on " enable filetype detection
filetype plugin on " enable filetype plugins
filetype indent on " enable filetype indentation
" tabstop settings
set tabstop=4 " a tab found in a file will be represented with 4 columns
set softtabstop=4 " when in insert mode <tab> is pressed move 4 columns
set shiftwidth=4 " indentation is 4 columns
" show linenumbers
set number
" Documentation configuration
let g:pdv_cfg_Author = 'Abraham Cruz <[email protected]>'
" Autocompletition
" Complete options (disable preview scratch window)
set completeopt = menu,menuone,longest
" Limit popup menu height
set pumheight = 15
" SuperTab option for context aware completion
let g:SuperTabDefaultCompletionType = "context"
let g:SuperTabNoCompleteAfter = ['^', ',', '\s']
let g:SuperTabMappingForward = '<c-space>'
let g:SuperTabMappingBackward = '<s-c-space>'
" Disable auto popup, use <Tab> to autocomplete
" let g:clang_complete_auto = 0
" Show clang errors in the quickfix window
let g:clang_complete_copen = 1
" TagBar Lint
let g:tagbar_phpctags_memory_limit = '512M'
" Upload on save if the project is configured to do so
autocmd BufWritePost * :call SyncUploadFile()
" Open each buffer in its own tab
:au BufAdd,BufNewFile * nested tab sball
所以每一个新的缓冲区在新标签打开。
我知道如果我这样做:
:e libra*/Core/Sess*/Ob*
例如,它会打开文件library/Core/Session/Object.php
但问题是,如果我做了一个错误,而不是打开该文件,它会打开一个新的缓冲区与名称libra*/Core/Sess*/Ob*
(假设文件不存在)。还有,我不喜欢被写入每一个所有/
时间,以便将更好地只是做:
:e libr*Cor*Sess*Obj*.php
但它会打开一个新的缓冲与该名称(libr*Cor*Sess*Obj*.php
),而不是打开该文件。 ..
我也来知道我可以这样做:
:fin libra(press tab here)
它会自动完成......但这里的问题是,它会显示(在这个例子中):find libexslt/
,我知道肯定文件夹不在我的文件夹内。其实,这里是我有文件夹的截图:
因此,大家可以看到,我没有libexslt那里......所以我不知道它正从这些信息。 ..
有什么方法可以轻松打开文件吗?在这个例子中,我知道文件是Session/Object.php所以我可以这样做:
:fin *Sessi*Obj*php
?另外,我知道该文件的声明中:
<?php
class Core_Session_Object
或者,另一个例子,
<?php
namespace Core\Session;
class Object
我可以做这样的事情:
:vimgrep /class*Core_Session_Object/ *.php
:vimgrep /name*Core*Sess*Obj/ *.php
?
非常感谢!这对我帮助很大。关于数据库,我试图使用ctag,但我真的不喜欢它的行为方式...... – Cito 2014-09-27 14:34:16