-
Notifications
You must be signed in to change notification settings - Fork 1
/
dot_vimrc
164 lines (135 loc) · 4.33 KB
/
dot_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
call plug#begin('~/.vim/plugged')
" Bundles
" Actual plugins
Plug 'VundleVim/Vundle.vim'
Plug 'tpope/vim-fugitive'
Plug 'kien/ctrlp.vim'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-repeat'
Plug 'editorconfig/editorconfig-vim'
Plug 'gerw/vim-HiLinkTrace'
" Meta plugins
Plug 'vim-scripts/ingo-library'
Plug 'vim-scripts/SyntaxRange'
" Syntax highlighting
Plug 'plasticboy/vim-markdown'
Plug 'cespare/vim-toml'
Plug 'rust-lang/rust.vim'
Plug 'mxw/vim-jsx'
Plug 'pangloss/vim-javascript'
Plug 'kchmck/vim-coffee-script'
Plug 'google/vim-jsonnet'
Plug 'sirtaj/vim-openscad'
Plug 'leafgarland/typescript-vim'
Plug 'beyondmarc/glsl.vim'
Plug 'vim-scripts/scons.vim'
Plug 'calviken/vim-gdscript3'
Plug 'wannesm/wmgraphviz.vim'
Plug 'sotte/presenting.vim'
Plug 'ziglang/zig.vim'
Plug 'junegunn/fzf.vim'
Plug 'sonph/onehalf', { 'rtp': 'vim' }
" github.com/junegunn/fzf.vim
nmap ;b :Buffers<CR>
nmap ;f :Files<CR>
nmap ;t :Tags<CR>
call plug#end()
filetype plugin indent on
set laststatus=2
set t_Co=256
let g:vim_markdown_folding_disabled=1
let g:vim_markdown_frontmatter=1
let g:jsx_ext_required = 0
set encoding=utf-8
set tabstop=4
set shiftwidth=4
set autoindent
set magic " unbreak vim's regex implementation
set number
set scrolloff=3
set sidescroll=3
set ruler
set cc=80
set nowrap
set ignorecase
set smartcase
set splitbelow
set hidden
set notimeout
" Search as you type, highlight results
set incsearch
set showmatch
set hlsearch
" Resize windows and move tabs and such with the mouse
set mouse=a
" Don't litter swp files everywhere
set backupdir=~/.cache
set directory=~/.cache
set nofoldenable
set lazyredraw
set tags=./tags;
set printheader=\
syntax on
let mapleader = "\<space>"
nnoremap \\ :noh<cr> " Clear higlighting
nnoremap <silent> <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR> " Trim trailing spaces
nnoremap Y y$
nnoremap cc :center<cr>
inoremap <C-c> <ESC>
" Ex mode is fucking dumb
nnoremap Q <Nop>
command Jp e ++enc=euc-jp
" Preferences for various file formats
autocmd FileType c setlocal noet ts=4 sw=4 tw=80
autocmd FileType h setlocal noet ts=4 sw=4 tw=80
autocmd FileType cpp setlocal noet ts=4 sw=4 tw=80
autocmd FileType s setlocal noet ts=4 sw=4
autocmd FileType go setlocal noet ts=4 sw=4
autocmd FileType hy setlocal filetype=lisp
autocmd FileType sh setlocal noet ts=4 sw=4
autocmd BufRead,BufNewFile *.js setlocal et ts=2 sw=2
autocmd FileType html setlocal et ts=2 sw=2
autocmd FileType htmldjango setlocal et ts=2 sw=2
autocmd FileType ruby setlocal et ts=2 sw=2
autocmd FileType scss setlocal et ts=2 sw=2
autocmd FileType yaml setlocal et ts=2 sw=2
autocmd FileType markdown setlocal tw=80 et ts=2 sw=2
autocmd FileType text setlocal tw=80
autocmd FileType meson setlocal noet ts=2 sw=2
autocmd FileType bzl setlocal et ts=2 sw=2
autocmd FileType typescript setlocal et ts=2 sw=2
autocmd FileType python setlocal et ts=4 sw=4
autocmd BufNewFile,BufRead *.ms set syntax=python ts=4 sw=4 noet
autocmd BufNewFile,BufRead *.scd set ts=4 sw=4 noet
autocmd FileType tex hi Error ctermbg=NONE
autocmd FileType mail setlocal noautoindent
augroup filetypedetect
autocmd BufRead,BufNewFile *mutt-* setfiletype mail
augroup filetypedetect
autocmd BufRead,BufNewFile *qutebrowser-editor-* set ts=4 sw=4 et
autocmd BufNewFile,BufRead * if expand('%:t') == 'APKBUILD' | set ft=sh | endif
autocmd BufNewFile,BufRead * if expand('%:t') == 'PKGBUILD' | set ft=sh | endif
set guioptions-=m
set guioptions-=T
set guioptions-=r
set guioptions-=e
nmap <leader>l :set list!<CR>
set listchars=tab:▸\ ,eol:¬,space:.
syntax enable
" Transparent editing of gpg encrypted files.
" By Wouter Hanegraaff
augroup encrypted
au!
autocmd BufReadPre,FileReadPre *.gpg set viminfo=
autocmd BufReadPre,FileReadPre *.gpg set noswapfile noundofile nobackup
autocmd BufReadPre,FileReadPre *.gpg set bin
autocmd BufReadPre,FileReadPre *.gpg let ch_save = &ch|set ch=2
autocmd BufReadPost,FileReadPost *.gpg '[,']!gpg --decrypt 2> /dev/null
autocmd BufReadPost,FileReadPost *.gpg set nobin
autocmd BufReadPost,FileReadPost *.gpg let &ch = ch_save|unlet ch_save
autocmd BufReadPost,FileReadPost *.gpg execute ":doautocmd BufReadPost " . expand("%:r")
autocmd BufWritePre,FileWritePre *.gpg '[,']!gpg --default-recipient-self -ae 2>/dev/null
autocmd BufWritePost,FileWritePost *.gpg u
augroup END
let g:presenting_top_margin = 2
" set printdevice=EPSON_LX-350