]> git.r.bdr.sh - rbdr/dotfiles/blame_incremental - vimrc
Add svelte config for ALE
[rbdr/dotfiles] / vimrc
... / ...
CommitLineData
1set nocompatible
2
3"
4" Basics
5"
6
7set number
8set ruler
9syntax on
10
11" Set encoding
12set encoding=utf-8
13
14" Whitespace stuff
15set nowrap
16set tabstop=2
17set shiftwidth=2
18set softtabstop=2
19set expandtab
20set list listchars=tab:\ \ ,trail:ยท
21
22" Searching
23set hlsearch
24set incsearch
25set ignorecase
26set smartcase
27
28" Tab completion
29set wildmode=list:longest,list:full
30set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*
31
32" Status bar
33set laststatus=2
34
35" allow backspacing over everything in insert mode
36set backspace=indent,eol,start
37
38" Show (partial) command in the status line
39set showcmd
40
41" Remember last location in file
42if has("autocmd")
43 au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
44 \| exe "normal g'\"" | endif
45endif
46
47"
48" File Type Config
49"
50
51" make uses real tabs
52au FileType make set noexpandtab
53
54" Thorfile, Rakefile, Vagrantfile and Gemfile are Ruby
55au BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,config.ru} set ft=ruby
56
57" make Python follow PEP8 ( http://www.python.org/dev/peps/pep-0008/ )
58au FileType python set softtabstop=4 tabstop=4 shiftwidth=4 textwidth=79
59
60" snes syntax highlighting
61au BufNewFile,BufRead *.asm,*.s set filetype=snes"
62
63" load the plugin and indent settings for the detected filetype
64filetype plugin indent on
65filetype plugin on
66set omnifunc=syntaxcomplete#Complete
67
68" Directories for swp files
69set backupdir=~/.vim/.backup
70set directory=~/.vim/.backup
71
72" Include local vimrc
73if filereadable(expand("~/.vimrc.local"))
74 source ~/.vimrc.local
75endif
76
77"
78" Tool Configs
79"
80
81" CTags
82map <Leader>rt :!ctags --extra=+f -R *<CR><CR>
83map <C-\> :tnext<CR>
84
85" Opens an edit command with the path of the currently edited file filled in
86" Normal mode: <Leader>e
87map <Leader>e :e <C-R>=expand("%:p:h") . "/" <CR>
88
89" Opens a tab edit command with the path of the currently edited file filled in
90" Normal mode: <Leader>t
91map <Leader>te :tabe <C-R>=expand("%:p:h") . "/" <CR>
92
93" % to bounce from do to end etc.
94runtime! macros/matchit.vim
95
96" Dank Mono Italics
97highlight Keyword cterm=italic
98
99" FZF config
100set rtp+=/usr/local/opt/fzf
101
102" Inserts the path of the currently edited file into a command
103noremap <C-P> :FZF <CR>
104
105" ALE config
106let g:ale_linter_aliases = {'svelte': ['css', 'javascript']}
107let g:ale_linters = {
108 \'javascript': ['eslint'],
109 \'svelte': ['stylelint', 'eslint']
110 \}
111let g:ale_fixers = {
112 \'javascript': ['eslint'],
113 \'svelte': ['eslint']
114 \}
115let g:ale_fix_on_save = 1
116
117"
118" A E S T H E T I C S
119"
120
121" Color Column
122let &colorcolumn="80,150"
123
124" Default color scheme
125set termguicolors
126color rbdr
127
128" Map colors to vim colors
129let g:fzf_colors =
130\ { 'fg': ['fg', 'Normal'],
131 \ 'bg': ['bg', 'Normal'],
132 \ 'hl': ['fg', 'Comment'],
133 \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
134 \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
135 \ 'hl+': ['fg', 'Statement'],
136 \ 'info': ['fg', 'PreProc'],
137 \ 'border': ['fg', 'Ignore'],
138 \ 'prompt': ['fg', 'Conditional'],
139 \ 'pointer': ['fg', 'Exception'],
140 \ 'marker': ['fg', 'Keyword'],
141 \ 'spinner': ['fg', 'Label'],
142 \ 'header': ['fg', 'Comment'] }
143
144"
145" Editing Shortcuts
146"
147
148" Folding Settings
149set foldmethod=syntax
150set foldnestmax=10
151set nofoldenable
152set foldlevel=1
153
154" Relative numbers
155autocmd FocusLost * :set norelativenumber
156autocmd InsertEnter * :set norelativenumber
157autocmd InsertLeave * :set relativenumber
158autocmd CursorMoved * :set relativenumber
159
160function! NumberToggle()
161 if(&relativenumber == 1)
162 set norelativenumber
163 else
164 set relativenumber
165 endif
166endfunction
167
168nnoremap <C-n> :call NumberToggle()<cr>
169
170
171" Move things up and down using Ctrl + Shift
172nnoremap <C-S-j> :m .+1<CR>==
173nnoremap <C-S-k> :m .-2<CR>==
174inoremap <C-S-j> <Esc>:m .+1<CR>==gi
175inoremap <C-S-k> <Esc>:m .-2<CR>==gi
176vnoremap <C-S-j> :m '>+1<CR>gv=gv
177vnoremap <C-S-k> :m '<-2<CR>gv=gv
178
179"
180" Plug Config
181"
182
183call plug#begin('~/.vim/plugged')
184
185" Syntaxes
186Plug 'rbdr/api-notation.vim'
187Plug 'elzr/vim-json'
188Plug 'mustache/vim-mode'
189Plug 'othree/yajs.vim'
190Plug 'ARM9/snes-syntax-vim'
191Plug 'posva/vim-vue'
192Plug 'leafOfTree/vim-svelte-plugin'
193Plug 'bumaociyuan/vim-swift'
194Plug 'udalov/kotlin-vim'
195
196" Editing
197Plug 'jiangmiao/auto-pairs'
198Plug 'tpope/vim-endwise'
199Plug 'michaeljsmith/vim-indent-object'
200
201" Tools
202Plug 'editorconfig/editorconfig-vim'
203Plug 'dense-analysis/ale'
204Plug 'vim-scripts/LargeFile'
205Plug 'tpope/vim-fugitive'
206Plug 'milkypostman/vim-togglelist'
207Plug 'jremmen/vim-ripgrep'
208Plug 'lifepillar/vim-mucomplete'
209
210" List ends here. Plugins become visible to Vim after this call.
211call plug#end()