URI:
       .vimrc - dotfiles - 🍚 personal arsenal of "rice"
  HTML git clone https://git.drkhsh.at/dotfiles.git
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
   DIR README
   DIR LICENSE
       ---
       .vimrc (6125B)
       ---
            1 " ██╗   ██╗██╗███╗   ███╗██████╗  ██████╗
            2 " ██║   ██║██║████╗ ████║██╔══██╗██╔════╝
            3 " ██║   ██║██║██╔████╔██║██████╔╝██║
            4 " ╚██╗ ██╔╝██║██║╚██╔╝██║██╔══██╗██║
            5 "  ╚████╔╝ ██║██║ ╚═╝ ██║██║  ██║╚██████╗
            6 "    ╚═══╝  ╚═╝╚═╝     ╚═╝╚═╝  ╚═╝ ╚═════╝
            7 "                   drkhsh <me@drkhsh.at>
            8 
            9 set nocompatible " must be first
           10 set lazyredraw
           11 set encoding=utf8
           12 set history=1000
           13 set autoread
           14 set modelines=0 " sec
           15 set wrap
           16 
           17 filetype plugin indent on
           18 syntax enable
           19 
           20 " colors
           21 set background=dark
           22 set t_Co=256
           23 set termguicolors
           24 
           25 set number
           26 set ruler
           27 set wildmenu
           28 set showmode
           29 set showmatch
           30 set mat=1 " blink 1/10s
           31 set mouse=a " enable
           32 
           33 set ignorecase
           34 set smartcase
           35 set incsearch
           36 set hlsearch
           37 set magic
           38 
           39 set noexpandtab " no comment
           40 set tabstop=4
           41 set shiftwidth=0 " tabstop
           42 set autoindent
           43 set smarttab
           44 set smartindent
           45 set copyindent
           46 set preserveindent
           47 
           48 if exists("+breakindent")
           49         set breakindent
           50 endif
           51 
           52 " fixes x11 clipboard
           53 set clipboard=unnamedplus
           54 
           55 set textwidth=80
           56 set nowrap
           57 set cursorline
           58 
           59 " color 80 columns limit
           60 set colorcolumn=80
           61 highlight ColorColumn ctermbg=black
           62 
           63 " backspace/cursor keys wrap to previous/next line
           64 set backspace=indent,eol,start
           65 set whichwrap+=<,>,[,],h,l
           66 
           67 " highlight extra whitespace
           68 highlight ExtraWhitespace ctermbg=red guibg=red
           69 match ExtraWhitespace /\s\+$/
           70 autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
           71 autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
           72 autocmd InsertLeave * match ExtraWhitespace /\s\+$/
           73 autocmd BufWinLeave * call clearmatches()
           74 
           75 " highlight todos etc.
           76 syn match   myTodo contained "\<\(TODO\|FIXME\|WARN\):"
           77 hi def link myTodo Todo
           78 
           79 
           80 " █▓▒░ keybindings
           81 
           82 " nerdtree
           83 nnoremap <leader>n :NERDTreeFocus<CR>
           84 nnoremap <C-n> :NERDTree<CR>
           85 nnoremap <C-t> :NERDTreeToggle<CR>
           86 nnoremap <C-f> :NERDTreeFind<CR>
           87 
           88 
           89 " █▓▒░ functions / automation
           90 
           91 function! SourceIfExists(file)
           92         if filereadable(expand(a:file))
           93                 exe 'source' a:file
           94         endif
           95 endfunction
           96 
           97 " notes
           98 function! DailyMode()
           99         " set header title for daily journal
          100         execute 'normal gg'
          101         let filename = '#' . ' ' . expand('%:r')
          102         call setline(1, filename)
          103 endfunction
          104 augroup daily
          105         autocmd!
          106 
          107         " populate daily journal template
          108     autocmd BufNewFile */notes/daily/**   0r ~/.vim/templates/daily.skel
          109 
          110         " set header for the particular daily journal
          111         autocmd BufNewFile */notes/daily/**   :call DailyMode()
          112 augroup END
          113 
          114 " ascii-art
          115 function! AsciiMode()
          116   e ++enc=cp850
          117   set nu!
          118   set virtualedit=all
          119   set colorcolumn=80
          120 endfunction
          121 command Ascii :call AsciiMode()
          122 
          123 
          124 " █▓▒░ plugins
          125 
          126 " nerdtree
          127 if !has('nvim')
          128         " start when Vim is started without file arguments.
          129         autocmd VimEnter *
          130                 \   if !argc()
          131                 \ |   Startify
          132                 \ |   NERDTree
          133                 \ |   wincmd w
          134                 \ | endif
          135 endif
          136 " start when Vim starts with a directory argument.
          137 autocmd StdinReadPre * let s:std_in=1
          138 autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in') |
          139         \ execute 'NERDTree' argv()[0] | wincmd p | enew | execute 'cd '.argv()[0] | endif
          140 " exit Vim if NERDTree is the only window remaining in the only tab.
          141 autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
          142 
          143 " vim-markdown: Folding
          144 let g:vim_markdown_folding_disabled = 1
          145 
          146 " vim-lightline
          147 set laststatus=2
          148 set noshowmode " displayed in status
          149 let g:lightline = {
          150   \ 'colorscheme': 'srcery_drk',
          151   \ 'active': {
          152   \   'left': [ [ 'mode', 'paste' ],
          153   \             [ 'readonly', 'filename', 'modified', 'gitbranch' ] ],
          154   \   'right': [ [ 'lineinfo' ],
          155   \              [ 'percent' ],
          156   \              [ 'fileformat', 'fileencoding', 'filetype' ] ]
          157   \ },
          158   \ 'component_function': {
          159   \   'gitbranch': 'FugitiveHead'
          160   \ },
          161   \ 'separator': { 'left': '▓▒░', 'right': '░▒▓' },
          162   \ 'subseparator': { 'left': '▒', 'right': '░' }
          163   \ }
          164 
          165 " startify
          166 if !has('nvim')
          167         packadd! vim-startify
          168         let g:startify_custom_header = [
          169                 \"   ▓█████▄  ██▀███   ██ ▄█▀ ██░ ██   ██████  ██░ ██",
          170                 \"   ▒██▀ ██▌▓██ ▒ ██▒ ██▄█▒ ▓██░ ██▒▒██    ▒ ▓██░ ██▒",
          171                 \"•••░██   █▌▓██ ░▄█ ▒▓███▄░ ▒██▀▀██░░ ▓██▄   ▒██▀▀██░•••",
          172                 \"   ░▓█▄   ▌▒██▀▀█▄  ▓██ █▄ ░▓█ ░██   ▒   ██▒░▓█ ░██",
          173                 \"   ░▒████▓ ░██▓ ▒██▒▒██▒ █▄░▓█▒░██▓▒██████▒▒░▓█▒░██▓",
          174                 \"    ▒▒▓  ▒ ░ ▒▓ ░▒▓░▒ ▒▒ ▓▒ ▒ ░░▒░▒▒ ▒▓▒ ▒ ░ ▒ ░░▒░▒",
          175                 \"    ░ ▒  ▒   ░▒ ░ ▒░░ ░▒ ▒░ ▒ ░▒░ ░░ ░▒  ░ ░ ▒ ░▒░ ░",
          176                 \"    ░ ░  ░   ░░   ░ ░ ░░ ░  ░  ░░ ░░  ░  ░   ░  ░░ ░",
          177                 \"      ░       ░     ░  ░    ░  ░  ░      ░   ░  ░  ░",
          178                 \ '',
          179                 \ ]
          180 endif
          181 
          182 " wiki
          183 let wiki_1 = {}
          184 let wiki_1.path = '$HOME/heap/wiki/'
          185 let wiki_1.path_html = '$HOME/heap/wiki/html'
          186 let wiki_1.template_path = '$HOME/heap/wiki/templates'
          187 let wiki_1.template_default = 'default'
          188 let wiki_1.template_ext = '.html'
          189 let wiki_1.syntax = 'markdown'
          190 let wiki_1.custom_wiki2html = "$HOME/heap/wiki/wiki2html.sh"
          191 let wiki_1.ext = '.md'
          192 let wiki_1.auto_export = 1
          193 let wiki_1.auto_header = 1
          194 let wiki_1.autotags = 1
          195 let g:vimwiki_list = [wiki_1]
          196 let g:vimwiki_ext2syntax = {'.md': 'markdown' }
          197 
          198 let g:languagetool_jar='$HOME/warez/LanguageTool-5.9/languagetool-commandline.jar'
          199 let g:languagetool_lang='en'
          200 
          201 
          202 " █▓▒░ includes
          203 call SourceIfExists("~/.vimrc.local")
          204 
          205 hi Normal guibg=NONE ctermbg=NONE
          206 colorscheme evangelion
          207