aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2019-06-17 20:41:34 +0200
committerTeddy Wing2019-06-17 20:41:34 +0200
commit516dab7f8b5083a3c6665c29cffc28b9645b3a85 (patch)
tree2f4a482c87d0f740f16b4c080e2c79693c369338
parenta4d85d0f98688b4eb73bcbf1a275eb90c8336e87 (diff)
downloaddotvim-516dab7f8b5083a3c6665c29cffc28b9645b3a85.tar.bz2
vimrc: Don't preserve indentation on empty lines
Over the years and as I've been using Vim, I've gradually stopped liking this style, and now prefer blank lines without whitespace. Rather than continuing to override the default for different filetypes, it feels like it's time to change the default.
-rw-r--r--ftplugin/coffee.vim6
-rw-r--r--ftplugin/go.vim6
-rw-r--r--ftplugin/haskell.vim6
-rw-r--r--ftplugin/javascript.vim6
-rw-r--r--ftplugin/objc.vim6
-rw-r--r--ftplugin/python.vim6
-rw-r--r--ftplugin/ruby.vim6
-rw-r--r--ftplugin/rust.vim6
-rw-r--r--vimrc9
9 files changed, 3 insertions, 54 deletions
diff --git a/ftplugin/coffee.vim b/ftplugin/coffee.vim
index fc06b0f..29c38be 100644
--- a/ftplugin/coffee.vim
+++ b/ftplugin/coffee.vim
@@ -7,11 +7,5 @@ setlocal softtabstop=2
setlocal shiftwidth=2
-" Don't preserve indentation on empty lines
-inoremap <buffer> <CR> <CR>
-nnoremap <buffer> o o
-nnoremap <buffer> O O
-
-
" Comment string
setlocal commentstring=#\ %s
diff --git a/ftplugin/go.vim b/ftplugin/go.vim
index 29243ef..4f32aa1 100644
--- a/ftplugin/go.vim
+++ b/ftplugin/go.vim
@@ -16,12 +16,6 @@ nnoremap <buffer> <leader>cr :!go run %<cr>
nnoremap <buffer> cdf :!go fmt %<cr>
-" Don't preserve indentation on empty lines
-inoremap <buffer> <CR> <CR>
-nnoremap <buffer> o o
-nnoremap <buffer> O O
-
-
" Comment string
setlocal commentstring=//\ %s
diff --git a/ftplugin/haskell.vim b/ftplugin/haskell.vim
index d393a45..6dad6bc 100644
--- a/ftplugin/haskell.vim
+++ b/ftplugin/haskell.vim
@@ -8,9 +8,3 @@ setlocal shiftwidth=4
setlocal textwidth=80
-
-
-" Don't preserve indentation on empty lines
-inoremap <buffer> <CR> <CR>
-nnoremap <buffer> o o
-nnoremap <buffer> O O
diff --git a/ftplugin/javascript.vim b/ftplugin/javascript.vim
deleted file mode 100644
index fa8bd24..0000000
--- a/ftplugin/javascript.vim
+++ /dev/null
@@ -1,6 +0,0 @@
-" JavaScript vim settings
-
-" Don't preserve indentation on empty lines
-inoremap <buffer> <CR> <CR>
-nnoremap <buffer> o o
-nnoremap <buffer> O O
diff --git a/ftplugin/objc.vim b/ftplugin/objc.vim
index 32e9437..8d7e976 100644
--- a/ftplugin/objc.vim
+++ b/ftplugin/objc.vim
@@ -5,12 +5,6 @@ setlocal softtabstop=4
setlocal shiftwidth=4
-" Don't preserve indentation on empty lines
-inoremap <buffer> <CR> <CR>
-nnoremap <buffer> o o
-nnoremap <buffer> O O
-
-
" Comment string
call tcomment#DefineType('objc', '// %s')
diff --git a/ftplugin/python.vim b/ftplugin/python.vim
index 434ae8e..1c0d30b 100644
--- a/ftplugin/python.vim
+++ b/ftplugin/python.vim
@@ -10,12 +10,6 @@ setlocal shiftwidth=4
setlocal textwidth=79
-" Don't preserve indentation on empty lines
-inoremap <buffer> <CR> <CR>
-nnoremap <buffer> o o
-nnoremap <buffer> O O
-
-
" Quickly add a debug line
nnoremap <buffer> <leader>gdo oimport ipdb; ipdb.set_trace()<Esc>_
nnoremap <buffer> <leader>gdO Oimport ipdb; ipdb.set_trace()<Esc>_
diff --git a/ftplugin/ruby.vim b/ftplugin/ruby.vim
index e95b70f..cfdc0ca 100644
--- a/ftplugin/ruby.vim
+++ b/ftplugin/ruby.vim
@@ -7,12 +7,6 @@ setlocal softtabstop=2
setlocal shiftwidth=2
-" Don't preserve indentation on empty lines
-inoremap <buffer> <CR> <CR>
-nnoremap <buffer> o o
-nnoremap <buffer> O O
-
-
" Debugging
nnoremap <buffer> Zd obyebug<Esc>
nnoremap <buffer> ZD Obyebug<Esc>
diff --git a/ftplugin/rust.vim b/ftplugin/rust.vim
index 0b1f2ae..c45091f 100644
--- a/ftplugin/rust.vim
+++ b/ftplugin/rust.vim
@@ -7,11 +7,5 @@ setlocal softtabstop=4
setlocal shiftwidth=4
-" Don't preserve indentation on empty lines
-inoremap <buffer> <CR> <CR>
-nnoremap <buffer> o o
-nnoremap <buffer> O O
-
-
" Comment string
setlocal commentstring=//\ %s
diff --git a/vimrc b/vimrc
index 893061e..ac948b3 100644
--- a/vimrc
+++ b/vimrc
@@ -429,6 +429,9 @@
" 2019.06.16:
" * Disable modelines for CVE-2019-12735.
"
+" 2019.06.17:
+" * Don't preserve indentation on empty lines.
+"
" Pathogen
@@ -680,12 +683,6 @@ vnoremap <c-h> <esc>:update<cr>gv
" Update all files and quit
nnoremap ZA :xall<cr>
-" Preserve indentation on empty lines
-" http://stackoverflow.com/a/7413117
-inoremap <CR> <CR>x<BS>
-nnoremap o ox<BS>
-nnoremap O Ox<BS>
-
" Allow undo of Ctrl-u and Ctrl-w in insert mode
" http://vim.wikia.com/wiki/Recover_from_accidental_Ctrl-U
inoremap <c-u> <c-g>u<c-u>