function to check for semicolon when using A

This commit is contained in:
ManjaroOne666 2018-02-25 17:40:51 +00:00
parent 9100997c8f
commit de1755aac9
1 changed files with 11 additions and 0 deletions

11
vimrc
View File

@ -161,6 +161,8 @@ nnoremap <leader>ry diw"0P
inoremap jk <esc>
nnoremap A :call Checksemicolon()<CR>
nnoremap <leader>co :!clear;
nnoremap <leader>gs :!clear; git status<CR>
nnoremap <leader>gd :!clear; git diff<CR>
@ -354,6 +356,15 @@ augroup END
" #functions
function! Checksemicolon()
:normal $
if getline('.')[col('.')-1] == ';'
:startinsert
else
:startinsert!
endif
endfunction
" get name of syntax item
function! SyntaxItem()
return synIDattr(synID(line('.'),col('.'),1),'name') . ' -> ' . synIDattr(synIDtrans(synID(line('.'),col('.'),1)), 'name' )