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 :)
function! TryAutosave()
if &autowriteall
if &mod
silent write
end
redraw
end
if &autowriteall
if &mod
silent write
end
redraw
end
endfunction
if exists("$AUTOSAVE")
set autowriteall
set autowriteall
end
augroup autosave

View file

@ -2,21 +2,21 @@
let g:only_generic_hl=1
com! Dark silent! let g:colors_name_bak = g:colors_name
\ | let g:ayucolor="dark"
\ | let g:arcadia_Daybreak=0
\ | let g:arcadia_Midnight=1
\ | let g:alduin_Shout_Become_Ethereal=1
\ | set bg=dark
\ | silent! exec "colorscheme ".g:colors_name_bak
\ | silent! delc PaperColor
\ | let g:ayucolor="dark"
\ | let g:arcadia_Daybreak=0
\ | let g:arcadia_Midnight=1
\ | let g:alduin_Shout_Become_Ethereal=1
\ | set bg=dark
\ | silent! exec "colorscheme ".g:colors_name_bak
\ | silent! delc PaperColor
com! Light silent! let g:colors_name_bak = g:colors_name
\ | let g:ayucolor="light"
\ | let g:arcadia_Daybreak=1
\ | let g:arcadia_Midnight=0
\ | let g:alduin_Shout_Become_Ethereal=0
\ | set bg=light
\ | silent! exec "colorscheme ".g:colors_name_bak
\ | silent! delc PaperColor
\ | let g:ayucolor="light"
\ | let g:arcadia_Daybreak=1
\ | let g:arcadia_Midnight=0
\ | let g:alduin_Shout_Become_Ethereal=0
\ | set bg=light
\ | silent! exec "colorscheme ".g:colors_name_bak
\ | silent! delc PaperColor
" Commands for some colorschemes I often use
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 DBlame !git blame % -L <line1>,<line2>
command! GitNext call <sid>git_next()
\| GitInfo
\| GitInfo
command! GitPrev call <sid>git_prev()
\| GitInfo
\| GitInfo
command! GitGoBlame call <sid>go_blame()
\| GitInfo
\| GitInfo
command! GitFirst call <sid>git_first() | call s:git_info()
command! GitLast call <sid>git_last() | call s:git_info()
command! GitInfo call <sid>git_info()
command! -nargs=1 GitCheckout call <sid>file_at_revision(<f-args>)
command! -nargs=? GitCompare try
\| call s:gitroot() | call <sid>git_diff(<f-args>)
\| catch
\| echo 'Not a git repo!'
\| endtry
\| call s:gitroot() | call <sid>git_diff(<f-args>)
\| catch
\| echo 'Not a git repo!'
\| endtry
command! GitRoot call <SID>cd_git_root('%')
command! GitOrig exec 'e '.b:git_original_file
command! ShowGitRoot try
\| echo <sid>gitroot()
\| catch | echo 'Not a git repository'
\| endtry
\| echo <sid>gitroot()
\| catch | echo 'Not a git repository'
\| endtry
augroup END

View file

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

View file

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