Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add + abbreviations #20

Closed
linuxcaffe opened this issue Nov 20, 2013 · 1 comment
Closed

add + abbreviations #20

linuxcaffe opened this issue Nov 20, 2013 · 1 comment

Comments

@linuxcaffe
Copy link

Just a kooky thought here, a "task add" routine within vim provides an opportunity to use vim abbreviations. This enables something that has been requested for years; add something in a short-form that get's expanded before saving.

example:

$ task add get tps @work 

becomes

$ task add get Training Progress Report proj:train pri:h +work
@teranex
Copy link
Owner

teranex commented Nov 20, 2013

You can already do this with standard Vim functionality. One possible method:
create a file ~/.vim/after/ftplugin/vimwiki.vim. This file will be executed by Vim whenever a file is detected to be a vimwiki file (after the default vimwiki file is processed). In the file add abbreviations like this:

cabbrev <buffer> tps Training Progress Report
cabbrev <buffer> @work proj:train pri:h +work

Now whenever you type 'tps' in commandline while in a vimwiki file Vim will immediately expand it to 'Training Progress Report'. I'm not sure if @work would work, but _work would work. You can also define abbreviations with 'iabbrev' for insert mode etc (vim :help has more info).

Besides, as far as I know the Taskwarrior aliasses can also be used for this:
alias.tps=Training Progress Report
task add tps
would for afaik.

@teranex teranex closed this as completed Nov 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants