-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.vimrc
94 lines (68 loc) · 2.18 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
syntax on
set autoindent
filetype plugin indent on
" No backup files
set nobackup
" No write backup
set nowritebackup
" No swap file
set noswapfile
" A buffer is marked as ‘hidden’ if it has unsaved changes, and it is not currently loaded in a window
" if you try and quit Vim while there are hidden buffers, you will raise an error:
" E162: No write since last change for buffer “a.txt”
set hidden
" Turn word wrap off
set nowrap
" Allow backspace to delete end of line, indent and start of line characters
set backspace=indent,eol,start
" convert tabs to spaces
set expandtab
" Set tab size in spaces
set tabstop=4
" The number of spaces inserted for a tab
set shiftwidth=4
" Turn on line numbers
set number
" Get rid of the delay when pressing O (for example)
" http://stackoverflow.com/questions/2158516/vim-delay-before-o-opens-a-new-line
set timeout timeoutlen=1000 ttimeoutlen=100
" UTF encoding
set encoding=utf-8
set fileencoding=utf-8
" Autoload files that have changed outside of vim
set autoread
" Don't show intro
set shortmess+=I
" Disable bell when you make a mistake
set visualbell
" Disables error flashes
set t_vb=
" 256 colour schemes
set t_Co=256
color ron
" ignore some directories with CTRL-P
let g:ctrlp_custom_ignore = {'dir': '\v[\/](target|results|build|node_modules)$'}
" automatic comment disabling
" http://vim.wikia.com/wiki/Disable_automatic_comment_insertion
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
autocmd BufNewFile,BufReadPost *.md set filetype=markdown
" set filename in status bar
set laststatus=2
" disable markdown folding
let g:vim_markdown_folding_disabled = 1
" Prevent Vim from adding an extra space after a full stop when using 'gq'
set formatoptions-=a
" https://vi.stackexchange.com/questions/18803/stop-vim-from-deleting-trailing-whitespace
function! TrimWhitespace()
" trailing whitespaces have meaning in markdown so don't try there
if &filetype!='markdown'
let l:save = winsaveview()
%s/\s\+$//e
call winrestview(l:save)
endif
endfunction
command! TrimWhitespace call TrimWhitespace()
" Ale
let b:ale_linters = ['eslint']
let g:ale_fixers = {'*': ['prettier']}
let g:ale_fix_on_save = 1