about summary refs log tree commit diff stats
path: root/src/command/cmd_ac.h
Commit message (Expand)AuthorAgeFilesLines
* Update copyright to include 2019Michael Vetter2019-01-221-1/+1
* Update copyrightJames Booth2018-01-211-1/+1
* Allow previous autocompletion with shift tabJames Booth2017-04-011-2/+2
* Update CopyrightJames Booth2017-01-281-1/+1
* Allow filepath autocompletion in pluginsJames Booth2016-10-101-0/+2
* Minor code tidy cmd_ac.hJames Booth2016-10-061-6/+3
* Make header defines consistentJames Booth2016-07-241-2/+2
* Update GPL link in headersJames Booth2016-07-241-1/+1
* Plugin unload remove cmd_acs and close windowJames Booth2016-07-051-0/+1
* Revert "WIP - Unload plugin commands"James Booth2016-06-301-1/+0
* WIP - Unload plugin commandsJames Booth2016-06-291-0/+1
* Fix command headersJames Booth2016-05-231-1/+6
* Rename command sourcesJames Booth2016-05-221-0/+57
ighlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# Compatible with ranger 1.6.0 through 1.7.*
#
# This plugin adds the new macro %date which is substituted with the current
# date in commands that allow macros.  You can test it with the command
# ":shell echo %date; read"

from __future__ import (absolute_import, division, print_function)

import time

import ranger.core.actions

# Save the original macro function
GET_MACROS_OLD = ranger.core.actions.Actions.get_macros


# Define a new macro function
def get_macros_with_date(self):
    macros = GET_MACROS_OLD(self)
    macros['date'] = time.strftime('%m/%d/%Y')
    return macros


# Overwrite the old one
ranger.core.actions.Actions.get_macros = get_macros_with_date