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:
parent
8d5389a879
commit
8edad2f43d
1 changed files with 5 additions and 5 deletions
10
vimrc
10
vimrc
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue