-
Notifications
You must be signed in to change notification settings - Fork 1
/
vimrc
181 lines (145 loc) · 3.45 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
filetype off
call pathogen#infect()
execute pathogen#helptags()
filetype plugin indent on
set nocompatible
set modelines=5
set modeline
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set encoding=utf-8
set scrolloff=3
set autoindent
set showmode
set showcmd
set hidden
set wildmenu
set wildmode=list:longest
set visualbell
set cursorline
set ttyfast
set ruler
set backspace=indent,eol,start
set laststatus=2
set directory=~/.vim/tmp/swap// " swap files
" Vim 7.3 options
if version >= 703
set colorcolumn=+1
set undodir=~/.vim/tmp/undo// " undo files
set undofile
endif
"Macvim only settings
if has("gui_running")
set guioptions=-t
set relativenumber
endif
let mapleader = ","
let maplocalleader = "\\"
nnoremap / /\v
vnoremap / /\v
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
nnoremap <leader><space> :noh<cr>
set wrap
set textwidth=80
set formatoptions=qrn1
" Show invisible chars by default
set listchars=tab:▸\ ,eol:¬
set list
au FocusLost * :wa
"Leader Mappings
nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
nnoremap <leader>v V`
nnoremap <leader>ev <C-w><C-v><C-l>:e $MYVIMRC<CR>
nnoremap <leader>1 yypVr=
nnoremap <leader>2 yypVr-
nnoremap <leader>l :set list!<CR>
nnoremap <leader>p :set paste!<CR>
let g:ctrlp_map = '<leader>,'
nnoremap <leader>w <C-w>v<C-w>l
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
"Colorscheme {{
set background=dark
let g:solarized_termcolors=16
if !has("gui_running")
let g:solarized_italic=0
endif
colorscheme solarized
"Invisible character colors
highlight NonText cterm=none guifg=#D9D9D9
highlight SpecialKey cterm=none guifg=#D9D9D9
syntax on
" }}
" Airline configuration
let g:airline_powerline_fonts = 1
let g:airline_solarized_bg='dark'
" NERD Tree {{{
noremap <F2> :NERDTreeToggle<cr>
inoremap <F2> <esc>:NERDTreeToggle<cr>
let NERDTreeHighlightCursorline = 1
let NERDTreeIgnore = ['.vim$', '.*\.pyc$', '.*.pid']
let NERDTreeMinimalUI = 1
let NERDTreeDirArrows = 1
let NERDChristmasTree = 1
let NERDTreeChDirMode = 2
let NERDTreeMapJumpFirstChild = 'gK'
" }}}
" YAML {{{
augroup ft_yaml
au!
au FileType yaml set shiftwidth=2
augroup END
" }}}
" tslime {{{
let g:tslime_ensure_trailing_newlines = 1
let g:tslime_normal_mapping = '<localleader>t'
let g:tslime_visual_mapping = '<localleader>t'
let g:tslime_vars_mapping = '<localleader>T'
" }}}
" Scheme {{{
autocmd filetype lisp,scheme,art setlocal equalprg=scmindent.rkt
" }}}
" vim-go {{{
let g:go_dispatch_enabled = 1
let g:go_fmt_command = "goimports"
" }}}
" vim-processing
let g:use_processing_java = 1
" CtrlP
nnoremap <leader>. :CtrlP<CR>
nnoremap <leader><leader> :CtrlPBuffer<CR>
" Filetype detection
au BufNewFile,BufRead *.adoc set filetype=asciidoc
au BufNewFile,BufRead *.less set filetype=css
au BufNewFile,BufRead *.j2 set filetype=html
au BufNewFile,BufRead *.pp set ts=2 sw=2
au BufNewFile,BufRead *.eyaml set filetype=yaml
autocmd filetype sh setlocal ts=2 sw=2
" Highlight comments in italics
highlight Comment cterm=italic
let s:uname = system("echo -n \"$(uname)\"")
"if !v:shell_error && s:uname == "Linux"
" set t_ZH=[3m
" set t_ZR=[23m
"endif
let g:niji_dark_colours = [
\ [ '81', '#5fd7ff'],
\ [ '99', '#875fff'],
\ [ '1', '#dc322f'],
\ [ '76', '#5fd700'],
\ [ '3', '#b58900'],
\ [ '2', '#859900'],
\ [ '6', '#2aa198'],
\ [ '4', '#268bd2'],
\ ]
let g:paredit_electric_return = 1
let g:SuperTabCrMapping = 0