-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
105 lines (83 loc) · 2.9 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
"don't clutter the current dir with backup files"
"WARNING you need to create ~/.vimtmp manually first"
set backupdir=$HOME/.config/nvim/tmp
"Setup persistent undo
set undodir=$HOME/.config/nvim/undo
set undofile
"configure spell-check"
set spelllang=en
set spellfile=$HOME/Obsidian/en.utf-8.add
autocmd FileType markdown setlocal spell
hi clear SpellBad
hi SpellBad cterm=underline ctermfg=red
"Install Pathogen with:
"mkdir -p ~/.vim/autoload ~/.vim/bundle
"curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
"execute pathogen#infect()
"treat [jt]sx files similarly to [jt]s
autocmd BufNewFile,BufRead *.jsx setlocal filetype=javascript
autocmd BufNewFile,BufRead *.tsx setlocal filetype=typescript
"autocmd BufNewFile,BufRead *.sol setlocal filetype=solidity
"autocmd BufNewFile,BufRead *.py setlocal filetype=python
"autocmd BufNewFile,BufRead *.sh setlocal filetype=sh
autocmd BufRead,BufNewFile *[Dd]ockerfile setfiletype dockerfile
"Use eslint to check javascript & typescript files
let g:syntastic_sh_checkers=['shellcheck']
"let g:syntastic_sh_shellcheck_exec=['shellcheck']
let g:syntastic_javascript_checkers=['eslint']
let g:syntastic_javascript_eslint_exec='node_modules/.bin/eslint'
let g:syntastic_typescript_checkers=['eslint']
let g:syntastic_typescript_eslint_exec='node_modules/.bin/eslint'
let g:syntastic_typescriptreact_checkers=['eslint']
let g:syntastic_typescriptreact_eslint_exec='node_modules/.bin/eslint'
let g:syntastic_python_checkers=['pylint']
let g:syntastic_solidity_checkers=['solhint']
"Lint shortcut
command LR SyntasticReset
command LT SyntasticToggleMode
command L SyntasticCheck
"Do not lint on :w
"autocmd VimEnter * SyntasticToggleMode
"use n spaces instead of tabs"
set tabstop=2
set shiftwidth=2
set expandtab
autocmd FileType solidity setlocal shiftwidth=4 softtabstop=4
"enable scrolling with mouse"
set mouse=a
"Fold code
set foldmethod=manual
"show line & column numbers by default"
set number
set relativenumber
set ruler
augroup linenumbers
autocmd!
autocmd BufEnter * :set relativenumber
autocmd BufLeave * :set number norelativenumber
autocmd WinEnter * :set relativenumber
autocmd WinLeave * :set number norelativenumber
autocmd InsertEnter * :set number norelativenumber
autocmd InsertLeave * :set relativenumber
autocmd FocusLost * :set number norelativenumber
autocmd FocusGained * :set relativenumber
augroup END
"no more \r"
set fileformat=unix
"fixes broken backspace"
set backspace=indent,eol,start
"wrap lines on whitespace/punctuation instead of the middle of words"
set nolist wrap linebreak breakat&vim
"display half-lines rather than @@@"
set display+=lastline
"screen will scroll to keep cursor more than n lines from edge"
set scrolloff=3
"turn on syntax highlighting"
syntax on
" Use new regular expression engine
set re=1
"turn on auto indent"
set autoindent
set smartindent
"NERDtree shortcut
map <silent> <C-n> :NERDTreeFocus<CR>