vamolessa / pepper Goto Github PK
View Code? Open in Web Editor NEWsimple and opinionated modal code editor for your terminal
Home Page: https://vamolessa.github.io/pepper/
simple and opinionated modal code editor for your terminal
Home Page: https://vamolessa.github.io/pepper/
Align selections is a crucial and very frequently use action (example) that I really miss when switch to Pepper. From Kakoune's keys docs:
& : Align selections, align the cursor of each selection by inserting spaces before the first character of each selection.
I set up pepper and rust analyzer. If I open a *.rs file pepper tells me that the rust analyzer is started. But how can I use it?
Hi, I want to try pepper. I installed pepper without lsp first and I got version 0.23.3. Then I want to use the lsp version, but this uses the v0.22.0
Is it possible to get the current pepper version with lsp support?
Just want to contribute a bit for the project, feel free to add this to the README.md
file or the bindings wiki.
If you want to change/improve anything on this cheat sheet, you could go to the KLE link then edit it later on!
This should enable quite a few command compositions with not that much of an effort.
Kakoune's expansion rules as a reference:
https://github.com/mawww/kakoune/blob/master/doc/pages/expansions.asciidoc
Hello,
I've played around with pepper
, and I was a little bit puzzled with the following course of actions:
I've launched the pepper
executable without any "file" argument:
$ pepper
After that, it looks like it's impossible to add any text or anything (you can't switch to "insert" mode, for example). You can't even run the command :save myfile.txt
because it throws an error message: error:no buffer opened
.
It looks strange but I often open my text editor to type text and thereafter save it to a new file.
So far, I didn't see how to do that with pepper, but I may be wrong. The only solution I can think of right now is to know how you're going to name your file beforehand (either by doing a touch myfile.txt
or launch pepper with myfile.txt
as an argument.
Do you see any better way, so far?
We currently have:
keys | action |
---|---|
m<char> |
save current buffer and main cursor position as a marker on register <char> |
M<char> |
go to marker on register <char> (if it's a valid marker) |
But I wish it can behave like Kakoune:
This will help user utilize the power of multi cursor way better.
I surprise that there is no way to save and quit at with one command like wq
on Vim, Kakoune or Helix when this is a very commonly used operation:
save-quit
Saves buffer to file then quits this client. If <path>
is present, it will use that path so save the buffer's content, making it the new buffer's associated filepath (it will also enable saving for that buffer from now on).
save-quit [<path>]
sq
save-quit-all
Saves all buffers to file then quits all clients.
save-quit-all
sqa
These commands will be very convenient but I could see why this command doesn't exist in the first place, it's a bit redundant and seem like something the user could config to achieve...:
If you find this suggestion it's suitable to be built-in with the editor, feel free to label this issue with "Plugin" or "Plugin Idea".
We currently have:
keys | action |
---|---|
cd |
clear all extra cursors and keep only the main cursor |
But there is no way to clear only the main cursor...
From Kakoune's keys docs:
Alt-Space : Clear the main selection.
I imagine it will be implemented like this:
| keys | action |
| ---------- | ----------------------------------------------------- |
| `cd` | clear all extra cursors and keep only the main cursor |
+ | `cD`, `CD` | clear only the main cursor |
Open one pepper and activate the command mode :foo
, don't press return yet.
Open another pepper, it takes over the prompt now.
Lines 20 to 21 in 033b088
The easiest way to reproduce it is by entering insert mode without a lsp server running and repeatedly insert a character (say, x
).
When the word being typed is at length around 23, it begins lagging hard because of fuzzy_match
poor performance.
It says `gj`, `gk` | move cursors to first/last line
but gj
is last line. So either write gk, gj
or last/first line
.
Hello, in features in README there is information about LSP support, but I can't find any more information about this, is it working? By the way, awesome project, I'm really looking into replacing neovim in future.
This bad because we should be able to use search navigation to expand selections.
As the title suggests!
Links that might be useful:
Hi 👋
I just purchased a prebuilt binary of pepper and tried to run it on macOS 12.0.1. Unfortunately, it doesn't work. Pepper immediately crashes upon starting it. No output whatsoever.
pepper version 0.19.1
macOS 12.0.1
I'm not getting goto definition to work. See the video below in which I'm trying to use gd
to go to definition for the word under the cursor in the pepper codebase.
I've confirmed that LSP is working since K
(for hover) does work and do give me information about the word under the cursor.
Environment
OS: macOS 12.0.1
Terminal: Kitty 0.24.2
pepper: 0.22.0
From Kakoune's keys docs:
* : set the search pattern to the main selection (automatically detects word boundaries).
Alt-* : set the search pattern to the main selection (verbatim, no smart detection).
I imagine it will be implemented with only one key * to set the search pattern to the main selection that:
The language syntax definition link on help.md ends in a 404 page
Pepper currently can pick commands for clipboard handling pretty fine but could be improve by supporting xclip
and Wayland's wl-clipboard
:
wl-clipboard
:
wl-copy
wl-paste --no-newline
xclip
is installed then use it:
xclip -in -selection clipboard
xclip -out -selection clipboard
xsel
as currently is.You could check out clipb
a clipboard managers warper that I write (relevant code).
I think replacing a single character is a common enough operation to be useful, even if it's orthogonal to the editing operations. I think it currently cannot conveniently be defined as a macro. Kakoune has the r
command which replaces every character in the selection with the next char entered, which works nicely with default-1 selections. The Helix editor has a r
command which works like in vi, I think.
Perhaps pepper could implement Kakoune's r
as gr
(like vim, replace whole selection by char), then one can define vi-style r
as a macro lcvhgr
.
I just installed the latest version of pepper. When I press <space>o
I get the open:
prompt, but there's nothing to select. This did work previously, but not anymore.
**
<pipe>
is|
. I had to write like this because of markdown table formatting.
You could actually do this:
| keys | action |
| ---- | ---------------- |
| `\|` | Do something ... |
keys | action |
---|---|
| |
Do something ... |
With a caret style cursor editing I find it more intuitive if the default cursor looks like a vertical bar instead of a box. That way if a cursor looks like a box I know that I have selected something. At the same time this avoids having to keep in mind that things change at the left of the box/cursor as changes only happen where the bar/line and or the selected box is.
Is there a way to change the cursor shape in pepper to a line/bar to get this behavior?
Hey, love pepper.
Excited to see a simple modern editor that can be extended.
Thank you for making it.
❯ sw_vers
ProductName: macOS
ProductVersion: 12.1
BuildVersion: 21C52
❯ sysctl -n machdep.cpu.brand_string
Apple M1
# ARM
❯ kitty --version
kitty 0.24.0 created by Kovid Goyal
# same crash on Terminal.app Version 2.12 (443)
❯ cargo --version
cargo 1.58.0
❯ ./target/debug/pepper -v
pepper version 0.21.0
Resized the terminal.
pepper
crashed.
❯ tput cols; tput lines
80
23
❯ cargo build
# ... cut ...
❯ ./target/debug/pepper
# resized terminal, pepper crashed
❯ tput cols; tput lines
80
48
❯ cat pepper-crash.txt
File: pepper-crash.txt
panicked at 'internal error: entered unreachable code', pepper/src/platforms/bsd
.rs:176:26
Same issue with cargo install pepper-plugin-lsp
or cargo build
from 86a44b7.
Cargo built version v0.10.6 crashes when opening a file, either from the command line or with the open command:
thread '' panicked at 'index out of bounds: the len is 0 but the index is 0', C:\Users\whein.cargo\registry\src\github.com-1ecc6299db9ec823\pepper-0.10.6\src\buffer.rs:364:10
I know it's a no go, but I don't have a regular keyboard with qwerty and dedicated cursor keys. I have a Redox keyboard (split matrix keyboard like Ergodox).
My layout is not standard qwerty. hjkl are scattered around the keyboard. Instead I use cursor keys on a second layer.
It would things easier for me if I can use cursor keys in normal mode instead hjkl
What should we do in the mac case? Do we actually need it there?
We just use libc::daemon
in other unix platforms to move the server executable to the background
for it to not be killed when the first client closes. Maybe there's some other way to do it?
Maybe on mac we can actually spawn the process directly as a daemon (using fork
instead of posix_spawn
right now)?
Or maybe just expand the code inside mac's libc::daemon
(which is here).
Need help on this since it's kinda hard for me to test since I don't have a mac accessible.
I'm working on the pepper codebase using rust-analyser
. Pressing gr
to find references causes pepper to crash on macOS. See the log below.
panicked at 'forgot to call 'finish' on ServerEventIter', plugin-lsp/src/protocol.rs:973:9
OS: macOS 12.0.1
Terminal: Kitty 0.24.2
pepper: 0.22.0
Display the color of color-hex-codes and color functions is pretty helpful for writing CSS and UI design... VScode support this feature by default, while NeoVim have an acceptable plugin vim-hexokinase
that do the job:
I hope Pepper could support for coloring:
#FFFFFF
).#FFF
).rgb(100%, 100%, 100%)
, rgb(255, 255, 255)
).rgba( ... )
).hsl( ... )
).hsla( ... )
).With styling options:
If you find this suggestion it's suitable to be built-in with the editor, feel free to label this issue with "Plugin" or "Plugin Idea".
This function is used to tell the width of a char
. It currently always returns 1
.
We should parse the unicode database which contains codepoints display widths and implement this function using that data.
This will enable, for example, correctly rendering buffers which contain CJK symbols which usually have a display length of 2
.
Use an empty buffer, insert mode, paste this string of 100 x: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
.
Pepper crashes:
thread '<unnamed>' panicked at 'index out of bounds: the len is 1 but the index is 14', src/client.rs:276:23
stack backtrace:
0: rust_begin_unwind
at /rustc/3e99439f4dacc8ba0d2ca48d221694362d587927/library/std/src/panicking.rs:515:5
1: core::panicking::panic_fmt
at /rustc/3e99439f4dacc8ba0d2ca48d221694362d587927/library/core/src/panicking.rs:92:14
2: core::panicking::panic_bounds_check
at /rustc/3e99439f4dacc8ba0d2ca48d221694362d587927/library/core/src/panicking.rs:69:5
3: pepper::command::CommandManager::eval_and_then_output
4: pepper::editor::Editor::on_client_event
5: pepper::application::ServerApplication::run_application
Reproducible on pepper 1e231e3.
Here are the logs:
❯ cargo install pepper-plugin-lsp
Updating crates.io index
Downloaded pepper-plugin-lsp v0.13.0
Downloaded 1 crate (36.1 KB) in 1.08s
Installing pepper-plugin-lsp v0.13.0
Downloaded pepper v0.26.1
Downloaded libc v0.2.124
Downloaded 2 crates (717.4 KB) in 2.07s
Compiling libc v0.2.124
Compiling pepper v0.26.1
error[E0277]: expected a `Fn<(char,)>` closure, found `[char; 4]`
--> /home/nnb/.cargo/registry/src/github.com-1ecc6299db9ec823/pepper-0.26.1/src/command.rs:180:48
|
180 | self.0 = self.0.trim_start_matches(&[' ', '\t', '\n', '\r']);
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected an `Fn<(char,)>` closure, found `[char; 4]`
|
= help: the trait `Fn<(char,)>` is not implemented for `[char; 4]`
= note: required because of the requirements on the impl of `FnOnce<(char,)>` for `&[char; 4]`
= note: required because of the requirements on the impl of `std::str::pattern::Pattern<'_>` for `&[char; 4]`
error[E0277]: expected a `Fn<(char,)>` closure, found `[char; 2]`
--> /home/nnb/.cargo/registry/src/github.com-1ecc6299db9ec823/pepper-0.26.1/src/command.rs:272:44
|
272 | self.0 = self.0.trim_start_matches(&[' ', '\t']);
| ^^^^^^^^^^^^ expected an `Fn<(char,)>` closure, found `[char; 2]`
|
= help: the trait `Fn<(char,)>` is not implemented for `[char; 2]`
= note: required because of the requirements on the impl of `FnOnce<(char,)>` for `&[char; 2]`
= note: required because of the requirements on the impl of `std::str::pattern::Pattern<'_>` for `&[char; 2]`
error[E0277]: expected a `Fn<(char,)>` closure, found `[char; 9]`
--> /home/nnb/.cargo/registry/src/github.com-1ecc6299db9ec823/pepper-0.26.1/src/command.rs:217:26
|
217 | match s.find(&[' ', '\t', '\n', '\r', '"', '\'', '{', '}', '#']) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `Fn<(char,)>` closure, found `[char; 9]`
|
= help: the trait `Fn<(char,)>` is not implemented for `[char; 9]`
= note: required because of the requirements on the impl of `FnOnce<(char,)>` for `&[char; 9]`
= note: required because of the requirements on the impl of `std::str::pattern::Pattern<'_>` for `&[char; 9]`
For more information about this error, try `rustc --explain E0277`.
error: failed to compile `pepper-plugin-lsp v0.13.0`, intermediate artifacts can be found at `/tmp/cargo-installJcnE6N`
Caused by:
could not compile `pepper` due to 3 previous errors
❯ cargo install pepper
Updating crates.io index
Installing pepper v0.26.1
Compiling libc v0.2.124
Compiling pepper v0.26.1
error[E0277]: expected a `Fn<(char,)>` closure, found `[char; 4]`
--> /home/nnb/.cargo/registry/src/github.com-1ecc6299db9ec823/pepper-0.26.1/src/command.rs:180:48
|
180 | self.0 = self.0.trim_start_matches(&[' ', '\t', '\n', '\r']);
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected an `Fn<(char,)>` closure, found `[char; 4]`
|
= help: the trait `Fn<(char,)>` is not implemented for `[char; 4]`
= note: required because of the requirements on the impl of `FnOnce<(char,)>` for `&[char; 4]`
= note: required because of the requirements on the impl of `std::str::pattern::Pattern<'_>` for `&[char; 4]`
error[E0277]: expected a `Fn<(char,)>` closure, found `[char; 2]`
--> /home/nnb/.cargo/registry/src/github.com-1ecc6299db9ec823/pepper-0.26.1/src/command.rs:272:44
|
272 | self.0 = self.0.trim_start_matches(&[' ', '\t']);
| ^^^^^^^^^^^^ expected an `Fn<(char,)>` closure, found `[char; 2]`
|
= help: the trait `Fn<(char,)>` is not implemented for `[char; 2]`
= note: required because of the requirements on the impl of `FnOnce<(char,)>` for `&[char; 2]`
= note: required because of the requirements on the impl of `std::str::pattern::Pattern<'_>` for `&[char; 2]`
error[E0277]: expected a `Fn<(char,)>` closure, found `[char; 9]`
--> /home/nnb/.cargo/registry/src/github.com-1ecc6299db9ec823/pepper-0.26.1/src/command.rs:217:26
|
217 | match s.find(&[' ', '\t', '\n', '\r', '"', '\'', '{', '}', '#']) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `Fn<(char,)>` closure, found `[char; 9]`
|
= help: the trait `Fn<(char,)>` is not implemented for `[char; 9]`
= note: required because of the requirements on the impl of `FnOnce<(char,)>` for `&[char; 9]`
= note: required because of the requirements on the impl of `std::str::pattern::Pattern<'_>` for `&[char; 9]`
For more information about this error, try `rustc --explain E0277`.
error: failed to compile `pepper v0.26.1`, intermediate artifacts can be found at `/tmp/cargo-installq78vuM`
Caused by:
could not compile `pepper` due to 3 previous errors
I'm running NixOS 21.11
From Tree-sitter's website:
Tree-sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited. Tree-sitter aims to be:
- General enough to parse any programming language.
- Fast enough to parse on every keystroke in a text editor.
- Robust enough to provide useful results even in the presence of syntax errors.
- Dependency-free so that the runtime library (which is written in pure C) can be embedded in any application.
I think this is the most important feature that missing in Pepper.
Running cargo install pepper
gets you the following output:
error: there is nothing to install in `pepper v0.16.0`, because it has no binaries
`cargo install` is only for installing programs, and can't be used with libraries.
To use a library crate, add it as a dependency in a Cargo project instead.
I tried defining one using c-j/c-k but it's difficult in general when you are at the beginning or end of buffer.
This would help a lot with manipulate complex multi selection. From Kakoune's keys docs:
Alt-z combines selections from the register with the current ones, whereas Alt-Z combines current selections with the ones in the register; a menu is then displayed which waits for one of the following additional keys:
- a append selections.
- u keep a union of selections.
- i keep an intersection of selections.
- < select the selection with the leftmost cursor for each pair.
- > select the selection with the rightmost cursor for each pair.
- + select the longest selection
- - select the shortest selection.
(I don't think <, >, + and - is useful)
This require #54 to be done.
Most of the time, I can't open any file with pepper (latest git rev as of writing, pepper
binary from the mine
crate). The following is written to pepper-crash.txt
:
panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }', pepper/src/application.rs:351:55
Judging from the source code, the problem seems to have something to do with updating the display upon opening a file. No idea how to fix it though :/
I'm considering moving from Kakoune over to pepper, but one thing that bugs me is the separate "selection mode" with the blue cursor. I feel like it consistently requires more or the same number of keystrokes compared to vi or Kakoune.
Here's an example: I'm at the beginning of the line
map-command <c-e> <c-p>
in normal mode and I want to change command
to insert
. Here's how I would do it with vi/kakoune/pepper:
eece
eeec
wwawi
Is five keystrokes the best pepper can do in this situation or have I missed the point of the separate "selection mode"?
Just installed 0.26, and get
thread 'main' panicked at 'could not spawn server', /home/defaultuser/.cargo/registry/src/github.com-1ecc6299db9ec823/pepper-0.26.0/src/platforms/unix_utils.rs:87:13 note: run with
RUST_BACKTRACE=1 environment variable to display a backtrace
Using SailfishOS (mobile).
Previous version worked fine...
Hello,
First of, thank you for making such a great code editor. I have try out many editor but this is the best one so far. Great UX, more minimal than Neovim and Helix but still have enough features out of the box unlike Kakoune.
Let's get to the main point:
I just noticed that I can't yank (y
) or paste (Y
) on macOS even though my copy-command
is set to pbcopy
and paste-command
is set to pbpaste
. Nothing happens when pressing y
and Y
just clears the selection without every pasting anything from the clipboard.
Following issue #46:
Pepper would be great if it have the quality-of-life-improvement features from two of the most popular VScode plugins: Auto Close Tag and Auto Rename Tag:
From the "Auto Rename Tag" VScode plugin:
Automatically add HTML/XML close tag, same as Visual Studio IDE or Sublime Text does:
- Automatically add closing tag when you type in the closing bracket of the opening tag
- After closing tag is inserted, the cursor is between the opening and closing tag
- Set the tag list that would not be auto closed
- Automatically close self-closing tag
- Support auto close tag as Sublime Text 3
- Use Keyboard Shortcut or Command Palette to add close tag manually
From the "Auto Rename Tag" VScode plugin:
When you rename one HTML/XML tag, automatically rename the paired HTML/XML tag
If you find this suggestion it's suitable to be built-in with the editor, feel free to label this issue with "Plugin" or "Plugin Idea".
Just a minor thing, but would be nice to have (and probably not hard):
When I use :open ...
I get file completion, but when I use :o ...
I don't.
(Same for self-defined aliases.)
Many color themes use a bright cursor but otherwise light text on dark background, so it would be good to use a different color for the character under cursor then (as terminal emulators do).
I guess one color is good enough for all cursors for now.
When editing some code at the bottom of the screen, the cursor is sometimes hidden by documentation or auto-suggestions popping up in the minibuffer, making it impossible to see the currently edited text. I'd suggest to automatically scroll down by the needed amount in that case.
If the cursor is on right at the beginning of the path (c:/), it cant correctly parse the path
👋 @vamolessa, this is not so much an issue than it is a question.
I read that one of pepper's goals were Extensible through external cli tools
on the Handmade Network's website. Is this true, and if so, how?
I'm coming from dte and was hoping pepper would provide some of the same features as dte
provides when it comes to integrating with external tools. dte
has a section on External Commands and I've found the following really useful:
command | description | pepper equivalent |
---|---|---|
filter | Filter selected text or whole file through external command. | ? |
run | Run external command. | ? |
exec-open | Run external command and open all filenames listed on its standard output. | find-file (sort of) |
The main thing in dte
I find powerful is the concept of exec
. In Unify commands that run external programs into a single "exec" command this concept is explored further where a single construct, exec
, can be used to implement a handful of other useful commands.
I really love being able to run :run tig blame $FILE
to temporarily open tig
's blame view on the current file and after exiting ending back in my editor. exec-open
allows me to run an external program such as fzf
and then see the selected files opened in dte
.
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.