I'm trying to jump to the next python class or function in vim with the following commands:
autocmd FileType python nnoremap <buffer> [[ ?^class|^\s*def<CR>
autocmd FileType python nnoremap <buffer> ]] /^class|^\s*def<CR>
But it doesn't work. Vim prompted:
Error detected while processing FileType Auto commands for "python":
E492: Not an editor command: ^\s*def<CR>
How to fix this?