-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
130 lines (93 loc) · 3.09 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
set backup
set backupdir=~/.vim/tmpfiles/
set dir=~/.vim/tmpfiles/
filetype off
set tabstop=4 shiftwidth=4 expandtab
set cindent autoindent smartindent
" http://got-ravings.blogspot.ca/2008/08/vim-pr0n-making-statuslines-that-own.html
set statusline=%t[%{strlen(&fenc)?&fenc:'none'},%{&ff}]%h%m%r%y%=%c,%l/%L\ %P
let mapleader=";"
map <leader>j vey0/"
map <leader>h vey0/\<"\>
" http://vim.wikia.com/wiki/Keep_your_cursor_centered_vertically_on_the_screen
" set scrolloff=5
au BufRead,BufNewFile */commitmsg.patch set textwidth=72
au BufRead,BufNewFile */.git/COMMIT_EDITMSG set textwidth=72
" paste same thing multiple times
xnoremap p pgvy
syn on
colors slate
"set number
set hls
let g:netrw_liststyle=3
map <leader>e :Explore<cr>
" for vimwiki
set nocompatible
filetype plugin on
syntax on
"let g:vimwiki_folding='list'
let wiki1 = {}
let wiki1.path = '~/.vimwiki/wiki/'
let wiki1.path_html = '~/.vimwiki/export/html/'
let g:vimwiki_list = [wiki1]
" python specific
au BufRead,BufNewFile *.py set colorcolumn=80
" c/c++ specific
au BufRead,BufNewFile *.c set tabstop=2 shiftwidth=2 expandtab
au BufRead,BufNewFile *.cc set tabstop=2 shiftwidth=2 expandtab
au BufRead,BufNewFile *.cxx set tabstop=2 shiftwidth=2 expandtab
au BufRead,BufNewFile *.cpp set tabstop=2 shiftwidth=2 expandtab
au BufRead,BufNewFile *.h set tabstop=2 shiftwidth=2 expandtab
au BufRead,BufNewFile *.hh set tabstop=2 shiftwidth=2 expandtab
au BufRead,BufNewFile *.hxx set tabstop=2 shiftwidth=2 expandtab
au BufRead,BufNewFile *.hpp set tabstop=2 shiftwidth=2 expandtab
" do not auto-insert comments in c style language
autocmd BufNewFile,BufRead * setlocal formatoptions-=r
" Rust specific
au BufRead,BufNewFile *.rs set textwidth=80 colorcolumn=80
" debian
set mouse=
" format json
map <leader>J :%!jq .
" clang-format
map <leader>cf :%!clang-format -style=Google
" terraform fmt
map <leader>tf :%!terraform fmt -
" write buffer to clipboard
map <leader>C :w !xclip -in
" NERDTree
map <C-n> :NERDTreeToggle<CR>
map <leader>N :NERDTreeFocus<CR>
" press R when in NERDTree pane to refresh!
" golint binding for :Lint
set rtp+=$GOPATH/src/golang.org/x/lint/misc/vim
" only read .gpg files with plugin
let g:GPGFilePattern = '*.gpg'
" rust.vim options
let g:rustfmt_autosave = 1
" autopep8
map <leader>p8 :%!autopep8 -
" shellcheck
au BufRead,BufNewFile *.sh :set makeprg=shellcheck\ -f\ gcc\ %
au BufRead,BufNewFile *.bash :set makeprg=shellcheck\ -f\ gcc\ %
" reformat lines: gq, but make sure to use nocindent!
" c++filt
map <leader>cppf :%!c++filt
let g:rustfmt_autosave = 0
" patch with contents of yank
" or: :%!patch -p1
"map <leader>P :call system("patch -p1", getreg(""))
map <leader>P :%!patch -p1
" sessions!
" :mksession ~/mysession.vim
" vim -S ~/mysession.vim
" for unicode, go to insert mode, ctrl-v, then type uNNNN:
" U+2194 = ↔
" U+2713 = ✓
" Ctrl-w H or type :wincmd H to go from horizontal to vertical layout.
" Ctrl-w J or type :wincmd J to go from vertical to horizontal layout.
" Show tabs as >>, and trailing characters as U+2593 (dark shade block)
set list
" set lcs=eol:↵
set lcs=tab:▹▹
set lcs+=trail:▓