vim-php-namespace
vim-php-namespace copied to clipboard
Inserting a use statement switches off auto indentation
Using: NeoVim version 0.2.2
init.vim config:
" Alphabetisize the use statements
let g:php_namespace_sort_after_insert = 1
" Insert the use statement
function! IPhpInsertUse()
call PhpInsertUse()
call feedkeys('a', 'n')
endfunction
autocmd FileType php inoremap <leader>u <Esc>:call IPhpInsertUse()<CR>
autocmd FileType php noremap <leader>u :call PhpInsertUse()<CR><Paste>
" Expand a class name to the qualified name
function! IPhpExpandClass()
call PhpExpandClass()
call feedkeys('a', 'n')
endfunction
autocmd FileType php inoremap <leader>ex <Esc>:call IPhpExpandClass()<CR>
autocmd FileType php noremap <leader>ex :call PhpExpandClass()<CR>
Inserting a use statement works as expected but when I go to insert a new line, the cursor starts at the very start of the line as opposed to the correct indentation like so:
This can be rectified with the command :set autoindent
but this only applies to the current buffer