*fancyterm.txt* Simple plugin to send commands from a buffer ============================================================================== Table of contents Introduction |fancyterm| Configuration |fancyterm-configuration| Usage |fancyterm-usage| Compatibility |fancyterm-compatibility| Changes |fancyterm-changes| ============================================================================== |INTRODUCTION| *fancyterm* fancyterm is a simple plugin that helps with sending entire buffers or just lines or selections into repls or shells fancyterm isn't actually as fancy as some more advanced live-repl environments, but because it aims to be somewhat universal, it works with many repls/shells out of the box, without any extra configuration. So it can easily become a quick-and-easy way to start a live-repl programming session. ============================================================================== CONFIGURATION *fancyterm-configuration* If you want the default keybindings, you don't have to configure anything. If you want to change the keybindings, you simply need to include your `nnormap` and `vnoremap` maps in your `vimrc` file right after the following line: > let g:fancyterm_map_keys = 0 This makes sure the bindings don't get created. The default mappings are as follows, and its also how you configure your own > nnoremap a :call TermSendBuffer() vnoremap v :call TermSendVisual() nnoremap . :call TermSendCurrentLine() < You can change the position of the terminal by setting `g:fancyterm_map_keys`. So, for example, to set the new terminal position to the bottom: > let g:fancyterm_term_pos = 'bot' < The string is the same as the commands described in `opening-window` Changing the height is done with the variable: > let g:fancyterm_term_height = 10 < The above sets the new terminal height to 10 rows. ============================================================================== USAGE *fancyterm-usage* To use this plugin simply follow the installation instructions in the README Once you've done that, open a terminal with the |:Term| command. This initialized the active terminal to this new session. Note that opening another terminal this way will abandon the old one and the new one becomes the active terminal. If you wish to set the active terminal, either because you forgot to use |:Term| and called `:term` instead, naviage to the terminal you wish to use and run |:TermSetActive|. This will set the active terminal to the buffer you are currently in. Once its open, simply use the bindings (default or your own) to start sending commands. For example, to send the entire buffer, using default bindings, you enter into normal mode and press a (as in 'All') You will see the buffer contain your entire buffer, followed by a newline which most terminals interpret as command submission. To send a visual selection, simply highlight the text in `visual-mode` and press v Your selection will be sent to the buffer. To send just the line where your cursor currently is, simply press . (thats the leader key followed by a dot) and your line will be sent to the terminal. If you want to use it for example with am ocaml repl, simply start the command 'ocaml' inside the shell and start writing your code, then use the relevant bindings to send text into the buffer. The tabs get automatically expanded to spaces based on your value of `tabstop`, to prevent readline() from causing unwanted completions in the terminal. ============================================================================== COMPATIBILITY *fancyterm-compatibility* Initially the plugin was ment for sending one-lines to a bash or PSQL terminal. But with a few modifications, it proved to be usefull for all sorts of repls, not just shells. It has been briefly tested with: * ocaml * python3 * bash * sbcl * psql But as long as the given shell/repl has multiline-input parsing support (most tend to have it) then it should _just work_ out of the box. perl5 has also been tested but only worked with a plain `perl` command. This is because of perl doesnt have a native repl, so you might need to install a perl repl that can handle multiline-input. Ruby is also very likely to work. It hasn't been tested though. So, as a rule of thumb, if it can parse multiple lines on the command line it will likely work. ============================================================================== CHANGES *fancyterm-changes* * Version 2.0.0 Since version 2.0.0 the default bindings have been removed. Instead, the key has been used in their place. This is because I didn't realize what was actually used for, and choose it pretty much at random. If you set `let g:fancyterm_map_keys = 0` then this change doesn't affect you ============================================================================== LICENSE Code is licensed under the MIT open source license. See LICENSE file with this distribution for more details. ============================================================================== .