-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.vimrc
executable file
·135 lines (105 loc) · 2.89 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
syntax enable
set background=dark
colorscheme default
if $TERM =~ '^\(tmux\|iterm\|vte\|gnome\)\(-.*\)\?$'
set termguicolors
endif
if &compatible
set nocompatible
endif
set encoding=utf-8
set lazyredraw
" Change the leader key to ','
let mapleader=","
" Use the default clipboard for the host operating system
set clipboard+=unnamedplus
set number
set relativenumber
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set smartindent
set shiftround
set smartcase
filetype plugin indent on
" <Ctrl-l> redraws the screen and removes any search highlighting.
nnoremap <silent> <C-l> :nohl<CR><C-l>
" Spelling
set spelllang=en_us
set spellfile=$DOTFILES/vim/dictionary.en.utf-8.add
" Wildignore
set wildignore+=*.pyc,*.zip,*.gz,*.tar
set wildignore+=*.jpg,*.jpeg,*.gif,*.png,*.ico,*.psd,*.swf
set wildignore+=*.pdf,*.doc,*.docx
set wildignore+=.gitkeep
" Command tabbing
" set wildmode=longest,list,full
set wildmenu
" Terminal
autocmd TermOpen * setlocal bufhidden=hide
if has('persistent_undo')
set undofile
endif
""
" Vim Plug
""
" https://github.com/junegunn/vim-plug
"
" Install by downloading the vim script and putting it in the right directory:
"
" # neovim
" $ curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
"
" # vim
" $ curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
""
call plug#begin('~/.vim/plugged')
let brew_prefix = system('brew --prefix') . '/'
" FZF
" Plug $brew_prefix . 'opt/fzf' " '/usr/local/opt/fzf'
" '/usr/local/opt/fzf'
Plug '/opt/homebrew/opt/fzf'
" Better Whitespace
let g:better_whitespace_enabled=1
Plug 'ntpeters/vim-better-whitespace'
call plug#end()
" Highlight codetags
augroup codetags
autocmd!
autocmd Syntax * call matchadd('Todo', '\W\zs\(TODO\|FIXME\|XXX\|???\|!!!\|BUG\|HACK\|NOTE\|INFO\|IDEA\):')
augroup END
" Highlight trailing whitespace
highlight BadWhitespace ctermbg=red guibg=red
" Python
augroup python
autocmd!
autocmd FileType python let &l:colorcolumn="80,".join(range(120,999),",")
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType python setlocal sts=4 sw=4 ts=4 tw=79
autocmd BufWritePre *.py normal m`:%s/\s\+$//e``
autocmd BufRead,BufNewFile *.py match BadWhitespace /^\t\+/
" autocmd BufRead,BufNewFile *.py match BadWhitespace /\s\+$/
augroup END
" Git messages
augroup gitcommit
autocmd!
autocmd FileType gitcommit setlocal colorcolumn=73
augroup END
" Markdown & Text
augroup text_settings
autocmd!
autocmd BufNewFile,BufRead *.md,*.txt,*.scratch setlocal spell wrap
augroup END
" Docker
augroup docker_settings
autocmd!
autocmd BufNewFile,BufRead .dockerignore setlocal filetype=conf
augroup END
" Cron
augroup crontab_settings
autocmd!
autocmd FileType crontab setlocal backupcopy=yes
augroup END