occivink / kakoune-phantom-selection Goto Github PK
View Code? Open in Web Editor NEWWork on multiple selections, one at a time
License: The Unlicense
Work on multiple selections, one at a time
License: The Unlicense
Hi,
here's my keybinds
declare-user-mode phantom
map global user p ": enter-user-mode -lock phantom<ret>" -docstring "phantom-selection"
map global phantom <a-)> ": phantom-sel-add-selection<ret><esc><esc><esc>" -docstring "add selection"
map global phantom <a-(> ";: phantom-sel-iterate-next<ret>" -docstring "clear selection"
map global phantom ) ": phantom-sel-iterate-next<ret>" -docstring "next"
map global phantom ( ": phantom-sel-iterate-prev<ret>" -docstring "prev"
#map global phantom % ": phantom-sel-select-all<ret>" -docstring "select all" #bugs
map global phantom <a-%> ": phantom-sel-select-all<ret>" -docstring "select all"
the problem is <a-(>
. Doing ;
to drop selection and then going to next one still leaves me with one character selected where the cursor was. Is there a way around this?
I'll explain what I mean with an example. But the gist is to support something similar to what counts do for "
.
This is a snippet from rc/base/restructuredtext.kak
:
add-highlighter shared/restructuredtext/c ref c
add-highlighter shared/restructuredtext/cabal ref cabal
add-highlighter shared/restructuredtext/clojure ref clojure
add-highlighter shared/restructuredtext/coffee ref coffee
add-highlighter shared/restructuredtext/cpp ref cpp
Say we wanted to create this from scratch. We would set it up so we have five copies, with the cursors at []
:
add-highlighter shared/restructuredtext/[] ref []
add-highlighter shared/restructuredtext/[] ref []
add-highlighter shared/restructuredtext/[] ref []
add-highlighter shared/restructuredtext/[] ref []
add-highlighter shared/restructuredtext/[] ref []
Now I want to do 2interactive-itersel
, where 2 means group them two by two. So the first group is the first two selections, second group selections 3 and 4, and so on. Similar to how the count works for "
.
Another use-case is if I want to make ad-hoc changes to each of them, but still within the groups. Here's a contrived example where c
is changed to c-family
, andcabal
to hs-cabal
, and so on:
add-highlighter shared/restructuredtext/c-family ref c-family
add-highlighter shared/restructuredtext/hs-cabal ref hs-cabal
add-highlighter shared/restructuredtext/lisp-clojure ref lisp-clojure
add-highlighter shared/restructuredtext/js-coffee ref js-coffee
add-highlighter shared/restructuredtext/gcc-cpp ref gcc-cpp
The idea is that I can change both occurences of e.g. c
to c-family
in one go if I place two cursors per line similar to the previous example, and then going proceed to the second two.
When cloning the entire repo in autoload (which is what plugin managers do), I get this error
>>>
/home/johannes/.config/kak/bundle/plugins/kakoune-phantom-selection/test.kak:1:1: 'try': 2:5: 'source': /home/johannes/git/kak-lsp/phantom-selection.kak: No such file or directory
bundle: couldn't source /home/johannes/.config/kak/bundle/plugins/kakoune-phantom-selection/test.kak
shell stderr: <<<
with this particular setup ("bundle" plugin manager), it leaves phantom-selection commands disfunctional.
Can we rename test.kak
to something without the kak
file extension, so it's not sourced automatically?
Face to highlight cursor under phantom selections. Maybe also to highlight eol.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.