Repository navigation
Expand file tree
/
Copy path.vimrc
More file actions
executable file
·136 lines (116 loc) · 5.55 KB
/
Copy path.vimrc
File metadata and controls
executable file
·136 lines (116 loc) · 5.55 KB
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
set fileencodings=utf-8
set background=dark " Use colors suited to a dark terminal.
syntax on " Syntax highlighting.
set autoindent " Auto-indent upon opening new line.
set colorcolumn=72,80 " Show width boundary.
highlight ColorColumn ctermbg=gray
highlight Visual term=reverse cterm=NONE ctermfg=black ctermbg=yellow guifg=black guibg=yellow
set hlsearch " Highlight search term matches.
set showmatch " Show matching bracket.
set ruler " Show line/column.
set showcmd " Show partial commands at bottom.
"set cursorline " Highlight current line.
set scrolloff=10 " Keep at least N lines above/below cursor.
set sidescrolloff=10 " Keep at least N lines left/right of cursor.
set mouse=a " Enable mouse (wheel scrolling, clicks).
if exists('$TMUX')
set ttymouse=sgr " Vim can't detect the mouse protocol under tmux.
endif
" Make the scroll wheel move the cursor (like j/k) instead of scrolling.
noremap <ScrollWheelUp> k
noremap <ScrollWheelDown> j
inoremap <ScrollWheelUp> <Up>
inoremap <ScrollWheelDown> <Down>
set list " Show whitespace.
set listchars=tab:>-,trail:~ " Whitespace display modifications.
highlight NonText ctermfg=red ctermbg=none
highlight SpecialKey ctermfg=darkgray ctermbg=none
" File exclusions for tab-completion and search:
set wildignore=
set wildignore+=**/node_modules/*
set wildignore+=**/target/*
set wildignore+=*.jar
set wildignore+=*.pyc
set wildignore+=*.zip
set wildignore+=.git
set wildignore+=.svn
set wildignore+=tags
autocmd BufRead,BufNewFile *.1 set filetype=roff
autocmd BufRead,BufNewFile *.bash set filetype=sh
autocmd BufRead,BufNewFile *.bashrc set filetype=sh
autocmd BufRead,BufNewFile *.buf set filetype=sql
autocmd BufRead,BufNewFile *.c set filetype=c
autocmd BufRead,BufNewFile *.cpp set filetype=cpp
autocmd BufRead,BufNewFile *.erb set filetype=eruby
autocmd BufRead,BufNewFile *.feature set filetype=feature
autocmd BufRead,BufNewFile *.fn set filetype=sql
autocmd BufRead,BufNewFile *.fnc set filetype=sql
autocmd BufRead,BufNewFile *.ftl set filetype=html
autocmd BufRead,BufNewFile *.go set filetype=go
autocmd BufRead,BufNewFile *.h set filetype=c
autocmd BufRead,BufNewFile *.hpp set filetype=cpp
autocmd BufRead,BufNewFile *.htm set filetype=html
autocmd BufRead,BufNewFile *.html set filetype=html
autocmd BufRead,BufNewFile *.inc set filetype=cpp
autocmd BufRead,BufNewFile *.java set filetype=java
autocmd BufRead,BufNewFile *.js set filetype=javascript
autocmd BufRead,BufNewFile *.json set filetype=json
autocmd BufRead,BufNewFile *.log set filetype=log
autocmd BufRead,BufNewFile *.nomad set filetype=nomad
autocmd BufRead,BufNewFile *.pkb set filetype=sql
autocmd BufRead,BufNewFile *.prc set filetype=sql
autocmd BufRead,BufNewFile *.py set filetype=python
autocmd BufRead,BufNewFile *.rb set filetype=ruby
autocmd BufRead,BufNewFile *.rs set filetype=rust
autocmd BufRead,BufNewFile *.md set filetype=text
autocmd BufRead,BufNewFile *.sh set filetype=sh
autocmd BufRead,BufNewFile *.shtml set filetype=html
autocmd BufRead,BufNewFile *.tbl set filetype=table
autocmd BufRead,BufNewFile *.tex set filetype=tex
autocmd BufRead,BufNewFile *.ts set filetype=typescript
autocmd BufRead,BufNewFile *.txt set filetype=text
autocmd BufRead,BufNewFile *.vimrc set filetype=vim
autocmd BufRead,BufNewFile *.vw set filetype=sql
autocmd BufRead,BufNewFile .plan set filetype=text
autocmd BufRead,BufNewFile .todo set filetype=todo
autocmd BufRead,BufNewFile COMMIT_EDITMSG set filetype=gitcommit
autocmd BufRead,BufNewFile Dockerfile set filetype=dockerfile
autocmd BufRead,BufNewFile Makefile set filetype=makefile
autocmd BufRead,BufNewFile Plan set filetype=text
autocmd BufRead,BufNewFile README set filetype=text
autocmd BufRead,BufNewFile README.txt set filetype=readme
autocmd BufRead,BufNewFile Makefile set filetype=makefile
autocmd BufRead,BufNewFile makefile set filetype=makefile
set number
set textwidth=0
set tabstop=4 softtabstop=4 shiftwidth=4 expandtab
autocmd FileType gitcommit set textwidth=71 colorcolumn=50,72
autocmd FileType c set ts=8 sts=8 noexpandtab
autocmd FileType go set ts=8 sts=8 noexpandtab
autocmd FileType ino set ts=4 sts=4 noexpandtab
autocmd FileType makefile set ts=8 sts=8 noexpandtab
autocmd FileType javascript set ts=2 sts=2
autocmd FileType json set ts=2 sts=2
autocmd FileType eruby set ts=2 sts=2
autocmd FileType feature set ts=2 sts=2
autocmd FileType nomad set ts=2 sts=2
autocmd FileType ruby set ts=2 sts=2
autocmd FileType yaml set ts=2 sts=2
map <C-g> :vimgrep <cword> % <bar> :cw <Enter>
map <C-h> :vimgrep <cword> **/* <bar> :cw <Enter>
" Requires vim-plug, Node.js:
if filereadable(expand("~/.vim/autoload/plug.vim"))
"call plug#begin('~/.vim/plugged')
"Plug 'neoclide/coc.nvim', {'branch': 'release'}
"call plug#end()
" One-time setup:
" sh $ rustup component add rust-analyzer
" vim :PlugInstall
" vim :CocInstall coc-json
" vim :CocInstall coc-pyright
" vim :CocInstall coc-rust-analyzer
"source $HOME/.coc.vimrc
endif
if filereadable(".local.vimrc")
source .local.vimrc
endif