<s> import neovim <EOL> import os <EOL> from datetime import datetime <EOL> @ neovim . plugin <EOL> class VimpBuffers ( object ) : <EOL> def __init__ ( self , vim ) : <EOL> self . vim = vim <EOL> @ neovim . command ( "<STR_LIT>" ) <EOL> def toggle_terminal_buffer ( self ) : <EOL> current_buffer = self . vim . current . buffer <EOL> for idx , window in enumerate ( self . vim . current . tabpage . windows , <NUM_LIT:1> ) : <EOL> if window . buffer . name . startswith ( "<STR_LIT>" ) : <EOL> self . vim . command ( "<STR_LIT>" . format ( idx ) ) <EOL> self . vim . command ( "<STR_LIT>" . format ( idx ) ) <EOL> window_number = self . vim . eval ( <EOL> "<STR_LIT>" . format ( current_buffer . number ) <EOL> ) <EOL> self . vim . command ( "<STR_LIT>" . format ( window_number ) ) <EOL> return <EOL> for buf in self . vim . buffers : <EOL> if buf . name . startswith ( "<STR_LIT>" ) : <EOL> self . vim . command ( "<STR_LIT>" . format ( buf . number ) ) <EOL> return <EOL> self . vim . command ( "<STR_LIT>" ) <EOL> self . vim . command ( "<STR_LIT>" ) <EOL> @ neovim . command ( "<STR_LIT>" ) <EOL> def open_log_file ( self ) : <EOL> filepath = os . path . join ( <EOL> os . environ . get ( "<STR_LIT>" ) , <EOL> "<STR_LIT>" % datetime . now ( ) . strftime ( "<STR_LIT>" ) <EOL> ) <EOL> self . vim . command ( "<STR_LIT>" % filepath ) </s>
