44" Main configuration
55" Visual Configuration
66" Shortcut Key Configuration
7+ " Fixes
78" Plugin Configuration
89" Private Configuration
910"
1314set nocompatible "don't need to keep compatibility with Vi
1415filetype plugin indent on "enable detection, plugins and indenting in one step
1516syntax on "Turn on syntax highlighting
17+ set omnifunc=syntaxcomplete#Complete "Omnicomplete enable
1618set encoding=utf-8 "Force UTF-8 encoding for special characters
1719set ruler "Turn on the ruler
1820set number "Show line numbers
@@ -126,6 +128,9 @@ nmap <leader>l :set list!<CR>
126128" Exit insert mode with jk
127129imap jk <Esc>
128130
131+ " Exit terminal mode with escape
132+ tnoremap <Leader><Esc> <C-w>N
133+
129134" reload configuration file
130135map <Leader>r :so $MYVIMRC<CR>
131136
@@ -175,9 +180,6 @@ endfunction
175180" pastetoggle just in case
176181set pastetoggle=<F2>
177182
178- " html
179- let g:html_indent_script1 = "inc"
180- let g:html_indent_style1 = "inc"
181183
182184" Navigate tabs
183185map <leader>1 :tabp<CR>
@@ -239,9 +241,6 @@ endfunc
239241
240242" nmap <C-S-R> :call <SID>SynStack()<CR>
241243
242- " fix syntax highlighting in Ruby by using the older regex engine for Ruby
243- " files
244- autocmd FileType ruby setlocal re=1
245244
246245" ----------- Digraphs -------
247246
@@ -254,6 +253,15 @@ silent! dig -. 8230 "U+2026=… HORIZONTAL ELLIPSIS
254253nmap <silent> ,cq :cclose<CR>
255254nmap <silent> ,co :copen<CR>
256255
256+ " ----------- Fixes ----------------------------------
257+ "
258+ " html
259+ let g:html_indent_script1 = "inc"
260+ let g:html_indent_style1 = "inc"
261+
262+ " fix syntax highlighting in Ruby by using the older regex engine for Ruby
263+ " files
264+ autocmd FileType ruby setlocal re=1
257265
258266" ----------- Plugin Configuration ----------------------------------
259267
@@ -284,7 +292,7 @@ map <Leader>f :CtrlP<CR>
284292map <Leader>b :CtrlPBuffer<CR>
285293
286294" Exclude files from ctrl-p finder
287- let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$'
295+ let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$\|node_modules$ '
288296
289297" ---- ack
290298" Open ack and ackg
@@ -295,14 +303,34 @@ map <Leader>a :Ack
295303let g:snipMate = {}
296304let g:snipMate.snippet_version = 1
297305
306+ " ---- CoC
307+ " always show in case things shift
308+ set signcolumn=yes
309+
310+ " enter to do completion
311+ inoremap <expr> <cr> coc#pum#visible() ? coc#pum#confirm() : "\<CR>"
312+
298313" ---- wiki
314+
315+ " only use wiki syntax under vimwiki folders
299316let g:vimwiki_global_ext = 0
300- let g:vimwiki_filetypes = ['markdown']
317+
301318let g:vimwiki_list = [{'path': '~/vimwiki/',
302319 \ 'syntax': 'markdown', 'ext': '.md'}]
303320
304321" ---- markdown configs
322+
305323let g:vim_markdown_folding_disabled = 1
324+ " highlight YAML frontmatter
325+ let g:vim_markdown_frontmatter = 1
326+
327+ " create links from clipboard
328+
329+ " create link out of word using clipboard text as link destination
330+ autocmd FileType markdown nnoremap <Leader>4 "aciw[<C-r>"](<Esc>"*pli)<Esc>
331+
332+ " create link out of selection using clipboard text as link destination
333+ autocmd FileType markdown vnoremap <Leader>4 "ac[<C-r>"](<Esc>"*pli)<Esc>
306334
307335" ---- vim-rooter configs
308336let g:rooter_targets = '/,*'
@@ -326,25 +354,10 @@ nmap <Leader>vs vip<LocalLeader>vs<CR>
326354" ----------- Mustache / Handlebars ---------------------------------
327355let g:mustache_abbreviations = 1
328356
329- " ----------- ALE configs ---------------------------------------
330- let g:ale_sign_column_always = 1
331- let g:ale_sign_error = '>>'
332- let g:ale_sign_warning = '--'
333- let g:ale_open_list = 0
334- let g:ale_keep_list_window_open = 0
335- let g:ale_list_vertical = 0
336- let g:ale_lint_on_enter = 1
337- " let g:ale_completion_enabled = 1
338- " set omnifunc=ale#completion#OmniFunc
339-
340- " Map keys to navigate between lines with errors and warnings.
341- nnoremap <leader>an :ALENextWrap<cr>
342- nnoremap <leader>ap :ALEPreviousWrap<cr>
343-
344357" ----------- vue configs -------------------
345358" limit preprocessors to speed up vim.
346- let g:vue_pre_processors = ["scss"]
347359
360+ let g:vue_pre_processors = ["scss"]
348361
349362" ----------- Dispatch configs ---------------------------------------
350363
@@ -353,6 +366,11 @@ autocmd BufEnter *_test.exs let b:dispatch = 'mix test %'
353366
354367nnoremap <Leader>e :Dispatch<CR>
355368
369+ " ----------- Stripper configs ---------------------------------------
370+ " Markdown is ignored by default. Redefining the ignored types so it's not
371+ " ignored anymore.
372+ let g:StripperIgnoreFileTypes = [ 'liquid', 'txt', 'my_ft' ]
373+
356374" ----------- quoting -----------
357375augroup textobj_quote
358376 autocmd!
@@ -366,6 +384,7 @@ autocmd FileType go setlocal ts=4 sts=4 sw=4 noexpandtab
366384" ---------- EEX Elixir templates -------
367385autocmd BufRead,BufNewFile *.eex set ft=eex.html
368386
387+
369388" ----------- Launch configs ---------------------------------------
370389if has('win32') || has ('win64')
371390 let $CLEAR_COMMAND="cls"
@@ -384,7 +403,8 @@ endif
384403
385404autocmd FileType javascript nmap <Leader>g :!"$CLEAR_COMMAND"; node "%"<cr>
386405autocmd FileType coffee nmap <Leader>g :!"$CLEAR_COMMAND"; coffee "%"<cr>
387- autocmd FileType markdown nmap <Leader>g :!mark "%"<cr><cr>
406+ autocmd FileType markdown nmap <Leader>h :!mark "%"<cr><cr>
407+ autocmd FileType markdown nmap <Leader>g :!typora "%"<cr><cr>
388408autocmd FileType groovy nmap <Leader>g :!"$CLEAR_COMMAND"; groovy "%"<cr>
389409autocmd FileType sh nmap <Leader>g :!"$CLEAR_COMMAND"; sh "%"<cr>
390410autocmd FileType python nmap <Leader>g :!"$CLEAR_COMMAND"; python3 "%"<cr>
0 commit comments