-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
63 lines (54 loc) · 1.79 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
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin()
" nginx
Plug 'chr4/nginx.vim'
" .fish
Plug 'dag/vim-fish', { 'for': 'fish' }
" Asynchronous Lint Engine
Plug 'dense-analysis/ale'
" Terraform
Plug 'hashivim/vim-terraform', { 'for': 'terraform' }
" Ansible
let g:ansible_unindent_after_newline = 1
" Rust
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
" NERDTree
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
" UltiSnips
"Plug 'SirVer/ultisnips'
" Git
Plug 'tpope/vim-fugitive'
" vim defaults - todo: replace
Plug 'tpope/vim-sensible'
" .editorconfig called last in hopes of overriding
Plug 'editorconfig/editorconfig-vim'
" fuzzy search
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
source ~/.shared-plugins.vimrc
call plug#end()
source ~/.shared.vimrc
" Settings
set ttymouse=xterm2
set mouse=nv
set shortmess=ilnxtToO
" Commands
com! FormatXML :%!python3 -c "import xml.dom.minidom, sys; print(xml.dom.minidom.parse(sys.stdin).toprettyxml())"
com! FormatJSON :%!python3 -m json.tool
com! TrimTrailingWhitespace :%s/\s\+$//e
" keyboard mappings (be sparing with these!)
map <C-n> :NERDTreeToggle<CR>
map <Leader>w <C-W>w
noremap <Leader>y "*y
noremap <Leader>p "*p
noremap <Leader>f :GFiles<CR>
" autocmds (be even more sparing with these!)
" quit NERDTree if it's the last remaining window
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" turn on spell check for markdown
autocmd FileType markdown :set spell
autocmd FileType nginx setlocal shiftwidth=4 tabstop=4 expandtab