Beispiel #1
0
 def getFirstFileInFolder(self, folder):
     log(folder)
     currentFiles = os.listdir(folder)
     for f in currentFiles:
         cf = os.path.abspath(os.path.join(folder, f))
         if os.path.isdir(os.path.abspath(cf)):
             return self.getFirstFileInFolder(cf)
         else:
             return f
     return None
Beispiel #2
0
 def cut(self, args, range):
     log('cut')
     # Get the selected files to clipboard
     exp = self.explorers[self.selectedExplorer]
     cb = exp.get_markers_as_string()
     # This way it is consistent between different instances
     # of bolt => will be nice for the refactoring of
     # multiple panes :)
     # Add operation type (copy/move) as prefix
     self.nvim.command("let g:BoltCb = '%s'" % ('mv#' + cb))
     self.nvim.command('startinsert')
     self.nvim.command('normal! $')
Beispiel #3
0
 def copy(self, args, range):
     log('copy')
     # Get the selected files to clipboard
     exp = self.explorers[self.selectedExplorer]
     cb = exp.get_markers_as_string()
     # Add the path(s) to bolt ('b') register
     self.nvim.command("let @b='%s'" %
                       (cb.replace('_{%boltSplitter%}_', ',')))
     # This way it is consistent between different instances
     # of bolt => will be nice for the refactoring of
     # multiple panes :)
     # Add operation type (copy/move) as prefix
     self.nvim.command("let g:BoltCb = '%s'" % ('cp#' + cb))
     self.nvim.command('startinsert')
     self.nvim.command('normal! $')
Beispiel #4
0
 def tc_explore(self, args, range):
     self.TcExplorer.tc_explore(args, range)
     logger.log('Explorer Spawned')
Beispiel #5
0
 def __init__(self, nvim):
     self.nvim = nvim
     # Enable logging
     logger.init_log(True)
     self.TcExplorer = vim_tc_explorer(nvim)
     logger.log('Plugin Initialized')