dot-vimrc (3431B)
1 set nocompatible " make vim act like vim and not vi 2 3 filetype plugin indent on 4 5 let mapleader = " " 6 let g:netrw_banner=0 " disable netrw's (filebrowser) banner, which takes up a lot of space 7 let g:netrw_liststyle=3 " enable a tree style list 8 9 set mouse=a " allow the mouse 10 set path+=** " allows for global searches 11 set clipboard^=unnamed 12 set clipboard^=unnamedplus 13 set undofile 14 set undodir=~/.cache/vim/undo 15 set undolevels=1000 16 set ruler " show line and column number (on the statusline) 17 set encoding=utf-8 18 set autoindent " 'n' option in formatoptions below requires autoindent 19 set formatoptions=tcqn1 " specify formatting behavior see 'fo-table' for details 20 set expandtab " use spaces for tabs, run ':retab!' to changes spaces to tabs 21 set noshiftround 22 set scrolloff=10 " offset when scrolling 23 set matchpairs+=<:> " add html pairs '<' & '>', jump pairs with '%' 24 set showmode 25 set showcmd 26 set showbreak=↪\ 27 set incsearch " while typing in search show matches 28 set ignorecase " ignore case in search patterns 29 set smartcase " override ignorecase if search pattern contains upper case 30 set laststatus=2 " always show a statusline 31 set hidden " allows for switching buffers without saving 32 33 set shiftwidth=4 34 set smarttab 35 36 autocmd FileType c setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab 37 autocmd FileType go setlocal noexpandtab tabstop=8 shiftwidth=8 softtabstop=0 38 autocmd FileType html setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab 39 autocmd FileType css setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab 40 autocmd FileType javascript setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab 41 autocmd FileType lua setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab 42 autocmd FileType sh setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab 43 autocmd FileType make setlocal noexpandtab tabstop=8 shiftwidth=8 softtabstop=0 44 autocmd FileType markdown setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab 45 autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab 46 autocmd FileType yaml setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab 47 autocmd FileType toml setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab 48 49 " open the notes file 50 nnoremap <leader>ww :e ~/notes.md<CR> 51 " open a the current diary 52 nnoremap <leader>w<leader>w :e ~/docs/diary/<C-r>=strftime("%d%m%y")<CR>.md<CR> 53 " render the opened .md document to html 54 nnoremap <leader>wh :call RenderMarkdown()<CR> 55 " next buffer 56 nnoremap <leader>b :bnext<CR> 57 " previous buffer 58 nnoremap <leader>B :bprev<CR> 59 " jump to a specific buffer 60 nnoremap <leader>bl :buffers<CR>:b 61 " go to Tag (ctags) 62 nnoremap gt <C-]> 63 " jump back (ctags) 64 nnoremap gT <C-t> 65 " taglist (ctags) 66 nnoremap <leader>tl :tselect<CR> 67 nnoremap j gj 68 nnoremap k gk 69 70 function! RenderMarkdown() abort 71 if expand('%:e') !=# 'md' 72 echohl WarningMsg | echo 'Not a Markdown file' | echohl None 73 return 74 endif 75 let l:out = expand('%:p:r') . '.html' 76 silent execute '!lowdown -s % -m css=/home/cmk/proj/main.css > ' . shellescape(l:out) 77 if v:shell_error == 0 78 echom 'Rendered: ' . l:out 79 else 80 echohl ErrorMsg | echo 'Render failed' | echohl None 81 endif 82 endfunction 83 84 syntax off