2019-03-24 15:03:56 +01:00
|
|
|
""Basic stuff
|
|
|
|
set number
|
2019-10-02 17:09:13 +02:00
|
|
|
set ttyfast
|
2019-10-16 22:24:12 +02:00
|
|
|
set encoding=utf8
|
2019-03-24 15:03:56 +01:00
|
|
|
""Colors
|
|
|
|
colorscheme synthwave
|
|
|
|
set t_Co=256
|
|
|
|
""Misc
|
|
|
|
set clipboard=unnamedplus
|
|
|
|
set nofoldenable
|
2019-04-02 12:24:17 +02:00
|
|
|
""Spaces instead of tabs
|
|
|
|
set expandtab
|
2019-05-11 01:04:20 +02:00
|
|
|
set tabstop=2
|
|
|
|
set shiftwidth=2
|
2019-08-29 23:22:18 +02:00
|
|
|
""Don't litter swp files everywhere
|
2019-08-27 01:07:55 +02:00
|
|
|
set backupdir=~/.cache
|
|
|
|
set directory=~/.cache
|
2019-10-16 22:24:12 +02:00
|
|
|
" Ignore case when searching
|
|
|
|
set ignorecase
|
2019-03-24 15:03:56 +01:00
|
|
|
""Keybindings
|
|
|
|
set pastetoggle=<F2>
|
2019-10-02 17:09:13 +02:00
|
|
|
let mapleader="\<Space>"
|
|
|
|
nnoremap <leader>n :noh<cr>
|
|
|
|
"Move the current line up or down
|
|
|
|
nnoremap <leader>k :m-2<cr>==
|
|
|
|
nnoremap <leader>j :m+<cr>==
|
|
|
|
"Gina status and commit shotcuts
|
|
|
|
nnoremap <leader>gs :Gina status<cr>
|
|
|
|
nnoremap <leader>gc :Gina commit<cr>
|
2019-08-29 23:22:18 +02:00
|
|
|
""Markdown
|
2019-05-31 00:22:54 +02:00
|
|
|
au FileType markdown Goyo
|
2019-06-10 04:36:12 +02:00
|
|
|
let g:markdown_fenced_languages = ['cpp', 'python', 'java', 'sql']
|
2019-03-24 15:03:56 +01:00
|
|
|
let g:vim_markdown_math=1
|
2019-08-29 23:22:18 +02:00
|
|
|
""Pandoc
|
2019-06-08 01:39:39 +02:00
|
|
|
autocmd FileType markdown nnoremap <silent> <F3> :<c-u>!pandoc %:p:S -o %:p:r:S.pdf --from markdown --template eisvogel --listings --toc -V lang=es &<cr>
|
2019-05-09 16:59:01 +02:00
|
|
|
autocmd FileType markdown nnoremap <silent> <F4> :<c-u>!pandoc %:p:S -o %:p:r:S.pdf --from markdown --template handout &<cr>
|
2019-05-11 03:40:12 +02:00
|
|
|
autocmd FileType markdown nnoremap <silent> <F5> :<c-u>!pandoc %:p:S -o %:p:r:S.pdf --from markdown --template assignment &<cr>
|
2019-05-09 16:59:01 +02:00
|
|
|
autocmd FileType markdown nnoremap <silent> <F6> :<c-u>!zathura %:p:r:S.pdf &<cr>
|
|
|
|
autocmd FileType markdown nnoremap <silent> <F7> :<c-u>!rm %:p:r:S.pdf &<cr>
|
2019-08-29 23:22:18 +02:00
|
|
|
""Snippets
|
2019-03-24 18:01:33 +01:00
|
|
|
let g:UltiSnipsExpandTrigger = '<tab>'
|
|
|
|
let g:UltiSnipsJumpForwardTrigger = '<tab>'
|
|
|
|
let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'
|
2019-08-29 23:22:18 +02:00
|
|
|
""Vim-plug
|
2019-05-31 00:22:54 +02:00
|
|
|
call plug#begin('~/.vim/plugged')
|
|
|
|
Plug 'plasticboy/vim-markdown', { 'for': 'markdown' }
|
|
|
|
Plug 'junegunn/goyo.vim', { 'on': 'Goyo' }
|
|
|
|
Plug 'SirVer/ultisnips', { 'for': 'markdown' }
|
2019-07-16 18:21:28 +02:00
|
|
|
Plug 'lambdalisue/gina.vim'
|
|
|
|
Plug 'airblade/vim-gitgutter'
|
2019-05-31 00:22:54 +02:00
|
|
|
Plug 'tpope/vim-surround'
|
|
|
|
Plug 'Raimondi/delimitMate'
|
|
|
|
call plug#end()
|
2019-08-29 23:22:18 +02:00
|
|
|
""Quitting whether Goyo is active or not
|
2019-03-24 15:03:56 +01:00
|
|
|
function! g:Goyo_before()
|
|
|
|
let b:quitting = 0
|
|
|
|
let b:quitting_bang = 0
|
|
|
|
autocmd QuitPre <buffer> let b:quitting = 1
|
|
|
|
cabbrev <buffer> q! let b:quitting_bang = 1 <bar> q!
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! g:Goyo_after()
|
|
|
|
if b:quitting && len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) == 1
|
|
|
|
if b:quitting_bang
|
|
|
|
qa!
|
|
|
|
else
|
|
|
|
qa
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
let g:goyo_callbacks = [function('g:Goyo_before'), function('g:Goyo_after')]
|