ranger: mkcd command
parent
0cd58f0aea
commit
7357124d93
|
@ -92,3 +92,23 @@ class extracthere(Command):
|
||||||
|
|
||||||
obj.signal_bind('after', refresh)
|
obj.signal_bind('after', refresh)
|
||||||
self.fm.loader.add(obj)
|
self.fm.loader.add(obj)
|
||||||
|
|
||||||
|
|
||||||
|
class mkcd(Command):
|
||||||
|
def execute(self):
|
||||||
|
""" Create folder and cd to it """
|
||||||
|
|
||||||
|
def execute(self):
|
||||||
|
from os.path import join, expanduser, lexists
|
||||||
|
from os import mkdir
|
||||||
|
|
||||||
|
dirname = join(self.fm.thisdir.path, expanduser(self.rest(1)))
|
||||||
|
if not lexists(dirname):
|
||||||
|
mkdir(dirname)
|
||||||
|
else:
|
||||||
|
self.fm.notify("file/directory exists!", bad=True)
|
||||||
|
|
||||||
|
self.fm.cd(dirname)
|
||||||
|
|
||||||
|
def tab(self):
|
||||||
|
return self._tab_directory_content()
|
||||||
|
|
|
@ -100,6 +100,7 @@ map ! console shell -w
|
||||||
map <F4> bulkrename
|
map <F4> bulkrename
|
||||||
map <F5> console shell -w file "%f"
|
map <F5> console shell -w file "%f"
|
||||||
map <F6> console touch
|
map <F6> console touch
|
||||||
|
map <F7> console mkcd
|
||||||
|
|
||||||
# ===================================================================
|
# ===================================================================
|
||||||
# == Personal shorcuts
|
# == Personal shorcuts
|
||||||
|
@ -116,9 +117,9 @@ map Q quit
|
||||||
map DD shell trash-put -- %s
|
map DD shell trash-put -- %s
|
||||||
|
|
||||||
## Extraction using atools.
|
## Extraction using atools.
|
||||||
map ex shell aunpack -e %s
|
map exs shell aunpack -e %s
|
||||||
map eeg shell aunpack -e %s -X "$HOME/games/"
|
map exg shell aunpack -e %s -X "$HOME/games/"
|
||||||
map pe extracthere
|
map exh extracthere
|
||||||
|
|
||||||
## Git
|
## Git
|
||||||
map ega shell -w git add %f %s
|
map ega shell -w git add %f %s
|
||||||
|
|
Loading…
Reference in New Issue