0

I am using the vim editor and I have some trouble with the FuzzyFinder I get from here. So I have a project called

~/project/

In the project, there is a

project/src/

and

project/build/

and a project/tags file. I created the tags file with

cd project
ctags -R --extra=+f

so to use the fuzzyfinder, I open some source file of the project:

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

and from there I try to do a fuzzyfind

:FufTaggedFile

to find my_class.cpp somewhere in my project folder. It is found by fuzzyfinder in src/myLibrary/src/my_class.cpp but when I hit enter it opens a file named

src/myLibrary/src/my_class.cpp

into the directory

~/project/src/app/src/

but doesn't open the file I would like him to open which is :

~/project/myLibrary/src/my_class.cpp

Do you know what can go wrong here?

edit

My ~/.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 
roi_saumon
  • 489
  • 4
  • 13

1 Answers1

0

~/project/src/app/src/myLibrary/src/my_class.cpp is probably opened because it's closer to your current location.

Maybe you have autochdir on or there's an option that tells your plugin how to behave in such a circumstance? You should read its documentation to be sure.

romainl
  • 186,200
  • 21
  • 280
  • 313
  • I checked that that I have noautochdir. Also, tried to change the tagrelative option but this didn't change anything. :( – roi_saumon Jan 29 '18 at 23:19
  • A FuzzyFinder option, not a Vim option. – romainl Jan 30 '18 at 06:49
  • I couldn't find a FuzzyFinder option that solves my problem. For the moment, the only work-around I found is to have my vim current directory to be the directory where the tag file is created. – roi_saumon Jan 30 '18 at 13:20