Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inserting a use statement switches off auto indentation #37

Open
dbatten5 opened this issue Jan 8, 2018 · 0 comments
Open

Inserting a use statement switches off auto indentation #37

dbatten5 opened this issue Jan 8, 2018 · 0 comments

Comments

@dbatten5
Copy link

dbatten5 commented Jan 8, 2018

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:

screen shot 2018-01-08 at 12 23 22
screen shot 2018-01-08 at 12 25 45

This can be rectified with the command :set autoindent but this only applies to the current buffer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant