function to check for semicolon when using A
This commit is contained in:
parent
9100997c8f
commit
069785d16d
11
vimrc
11
vimrc
|
@ -161,6 +161,8 @@ nnoremap <leader>ry diw"0P
|
||||||
|
|
||||||
inoremap jk <esc>
|
inoremap jk <esc>
|
||||||
|
|
||||||
|
nnoremap A :call Checksemicolon()<CR>;
|
||||||
|
|
||||||
nnoremap <leader>co :!clear;
|
nnoremap <leader>co :!clear;
|
||||||
nnoremap <leader>gs :!clear; git status<CR>
|
nnoremap <leader>gs :!clear; git status<CR>
|
||||||
nnoremap <leader>gd :!clear; git diff<CR>
|
nnoremap <leader>gd :!clear; git diff<CR>
|
||||||
|
@ -354,6 +356,15 @@ augroup END
|
||||||
|
|
||||||
" #functions
|
" #functions
|
||||||
|
|
||||||
|
function! Checksemicolon()
|
||||||
|
:normal $
|
||||||
|
if getline('.')[col('.')-1] == ';'
|
||||||
|
:startinsert
|
||||||
|
else
|
||||||
|
:startinsert!
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
" get name of syntax item
|
" get name of syntax item
|
||||||
function! SyntaxItem()
|
function! SyntaxItem()
|
||||||
return synIDattr(synID(line('.'),col('.'),1),'name') . ' -> ' . synIDattr(synIDtrans(synID(line('.'),col('.'),1)), 'name' )
|
return synIDattr(synID(line('.'),col('.'),1),'name') . ' -> ' . synIDattr(synIDtrans(synID(line('.'),col('.'),1)), 'name' )
|
||||||
|
|
Loading…
Reference in New Issue