1

I am unable to start Vdebug. I am using Vim-Plug to handle my plugins, :PlugStatus on a PHP file gives a status of OK. However, when I press F5, Vdebug is not started.

Does anyone has any idea what is going wrong? I also tried to change the mappings, but this had no effect.

I am using xfce4-terminal, and here is my .vimrc

" vim:fdm=marker:foldlevel=0
" Vim settings for Ruben Verweij
" Use Vim mode {{{
set nocompatible
" }}}
" Set encoding and file formats {{{
set encoding=utf-8 nobomb
scriptencoding utf-8
set fileformats=unix,mac,dos
set fileformat=unix
" }}}
" Use Plug for plugin management {{{
if empty(glob("~/.vim/autoload/plug.vim"))
    execute '!curl -fLo ~/.vim/autoload/plug.vim https://raw.github.com/junegunn/vim-plug/master/plug.vim'
endif
call plug#begin('~/.vim/plugged')
" }}}
" Backup and undo settings {{{
if has("vms")
    set nobackup      " do not keep a backup file, use versions instead
else
    set backup        " keep a backup file (restore to previous version)
    set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
    set backupskip=/tmp/*,/private/tmp/*
    set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
    set writebackup
    set undofile      " keep an undo file (undo changes after closing)
    set undolevels=500
    set undoreload=500
endif
set history=50      " keep 50 lines of command line history
" }}}
" Langnoremap setting {{{
if has('langmap') && exists('+langnoremap')
    " Prevent that the langmap option applies to characters that result from a
    " mapping.  If unset (default), this may break plugins (but it's backward
    " compatible).
    set langnoremap
endif
" }}}
" Basic shortcuts (leader) {{{
" Leader key
let mapleader=","
let maplocalleader=",,"
" Ever notice a slight lag after typing the leader key + command? This lowers
" the timeout.
set timeoutlen=500
" }}}
" Movement commands {{{
" move vertically by visual line
nnoremap j gj
nnoremap k gk
" }}}
" Insert mode misc settings {{{
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
" }}}
" Autoformat options {{{
set formatoptions=
set formatoptions+=c                  " Auto-wrap comments using textwidth
set formatoptions+=r                  " Continue comments by default
set formatoptions-=o                  " do not continue comment using o or O
set formatoptions+=q                  " continue comments with gq
set formatoptions+=n                  " Recognize numbered lists
set formatoptions+=2                  " Use indent from 2nd line of a paragraph
set formatoptions+=l                  " Don't break lines that are already long
set formatoptions+=1                  " Break before 1-letter words
" Vim 7.4 only: no // comment when joining commented lines
if v:version >= 704 | set formatoptions+=j | endif
" }}}
" Syntax highlighting {{{
" Switch syntax highlighting on, when the terminal has colors
syntax on
" }}}
" Omnicomplete settings {{{
set omnifunc=syntaxcomplete#Complete
set completeopt=longest,menuone
" }}}
" Text wrapping and tab widths {{{
set wrap
set textwidth=80
" highlight just the 81st column of wide lines... (Damien Conway)
highlight ColorColumn ctermbg=magenta
call matchadd('ColorColumn', '\%81v', 100)

" tabwidth
set tabstop=4       " visual spaces per tab
set softtabstop=4   " spaces when editing
set shiftwidth=4
set expandtab
" }}}
" Autowrite settings {{{
" Write the old file out when switching between files.
set autowrite
" Saves file when Vim window loses focus
au FocusLost * :wa
" Save file with sudo powers
cmap w!! w !sudo tee %
" }}}
" Jump to last cursor position {{{
augroup vimrcEx
    au!

    " When editing a file, always jump to the last known cursor position.
    " Don't do it when the position is invalid or when inside an event handler
    " (happens when dropping a file on gvim).
    autocmd BufReadPost *
                \ if line("'\"") >= 1 && line("'\"") <= line("$") |
                \   exe "normal! g`\"" |
                \ endif
augroup END
" }}}
" Search settings {{{
set ignorecase  " case insensitive search
set smartcase   " only case sensitive when typing capitals
set incsearch   " do incremental searching
set hlsearch    " highlight search matches
" }}}
" Folding settings {{{
" Enable code folding
set foldenable
" Use space to toggle folds and create folds
nnoremap <silent> <Space> @=(foldlevel('.')?'za':"\<Space>")<CR>
vnoremap <Space> zf
" Set foldmethod to indent and allow manual
augroup vimrc
    au BufReadPre * setlocal foldmethod=indent
    au BufWinEnter * if &fdm == 'indent' | setlocal foldmethod=manual | endif
augroup END
set foldlevelstart=10   " Open most folds by default
set foldnestmax=10      " 10 nested folds max
" }}}
" Git settings {{{
" Ignore whitespaces with git diffs
set diffopt+=iwhite
" }}}
" Plug plugins {{{
Plug 'kien/ctrlp.vim'
Plug 'ervandew/supertab'
Plug 'shawncplus/phpcomplete.vim', { 'for': 'php' }
Plug 'StanAngeloff/php.vim', { 'for': 'php' }
Plug 'scrooloose/syntastic'
Plug 'joonty/vdebug', { 'for': 'php' }
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-commentary'
Plug 'skammer/vim-css-color', { 'for': 'css' }
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-git'
Plug 'airblade/vim-gitgutter'
Plug 'pangloss/vim-javascript', { 'for': 'javascript' }
Plug 'heavenshell/vim-jsdoc', { 'for': 'javascript' }
Plug 'leshill/vim-json', { 'for': 'json' }
Plug 'xolox/vim-misc'
Plug 'tpope/vim-repeat'
Plug 'vim-latex/vim-latex', { 'for': 'latex' }
Plug 'kshenoy/vim-signature'
Plug 'ntpeters/vim-better-whitespace'
Plug 'Chiel92/vim-autoformat'
Plug 'hynek/vim-python-pep8-indent', { 'for': 'python' }
Plug 'majutsushi/tagbar'
Plug 'ivalkeen/vim-ctrlp-tjump'
Plug 'Valloric/YouCompleteMe', { 'do': './install.py --tern-completer' }
" }}}
" Vim airline {{{
let g:airline#extensions#tabline#enabled = 1
let g:airline_enable_branch     = 1
set laststatus=2
let g:airline_powerline_fonts = 1
" }}}
" YouCompleteMe {{{
let g:ycm_key_list_select_completion = ['<C-TAB>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-S-TAB>', '<Up>']
let g:ycm_collect_identifiers_from_tags_files = 1
let g:ycm_path_to_python_interpreter = '/usr/bin/python'
let g:SuperTabDefaultCompletionType = '<C-Tab>'
" }}}
" CtrlP {{{
set updatetime=250
let g:ctrlp_map = '<c-p>'
let g:ctrlp_working_path_mode = 'ra'
let g:ctrlp_reuse_window = 1            " Use same window
nnoremap <silent> <Leader>b :CtrlPBuffer<CR>
nnoremap <silent> <Leader>t :CtrlPTag<CR>
" CtrlP tjump
nnoremap <c-]> :CtrlPtjump<cr>
vnoremap <c-]> :CtrlPtjumpVisual<cr>
" Ignore settings
set wildignore+=*/vendor/**
"}}}
" The Silver Searcher {{{
" Use ag over grep
set grepprg=ag\ --nogroup\ --nocolor

" Use ag in CtrlP for listing files. Lightning fast and respects
" .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'

" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0

" define :Ag
if !exists(":Ag")
    command -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!
endif

" bind K to grep word under cursor
nnoremap K :silent! grep! "\b<C-R><C-W>\b"<CR>:cw<CR>

" bind \ (backward slash) to grep shortcut
nnoremap \ :Ag<SPACE>
" }}}
" GitGutter {{{
let g:gitgutter_grep_command = 'ag --nocolor'
" }}}
" Syntastic {{{
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_loc_list_height = 5
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 1
let g:syntastic_id_checkers = 1
let g:syntastic_aggregate_errors = 1
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_python_python_exec = '/usr/bin/python3'
let g:syntastic_python_checkers = ['python', 'pylint']
let g:syntastic_enable_signs = 1

let g:syntastic_error_symbol = '?'
let g:syntastic_style_error_symbol = '??'
let g:syntastic_warning_symbol = '??'
let g:syntastic_style_warning_symbol = '?'

highlight link SyntasticErrorSign SignColumn
highlight link SyntasticWarningSign SignColumn
highlight link SyntasticStyleErrorSign SignColumn
highlight link SyntasticStyleWarningSign SignColumn
" }}}
" Tagbar {{{
nnoremap <silent> <Leader>s :TagbarToggle<CR>
" }}}
" PHP settings {{{
" PHP Docblocks
function! PhpSyntaxOverride()
    hi! def link phpDocTags  phpDefine
    hi! def link phpDocParam phpType
endfunction
augroup phpSyntaxOverride
    autocmd!
    autocmd FileType php call PhpSyntaxOverride()
augroup END

let g:formatdef_phpfmt = '"php ~/bin/phpfmt --no-backup --psr --smart_linebreak_after_curly --visibility_order -"'
let g:formatters_php = ['phpfmt']
" }}}
" XDebug with vdebug {{{
" TODO: per project setting of path mapping?
let g:vdebug_options = {
            \   'path_maps': {
            \       "/vagrant/dev_src/": "/home/ruben/Code/studentsplus/dev_src/",
            \   },
            \   'timeout': 30,
            \   'break_on_open': 1
            \}
"}}}
" CSS settings {{{
let g:cssColorVimDoNotMessMyUpdatetime = 1
" }}}
" LaTeX Settings {{{
let g:tex_flavor='latex'
let g:Tex_DefaultTargetFormat = 'pdf'
let g:Tex_CompileRule_pdf = 'arara -v $*'
" }}}
" Clipboard shortcuts {{{
nnoremap <C-y> "+y
vnoremap <C-y> "+y
" }}}
" UI settings {{{
set ruler       " show the cursor position all the time
set showcmd     " display incomplete commands
set number      " show linenumbers
set linespace=3 " Prefer a slightly higher line height
set mousehide   " Hide mouse when typing
set cursorline  " Highlight current line
set wildmenu    " visual autocomplete for command menu
set showmatch   " highlight matching [{(
" }}}
" Theme {{{
" Set the color scheme.
set background=dark
" }}}
" Vim signature (marks) {{{
let g:SignatureMarkTextHLDynamic = 1
let g:SignatureMarkerTextHLDynamic = 1
" }}}
" End Plug {{{
" Add plugins to &runtimepath
call plug#end()
" }}}
" Identation settings {{{
" Enable file type detection
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent on

set autoindent                        " indent when creating newline

" for autoindent, use same spaces/tabs mix as previous line, even if
" tabs/spaces are mixed. Helps for docblock, where the block comments have a
" space after the indent to align asterisks
set copyindent

" Try not to change the indent structure on "<<" and ">>" commands. I.e. keep
" block comments aligned with space if there is a space there.
set preserveindent

" Smart detect when in braces and parens. Has annoying side effect that it
" won't indent lines beginning with '#'. Relying on syntax indentexpr instead.
set nosmartindent

" Global setting. I don't edit C-style code all the time so don't default to
" C-style indenting.
set nocindent
" }}}
  • I've never used the plugin but the readme page says Start Vdebug with <F5>, which will make it wait for an incoming connection. Run the script you want to debug, with the debugging engine enabled. A new tab will open with the debugging interface. you didn't mention starting the script you want to debug in your post so just to be sure: do you start the script to start the debugging? Also (probably) not related to your problem but you should keep only your plugin installation/customization between call plug#begin('~/.vim/plugged') and call plug#end(). – statox Mar 14 '16 at 16:53
  • Thanks for the tip on the begin/end tags. Just to be clear: I have opened a .php file in vim, and on a non-blank line in this file, I press <kbd>F5</kbd>. Then nothing happens. It should start a Vdebug session. I have also started the script with Xdebug enabled, but still nothing happens. – Ruben Mar 14 '16 at 20:16
  • I started my vim with your .vimrc, installed your plugins excepted youCompleteMe which poped an error, edited a php file and pressed F5 and I got the message Waiting for connection (Ctrl-C to cancel etc...). So I would be surprised but maybe youCompleteMe creates a conflict and you should try after disabling it otherwise as I can't reproduce your problem I don't know how to help you :-/ good luck :-) – statox Mar 14 '16 at 20:39
  • I have tried that as per your suggestion, but it does not work... Very strange. Which terminal emulator are you using? Maybe something is wrong with the keycode it receives. I am using xfce4-terminal. thanks for your help! :) – Ruben Mar 14 '16 at 21:39
  • Indeed good think to check I'm using rxvt-unicode on a Debian Jessie with gnome3. – statox Mar 14 '16 at 21:46
1

Turns out, my vim-gtk was not compiled with Python support, the output of :echo has("python") Returned 0. Manually compiling vim with python support as listed here solved the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.