See https://github.com/romainl/vim-rnb for an up-to-date version.
The open source community depends on the efforts of a small group of volunteers relative to the number of users. In order to make the most of contributors' time, here is some advice for asking “good questions”. This is largely paraphrased from this article by Eric Steven Raymond and Rick Moen, with edits for brevity and tone. If you have the time (and tolerance), I strongly recommend reading that article over this one. Let's start with the procedure.
- Try to find an answer by searching the archives of the issue-tracker, IRC, matrix-room, discord, forum or mailing list you plan to post to.
- Try to find an answer by searching the Web.
- Try to find an answer by reading the manual.
- Try to find an answer by reading a FAQ.
- Try to find an answer by inspection or experimentation.
-- Made with 'mini.colors' module of https://github.com/echasnovski/mini.nvim | |
if vim.g.colors_name ~= nil then vim.cmd('highlight clear') end | |
vim.g.colors_name = "average_dark" | |
-- Highlight groups | |
local hi = vim.api.nvim_set_hl | |
hi(0, "@constant.builtin", { ctermfg = 146, fg = "#8ebbd3" }) | |
hi(0, "@constructor", { ctermfg = 110, fg = "#7fbce4" }) |
-- Made with 'mini.colors' module of https://github.com/echasnovski/mini.nvim | |
if vim.g.colors_name ~= nil then vim.cmd('highlight clear') end | |
vim.g.colors_name = "average_dark" | |
-- Highlight groups | |
local hi = vim.api.nvim_set_hl | |
hi(0, "@constant.builtin", { ctermfg = 146, fg = "#8ebbd3" }) | |
hi(0, "@constructor", { ctermfg = 110, fg = "#7fbce4" }) |
Our goal, here, is threefold:
- use Vim's built-in features to their fullest,
- be a good project citizen even if we don't use $EDITOR_DU_JOUR,
- have a minimal but beneficial impact on the infrastructure of the project we work on.
Searching can be an efficient way to navigate the current buffer.
The first search commands we learn are usually /
and ?
. These are seriously cool, especially with the incsearch
option enabled which lets us keep typing to refine our search pattern. /
and ?
really shine when all we want is to jump to something we already have our eyeballs on but they are not fit for every situation:
- when we want to search something that's not directly there, those two commands can make us lose context very quickly,
- when we need to compare the matches.
-
Ctrl + F keys and a lot of other key combinations are hooked by MacOs. You're mostly don't use them, so just turn everything off in System Preferences -> Keyboard -> Shortcuts. If you have another software that handles your key combinations, like Keyboard Maestro, you should turn these actions/macros off, otherwise you won't get right hex sequence.
-
Enter command below in default MacOs Terminal. (Warning!: shortcuts can also be hooked by terminal emulators, like iTerm. To avoid it use default MacOs terminal. If you are on alacritty, you can enter
alacritty --print-events
and use poped up terminal).
xxd -psg
then type your key combination and hit enter. (Warning!: if you don't see any output for your combination, then read step 1 again)
#!/bin/sh | |
usage() { | |
cat <<\EOF | |
usage: git jump <mode> [<args>] | |
Jump to interesting elements in an editor. | |
The <mode> parameter is one of: | |
diff: elements are diff hunks. Arguments are given to diff. |
# Reconstructed via infocmp from file: /usr/share/terminfo/t/tmux-256color | |
tmux-256color|tmux with 256 colors, | |
OTbs, OTpt, am, hs, km, mir, msgr, xenl, AX, G0, | |
colors#256, cols#80, it#8, lines#24, pairs#32767, U8#1, | |
acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, | |
bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, | |
clear=\E[H\E[J, cnorm=\E[34h\E[?25h, cr=^M, | |
csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, | |
cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, | |
cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\EM, |