summary refs log tree commit diff
path: root/_vimrc
blob: c3fc94c123a9a713b1af2227d9c5d022c2467837 (plain) (blame)
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
set nocompatible

noremap \ ,
let mapleader = ","

set backspace=indent,eol,start " allow backspacing everything
set hidden
set backup
set history=50
set ruler " show cursor position all the time
set showcmd " show incomplete commands
set incsearch
set ignorecase
set smartcase
set guioptions-=t " no tear-off menus
if has('mouse')
  set mouse=a
endif
if &t_Co > 2 || has("gui_running")
  syntax on
  set hlsearch
endif

augroup vimrcEx
au!
" jump to the last cursor position
autocmd BufReadPost *
  \ if line("'\"") > 1 && line("'\"") <= line("$") |
  \   exe "normal! g`\"" |
  \ endif
augroup END

set autoindent
set smartindent
colorscheme twilight
set nu

" 4-space indents
set tabstop=4
set shiftwidth=4
set expandtab

filetype plugin indent on
autocmd FileType ruby setlocal expandtab shiftwidth=2

"set showmatch " jump to matching bracket
set guioptions-=T " no toolbar in gvim
"set cc=80 " highlight 80th column
set guifont=Monospace\ 9

set spell
"set fdm=syntax " fold by syntax

highlight OverLength ctermbg=darkred ctermfg=white guibg=#592929
match OverLength /\%81v.\+/

nnoremap ' `
nnoremap ` '

"better tab complete
set wildmenu
set wildmode=list:longest
set wildignore=*.o,*.d,*~

set title " change terminal title

runtime macros/matchit.vim " smarter %

nmap <silent> <leader>n :silent :nohlsearch<CR>

" Show trailing whitespace with ,s
set listchars=tab:>-,trail:·,eol:$
nmap <silent> <leader>s :set nolist!<CR>

set shortmess=atI

" Easy X copy/paste
map <leader>p "+p
map <leader>P "+P
map <leader>y "+y
map <leader>Y "+Y
map <leader>d "+d
map <leader>D "+D

set visualbell t_vb=

set cursorline

" Insert hard tab
imap <silent> <S-tab> <C-v><tab>

set browsedir=buffer " GUI Open starts in CWD

map Q gq

command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis | wincmd p | diffthis

" Show trailing whitespace and hard tabs
set list
set listchars=tab:»·,trail:·