/
vimrc
78 lines (56 loc) · 1.57 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
" Fix WSL2 vim colors
set term=screen-256color
set t_ut=
" Do not use old style vim mode
set nocompatible
" Enable syntax highlighting
syntax enable
" Enable search highlighting
set hlsearch
" Shortcut to mute highlighting
nnoremap <silent> <C-l> :<C-u>nohlsearch<CR><C-l>
" Shortcuts to insert timestamps
nnoremap <F5> "=strftime("%Y-%m-%d")<CR>PA
inoremap <F5> <C-R>=strftime("%Y-%m-%d")<CR>
nnoremap <F4> "=strftime("%H%M")<CR>PA
inoremap <F4> <C-R>=strftime("%H%M")<CR>
" Set colorscheme
colorscheme monokai
" Use hybrid line numbers
set relativenumber
set number
" Disable relative line numbers in insert mode
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup END
" Always show postition
set ruler
" Show matching brackets when cursor is over them
set showmatch
" Set UTF-8 as standard encoding
set encoding=utf-8
" Always display the statusline
set laststatus=2
" Adjust colors
set background=dark
" Treat all numerals as decimal
set nrformats=
" Tabs and spaces
" Size of a hard tabstop
set tabstop=4
" Size of an indent
set shiftwidth=4
" A combination of spaces and tabs are used to simulate tab stops a width
" other that the (hard)tabstop
set softtabstop=4
" Making a copy and overwriting the original file
set backupcopy=yes
" Do not expand tabs
set noexpandtab
" Transparent background
highlight Normal ctermbg=NONE
highlight nonText ctermbg=NONE
" Support for custom journal syntax highlighting
autocmd BufNewFile,BufRead *.journal set syntax=journal