Live data from Hacker News

Show HN: CuteVim – Portable Vim with a cute vimrc

github.com

61–70 of 74 posts

Re: Show HN: CuteVim – Portable Vim with a cute vimrc

#61
post #43
post #32

Earlier quoted context omitted.

If there's an "m" it's not portable vi and that's a fraud anyway.

The binary was compiled with Cosmopolitan Libc [0], and therefore the binary will execute natively on Linux, Mac, Windows, FreeBSD, OpenBSD, NetBSD, and bare metal (BIOS boot). I would call that portable. [0] https://github.com/jart/cosmopolitan

I am flabbergasted by how irrelevant this reply is.

I am agreeing with the original comment.

Why would you post that? What is wrong with you?

Re: Show HN: CuteVim – Portable Vim with a cute vimrc

#62
post #31

> PS: If you don't have an OLED screen, don't comment out autocmd ColorScheme * call OLED_Black() around line 1162. Instead, go buy an OLED screen! It's really worth it!! Interesting truth. Vivid colors, best response time, saves power in dark mode, #000 looks amazing (and off-black looks muddied). Honestly I wish we normalized true black themes for this reason.

To quote from their readme: “Overriding dark themes to replace the uggly muddy darkgreys by a pure #000000 black: this is ideal on OLED screens which can do pitchblack and give you a higher constrast” Those muddy dark greys are actually there for purposefully lowering the contrast, to prevent fatigue. It takes a while to accommodate to lesser contrast, but once you do it, you will likely never want the pure blacks ba…

You can also turn way down the brightness & save even more power if #000 & #fff are used to get a low contrast. Seems folks forget about this adjustment as anyone using a low-contrast theme for their site makes me crank up my brightness just to read it. Books being high contrast black & white wasn’t an issue since it’s in ambient light, but if your screen is brighter than ambient, then of course you’ll want a low-contrast theme, but you could have just lowered your brightness.

I’m happy with my OLED phone, laptop, & monitor while not having daily driven a IPS device in 5 years.

Re: Show HN: CuteVim – Portable Vim with a cute vimrc

#63
post #58
post #57

Earlier quoted context omitted.

I asked my optometrist about the best setting for viewing comfort, and she said black letters on white background. So I have that, except with a bit of tint, also following a theory that looking at certain colors affects moods.

>> Light text on a dark background blooms more and makes it harder to distinguish the characters. > I asked my optometrist about the best setting for viewing comfort, and she said black letters on white background I did some reading before I started using light themes, and the theory agrees with your optometrist, especially for astigmatism. However, after getting an OLED screen, my experience didn't match the theory…

Hyperlinks to scripts? I’ve been wanting to do something similar for ages for those few occasions where ambient sunlight really wanted me moving to something that wasn’t a dark. It seemed like quite a bit of work since, like you, more often than not, I’m not in that sort of environment.

Re: Show HN: CuteVim – Portable Vim with a cute vimrc

#64
post #63
post #58

Earlier quoted context omitted.

>> Light text on a dark background blooms more and makes it harder to distinguish the characters. > I asked my optometrist about the best setting for viewing comfort, and she said black letters on white background I did some reading before I started using light themes, and the theory agrees with your optometrist, especially for astigmatism. However, after getting an OLED screen, my experience didn't match the theory…

Hyperlinks to scripts? I’ve been wanting to do something similar for ages for those few occasions where ambient sunlight really wanted me moving to something that wasn’t a dark. It seemed like quite a bit of work since, like you, more often than not, I’m not in that sort of environment.

I have no nice release but on hyprland, I use the following to increase /sys/class/backlight/intel_backlight/brightness by steps of +- 200 units that I calibrated with my eyeballs and /sys/class/backlight/intel_backlight/max_brightness:

binde = , XF86MonBrightnessDown, exec, $HOME/.config/hypr/changebrightness.sh - 200

binde = , XF86MonBrightnessUp, exec, $HOME/.config/hypr/changebrightness.sh + 200

The script is just reading /sys/class/backlight/intel_backlight/brightness and writing back the same value +- 200

The most important is what plays with that: color inversion, red shift, contrast increase, so install gammarelay-rs and wl-gammactl then do key mappings.

The contrast increase is a nice feature to avoid trimming low contrast element (ex: light key text on a grey background), before moving to use exclusively red on black ("submarine" night mode)

# alt= dark red nightmode

# WARNING conflict betweel wl-gammarelay-rs and wl-gammactl: before using one, must killall the other first # So unconditionally kill the other before running commands

bind = ALT,Print, exec, killall wl-gammactl

bind = ALT,Print, exec, killall wl-gammarelay-rs || ( wl-gammarelay-rs & busctl --user -- set-property rs.wl-gammarelay / rs.wl.gammarelay Temperature q 1000 )

# Control= increase contrast for OLED dark

bind = CONTROL,Print, exec, killall wl-gammarelay-rs

bind = CONTROL,Print, exec, killall wl-gammactl || GTK_THEME=Adwaita-amoled-dark-Fix wl-gammactl -c 2.500 -b 0.700 -g 1.000

# Shift= invert

bind = SHIFT,Print, exec, killall wl-gammarelay-rs

bind = SHIFT,Print, exec, killall wl-gammactl || GTK_THEME=Adwaita-amoled-dark-Fix wl-gammactl -c -1.000 -b 2.000 -g 1.000

# Win= brightness menu

bind = WIN,Print, exec, killall wl-gammarelay-rs

bind = WIN,Print, exec, killall wl-gammactl || GTK_THEME=Adwaita-amoled-dark-Fix wl-gammactl

> I’ve been wanting to do something similar for ages for those few occasions where ambient sunlight really wanted me moving to something that wasn’t a dark.

If it's a rare occasion, you must use a dark theme by default, so I would do

- first Ctrl+Printscreen to try to increase the constrast of your back theme: it's rare and counterintuitive, but if you have no reflections on the screen, it can help in the sun

- if it's not enough cancel it by another Ctrl+PrintScreen, then Shift+Printscreen to toggle the inverted mode

- then Fn F5 (which causes XF86MonBrightnessDown on by thinkpad) to reduce the brightness until you like it

If works best if you have OS-wide theme toggle. I use 2 terminals with different themes because unlike on Windows Terminal, on Linux the hot toggles of colors themes for Terminals isn't working so well.

If you have a brightness sensor (often in the keyboard, for color calibration on thinkpads, or in the webcam housing for balance adjustement), you could do much better: record in a sqlite database the timestamps, the brightness value, and your actions (ex: reducing lightness +400)

After a few days of collecting metrics, you should be able to calibrate a default reponse that would change with your habits: imagine pressing a key and reproducing your modal reponse to this kind of ambiant brightness (this theme, that brightness, this color filter...)

Re: Show HN: CuteVim – Portable Vim with a cute vimrc

#65
post #60

Earlier quoted context omitted.

That's not true. For many people Emacs' text editor is the least interesting part of it and use evil mode to get Vim-like bindings. While the jokes may lean on the differences in key-bindings, they are hardly the whole story. Vim is a super lightweight editor that is available everywhere and very easy to carry around your own single-file config. You're allowed to configure it however you want. Vim too has its share o…

The point of vim is to be vi but with more features. It's not to configure it however you dang well please. If this were the point, which it isn't, you could use emacs, which can be configured in vastly more dang ways. Including ways which are a superset of vi, as you yourself admit.

Agree to disagree, I guess. However, the first half of the very first sentence on www.vim.org is "Vim is a highly configurable text editor" so take that as you will. I'm fairly certain there won't be any vim police showing up at my door if I make a chord-mapping :D I'm not into the chord-mappings myself, but I support those who are.

Re: Show HN: CuteVim – Portable Vim with a cute vimrc

#66
post #60

Earlier quoted context omitted.

That's not true. For many people Emacs' text editor is the least interesting part of it and use evil mode to get Vim-like bindings. While the jokes may lean on the differences in key-bindings, they are hardly the whole story. Vim is a super lightweight editor that is available everywhere and very easy to carry around your own single-file config. You're allowed to configure it however you want. Vim too has its share o…

The point of vim is to be vi but with more features. It's not to configure it however you dang well please. If this were the point, which it isn't, you could use emacs, which can be configured in vastly more dang ways. Including ways which are a superset of vi, as you yourself admit.

> emacs, which can be configured in vastly more dang ways. Including ways which are a superset of vi, as you yourself admit.

lol

I think this may be turning into a emacs/vim war :)

> The point of vim is to be vi but with more features.

What defines the point of a tool is what its users make with it.

Having vim with emacs short inside a binary I can run anywhere (from BSD to Windows, which I still love to use sometimes) gives me freedom, so for me the point of vim is freedom.

I like emacs shortcuts (at least the readline ones) but not emacs itself, so for me, there's no point in using emacs.

But if you prefer emacs, why don't you try to do the same thing I did, yet with emacs? You can follow my tutorial (check the part about strace to know where to add your files) and the binary from https://cosmo.zip/pub/cosmos/bin/emacs

I may not like emacs, but if you prepare something containing what you consider should be the defaults, I'd be curious enough to give it a try :)

Re: Show HN: CuteVim – Portable Vim with a cute vimrc

#67
post #47

To solve the issue with Ctrl-k Ctrl-u leaving out one char in normal mode, have you considered setting virtualedit=onemore? It's often a sensible option when you want to "unify" the behavior of normal and insert modes (I've not tested it in your environment, though).

I hadn't. but I will! I like Ctrl-k Ctrl-u to clear the line, and this leftover character is something I really don't like, so THANK YOU! If you have more suggestions, I'd be interested to know! (the best way might be for you to try to edit files with it for like 10 minutes, to see what's missing from your usual configuration) I'd love hear what different people find missing from CuteVim to make it more helpful and p…

Much of your setup is purely personal taste, so I wouldn't feel comfortable to comment on it. I'd just suggest you get rid of some old vim cruft:

  :set complete-=i
  :set nrformats-=octal
For consistency:

  :noremap Y y$
  :noremap vv V
Since you set 'shiftwidth' (4) different from 'tabstop' (8), you should also set 'smarttab'.

I'd add j to 'formatoptions' for .c and .h files (or even for all types of file).

Re: Show HN: CuteVim – Portable Vim with a cute vimrc

#68
post #64
post #63

Earlier quoted context omitted.

Hyperlinks to scripts? I’ve been wanting to do something similar for ages for those few occasions where ambient sunlight really wanted me moving to something that wasn’t a dark. It seemed like quite a bit of work since, like you, more often than not, I’m not in that sort of environment.

I have no nice release but on hyprland, I use the following to increase /sys/class/backlight/intel_backlight/brightness by steps of +- 200 units that I calibrated with my eyeballs and /sys/class/backlight/intel_backlight/max_brightness: binde = , XF86MonBrightnessDown, exec, $HOME/.config/hypr/changebrightness.sh - 200 binde = , XF86MonBrightnessUp, exec, $HOME/.config/hypr/changebrightness.sh + 200 The script is jus…

Thanks. I can think about some of these topics but I can’t use hyprland because there is no color management in Wayland :\

Re: Show HN: CuteVim – Portable Vim with a cute vimrc

#69
post #68
post #64

Earlier quoted context omitted.

I have no nice release but on hyprland, I use the following to increase /sys/class/backlight/intel_backlight/brightness by steps of +- 200 units that I calibrated with my eyeballs and /sys/class/backlight/intel_backlight/max_brightness: binde = , XF86MonBrightnessDown, exec, $HOME/.config/hypr/changebrightness.sh - 200 binde = , XF86MonBrightnessUp, exec, $HOME/.config/hypr/changebrightness.sh + 200 The script is jus…

Thanks. I can think about some of these topics but I can’t use hyprland because there is no color management in Wayland :\

I don't know what you mean by color management - is it the calibration of the display with xrite/argyll?

For ICC profiles colormgr can help: https://wiki.archlinux.org/title/ICC_profiles#Wayland

If you just need basic brightness, contrast and gamma, wl-gammactl should do that: https://github.com/mischw/wl-gammactl

BTW Hyprland is not required, it's just the most practical way to have shortcuts key mappings in Wayland

Re: Show HN: CuteVim – Portable Vim with a cute vimrc

#70
post #47

Earlier quoted context omitted.

I hadn't. but I will! I like Ctrl-k Ctrl-u to clear the line, and this leftover character is something I really don't like, so THANK YOU! If you have more suggestions, I'd be interested to know! (the best way might be for you to try to edit files with it for like 10 minutes, to see what's missing from your usual configuration) I'd love hear what different people find missing from CuteVim to make it more helpful and p…

Much of your setup is purely personal taste, so I wouldn't feel comfortable to comment on it. I'd just suggest you get rid of some old vim cruft: :set complete-=i :set nrformats-=octal For consistency: :noremap Y y$ :noremap vv V Since you set 'shiftwidth' (4) different from 'tabstop' (8), you should also set 'smarttab'. I'd add j to 'formatoptions' for .c and .h files (or even for all types of file).

I've gather information from many sources and removed what I've found to be no longer applicable, but there must still be some cruft hiding!

Thanks a lot for your suggestions! I'll prepare a new revision!

Post reply on HN