-
Notifications
You must be signed in to change notification settings - Fork 0
/
setting.vim
72 lines (55 loc) · 2.25 KB
/
setting.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
" https://github.com/mhartington/nvim-typescript/issues/185#issuecomment-425212727
set signcolumn=yes
set cul " highlight current line
highlight clear SignColumn " SignColumn should match background for things like vim-gitgutter, vim-signify
highlight clear LineNr " Current line number row will have same background color in relative mode.
set cc=120 " highlight 120th column
set nohls " dont highlight search keyword
set relativenumber
set autoindent " Indent at the same level of the previous line
set shiftwidth=4 " Use indents of 4 spaces
set expandtab " Tabs are spaces, not tabs
set tabstop=4 " An indentation every four columns
set softtabstop=4 " Let backspace delete indent
set fdm=indent " set fold method
" status bar
set cmdheight=3
set laststatus=2
set noshowmode
set ignorecase " Case insensitive search
set smartcase " Case sensitive when uppercase present
" language and encoding stuff
set helplang="en,zh-cn"
set fileencodings=utf-8,chinese,latin-1
set fileformat=unix
" language for message on cmd line
lan mes en_US.utf-8
"turn on that syntax highlighting
syntax on
filetype on
" make buffer files can hidden
set hidden
" don't update the display while executing macros
set lazyredraw
set scrolljump=5 " Lines to scroll when cursor leaves screen
set scrolloff=3 " Minimum lines to keep above and below cursor
set updatetime=1000
" prevent '<esc>' delay in terminal http://stackoverflow.com/a/33957679/2326199
set ttimeout
set ttimeoutlen=100
set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too
set spell
set spelllang=en
" warn me when files change outside
augroup improved_autoread
autocmd!
autocmd FocusGained * silent! checktime
autocmd BufEnter * silent! checktime
augroup end
noremap <c-z> :suspend<cr>:silent! checktime<cr>
augroup better_defaults
autocmd!
" Remove trailing whitespaces and ^M chars
autocmd FileType c,cpp,java,go,php,javascript,python,twig,xml,yml,html,vue.tsx,ts,jsx,typescript autocmd BufWritePre <buffer> if !exists('g:keep_trailing_whitespace') | call StripTrailingWhitespace() | endif
autocmd FileType help no <buffer> q :bd<cr>
augroup end