0

我正在使用 vim 编辑器,我从这里得到的 FuzzyFinder 遇到了一些问题。所以我有一个项目叫

~/project/

在项目中,有一个

project/src/

project/build/

和一个project/tags文件。我创建了标签文件

cd project
ctags -R --extra=+f

所以要使用fuzzyfinder,我打开了项目的一些源文件:

$ vim project/src/app/src/main.cpp

从那里我尝试做一个模糊查找

:FufTaggedFile

在我的项目文件夹中找到my_class.cpp某处。它是由模糊查找器找到的,src/myLibrary/src/my_class.cpp 但是当我按 Enter 键时,它会打开一个名为

src/myLibrary/src/my_class.cpp

进入目录

~/project/src/app/src/

但没有打开我希望他打开的文件:

~/project/myLibrary/src/my_class.cpp

你知道这里会出什么问题吗?

编辑

我的 ~/.vimrc

set nocompatible              " be iMproved, required                                                                                                                
filetype off                  " required                                                                                                                             

" set the runtime path to include Vundle and initialize                                                                                                              
set rtp+=~/.vim/bundle/Vundle.vim                                                                                                                                    
call vundle#begin()                                                                                                                                                  
" alternatively, pass a path where Vundle should install plugins                                                                                                     
"call vundle#begin('~/some/path/here')                                                                                                                               

" let Vundle manage Vundle, required                                                                                                                                 
Plugin 'VundleVim/Vundle.vim'                                                                                                                                        

" The following are examples of different formats supported.                                                                                                         
" Keep Plugin commands between vundle#begin/end.                                                                                                                     

" YouCompletMe for autocompletion                                                                                                                                    
Plugin 'https://github.com/Valloric/YouCompleteMe'                                                                                                                   

"Conque-GDB                                                                                                                                                          
Plugin 'vim-scripts/Conque-GDB'                                                                                                                                      

"FuzzyFinder                                                                                                                                                         
Plugin 'vim-scripts/FuzzyFinder'                                                                                                                                     

"AutoTag                                                                                                                                                             
Plugin 'https://github.com/craigemery/vim-autotag'                                                                                                                   

"vim airline                                                                                                                                                         
Plugin 'vim-airline/vim-airline'                                                                                                                                     
Plugin 'vim-airline/vim-airline-themes'                                                                                                                              

"solarized color theme                                                                                                                                               
"Plugin 'git://github.com/altercation/solarized.git'                                                                                                                 
"Bundle 'altercation/vim-colors-solarized'                                                                                                                           

" All of your Plugins must be added before the following line                                                                                                        
call vundle#end()            " required                                                                                                                              
filetype plugin indent on    " required                                                                                                                              
" To ignore plugin indent changes, instead use:                                                                                                                      
"filetype plugin on                                                                                                                                                  
"                                                                                                                                                                    
" Brief help                                                                                                                                                         
" :PluginList       - lists configured plugins                                                                                                                       
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache                                                                                            
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal                                                                         
"                                                                                                                                                                    
" see :h vundle for more details or wiki for FAQ                                                                                                                     
" Put your non-Plugin stuff after this line                                                                                                                          

"options for ConqueGdb                                                                                                                                               
"vem we close ConqueGdb, it also closes the split                                                                                                                    
let g:ConqueTerm_CloseOnEnd = 1                                                                                                                                      

"set the line number"                                                                                                                                                
set number                                                                                                                                                           

"hilight the word we search for with the / command                                                                                                                   
set hlsearch                                                                                                                                                         

"set relative numbering                                                                                                                                              
set relativenumber                                                                                                                                                   

"set the tags file                                                                                                                                                   
set tags=./tags;                                                                                                                                                     
"set tags=tags;                                                                                                                                                      

"remappings                                                                                                                                                          

"save with ctrl+s                                                                                                                                                    
noremap <silent> <C-S>          :update<CR>                                                                                                                          
vnoremap <silent> <C-S>         <C-C>:update<CR>                                                                                                                     
inoremap <silent> <C-S>         <C-O>:update<CR>                                                                                                                     

"dont allow the arrows for mooving                                                                                                                                   
noremap <Up> <NOP>                                                                                                                                                   
noremap <Down> <NOP>                                                                                                                                                 
noremap <Left> <NOP>                                                                                                                                                 
noremap <Right> <NOP>                                                                                                                                                

"automatic bracket seeting                                                                                                                                           
inoremap ( ()<Esc>i
"inoremap { {<cr>}<c-o>O                                                                                                                                             
inoremap [ []<Esc>i                                                                                                                                                  
inoremap < <><Esc>i                                                                                                                                                  
syntax on                                                                                                                                                            

"FuzzyFinder remappings                                                                                                                                              
noremap ,f :FufFileWithCurrentBufferDir<CR>                                                                                                                          
noremap ,b :FufBuffer<CR>                                                                                                                                            
noremap ,t :FufTaggedFile<CR>                                                                                                                                        

"go out of a parenthesis with ctrl+a                                                                                                                                 
inoremap <C-e> <C-o>A                                                                                                                                                

"no swap files                                                                                                                                                       
set noswapfile                                                                                                                                                       

"set term=screen-256color-bce                                                                                                                                        
"set t_Co=256                                                                                                                                                        


"set solarized theme in vim                                                                                                                                          
set background=dark                                                                                                                                                  
colorscheme solarized                                                                                                                                                

"set solarized theme for vim-airline                                                                                                                                 
let g:airline_theme='solarized'                                                                                                                                      

"Enable the list of buffers                                                                                                                                          
let g:airline#extensions#tabline#enabled = 1                                                                                                                         

" Show just the filename                                                                                                                                             
let g:airline#extensions#tabline#fnamemod = ':t'                                                                                                                     

"automatically change the current directory                                                                                                                          
"set autochdir                                                                                                                                                       
"set noautochdir 
4

1 回答 1

0

~/project/src/app/src/myLibrary/src/my_class.cpp可能已打开,因为它更靠近您当前的位置。

也许您有autochdir或有一个选项可以告诉您的插件在这种情况下如何表现?你应该阅读它的文档来确定。

于 2018-01-29T06:30:20.717 回答