-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
135 lines (99 loc) · 2.96 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
126
127
128
129
130
131
132
133
134
""""""
" UI "
""""""
" disable vi compatibility
set nocompatible
" automatically load changed files
set autoread
" auto-reload vimrc
autocmd! bufwritepost vimrc source ~/.vim/vimrc
"autocmd! bufwritepost gvimrc source ~/.vim/gvimrc
" show the filename in the window titlebar
set title
" set encoding
set encoding=utf-8
" directories for swp files
set backupdir=~/.vim/backup
set directory=~/.vim/backupf
" display incomplete commands at the bottom
set showcmd
" mouse support
set mouse=a
" line numbers
" set number
" highlight cursor line
set cursorline
" wrapping stuff
" set textwidth=80
" set colorcolumn=80
" ignore whitespace in diff mode
set diffopt+=iwhite
" Be able to arrow key and backspace across newlines
set whichwrap=bs<>[]
" Status bar
set laststatus=2
" remember last cursor position
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
" show '> ' at the beginning of lines that are automatically wrapped
set showbreak=>\ \ \
" enable completion
set ofu=syntaxcomplete#Complete
" make laggy connections work faster
set ttyfast
" let vim open up to 100 tabs at once
set tabpagemax=100
" case-insensitive filename completion
set wildignorecase
"""""""""""""
" Searching "
"""""""""""""
set hlsearch "when there is a previous search pattern, highlight all its matches
set incsearch "while typing a search command, show immediately where the so far typed pattern matches
set ignorecase "ignore case in search patterns
set smartcase "override the 'ignorecase' option if the search pattern contains uppercase characters
set gdefault "imply global for new searches
"""""""""""""
" Indenting "
"""""""""""""
" When auto-indenting, use the indenting format of the previous line
set copyindent
" When on, a <Tab> in front of a line inserts blanks according to 'shiftwidth'.
" 'tabstop' is used in other places. A <BS> will delete a 'shiftwidth' worth of
" space at the start of the line.
set smarttab
" Copy indent from current line when starting a new line (typing <CR> in Insert
" mode or when using the "o" or "O" command)
set autoindent
" Automatically inserts one extra level of indentation in some cases, and works
" for C-like files
set smartindent
"""""""""
" Theme "
"""""""""
syntax enable
set background=dark "uncomment this if your terminal has a dark background
""""""""
" GVim "
""""""""
"disable cursor blinking
set gcr=n:blinkon0
"remove menu bar
set guioptions-=m
"""""""""""""""""""""
" Language-Specific "
"""""""""""""""""""""
" load the plugin and indent settings for the detected filetype
filetype plugin indent on
" Thorfile, Rakefile, Vagrantfile and Gemfile are Ruby
au BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,config.ru} set ft=ruby
au BufRead,BufNewFile *.html.erb set ft=eruby
" Add json syntax highlighting
au BufNewFile,BufRead *.json set ft=json syntax=javascript
"""""""""""""""""
" My Own Things "
"""""""""""""""""
" Show line number, line length etc bottom-right
set ruler