mirror of
https://gitea.blesmrt.net/mikaela/shell-things.git
synced 2024-11-28 22:19:45 +01:00
vimrc: %retab,s uncomment tabstop, comment dos2unix (leaving it for git)
This commit is contained in:
parent
1881c9b88f
commit
ebab6a7829
37
rc/vimrc
37
rc/vimrc
@ -30,8 +30,10 @@ set modeline
|
||||
|
||||
" These may be difficult with multiple languages especially if Vim already
|
||||
" knows what to do
|
||||
"set tabstop=4 "four spaces is likely a tab
|
||||
set tabstop=4 "four spaces is likely a tab
|
||||
"set shiftwidth=4
|
||||
" For accessibility tabs instead of spaces (uncomment for spaces instead of
|
||||
" tabs)
|
||||
"set expandtab
|
||||
|
||||
set autoindent
|
||||
@ -81,23 +83,24 @@ autocmd BufReadPost *
|
||||
\ exe "normal! g`\"" |
|
||||
\ endif
|
||||
|
||||
" I think leaving line endings to git may be more safe
|
||||
" dos2unix ^M copied from https://stackoverflow.com/a/5361702/1675649
|
||||
fun! Dos2unixFunction()
|
||||
let _s=@/
|
||||
let l = line(".")
|
||||
let c = col(".")
|
||||
try
|
||||
set ff=unix
|
||||
w!
|
||||
"%s/\%x0d$//e
|
||||
catch /E32:/
|
||||
echo "Sorry, the file is not saved."
|
||||
endtry
|
||||
let @/=_s
|
||||
call cursor(l, c)
|
||||
endfun
|
||||
com! Dos2Unix keepjumps call Dos2unixFunction()
|
||||
au BufReadPost * keepjumps call Dos2unixFunction()
|
||||
"fun! Dos2unixFunction()
|
||||
" let _s=@/
|
||||
" let l = line(".")
|
||||
" let c = col(".")
|
||||
" try
|
||||
" set ff=unix
|
||||
" w!
|
||||
" "%s/\%x0d$//e
|
||||
" catch /E32:/
|
||||
" echo "Sorry, the file is not saved."
|
||||
" endtry
|
||||
" let @/=_s
|
||||
" call cursor(l, c)
|
||||
"endfun
|
||||
"com! Dos2Unix keepjumps call Dos2unixFunction()
|
||||
"au BufReadPost * keepjumps call Dos2unixFunction()
|
||||
|
||||
" Highlight all search results
|
||||
set hlsearch
|
||||
|
Loading…
Reference in New Issue
Block a user