Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Things I want to see in vis #530

Closed
srghma opened this issue Apr 3, 2017 · 12 comments
Closed

Things I want to see in vis #530

srghma opened this issue Apr 3, 2017 · 12 comments

Comments

@srghma
Copy link

srghma commented Apr 3, 2017

  1. remove windows
    lets terminal multiplexer take care of it. You have made windows, user will demand tabs. Consider how kakoune have made this: kakoune provides --session option, in session registers and many other things are shared, also this allows such things as using kak as pager and others. Can vim do this? Not well enough (ehhh, if only dvtm had tabs, you know, layouts -> tabs -> windows, its like current windows, but one window is visible and others are under, I am dreaming about that since tmux)

  2. full synchronization with system clipboard
    I love when I can transfer text from browser to editor seamlessly, so I have made this: y and p - to and from system clipboard, d - remove and forget, ,d - cut, for yank history I'm using copyq
    With multiple cursors things becoming tricky, lets consider how guys from sublime have dealt with this: sublime copy to system clipboard, delimiter is \n, if number of lines is the same as number of cursors - each line goes to corresponding cursor, if no - paste whole text under each cursor

I'm not demanding this, but this is what I will do anyway if I will use your editor and vis can benefit from this too if insists on using modern ways of saving data

  1. buffer autoreloading on change
    kakoune have this feature: if file was changed externally it will be reloaded, if you have made uncommited changes - you can get them back with undo

  2. vimgolf
    again mawww showed charms of his editor for newbs in vimgolf, I personally have read a book (I'm lying) about sam and hasn't understood a thing about structural regexp and why you decided to use them

@aeosynth
Copy link
Contributor

aeosynth commented Apr 3, 2017

3 is autoread in vim:

When a file has been detected to have been changed outside of Vim and
it has not been changed inside of Vim, automatically read it again.
When the file has been deleted this is not done.

@ghost
Copy link

ghost commented Apr 3, 2017

Speaking of windows is there any way to disable them currently ? I've been using vi for a lot of time and it's sure is annoying when a program has it's own windowing system.
Also where can I find actual examples of configs ? I never touched lua, how do I disable the grey-ish theme for example ?

@aeosynth
Copy link
Contributor

aeosynth commented Apr 3, 2017

@throwaway217 you can disable themes completely with set syntax off, or change the theme with eg set theme dark-16. included themes, community themes

you can search github for configs, (although note that many will use an older format, since 0.3 was released recently): https://github.com/search?utf8=%E2%9C%93&q=filename%3Avisrc.lua&type=Code

@martanne
Copy link
Owner

martanne commented Apr 4, 2017

  1. @BjornMelgaard I agree that an editor shouldn't be in the window
    managing business. There is already an issue Integrate with external window manager #130 for it. Introducing
    a client/server architecture and/or asynchronous plugins will require
    quite a bit of design work. I do not want to make these changes without
    at least first thinking about a sound theoretical model. Introducing
    these features essentially moves from a single-user editor model to
    a collaborative editing setting, because changes can suddenly happen
    concurrently.

    I might or might not be able to spend some time on these topics during
    the summer.

    The other things you mention (usage as a pager etc.) seem entirely
    unrelated to the window management issue and should in principle be
    possible with vis.

    dvtm already supports tags which can be abused as tabs. There is also
    a per-tag (layout) patch floating around somewhere.

    @throwaway217 no, window support can't be disabled. It is used to
    implement the command prompt which is just a regular file. Press
    :<Up> to expand it to a full window without status bar. Even with a
    client/server architecture this would likely remain unchanged. Just ignore
    window support, if you do not need it.

  2. Yes register handling for multiple cursors should be improved. Each
    cursor is currently limited to a single register which has no relation
    to the regular registers available in "single cursor" mode. That is
    also the reason why Paste into visual selected word with multiple cursors #527 currently doesn't work. More generally, this
    falls under Integration of multiple cursors into the vi(m) workflow #93 e.g. should marks also be per cursor?

    As for integration with the system clipboard. I'm not sure whether
    I care about that. What is a use case for pasting a single line
    at every cursor location?

  3. How are external file changes detected? In vim this doesn't really
    seem to work reliable and requires hacks such as vim-autoread.
    And no, stat(2)-ing the file on every cursor motion and/or relying
    upon platform specific file system event watching libraries (e.g. inotify
    etc) is not an appropriate solution.

  4. Might be nice, but ENOTIME. I believe for curious minds there is
    sufficient documentation available: re-read the man page and the referenced
    tutorials/papers.

@srghma
Copy link
Author

srghma commented Apr 7, 2017

@martanne

  1. So, ignore windows feature, maybe you are right, I have missed vim's command-line history in kakoune
  2. I think marks shouldnt be per cursor, this will allow kakoune's z (saving selection, appending current selection to saved), love that.

What is a use case for pasting a single line at every cursor location? - Mmm..only can say that I have used that in every single editor a lot, it seems indispensable for me 😕

  1. autoread - then maybe better to make plugin for that and not to include natively

  2. Then can you please fill this table 😄 , it's kakoune bindings, I'm interested in

P.S.
5. Why in vis colliding selections are not merged, like this done in kakoune/sublime? Prons of merging - straightforwardness

@martanne
Copy link
Owner

martanne commented Apr 7, 2017

I added some analogous commands to your table. The others are currently not supported. Count specifiers were discussed in #219 and on the mailing list. In general you will notice that kakoune has probably a much more polished UI while vis has traditionally focused more on "backend" issues. Selections are not merged because it was simpler to implement and not really deemed necessary.

Regarding the system clipboard integration: if it is indeed indispensable for you, then it shouldn't be hard to list a few use cases? Assuming you have an arbitrary block of text copied, how do you even know that it matches the number of cursors?

@srghma
Copy link
Author

srghma commented Apr 10, 2017

Everything is illuminated 😄 🙇‍♂️

  1. Are you planning to implement merging selections? With merged selections it would be easier to predict output of vis commands, the sooner - the better

  2. how do you even know that it matches the number of cursors? - Interesting question, I think in sublime I pasted text immediately after copying or transferred text across blocks with same size and never counted number of cursors. For example:

before ([] - selection)

[text]1
[text]2
[text]3

after cut - paste

1[text]
2[text]
3[text]

Something like that, without changing number of cursors in between.
And it makes convenient to copy textobjects with one command (and not just that)

P.S.
I have added z bindings and removed obvious J

@srghma
Copy link
Author

srghma commented Apr 14, 2017

Vis synchronized clipboard concept

Requirements: clipboard manager, such as copyq (0-9 registers functionality delegates to copyq)

# i3 config
bindsym $mod+p       exec --no-startup-id "copyq show"
for_window [class="copyq"]             floating enable

Bindings:

y/Y - copy to clipboard with delimiter current_delimiter/ copy to clipboard till EOL
d/D - delete / delete till EOL
p/P - paste (divide by current_delimiter and paste under according cursor, extra lines are ignored, like in kakoune)
a-p/a-P - paste all (whole clipboard content under according cursor, without dividing)
,d/,D - cut with delimiter / cut till EOL
" - prompt to enter current_delimiter (by default delimiter is \n)

Extra:

  • in visual mode Y - can rather append selection to active clipboard item, than create new item in clipboard history, but that

@martanne
Copy link
Owner

I'm still not convinced this clipboard integration is really necessary. In general vis is designed to work with external tools without having to deal with the system clipboard.

For example if you have multiple selections then:

  • :| your-command will filter them through your command
  • :w your-file will concatenate and write them to your file
  • :> ( cat ; echo ) >> your-file will write them with a delimiter (in this case \n) to your file

This covers my use cases. Admittedly the reverse, i.e. inserting the n-th line from a file at cursor position n is currently not easily possible.

I pasted text immediately after copying or transferred text across blocks with same size

Either I'm misunderstanding things, or this is already possible? If you use d as cut and p as your paste command it will transform [text]1 to 1text.

@srghma
Copy link
Author

srghma commented Apr 14, 2017

I'm still not convinced this clipboard integration is really necessary - Ok, now I think that too. It's better to be implemented in plugin and used in combination with commands that you gave. Thanks for commands.

Either I'm misunderstanding things, or this is already possible? - You have asked for use case to explain how do you even know that it matches the number of cursors, I have answered that I am not counting number of copied lines, because I don't need to, maybe example was bad.

@srghma srghma closed this as completed Apr 14, 2017
@martanne
Copy link
Owner

martanne commented Jul 5, 2017

I updated your table with recent developments. Vis is now also able to save/restore selections to/from registers and perform various set operations on them.

Furthermore overlapping selections should now be merged (see also #582).

@srghma
Copy link
Author

srghma commented Jul 5, 2017

👍 😺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants