Code Monkey home page Code Monkey logo

vimlog's Introduction

Source code for https://arp242.net/vimlog

Add new patches to gen.py, change the HTML in tpl.html. The index.html file is generated and shouldn't be changed directly.

Also useful: https://github.com/tweekmonster/helpful.vim

Useful maps:

augroup gitlog
    au FileType git
            "\ Go to commit.
            \  nnoremap <Leader>g :exe printf(":!cd ~/src/vim && git diff %s^\\!", split(getline('.'), ' ')[1])<CR>
            "\ Delete commit.
            \| nnoremap <Leader>d :call search('^commit ', 'bc') \| :exe 'd' . (search('^commit ', 'n') - line('.'))<CR>
            "\ Format commit.
            \| nnoremap <Leader>f :call <SID>format_commit()<CR>
augroup end

fun! s:format_commit()
    call search('^commit ', 'bc')
    silent normal! ms4j^w"vdt:

    call search('Solution: ')
    silent normal! f:llm<
    call search('^$')
    silent normal! k$m>gv"dd
    let @d = substitute(@d, '[\r\n ]\+', ' ', 'g')
    let l:end = line('.')
    normal! 'sd
    silent exe 'd' . (l:end - line('.') - 1)

    call setline('.', printf("[\"%s\", ['%s'],", trim(@d), trim(@v)))
    call setline(line('.') + 1, "    ''' '''],")

    call search('^commit ', '')
endfun

vimlog's People

Contributors

arp242 avatar chrisbra avatar akkartik avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.