-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
161 lines (128 loc) · 3.91 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
set shell=/bin/bash
set ttyfast
set lazyredraw
let $PATH='/usr/local/bin:' . $PATH
" Include plugin files
if filereadable(expand("~/.config/.vimrc.bundles"))
source ~/.config/.vimrc.bundles
endif
" Sessions
let g:session_autoload = 'no'
" NerdTRee config
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
filetype plugin indent on
augroup vimrcEx
autocmd!
" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78
" When editing a file, always jump to the last known cursor position.
" Don't do it for commit messages, when the position is invalid, or when
" inside an event handler (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if &ft != 'gitcommit' && line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
" Set syntax highlighting for specific file types
autocmd BufRead,BufNewFile Appraisals set filetype=ruby
autocmd BufRead,BufNewFile *.md set filetype=markdown
" Enable spellchecking for Markdown
autocmd FileType markdown setlocal spell
" Automatically wrap at 80 characters for Markdown
autocmd BufRead,BufNewFile *.md setlocal textwidth=80
augroup END
" Display extra whitespace
set list listchars=tab:»·,trail:·
" Reduce timeout after <ESC> is recieved.
set timeout
set ttimeout
set ttimeoutlen=225
set timeoutlen=225
" highlight vertical column of cursor
set cursorline
" Leave paste mode on exit
au InsertLeave * set nopaste
set noerrorbells " No beeps
set backspace=2 " Backspace deletes like most programs in insert mode
set nocompatible " Use Vim settings, rather then Vi settings
set nobackup
set nowritebackup
set noswapfile
set history=500
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
set hlsearch " highlight matches
set laststatus=2 " Always display the status line
set autowrite " Automatically :write before running commands
set ignorecase
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)
set autoread " Automatically reread changed files without asking me anything
" Numbers
set number " Always show line numbers
set colorcolumn=105 " Show a horisontal bar at 105 characters to avoid long lines
set norelativenumber
set numberwidth=5
" Persistent undo
set undodir=~/.vim/undo/
set undofile
set undolevels=1000
set undoreload=10000
" Tab completion
" will insert tab at beginning of line,
" will use completion if not at beginning
set wildmode=list:longest,list:full
set complete=.,w,b,u,t
" Open new split panes to right and bottom, which feels more natural
set splitbelow
set splitright
" Indendation configuration
set autoindent
set smartindent
set cindent
set filetype=html
set noexpandtab
set tabstop=4
set shiftwidth=4
set softtabstop=-1
set smartcase
set guifont=Roboto\ Mono\ for\ Powerline:h12
set encoding=utf-8
set t_Co=256
set fillchars+=stl:\ ,stlnc:\
set term=xterm-256color
set termencoding=utf-8
" have jsx highlighting/indenting work in .js files as well
let g:jsx_ext_required = 0
" Treat <li> and <p> tags like the block tags they are
let g:html_indent_tags = 'li\|p'
" Enable MatchTagAlways for these files
let g:mta_filetypes = {
\ 'html' : 1,
\ 'xhtml' : 1,
\ 'xml' : 1,
\ 'jinja' : 1,
\ 'phtml' : 1,
\ 'php' : 1,
\ 'jsx' : 1,
\ 'js' : 1,
\}
" Enable mouse if its supported
if has('mouse')
set mouse=a
endif
filetype indent on
syntax on
if filereadable(expand("~/.config/.vimrc.keybindings"))
source ~/.config/.vimrc.keybindings
endif
if filereadable(expand("~/.config/.vimrc.colorscheme"))
source ~/.config/.vimrc.colorscheme
endif
if filereadable(expand("~/.config/.vimrc.statusline"))
source ~/.config/.vimrc.statusline
endif
if filereadable(expand("~/.config/.vimrc.local"))
source ~/.config/.vimrc.local
endif