1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

change vim script style from 4-space indent to 2-space

This commit is contained in:
jdhao 2020-09-26 09:15:40 +08:00
parent c248ab02d4
commit b65c7c6d70
14 changed files with 343 additions and 344 deletions

View File

@ -15,6 +15,11 @@ set foldmethod=expr foldlevel=0 foldlevelstart=-1
" see `:h K` and https://stackoverflow.com/q/15867323/6064933 " see `:h K` and https://stackoverflow.com/q/15867323/6064933
set keywordprg=:help set keywordprg=:help
set tabstop=2 " number of visual spaces per TAB
set softtabstop=2 " number of spaces in tab when editing
set shiftwidth=2 " number of spaces to use for autoindent
set expandtab " expand tab to spaces so that tabs are spaces
" Only define following variable if Auto-pairs plugin is used " Only define following variable if Auto-pairs plugin is used
if &runtimepath =~? 'auto-pairs' if &runtimepath =~? 'auto-pairs'
let b:AutoPairs = AutoPairsDefine({'<' : '>'}) let b:AutoPairs = AutoPairsDefine({'<' : '>'})

View File

@ -24,9 +24,7 @@ augroup END
augroup resume_edit_position augroup resume_edit_position
autocmd! autocmd!
autocmd BufReadPost * autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit' \ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit' | execute "normal! g`\"zvzz" | endif
\ | execute "normal! g`\"zvzz"
\ | endif
augroup END augroup END
" Display a message when the current file is not in utf-8 format. " Display a message when the current file is not in utf-8 format.
@ -34,8 +32,7 @@ augroup END
" https://github.com/vim/vim/issues/4379 " https://github.com/vim/vim/issues/4379
augroup non_utf8_file_warn augroup non_utf8_file_warn
autocmd! autocmd!
autocmd BufRead * if &fileencoding != 'utf-8' autocmd BufRead * if &fileencoding != 'utf-8' | unsilent echomsg 'File not in UTF-8 format!' | endif
\ | unsilent echomsg 'File not in UTF-8 format!' | endif
augroup END augroup END
" Automatically reload the file if it is changed outside of Nvim, see " Automatically reload the file if it is changed outside of Nvim, see

View File

@ -15,14 +15,12 @@ if g:is_win || g:is_mac
echomsg 'Installing Vim-plug on your system' echomsg 'Installing Vim-plug on your system'
silent execute '!curl -fLo ' . g:VIM_PLUG_PATH . ' --create-dirs ' silent execute '!curl -fLo ' . g:VIM_PLUG_PATH . ' --create-dirs '
\ . 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' \ . 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
augroup plug_init augroup plug_init
autocmd! autocmd!
autocmd VimEnter * PlugInstall --sync | quit |source $MYVIMRC autocmd VimEnter * PlugInstall --sync | quit |source $MYVIMRC
augroup END augroup END
else else
echoerr 'Curl must be available to install vim-plug, or you may install ' echoerr 'Curl not available on your system, you may install vim-plug by yourself.'
\ . 'vim-plug by yourself.'
finish finish
endif endif
endif endif
@ -753,8 +751,7 @@ if ( g:is_win || g:is_mac ) && executable('latex')
if g:is_win if g:is_win
let g:vimtex_view_general_viewer = 'SumatraPDF' let g:vimtex_view_general_viewer = 'SumatraPDF'
let g:vimtex_view_general_options_latexmk = '-reuse-instance' let g:vimtex_view_general_options_latexmk = '-reuse-instance'
let g:vimtex_view_general_options let g:vimtex_view_general_options = '-reuse-instance -forward-search @tex @line @pdf'
\ = '-reuse-instance -forward-search @tex @line @pdf'
endif endif
if g:is_mac if g:is_mac