Skip to content

Instantly share code, notes, and snippets.

@1ncend1ary
Created September 4, 2021 14:52
Show Gist options
  • Save 1ncend1ary/bf44a7a465def3d33213c7b1f83ac008 to your computer and use it in GitHub Desktop.
Save 1ncend1ary/bf44a7a465def3d33213c7b1f83ac008 to your computer and use it in GitHub Desktop.
function! myspacevim#before() abort
" vim-plug installation
" Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' }
call SpaceVim#custom#SPCGroupName(['g'], '+Custom')
autocmd FileType markdown nmap <buffer><silent> <leader>l :call mdip#MarkdownClipboardImage()<CR>
autocmd FileType html nmap <buffer><silent> <leader>l :call mdip#MarkdownClipboardImage()<CR>
call SpaceVim#custom#SPC('nnoremap', ['g', 'l'], ':call mdip#MarkdownClipboardImage()<CR>', 'Paste image to markdown file', 1)
map <silent> <leader>h ys$}.
call SpaceVim#custom#SPC('nnoremap', ['g', 'h'], 'ys$}.', 'surround word with {}', 0)
" there are some defaults for image directory and image name, you can change them
" let g:mdip_imgdir = 'img'
" let g:mdip_imgname = 'image'
set spelllang=en,ru
set spell
set wrap
" " This is old version for html
" " map <leader>o :w<CR>:silent exec !adoc2html %:p<CR>:silent exec !open-firefox-notes<CR>:redraw!<CR>
map <leader>o :w<CR>:exec "!adoc2html %:p"<CR>:redraw!<CR>
call SpaceVim#custom#SPC('nnoremap', ['g', 'o'], ':w<CR>:exec "!adoc2html %:p"<CR>:redraw!<CR>', 'Convert asciidoc to html', 1)
call SpaceVim#custom#SPC('nnoremap', ['g', 'i'], ':w<CR>:exec "!adoc2tex %:p"<CR>:redraw!<CR>', 'Convert asciidoc to latex', 1)
" first `%s` is a path
" " second `%s` is an image file name
" " this is default for windows
" let g:asciidoctor_img_paste_command = 'gm convert clipboard: %s%s'
"
" " for osx
" " let g:asciidoctor_img_paste_command = 'pngpaste %s%s'
"
" " for linux
let g:asciidoctor_img_paste_command = 'xclip -selection clipboard -t image/png -o > %s%s'
"
"
"
" " first `%s` is a base document name:
" " (~/docs/hello-world.adoc => hello-world)
" " second `%s` is a number of the image.
let g:asciidoctor_img_paste_pattern = 'img/img_%s_%s.png'
autocmd FileType asciidoctor nmap <buffer><silent> <leader>l :AsciidoctorPasteImage<CR>
"" call SpaceVim#custom#SPC('nnoremap', ['g', 'l'], ':AsciidoctorPasteImage<CR>', 'test custom SPC', 0)
inoremap <c-v> <esc>:set paste<cr>a<c-r>=getreg('+')<cr><esc>:set nopaste<cr>mi`[=`]`ia
nmap <S-Enter> O<Esc>
nmap <CR> o<Esc>
" let g:better_escape_interval = 70
" let g:better_escape_shortcut = ['jk', 'ол']
nnoremap <C-J> a<CR><Esc>k
let g:XkbSwitchEnabled = 1
" Fold sections, default `0`.
let g:asciidoctor_folding = 1
" Fold options, default `0`.
let g:asciidoctor_fold_options = 1
let g:tex_flavor='latex'
let g:vimtex_view_method='zathura'
let g:vimtex_quickfix_mode=0
set conceallevel=1
let g:tex_conceal='abdmg'
" Trigger configuration. You need to change this to something other than <tab> if you use one of the following:
" - https://github.com/Valloric/YouCompleteMe
" - https://github.com/nvim-lua/completion-nvim
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
let g:UltiSnipsSnippetStorageDirectoryForUltiSnipsEdit="/home/secret/.SpaceVim/UltiSnips/"
function! s:test_section() abort
return 'ok'
endfunction
call SpaceVim#layers#core#statusline#register_sections('test', function('s:test_section'))
endfunction
function! myspacevim#after() abort
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment