Git Product home page Git Product logo

vim-ledger-mode's Introduction

vim-ledger-mode

This vim plugin is to be used along with vim-ledger and add a special ledger mode with special keybindings.

Keybindings

To enter ledger mode, in normal mode, type <leader>l. You are then in ledger normal mode.

Normal Ledger Mode

  • <Esc> escapes the ledger mode back to normal mode
  • { and } navigates to the previous / next transaction
  • ^ and $ navigates to the first / last line of the current transaction
  • 'O' and 'o' opens up a transaction before / after the current one and goes to ledger insert mode
  • tt to toggle the current transaction between the current date and the date of the previous transaction

TODO:

  • tr to toggle the reconciled status
  • <S-Tab> and <Tab> to go to the previous / next field (transaction comment, account, amount)
  • B, W goes to the previous / next field
  • E goes to the end of the current field

Insert Ledger Mode

  • <Tab> autocompletes account
  • <CR> goes to the next field
    • in a transaction comment, creates a line to type an account
    • if you are in an account line, but the line is empty, creates the next transaction
    • if you have typed an account name, goes to type the amount
    • if you typed the amount, goes to type the next account

Lightline integration

To display the ledger mode, you can use the g:ledger_mode variable that contains either an empty string or LEDGER. You can integrate it with lightline by adding this function to your vimrc:

function! Lightline_mode() abort
  let res = lightline#mode()
  if exists('g:ledger_mode') && len(g:ledger_mode)
    let res .= ' ' . g:ledger_mode
  end
  return res
endfunction

You also have to use this function for the mode widget in lightline:

let g:lightline = {
  ...
\ 'component': {
\   'mode': '%{Lightline_mode()}',
  	...
\ },
\ }

vim-ledger-mode's People

Contributors

mildred avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.