Retab vim scripts 💢

This commit is contained in:
Talia 2020-08-17 14:54:08 +02:00
parent 71732691b2
commit 81ccea43ea
5 changed files with 49 additions and 49 deletions

View File

@ -1,16 +1,16 @@
" Extend autosavefeature :) " Extend autosavefeature :)
function! TryAutosave() function! TryAutosave()
if &autowriteall if &autowriteall
if &mod if &mod
silent write silent write
end end
redraw redraw
end end
endfunction endfunction
if exists("$AUTOSAVE") if exists("$AUTOSAVE")
set autowriteall set autowriteall
end end
augroup autosave augroup autosave

View File

@ -2,21 +2,21 @@
let g:only_generic_hl=1 let g:only_generic_hl=1
com! Dark silent! let g:colors_name_bak = g:colors_name com! Dark silent! let g:colors_name_bak = g:colors_name
\ | let g:ayucolor="dark" \ | let g:ayucolor="dark"
\ | let g:arcadia_Daybreak=0 \ | let g:arcadia_Daybreak=0
\ | let g:arcadia_Midnight=1 \ | let g:arcadia_Midnight=1
\ | let g:alduin_Shout_Become_Ethereal=1 \ | let g:alduin_Shout_Become_Ethereal=1
\ | set bg=dark \ | set bg=dark
\ | silent! exec "colorscheme ".g:colors_name_bak \ | silent! exec "colorscheme ".g:colors_name_bak
\ | silent! delc PaperColor \ | silent! delc PaperColor
com! Light silent! let g:colors_name_bak = g:colors_name com! Light silent! let g:colors_name_bak = g:colors_name
\ | let g:ayucolor="light" \ | let g:ayucolor="light"
\ | let g:arcadia_Daybreak=1 \ | let g:arcadia_Daybreak=1
\ | let g:arcadia_Midnight=0 \ | let g:arcadia_Midnight=0
\ | let g:alduin_Shout_Become_Ethereal=0 \ | let g:alduin_Shout_Become_Ethereal=0
\ | set bg=light \ | set bg=light
\ | silent! exec "colorscheme ".g:colors_name_bak \ | silent! exec "colorscheme ".g:colors_name_bak
\ | silent! delc PaperColor \ | silent! delc PaperColor
" Commands for some colorschemes I often use " Commands for some colorschemes I often use
com! Ayu colorscheme ayu com! Ayu colorscheme ayu

View File

@ -232,25 +232,25 @@ au BufWritePost * try | let b:blame=<SID>git_blame("","") | catch | unlet! b:bla
command! -range -nargs=? Blame call <SID>blame_command(<q-args>, <line1>, <line2>) command! -range -nargs=? Blame call <SID>blame_command(<q-args>, <line1>, <line2>)
command! -range DBlame !git blame % -L <line1>,<line2> command! -range DBlame !git blame % -L <line1>,<line2>
command! GitNext call <sid>git_next() command! GitNext call <sid>git_next()
\| GitInfo \| GitInfo
command! GitPrev call <sid>git_prev() command! GitPrev call <sid>git_prev()
\| GitInfo \| GitInfo
command! GitGoBlame call <sid>go_blame() command! GitGoBlame call <sid>go_blame()
\| GitInfo \| GitInfo
command! GitFirst call <sid>git_first() | call s:git_info() command! GitFirst call <sid>git_first() | call s:git_info()
command! GitLast call <sid>git_last() | call s:git_info() command! GitLast call <sid>git_last() | call s:git_info()
command! GitInfo call <sid>git_info() command! GitInfo call <sid>git_info()
command! -nargs=1 GitCheckout call <sid>file_at_revision(<f-args>) command! -nargs=1 GitCheckout call <sid>file_at_revision(<f-args>)
command! -nargs=? GitCompare try command! -nargs=? GitCompare try
\| call s:gitroot() | call <sid>git_diff(<f-args>) \| call s:gitroot() | call <sid>git_diff(<f-args>)
\| catch \| catch
\| echo 'Not a git repo!' \| echo 'Not a git repo!'
\| endtry \| endtry
command! GitRoot call <SID>cd_git_root('%') command! GitRoot call <SID>cd_git_root('%')
command! GitOrig exec 'e '.b:git_original_file command! GitOrig exec 'e '.b:git_original_file
command! ShowGitRoot try command! ShowGitRoot try
\| echo <sid>gitroot() \| echo <sid>gitroot()
\| catch | echo 'Not a git repository' \| catch | echo 'Not a git repository'
\| endtry \| endtry
augroup END augroup END

View File

@ -1,3 +1,3 @@
command! -nargs=? Scratch enew command! -nargs=? Scratch enew
\ | set filetype=<args> \ | set filetype=<args>
\ | set buftype=nofile \ | set buftype=nofile

View File

@ -28,57 +28,57 @@ endf
" └──────────┘ " └──────────┘
function! s:dquote_op(type) function! s:dquote_op(type)
normal `[m<`]m> normal `[m<`]m>
call <SID>surround(a:type, '"', '"') call <SID>surround(a:type, '"', '"')
endf endf
nnoremap <leader>" :<C-U>set operatorfunc=<SID>dquote_op<CR>g@ nnoremap <leader>" :<C-U>set operatorfunc=<SID>dquote_op<CR>g@
vnoremap <leader>" :<C-U>call <SID>vsurround('"', '"')<CR> vnoremap <leader>" :<C-U>call <SID>vsurround('"', '"')<CR>
function! s:squote_op(type) function! s:squote_op(type)
normal `[m<`]m> normal `[m<`]m>
call <SID>surround(a:type, "'", "'") call <SID>surround(a:type, "'", "'")
endf endf
nnoremap <leader>' :<C-U>set operatorfunc=<SID>squote_op<CR>g@ nnoremap <leader>' :<C-U>set operatorfunc=<SID>squote_op<CR>g@
vnoremap <leader>' :<C-U>call <SID>vsurround("'", "'")<CR> vnoremap <leader>' :<C-U>call <SID>vsurround("'", "'")<CR>
function! s:paren_op(type) function! s:paren_op(type)
normal `[m<`]m> normal `[m<`]m>
call <SID>surround(a:type, "(", ")") call <SID>surround(a:type, "(", ")")
endf endf
nnoremap <leader>( :<C-U>set operatorfunc=<SID>paren_op<CR>g@ nnoremap <leader>( :<C-U>set operatorfunc=<SID>paren_op<CR>g@
vnoremap <leader>( :<C-U>call <SID>vsurround("(", ")")<CR> vnoremap <leader>( :<C-U>call <SID>vsurround("(", ")")<CR>
function! s:pracket_op(type) function! s:pracket_op(type)
normal `[m<`]m> normal `[m<`]m>
call <SID>surround(a:type, "[", "]") call <SID>surround(a:type, "[", "]")
endf endf
nnoremap <leader>[ :<C-U>set operatorfunc=<SID>bracket_op<CR>g@ nnoremap <leader>[ :<C-U>set operatorfunc=<SID>bracket_op<CR>g@
vnoremap <leader>[ :<C-U>call <SID>vsurround("[", "]")<CR> vnoremap <leader>[ :<C-U>call <SID>vsurround("[", "]")<CR>
function! s:brace_op(type) function! s:brace_op(type)
normal `[m<`]m> normal `[m<`]m>
call <SID>surround(a:type, "{", "}") call <SID>surround(a:type, "{", "}")
endf endf
nnoremap <leader>{ :<C-U>set operatorfunc=<SID>brace_op<CR>g@ nnoremap <leader>{ :<C-U>set operatorfunc=<SID>brace_op<CR>g@
vnoremap <leader>{ :<C-U>call <SID>vsurround("{", "}")<CR> vnoremap <leader>{ :<C-U>call <SID>vsurround("{", "}")<CR>
function! s:angle_op(type) function! s:angle_op(type)
normal `[m<`]m> normal `[m<`]m>
call <SID>surround(a:type, "<", ">") call <SID>surround(a:type, "<", ">")
endf endf
nnoremap <leader>< :<C-U>set operatorfunc=<SID>angle_op<CR>g@ nnoremap <leader>< :<C-U>set operatorfunc=<SID>angle_op<CR>g@
vnoremap <leader>< :<C-U>call <SID>vsurround("<", ">")<CR> vnoremap <leader>< :<C-U>call <SID>vsurround("<", ">")<CR>
function! s:backtick_op(type) function! s:backtick_op(type)
normal `[m<`]m> normal `[m<`]m>
call <SID>surround(a:type, "`", "`") call <SID>surround(a:type, "`", "`")
endf endf
nnoremap <leader>` :<C-U>set operatorfunc=<SID>backtick_op<CR>g@ nnoremap <leader>` :<C-U>set operatorfunc=<SID>backtick_op<CR>g@
vnoremap <leader>` :<C-U>call <SID>vsurround("`", "`")<CR> vnoremap <leader>` :<C-U>call <SID>vsurround("`", "`")<CR>
function! s:asterisk_op(type) function! s:asterisk_op(type)
normal `[m<`]m> normal `[m<`]m>
call <SID>surround(a:type, "*", "*") call <SID>surround(a:type, "*", "*")
endf endf
nnoremap <leader>* :<C-U>set operatorfunc=<SID>asterisk_op<CR>g@ nnoremap <leader>* :<C-U>set operatorfunc=<SID>asterisk_op<CR>g@
vnoremap <leader>* :<C-U>call <SID>vsurround("*", "*")<CR> vnoremap <leader>* :<C-U>call <SID>vsurround("*", "*")<CR>