vim的fuzzyfinder插件打开文件,其名称为整个目录

时间:2018-01-28 18:53:40

标签: vim fuzzyfinder

我正在使用vim编辑器,我从here获得的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 中的fuzzyfinder找到,但是当我按下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 

1 个答案:

答案 0 :(得分:0)

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

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

相关问题