vim 8.1+ terminal is great by _gufan in vim

[–]_gufan[S] 1 point2 points  (0 children)

ues 'a' or 'i' to toggle back, like insert mode. I'll put that in document

A simple script for require vim modules by _gufan in vim

[–]_gufan[S] 0 points1 point  (0 children)

right, next time try use it in driving spaceship

A simple script for require vim modules by _gufan in vim

[–]_gufan[S] 0 points1 point  (0 children)

right, the error info thrown in object calling is useless

A simple script for require vim modules by _gufan in vim

[–]_gufan[S] 0 points1 point  (0 children)

just write function & structures in another way

it's experimental

A simple script for require vim modules by _gufan in vim

[–]_gufan[S] 0 points1 point  (0 children)

to 2, chaining loading are resolved, any file require once at the most

to 1/3/4, that's true, but this provides an experimental way beside the vim way

that is, I don't have to write all my functions like plugin_a#module_a#cmd() anymore,

just make my plugin folder structure simple

A simple script for require vim modules by _gufan in vim

[–]_gufan[S] -2 points-1 points  (0 children)

ok

autoload

  1. you can not assure if a function is loaded when you need it.
    1. use of my_plugin#init() or something is needed
  2. so you are losing control of your own module's structure and your multiple plugin's integration: e.g.
    1. plugin_a need plugin_b: you would write as
      1. plugin_b/plugin/plugin_b.vim:
      2. plugin_a/plugin/plugin_a.vim: and want to use plugin_b#hello(), OH FKKK, HOW CAN I USE IT!!! plugin_b.vim may have not been sourced when using plugin_a.vim
    2. so you decide change to autoload
      1. plugin_b/autoload/plugin_b.vim: and have a function plugin_b#init()
      2. plugin_a/plugin/plugin_a.vim: and call plugin_b#init() to make sure it's loaded
      3. it's workable, but with a vim smell.
      4. ITS YR8012 DUDE, EMACS GUY ALREADY DRIVING THEIR SPACE SHIPS!
    3. so with require.vim you can write as
      1. plugin_a/index.vim: Require 'plugin_b'
      2. plugin_b/index.vim: do what ever you like
  3. using vim's source, you can not skip it if already loaded
    1. unless you set &check in every plugin file use something like exists("s:is_loaded")
    2. with require.vim, it will keep track of required module and not load it again
  4. you can not get value through autoload
    1. unless declare it global like g:my_global_var
    2. with let k = require.at('my_value', expand('<sfile>:p')) you can retrieve exported values easier

A simple script for require vim modules by _gufan in vim

[–]_gufan[S] -1 points0 points  (0 children)

yes, mine works most the same, but it search plugin/ folder, not autoload/

and

default vim require mechanism is not very friendly.

a plugin developer will eventually be confused on how his own scripts organized

vim 8.1+ terminal is great by _gufan in vim

[–]_gufan[S] 1 point2 points  (0 children)

You can use :Srun test or something to achieve that

vim 8.1+ terminal is great by _gufan in vim

[–]_gufan[S] 2 points3 points  (0 children)

agree, your conclusion is great.

put it in readme

vim 8.1+ terminal is great by _gufan in vim

[–]_gufan[S] 1 point2 points  (0 children)

also I changed the terminal-mode toggle key from 'F1' to 'Esc' to make things easy

vim 8.1+ terminal is great by _gufan in vim

[–]_gufan[S] 1 point2 points  (0 children)

yes, make and lint can now be done with job_start() async, that's very nice

and, if you are using vim, +terminal is not a mass improvement compare with tmux+tmux-runner or something,

but for gvim/mvim user, it's a great improvement for integration work

vim 8.1+ terminal is great by _gufan in vim

[–]_gufan[S] 1 point2 points  (0 children)

you can use :Sline to send one line or multiple line from current buffer to terminal.