]>
Commit | Line | Data |
---|---|---|
1 | set nocompatible | |
2 | ||
3 | " | |
4 | " Basics | |
5 | " | |
6 | ||
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 | ||
35 | " allow backspacing over everything in insert mode | |
36 | set backspace=indent,eol,start | |
37 | ||
38 | " Show (partial) command in the status line | |
39 | set showcmd | |
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 | ||
47 | " | |
48 | " File Type Config | |
49 | " | |
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 | ||
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 | ||
60 | " snes syntax highlighting | |
61 | au BufNewFile,BufRead *.asm,*.s set filetype=snes" | |
62 | ||
63 | " load the plugin and indent settings for the detected filetype | |
64 | filetype plugin indent on | |
65 | filetype plugin on | |
66 | ||
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 | ||
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 | ||
92 | " % to bounce from do to end etc. | |
93 | runtime! macros/matchit.vim | |
94 | ||
95 | " Dank Mono Italics | |
96 | highlight Keyword cterm=italic | |
97 | ||
98 | " FZF config | |
99 | set rtp+=$FZF_VIM_PATH | |
100 | ||
101 | " Inserts the path of the currently edited file into a command | |
102 | noremap <C-P> :FZF <CR> | |
103 | ||
104 | let g:fzf_layout = { 'down': '40%' } | |
105 | ||
106 | " Auto Pairs | |
107 | let g:AutoPairsMultilineClose = 0 | |
108 | ||
109 | " ALE config | |
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 | |
120 | ||
121 | " Svelte Config | |
122 | let g:vim_svelte_plugin_use_typescript = 1 | |
123 | ||
124 | " Deoplete config | |
125 | let g:deoplete#enable_at_startup = 1 | |
126 | inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>" | |
127 | inoremap <expr><S-tab> pumvisible() ? "\<c-p>" : "\<tab>" | |
128 | ||
129 | " | |
130 | " A E S T H E T I C S | |
131 | " | |
132 | ||
133 | " Color Column | |
134 | let &colorcolumn="80,150" | |
135 | ||
136 | " Default color scheme | |
137 | set termguicolors | |
138 | color rbdr | |
139 | ||
140 | " Map colors to vim colors | |
141 | let g:fzf_colors = | |
142 | \ { 'fg': ['fg', 'Normal'], | |
143 | \ 'bg': ['bg', 'Normal'], | |
144 | \ 'hl': ['fg', 'Comment'], | |
145 | \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'], | |
146 | \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'], | |
147 | \ 'hl+': ['fg', 'Statement'], | |
148 | \ 'info': ['fg', 'PreProc'], | |
149 | \ 'border': ['fg', 'Ignore'], | |
150 | \ 'prompt': ['fg', 'Conditional'], | |
151 | \ 'pointer': ['fg', 'Exception'], | |
152 | \ 'marker': ['fg', 'Keyword'], | |
153 | \ 'spinner': ['fg', 'Label'], | |
154 | \ 'header': ['fg', 'Comment'] } | |
155 | ||
156 | " | |
157 | " Editing Shortcuts | |
158 | " | |
159 | ||
160 | " Folding Settings | |
161 | set foldmethod=syntax | |
162 | set foldnestmax=10 | |
163 | set nofoldenable | |
164 | set foldlevel=1 | |
165 | ||
166 | " Relative numbers | |
167 | autocmd FocusLost * :set norelativenumber | |
168 | autocmd InsertEnter * :set norelativenumber | |
169 | autocmd InsertLeave * :set relativenumber | |
170 | autocmd CursorMoved * :set relativenumber | |
171 | ||
172 | function! NumberToggle() | |
173 | if(&relativenumber == 1) | |
174 | set norelativenumber | |
175 | else | |
176 | set relativenumber | |
177 | endif | |
178 | endfunction | |
179 | ||
180 | nnoremap <C-n> :call NumberToggle()<cr> | |
181 | ||
182 | ||
183 | " Move things up and down using Ctrl + Shift | |
184 | nnoremap <C-S-j> :m .+1<CR>== | |
185 | nnoremap <C-S-k> :m .-2<CR>== | |
186 | inoremap <C-S-j> <Esc>:m .+1<CR>==gi | |
187 | inoremap <C-S-k> <Esc>:m .-2<CR>==gi | |
188 | vnoremap <C-S-j> :m '>+1<CR>gv=gv | |
189 | vnoremap <C-S-k> :m '<-2<CR>gv=gv | |
190 | ||
191 | " Limelight / Goyo config | |
192 | ||
193 | let g:limelight_conceal_ctermfg = 'gray' | |
194 | let g:limelight_conceal_guifg = 'DarkGray' | |
195 | ||
196 | autocmd! User GoyoEnter Limelight | |
197 | autocmd! User GoyoLeave Limelight! | |
198 | nnoremap <leader>f :Limelight!!<CR>== | |
199 | inoremap <leader>f <Esc>:Limelight!!<CR>==gi | |
200 | vnoremap <leader>f :<C-u>Limelight!!<CR>gv=gv | |
201 | nnoremap <leader>g :Goyo<CR>== | |
202 | inoremap <leader>g <Esc>:Goyo<CR>==gi | |
203 | vnoremap <leader>g :<C-u>Goyo<CR>gv=gv | |
204 | ||
205 | " | |
206 | " Plug Config | |
207 | " | |
208 | ||
209 | call plug#begin('~/.vim/plugged') | |
210 | ||
211 | " Syntaxes | |
212 | Plug 'https://gitlab.com/rbdr/api-notation.vim.git' | |
213 | Plug 'elzr/vim-json' | |
214 | Plug 'mustache/vim-mode' | |
215 | Plug 'othree/yajs.vim' | |
216 | Plug 'ARM9/snes-syntax-vim' | |
217 | Plug 'posva/vim-vue' | |
218 | Plug 'leafgarland/typescript-vim' | |
219 | Plug 'leafOfTree/vim-svelte-plugin' | |
220 | Plug 'bumaociyuan/vim-swift' | |
221 | Plug 'udalov/kotlin-vim' | |
222 | Plug 'tikhomirov/vim-glsl' | |
223 | Plug 'jparise/vim-graphql' | |
224 | Plug 'digitaltoad/vim-pug' | |
225 | Plug 'https://git.sr.ht/~torresjrjr/gemini.vim' | |
226 | Plug 'rust-lang/rust.vim' | |
227 | Plug 'dart-lang/dart-vim-plugin' | |
228 | ||
229 | " Editing | |
230 | Plug 'tpope/vim-endwise' | |
231 | Plug 'rstacruz/vim-closer' | |
232 | Plug 'michaeljsmith/vim-indent-object' | |
233 | Plug 'editorconfig/editorconfig-vim' | |
234 | ||
235 | " Distraction free editing | |
236 | Plug 'junegunn/goyo.vim' | |
237 | Plug 'junegunn/limelight.vim' | |
238 | ||
239 | " Tools | |
240 | Plug 'editorconfig/editorconfig-vim' | |
241 | Plug 'dense-analysis/ale' | |
242 | Plug 'neoclide/coc.nvim', {'branch': 'release'} | |
243 | Plug 'vim-scripts/LargeFile' | |
244 | Plug 'tpope/vim-fugitive' | |
245 | Plug 'milkypostman/vim-togglelist' | |
246 | Plug 'jremmen/vim-ripgrep' | |
247 | ||
248 | " List ends here. Plugins become visible to Vim after this call. | |
249 | call plug#end() | |
250 | ||
251 | if filereadable(expand('~/.vimrc.local')) | |
252 | exe 'source' '~/.vimrc.local' | |
253 | endif |