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