-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
52 lines (44 loc) · 1.55 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
colorscheme vividchalk
" General
set nobackup
set nowritebackup
set directory=~/.vim/tmp " directory to place swap files in
set clipboard=unnamed " share clipboard
set hidden " you can change buffers without saving
set list " show whitespace
set nocompatible " explicitly get out of vi-compatible mode
set noerrorbells " don't make noise
set noexrc " don't use local version of .(g)vimrc, .exrc
set nojoinspaces " gq and J don't use 2 spaces after .
set nomodeline " ignore modeline settings in files
set number relativenumber " show numbers relative to position
set virtualedit=all " cursor can select empty cells
" Text Formatting/Layout
set ignorecase " case insensitive by default
set nowrap " do not wrap line
set shiftround " when at 3 spaces, and I hit > ... go to 4, not 5
set smartcase " if there are caps, go case-sensitive
set shiftwidth=2
set softtabstop=2
set tabstop=2
set expandtab " use soft tabs by default
" Don't let vim override tabstop in markdown files
let g:markdown_recommended_style=0
" Relative Number
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup END
" Folding
set foldenable
set foldmethod=manual
" Split navigation ctrl-[hjkl]
nmap <silent> <c-k> :wincmd k<CR>
nmap <silent> <c-j> :wincmd j<CR>
nmap <silent> <c-h> :wincmd h<CR>
nmap <silent> <c-l> :wincmd l<CR>
" Remove trailing whitespace before saving
au BufWritePre * :%s/\s\+$//e
" Markdown files have 80 char line length
au BufRead,BufNewFile *.md setlocal textwidth=80