-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
125 lines (116 loc) · 3.82 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
" Notes {
"
" Sections
" -> Basic
" -> General
" -> UI
" -> Tabs/Layout
" -> Search
" -> Plugin Settings
" -> Mappings
" -> Autocommands
"
" }
" Basic {
call pathogen#infect()
set nocompatible " don't use vi-compatible mode
set noexrc " don't use .vimrc in current directory
set history=1000 " remember most of the commands
set background=dark " dark is stark
if has("gui_running")
"set guioptions-=m " remove menu bar
"set guioptions-=T " remove toolbar
"set guioptions-=r " remove scroll-bar
colorscheme railscasts
elseif $COLORTERM == 'gnome-terminal'
set term=gnome-256color
colorscheme railscasts
else
colorscheme default
endif
syntax on " syntax highlight on
" }
" General {
filetype plugin indent on " load filetype plugins/indent settings
set nobackup " use version control
set fileformats=unix,dos,mac " support all three, in this order
set hidden " change buffers w/out saving
" set mouse=a " maybe i can need it
set mousehide " hide mouse while typing
set noerrorbells " no noise
set wildmenu " <TAB> completion shell-like
set wildmode=longest:full
" }
" UI {
set number " show line numbers
set numberwidth=4 " up to 9999 lines
set laststatus=2 " always show status line
set list " show tabs and trailing spaces
set listchars=tab:▸\ ,trail:¬ " nice symbols
highlight NonText guifg=#4a4a59 " make it barely visible
highlight SpecialKey guifg=#4a4a59 " make it barely visible
set matchtime=4 " show 0.4s matching bracket
set showmatch " show matching brackets
set nostartofline " leave cursor where it was
set ruler " show current position
set scrolloff=5 " keep 5 lines (top/bottom) when scrolling
set shortmess=aOstT " shortens msgs to avoid 'press a key' prompt
set showcmd " show command that is being typed
set statusline=%F%m%r%h%w[%L][%{&ff}]%y[%p%%][%04l,%04v]
" | | | | | | | | | | |
" | | | | | | | | | | + current column
" | | | | | | | | | |
" | | | | | | | | | +-- current line
" | | | | | | | | +-- current % into file
" | | | | | | | +-- current syntax in square brackets
" | | | | | | |
" | | | | | | +-- current fileformat
" | | | | | +-- number of lines
" | | | | +-- preview flag in square brackets
" | | | +-- help flag in square brackets
" | | +-- readonly flag in square brackets
" | +-- rodified flag in square brackets
" +-- full path to file in the buffer
" }
" Tabs/Layout {
set completeopt= " no popup menu for completion
set expandtab " no real tabs
set shiftround " when 3 spaces and one hits > go to 4, not 5
set tabstop=2 " real tabs are 2 spaces
set softtabstop=2 " tab and backspace are 2 spaces
set shiftwidth=2 " indent 2 spaces
" set nowrap " do not wrap lines
" }
" Search {
set nohlsearch " don't highlight search hits
set ignorecase " case insensitive by default
set smartcase " if there are caps, go case-sensitive
" }
" Plugin Settings {
" NerdTree
map <C-f> :NERDTree<CR>
" }
" Mappings {
" Windows {
map <C-k> <C-W>k
map <C-j> <C-W>j
map <C-h> <C-W>h
map <C-l> <C-W>l
map <C-Up> <C-W>k
map <C-Down> <C-W>j
map <C-Left> <C-W>h
map <S-right> <C-W>l
" }
" Tabs {
map <S-Left> :tabprev<CR>
map <S-Right> :tabnext<CR>
" direct to tab # with #gt where # is the number of the tab
" }
" }
" Autocommands {
" make vim restore cursor position in files
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
au FileType python setl sw=4 sts=4
endif
" }