-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
67 lines (60 loc) · 1.73 KB
/
vimrc
File metadata and controls
67 lines (60 loc) · 1.73 KB
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
let mapleader=","
" ---------------------------------------
" Standard and common configurations
" ---------------------------------------
set number
set hlsearch
set wildmenu
set ruler
set nowrap
set ignorecase
set smartcase
set showmatch
set smarttab
set noexpandtab
set tabstop=4
set shiftwidth=4
set autoindent
set smartindent
" ---------------------------------------
" Maps
" ---------------------------------------
map <space> /
map <silent> <leader><cr> :noh<cr>
map <leader>tn :tabnew
map <leader>tc :tabclose<cr>
map <leader>to :tabonly<cr>
map <leader>tq :tabp<cr>
map <leader>te :tabn<cr>
" ---------------------------------------
" Functions
" ---------------------------------------
function! CreatingFile(type)
execute '0r ~/.vim/templates/' . a:type
%s/{{username}}/0strezz/g
%s/{{date}}/\=strftime('%a %e %b, %G: %T')/g
normal! G
endfunction
" ---------------------------------------
" Augroups
" ---------------------------------------
augroup Templates
autocmd!
autocmd BufNewFile *.java call CreatingFile('slash')
autocmd BufNewFile *.c call CreatingFile('slash')
autocmd BufNewFile *.cpp call CreatingFile('slash')
autocmd BufNewFile *.rust call CreatingFile('slash')
autocmd BufNewFile *.sql call CreatingFile('slash')
autocmd BufNewFile *.py call CreatingFile('hash')
autocmd BufNewFile *.sh call CreatingFile('hash')
autocmd BufNewFile *.s call CreatingFile('hash')
autocmd BufNewFile *.asm call CreatingFile('hash')
augroup END
" ---------------------------------------
" Others
" ---------------------------------------
try
set undodir=/home/$USER/.vim/stuff
set undofile
catch
endtry