-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.vimrc
151 lines (122 loc) · 4.04 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
" Disable vi bugs
set nocompatible
" Vundle doesn't like this
filetype off
" Prefer the git protocol
let g:vundle_default_git_proto = 'git'
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin() " All plugin commands MUST start here
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" Sensible defaults
" owned by pacman
" Plugin 'tpope/vim-sensible'
" updated ftplugins for git
" owned by pacman
" Plugin 'tpope/vim-git'
" Wrapper for using git in vim
" owned by pacman
" Plugin 'tpope/vim-fugitive'
" Git statusline
" owned by pacman
" Plugin 'airblade/vim-gitgutter'
" Auto-make endifs in scripts
" owned by pacman
" Plugin 'tpope/vim-endwise'
" Integrate unix file handling (auto chmod+x new files with a shebang)
" owned by pacman
" Plugin 'tpope/vim-eunuch'
" Show evil whitespace
Plugin 'vim-scripts/ShowTrailingWhitespace'
" Reopen at the last cursor position
Plugin 'farmergreg/vim-lastplace'
" Syntax checking for everything
" owned by pacman
" Plugin 'scrooloose/syntastic'
call vundle#end() " Finished adding plugins
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
filetype plugin indent on " turn filetype detection back on after vundle finishes
set t_Co=256 "Sets Vim to use 256 colors
colorscheme default
" vim doesn't know how to do this itself
" Don't use inscrutable light colorschemes in the dark
if has('gui_running')
set background=light
else
set background=dark
endif
" Set line numbers
" Current line is absolute, other lines are relative to current line.
set number
set relativenumber
" Tabs started annoying me
set expandtab
set shiftwidth=4
set tabstop=4
" Search settings
set incsearch "Start searching immediately
set hlsearch "Highlight search terms
set showmatch "Highlight matching parentheses
set ignorecase "Ignore case when searching
set smartcase
set autoindent smartindent
" keep a backup file
set backup
" sudoedit uses this instead of /tmp
set backupskip+=/var/tmp/*
" If folds exist, they were probably set manually... and explicit is always
" best!
set foldmethod=marker
" Open new windows to the right.
set splitright
" Nuke evil whitespace from orbit
function StripTrailingWhitespace()
" Don't remove trailing whitespace for these filetypes
if &ft =~ 'markdown\|gitsendemail\|json'
return
endif
let save_cursor = getpos(".")
" Match and remove blank lines at EOF
:silent! %s#\($\n\s*\)\+\%$##
" Match and remove whitespace at EOL
:silent! %s#\s\+$##
call setpos('.', save_cursor)
endfunction
autocmd BufWritePre * call StripTrailingWhitespace()
" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
" Only define it when not defined already.
if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
\ | wincmd p | diffthis
endif
" Mouse isn't auto-enabled :(
if has('mouse')
set mouse=a
endif
" PKGBUILD is a subclass of sh
let g:syntastic_filetype_map = { "PKGBUILD": "sh" }
" Syntastic shouldn't check for makepkg variables or erroring `cd`s.
if @% =~ 'PKGBUILD$' || &ft ==? 'PKGBUILD'
let b:syntastic_sh_shellcheck_post_args = "-e SC2034,SC2154,SC2164"
endif
" vim's internal logic for editing http:// files is completely broken,
" utterly. It doesn't follow redirects.
let g:netrw_http_cmd = "curl"
let g:netrw_http_xcmd = "-fLo"
" EditorConfig globalness
let g:EditorConfig_python_files_dir = '/usr/lib/python3.6/site-packages/editorconfig'
let g:EditorConfig_core_mode = 'python_builtin'
let g:EditorConfig_max_line_indicator = "exceeding"
""" Key mappings
" up/down treats wrapped lines as separate lines
nnoremap j gj
nnoremap k gk