-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
117 lines (87 loc) · 2.1 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
" Based on this https://gist.github.com/gabrielso/3724745
" Set vim as default editor
" sudo update-alternatives --config editor
" Enable syntax highlighting
syntax on
" Use Vim settings, rather than Vi settings
set nocompatible
" Read file when modified outside Vim
set autoread
" Do not keep any history
"set viminfo='0,:0,<0,@0,f0
"set nobackup
"set nowb
set noswapfile
" Allow backspacing over everything in INSERT mode
set backspace=indent,eol,start
" Show ruler and command visual aid
set ruler
set showcmd
" Set color at 80'th column
set colorcolumn=80
highlight ColorColumn ctermbg=4
" Disable bells
set noerrorbells
set visualbell
set t_vb=
" Don't use Ex mode, use Q for formatting
map Q gq
" CTRL-U in INSERT mode deletes a lot. Use CTRL-G u to first break undo,
" so that you can undo CTRL-U after inserting a line break.
inoremap <C-U> <C-G>u<C-U>
" Set partial search and result highlighting
set incsearch
set hlsearch
" Ignore case when searching
set ignorecase
set smartcase
" Show matching bracets
set showmatch
" Highlight the cursor line
"set cursorline
" Use Monaco as default font
set guifont=Monaco:h12
" Hide the toolbar in GUI
set guioptions-=T
" Set the colorscheme and window transparency
"colorscheme desert
"set transparency=5
" Disable 'command' and 'option' navigation bindings
if has("gui_macvim")
let macvim_skip_cmd_opt_movement = 1
endif
" Change Netrw tree mode
let g:netrw_liststyle=3
" Set default vertical split to right
set splitright
" Set soft tabs
set tabstop=4
set shiftwidth=4
set expandtab
set smarttab
" Indent
set ai
set si
" Show invisibles
"set listchars=eol:¬,tab:▸\ ,trail:·
set listchars=tab:▸\ ,trail:·
highlight NonText guifg=#4a4a59
highlight SpecialKey guifg=#4a4a59
" Enable mouse and clipboard sharing
set mouse=a
set clipboard+=unnamedplus
" Show line number and listchars
set list
set nu
set rnu
" Autocomplete enclosures
" https://stackoverflow.com/a/62536744/15911637
" Use jk to press Esc
inoremap jk <Esc>
" switch buffer
" https://stackoverflow.com/a/5562707/15911637
map gn :bn<cr>
map gp :bp<cr>
map gd :bd<cr>
" Clear highlight
map <C-h> :noh<cr>