-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
121 lines (92 loc) · 3.46 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
"set nu
syntax on
syntax sync fromstart
"set t_Co=256 " use 256 colors
"set termguicolors " use 24 bit color
"older schemes
"colorscheme delek
"colorscheme ingretu
set background=dark
"override horrible non-black background jfc how can people live with that shit?
highlight Normal guibg=black guifg=white
"simple underline (or under-squiggle - if available) for spell errors
augroup SpellUnderline
autocmd!
autocmd ColorScheme * hi SpellBad cterm=underline ctermfg=NONE ctermbg=NONE
augroup END
"colorscheme palenight
colorscheme vividchalk
" Store all swap files in a single directory
" thanks kad!
set directory^=$HOME/.vim/tmp//
set nocompatible " Use Vim defaults (much better!)
set viminfo='20,\"50 " read/write a .viminfo file, don't store more
" than 50 lines of registers
set history=50 " keep 50 lines of command line history
set bs=indent,eol,start " allow backspacing over everything in insert mode
set autoindent " always set autoindenting on
set preserveindent
set nosmartindent " set smart indentation off - it fucks up Python
set smarttab
set expandtab
set textwidth=79
set cursorline
set ruler " show the cursor position all the time
set expandtab " expand tabs to spaces
set shiftwidth=4 " default width of the smart tab
set tabstop=4 " default existing tabs' width
set softtabstop=4
set modeline " enable modeline support
set modelines=5 " look for modelines up to the 5h line
set showmatch " show the matching paren/bracket
set matchtime=2 " but faster
"set spell " check grammar
set formatoptions=croqn2
set lbr
set nojoinspaces
function! PasteAwareStatusline()
let default = "%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P"
if &paste
return "%#ErrorMsg#" . default . "%*"
endif
return default
endfunction
set statusline=%!PasteAwareStatusline()
"let g:lightline = { 'colorscheme': 'palenight' }
"let g:palenight_terminal_italics=1
" paste/nopaste toggle
nmap <Leader>p :set paste!<CR>
" Ruby and related
autocmd BufNewFile,BufRead Gemfile,Vagrantfile setlocal filetype=ruby
autocmd BufNewFile,BufRead *.tt,*.citrus setlocal filetype=treetop
" Don't use foldmethod=syntax as it is DOG SLOW on nontrivial files :(
autocmd FileType ruby setlocal tabstop=2 softtabstop=2 shiftwidth=2
autocmd BufNewFile,BufRead *.json set filetype=json
autocmd BufNewFile,BufRead *.jsonp set filetype=json
" Markdown
autocmd BufNewFile,BufRead *.txt setlocal filetype=markdown
autocmd FileType markdown setlocal ai comments=n:> spell
" ReST
autocmd BufNewFile,BufRead *.rst,*.rest setlocal filetype=rst
autocmd FileType rst setlocal ai comments=n:> spell
" YAML
autocmd FileType yaml setlocal tabstop=2 shiftwidth=2 softtabstop=2
" No more need to drop modelines into common Apache files
" (both Debian and RedHat style Apache conf dirs)
autocmd BufNewFile,BufRead /etc/apache2/*,/etc/httpd/* setlocal filetype=apache
" Same for nginx
autocmd BufNewFile,BufRead */etc/nginx/* setlocal ft=nginx
" JSON
autocmd BufNewFile,BufRead *.json setlocal ft=javascript
" Zsh
autocmd BufNewFile,BufRead ~/.zsh* setlocal filetype=zsh
" Io
autocmd BufNewFile,BufRead *.io setlocal ft=io
" Racket/Scheme
autocmd BufNewFile,BufRead *.rkt setlocal tabstop=2 softtabstop=2 shiftwidth=2 ft=scheme
" pretty print json
map <leader>jt <Esc>:%!json_xs -f json -t json-pretty<CR>
" plugins init
call plug#begin()
" plugins init end
call plug#end()