" randomuser's vimrc " vim-plug {{{ call plug#begin() Plug 'tridactyl/vim-tridactyl' Plug 'vimwiki/vimwiki' cal plug#end() " }}} " misc {{{ nnoremap ; : nnoremap : ; let mapleader = " " set nocompatible " }}} " defined settings {{{ set number set foldmethod=marker set encoding=utf8 set list set lcs=tab:->,trail:_,eol:^ set clipboard=unnamedplus set spell set spelllang=en_us set title set ts=2 set sw=2 set hlsearch set incsearch set ignorecase set smartcase set inccommand=nosplit set nocompatible set hidden set path+=** set wildmenu colorscheme earth " }}} " shortcuts {{{ " toggle line numbers and listchars nnoremap ym :set number!:set list! " vimrc thing nnoremap rr :source ~/.config/nvim/init.vim nnoremap re :edit ~/.config/nvim/init.vim " show the file explorer nnoremap fs :Lexplore " show the shortcuts in the vimrc nnoremap ke :e ~/.config/nvim/init.vim ggzR/shortcutsz " jk to escape insert mode inoremap jk " go back to the previous error, then correct inoremap u[s1z=`]au inoremap qp u[s1z=`]au inoremap zgi inoremap qo zgi nnoremap zg tnoremap nnoremap wl \< nnoremap wr \> nnoremap wd - nnoremap wu + nnoremap mk :make:spl:terminal ./main nnoremap wI :VimwikiDiaryIndex inoremap mZ0i`ZlA " }}} " autocmds {{{ au Filetype python setl et ts=4 sw=4 function SwapExistsHandler() silent !vim-swap-handler "%:p" if v:shell_error == 0 let v:swapchoice='o' return elseif v:shell_error == 1 let v:swapchoice='o' echom "The file has been opened read-only, as there is not another vim instance editing this file." elseif v:shell_error == 127 echom "The vim-swap-handler command doesn't exist." else echom "An unknown error occurred." endif endfunction autocmd SwapExists * call SwapExistsHandler() au BufWrite bspwmrc !bspc wm -r au BufWrite sxhkdrc !killall sxhkd -USR1 " }}} " statusline {{{ set statusline=%f set statusline+=\ set statusline+=%r%m%q%h set statusline+=%= set statusline+=%y\ 0x%02B\ %04l:%03c:%03p " }}} " titlebar {{{ let &titlestring='%{expand("%:p")}' " }}} " netrw {{{ let g:netrw_banner=0 " }}} " ultisnips {{{ let g:UltiSnipsExpandTrigger = '' let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" " }}}