From de1755aac904031368888f6bb6a35ae9ba27bba3 Mon Sep 17 00:00:00 2001 From: ManjaroOne666 Date: Sun, 25 Feb 2018 17:40:51 +0000 Subject: [PATCH] function to check for semicolon when using A --- vimrc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vimrc b/vimrc index abad5dc..fdfa9ed 100644 --- a/vimrc +++ b/vimrc @@ -161,6 +161,8 @@ nnoremap ry diw"0P inoremap jk +nnoremap A :call Checksemicolon() + nnoremap co :!clear; nnoremap gs :!clear; git status nnoremap gd :!clear; git diff @@ -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' )