Merge pull request #285 from lfilho/improved-semicolon-insertion
Improved semicolon insertion
This commit is contained in:
commit
f460aa1442
13
vim/plugin/settings/yadr-append-semicolon.vim
Normal file
13
vim/plugin/settings/yadr-append-semicolon.vim
Normal file
@ -0,0 +1,13 @@
|
||||
" If there isn't one, append a semi colon to the end of the current line.
|
||||
function! s:appendSemiColon()
|
||||
if getline('.') !~ ';$'
|
||||
let original_cursor_position = getpos('.')
|
||||
exec("s/$/;/")
|
||||
call setpos('.', original_cursor_position)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" For programming languages using a semi colon at the end of statement.
|
||||
autocmd FileType c,cpp,css,java,javascript,perl,php,jade nmap <silent> ;; :call <SID>appendSemiColon()<CR>
|
||||
autocmd FileType c,cpp,css,java,javascript,perl,php,jade inoremap <silent> ;; <ESC>:call <SID>appendSemiColon()<CR>a
|
||||
|
@ -65,9 +65,6 @@ vmap ,{ c{<C-R>"}<ESC>
|
||||
" gary bernhardt's hashrocket
|
||||
imap <c-l> <space>=><space>
|
||||
|
||||
" Semicolon at end of line by typing ;;
|
||||
inoremap ;; <C-o>A;<esc>
|
||||
|
||||
" Change inside various enclosures with Cmd-" and Cmd-'
|
||||
" The f makes it find the enclosure so you don't have
|
||||
" to be standing inside it
|
||||
|
Loading…
x
Reference in New Issue
Block a user