diff --git a/vimrc b/vimrc index c265da8..b493530 100644 --- a/vimrc +++ b/vimrc @@ -1,84 +1,5 @@ " This is vimrc file, using as the profile of vim. " After modify vimrc, use `:so $MYVIMRC` to reload new profile. -runtime! vimrc.d/*.vim +" Settings could be rewrited by editing this file. -" env variables -if has('win32') || has('win64') - let g:CONFIGPATH = $USERPROFILE . '/vimfiles' -elseif has('unix') - let g:CONFIGPATH = $HOME . '/.vim' -endif - -filetype plugin indent on " Load plugins according to detected filetype. -syntax on " Enable syntax highlighting. - -set autoindent " Indent according to previous line. -set expandtab " Use spaces instead of tabs. -set softtabstop =4 " Tab key indents by 4 spaces. -set shiftwidth =4 " >> indents by 4 spaces. -set shiftround " >> indents to next multiple of 'shiftwidth'. - -set backspace =indent,eol,start " Make backspace work as you would expect. -set hidden " Switch between buffers without having to save first. -set laststatus =2 " Always show statusline. -set display =lastline " Show as much as possible of the last line. - -set showmode " Show current mode in command-line. -set showcmd " Show already typed keys when more are expected. - -set incsearch " Highlight while searching with / or ?. -set hlsearch " Keep matches highlighted. - -set ttyfast " Faster redrawing. -set lazyredraw " Only redraw when necessary. - -set splitbelow " Open new windows below the current window. -set splitright " Open new windows right of the current window. - -set cursorline " Find the current line quickly. -set wrapscan " Searches wrap around end-of-file. -set report =0 " Always report changed lines. -set synmaxcol =200 " Only highlight the first 200 columns. - -set list " Show non-printable characters. - -if has('multi_byte') && &encoding ==# 'utf-8' - let &listchars = 'tab:▸ ,extends:❯,precedes:❮,nbsp:±' -else - let &listchars = 'tab:> ,extends:>,precedes:<,nbsp:.' -endif - -" The fish shell is not very compatible to other shells and unexpectedly -" breaks things that use 'shell'. -if &shell =~# 'fish$' - set shell=/bin/bash -endif - -if has('win32') - set shell=pwsh.exe - set shellcmdflag=-command - set shellquote=\" - set shellxquote= -endif - -" Put all temporary files under the same directory. -" https://github.com/mhinz/vim-galore#temporary-files -set backup -set backupext =-vimbackup -set backupskip = -set updatecount =100 -set undofile - -if exists('g:CONFIGPATH') - execute 'set undodir=' . escape(g:CONFIGPATH, ' \') . '/undo/' - execute 'set directory=' . escape(g:CONFIGPATH, ' \') . '/swap/' - execute 'set backupdir=' . escape(g:CONFIGPATH, ' \') . '/backup/' -endif - -" set textwidth =80 - -set updatetime =300 -set signcolumn =yes -set smartcase - -set foldmethod =manual +runtime! vimrc.d/*.vim \ No newline at end of file diff --git a/vimrc.d/01-basic.vim b/vimrc.d/01-basic.vim new file mode 100644 index 0000000..6122228 --- /dev/null +++ b/vimrc.d/01-basic.vim @@ -0,0 +1,83 @@ +" This is vimrc basic settings. +" Settings could be overwrited by modifying ../vimrc + +" env variables +if has('win32') || has('win64') + let g:CONFIGPATH = $USERPROFILE . '/vimfiles' +elseif has('unix') + let g:CONFIGPATH = $HOME . '/.vim' +endif + +filetype plugin indent on " Load plugins according to detected filetype. +syntax on " Enable syntax highlighting. + +set autoindent " Indent according to previous line. +set expandtab " Use spaces instead of tabs. +set softtabstop =4 " Tab key indents by 4 spaces. +set shiftwidth =4 " >> indents by 4 spaces. +set shiftround " >> indents to next multiple of 'shiftwidth'. + +set backspace =indent,eol,start " Make backspace work as you would expect. +set hidden " Switch between buffers without having to save first. +set laststatus =2 " Always show statusline. +set display =lastline " Show as much as possible of the last line. + +set showmode " Show current mode in command-line. +set showcmd " Show already typed keys when more are expected. + +set incsearch " Highlight while searching with / or ?. +set hlsearch " Keep matches highlighted. + +set ttyfast " Faster redrawing. +set lazyredraw " Only redraw when necessary. + +set splitbelow " Open new windows below the current window. +set splitright " Open new windows right of the current window. + +set cursorline " Find the current line quickly. +set wrapscan " Searches wrap around end-of-file. +set report =0 " Always report changed lines. +set synmaxcol =200 " Only highlight the first 200 columns. + +set list " Show non-printable characters. + +if has('multi_byte') && &encoding ==# 'utf-8' + let &listchars = 'tab:▸ ,extends:❯,precedes:❮,nbsp:±' +else + let &listchars = 'tab:> ,extends:>,precedes:<,nbsp:.' +endif + +" The fish shell is not very compatible to other shells and unexpectedly +" breaks things that use 'shell'. +if &shell =~# 'fish$' + set shell=/bin/bash +endif + +if has('win32') + set shell=pwsh.exe + set shellcmdflag=-command + set shellquote=\" + set shellxquote= +endif + +" Put all temporary files under the same directory. +" https://github.com/mhinz/vim-galore#temporary-files +set backup +set backupext =-vimbackup +set backupskip = +set updatecount =100 +set undofile + +if exists('g:CONFIGPATH') + execute 'set undodir=' . escape(g:CONFIGPATH, ' \') . '/undo/' + execute 'set directory=' . escape(g:CONFIGPATH, ' \') . '/swap/' + execute 'set backupdir=' . escape(g:CONFIGPATH, ' \') . '/backup/' +endif + +" set textwidth =80 + +set updatetime =300 +set signcolumn =yes +set smartcase + +set foldmethod =manual \ No newline at end of file diff --git a/vimrc.d/01-gui.vim b/vimrc.d/02-gui.vim similarity index 100% rename from vimrc.d/01-gui.vim rename to vimrc.d/02-gui.vim diff --git a/vimrc.d/33-airline.vim b/vimrc.d/33-airline.vim new file mode 100644 index 0000000..bf205db --- /dev/null +++ b/vimrc.d/33-airline.vim @@ -0,0 +1,3 @@ +" This is configurations for airline. + +packadd! airline \ No newline at end of file