-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
57 lines (43 loc) · 1.53 KB
/
vimrc
File metadata and controls
57 lines (43 loc) · 1.53 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
" be improved, required for pretty much everything
set nocompatible
" use vim-pathogen to manage bundles
runtime bundle/vim-pathogen/autoload/pathogen.vim
execute pathogen#infect('bundle/{}')
" let filetypes do their own things
filetype plugin indent on
" set UTF-8 encoding
set encoding=utf-8
set fileencoding=utf-8
" show line numbers
set number
" disable bells
set belloff=all
" statusline
set laststatus=2 " always on
set statusline= " start from scratch
set statusline+=\ %n " buffer number
set statusline+=\ %<%F " full file path, truncated
set statusline+=%m " modified flag
set statusline+=\ \|\ %Y " filetype
set statusline+=\ \|\ %{&fileformat} " line break type
set statusline+=\ \|\ %{&fileencoding} " file encoding (utf-8, pls)
set statusline+=%=%10((%l,%c)%) " (line, column) coordinates
" highlight slash searches
set hlsearch
" make sure backspace always works on Mac
set backspace=indent,eol,start
" turn on syntax highlighting
syntax on
" use the default colorscheme because the rest are *~*bad*~*
" GUIs can override this if they want
colorscheme default
" CUSTOM MAPPINGS GO AT THE BOTTOM
" Escape mapping
:imap jk <Esc>
:imap kj <Esc>
" Single character insertion
function! RepeatChar(char, count)
return repeat(a:char, a:count)
endfunction
nnoremap s :<C-U>exec "normal i".RepeatChar(nr2char(getchar()), v:count1)<CR>
nnoremap S :<C-U>exec "normal a".RepeatChar(nr2char(getchar()), v:count1)<CR>