New-line function now clears new line

This is only relevant when vim auto-generates some text for the new
line, for example then continuing multiple line comments.
This commit is contained in:
Talia 2017-10-23 14:28:12 +02:00
parent 8d5389a879
commit 8edad2f43d

10
vimrc
View file

@ -66,7 +66,7 @@ set shiftwidth=2
set gdefault set gdefault
set wrap set wrap
" au BufEnter,BufRead * set linebreak au BufEnter,BufRead * set linebreak
set breakat=\ .,{ set breakat=\ .,{
set display+=lastline set display+=lastline
set showbreak=+->\ set showbreak=+->\
@ -93,7 +93,7 @@ noremap Q @q
nnoremap <S-space> gQ nnoremap <S-space> gQ
noremap <C-s> :w<CR> noremap <C-s> :w<CR>
noremap <C-x> :hide<CR> noremap <C-x> :hide<CR>
noremap <C-q> :close<CR> noremap <C-q> :bdelete<CR>
nnoremap <C-n> :bnext<CR> nnoremap <C-n> :bnext<CR>
nnoremap <C-p> :bprevious<CR> nnoremap <C-p> :bprevious<CR>
noremap <F1> :setl number!<CR> noremap <F1> :setl number!<CR>
@ -120,12 +120,12 @@ nnoremap <S-ENTER> :call <SID>Enter(1)<CR>
function! s:Enter(shift) function! s:Enter(shift)
if !a:shift if !a:shift
if col(".")-1 if col(".")-1
exe "normal o\<esc>" exe "normal o\<esc>0d$"
else else
exe "normal O\<esc>j0" exe "normal O\<esc>0d$j0"
end end
else else
exe "normal O\<esc>j" exe "normal O\<esc>0d$j"
endif endif
endfunction endfunction