RobertAudi / junkfile.vim

Create temporary file for memo, testing, ...

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This plugin is not maintained anymore. Neovim users should use junkfile.nvim instead.


junkfile.vim

junkfile creates junk files. Instead of other scratch plugins, it can create files with a filetype.

Table of Contents

Usage

Create junk file:

:JunkfileOpen

Interface

Functions

Open {prefix} junk file using {edit-command}. If {edit-command} is omitted, g:junkfile#edit_command is used instead.

junkfile#open({prefix} [, {edit-command}])

Open {filename} junk file immediately. It is useful to edit memo or diary file.

junkfile#open_immediately({filename})

Save current buffer in {prefix} junk file and open it using {edit-command}. If {edit-command} is omitted, g:junkfile#edit_command is used instead.

junkfile#save({prefix} [, {edit-command}])

Commands

For all the commands except the Junkfile*Save commands, if {postfix} is given, it will open junk file immediately.

Command Description
:JunkfileOpen [{postfix}] Creates new junk file using g:junkfile#edit_command.
:JunkfileEdit [{postfix}] Creates new junk file in the current window.
:JunkfileSplit [{postfix}] Creates new junk file in a horizontal split.
:JunkfileVsplit [{postfix}] Creates new junk file in a vertical split.
:JunkfileTabEdit [{postfix}] Creates new junk file in a new tab.
:JunkfileSave Save the current buffer to a junk file and open it in the current buffer.
:JunkfileSplitSave Save the current buffer to a junk file and open it in a new horizontal split.
:JunkfileVsplitSave Save the current buffer to a junk file and open it in a new vertical split.
:JunkfileTabSave Save the current buffer to a junk file and open it in a new tab.

Variables

Variable Description
g:junkfile#directory Specifies the directory where junkfile writes junk files.
Defaults to ~/.cache/junkfile.
g:junkfile#edit_command Specifies buffer open command when :JunkfileOpen.
Defaults to edit.

Examples

command! -nargs=0 JunkfileDay call junkfile#open_immediately(strftime('%Y-%m-%d.txt'))
command! -nargs=0 JunkfileDiary call junkfile#open_immediately(strftime('%Y-%m-%d.md'))

Credits

Author

Shougo Matsushita – GitHub

Contributors

About

Create temporary file for memo, testing, ...

License:MIT License


Languages

Language:Vim Script 100.0%