-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
149 lines (104 loc) · 2.54 KB
/
vimrc
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
" --------------------------------
" plug stuff
call plug#begin('~/.vim/plugged')
Plug 'dylanaraps/wal.vim'
call plug#end()
" ---------------------------------
" ---------------------------------
" vim configuration (just some mashup of vimrc's)
" returns true if paste mode is enabled
function! HasPaste()
if &paste
return 'PASTE MODE '
endif
return ''
endfunction
" don't try to be vi compatible
set nocompatible
" rendering
set ttyfast
" set history
set history=100
" enable filetype plugins
filetype plugin on
filetype indent on
" set autoread
set autoread
" when using a map leader, you can do extra key combinations
" for example, <leader>w saves the current file
let mapleader = ","
" fast saving
nmap <leader>w :w!<cr>
" set 7 lines to the cursor - when moving vertically using j/k
set so=7
" avoid garbled chars in chinese language windows os
let $LANG='en'
set langmenu=en
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
" turn on the wild menu
set wildmenu
" always show current pos
set ruler
" height of the command bar
set cmdheight=2
" a buffer becomes hidden when it's abandoned
set hid
" configure backspace so it acts as it should act
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
" ignore case when searching
set ignorecase
" when searching, try to be smart about cases
set smartcase
" highlight search results
set hlsearch
" makes search act like search in modern browsers
set incsearch
" don't redraw while executing macros (good performance config)
set lazyredraw
" for regex turn magic on
set magic
" show matching brackets when text indicator is over them
set showmatch
" how many tenths of a second to blink when matching brackets
set mat=2
" no sound on errors
set noerrorbells
set novisualbell
set t_vb=
set tm=500
" add extra margin to the left
set foldcolumn=1
" enable syntax highlighting
syntax enable
" colorscheme (pywaled)
colorscheme wal
" set utf-8
set encoding=utf8
" use unix as the standard file type
set ffs=unix,dos,mac
" turn backup off
set nobackup
set nowb
set noswapfile
" use spaces instead of tabs (yes!)
set expandtab
" be smart when using tabs
set smarttab
" 1 tab == 4 spaces
set shiftwidth=4
set tabstop=4
" linebreak on 500 chars
set lbr
set tw=500
set ai " auto indent
set si " smart indent
set wrap " wrap lines
" always show the status line
set laststatus=2
" format the status line
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \line:\ %l\ \ column:\ %c
" remap vim 0 to first non-blank char
map 0 ^
" ---------------------------------