vim-config/vimrc

88 lines
2.8 KiB
VimL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

" This is vimrc file, using as the profile of vim.
" After modify vimrc, use `:so $MYVIMRC` to reload new profile.
" env variables
if has('win32') || has('win64')
let g:CONFIGPATH = $USERPROFILE . '/vimfiles'
elseif has('unix')
let g:CONFIGPATH = $HOME . '/.vim'
endif
" ale
" packadd! ale
" ale
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