I'm newbie at VIM using it as IDE. I'm trying to figure how to open in an easy way files within my "project".
I have this configurations in my .vimrc file:
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 <abrahamsustaita@gmail.com>'
" 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
So every new buffer is opened in a new tab.
I know if I do:
:e libra*/Core/Sess*/Ob*
for instance, it will open the file library/Core/Session/Object.php
But the problem is if I make one mistake, instead of open the file, it will open a new Buffer with the name libra*/Core/Sess*/Ob*
(supposing the file does not exists). Also, I don't like to be writing every time all the /
so will be better to just do:
:e libr*Cor*Sess*Obj*.php
But it will open a new buffer with that name (libr*Cor*Sess*Obj*.php
), instead of opening the file...
I came to know also that I can do:
:fin libra(press tab here)
And it will autocomplete... but the problem here is it will show (for this example) :find libexslt/
and I know for sure that folder is not within the folder I'm. Actually, here is an screenshot of the folders I have there:
So as you can see, I have no libexslt there... so I don't know where it is getting that info from...
Is there any way to open a file easily? In this example, I know the file is Session/Object.php so could I do something like:
:fin *Sessi*Obj*php
? Also, I know the file has inside the declaration:
<?php
class Core_Session_Object
Or, another example,
<?php
namespace Core\Session;
class Object
Can I do something like:
:vimgrep /class*Core_Session_Object/ *.php
:vimgrep /name*Core*Sess*Obj/ *.php
?