Common use cases and keymaps for this config. Layout and conventions live in STRUCTURE.md.
map <C-Fx> is equal to map <Fy> where y = x + 24.
map <S-Fx> is equal to map <Fy> where y = x + 12.
| key | action |
|---|---|
<leader>;; |
open the dashboard |
<leader>;c / <leader>;C |
:lcd / :cd to the current file's dir |
<leader>;l / ;m / ;I / ;x |
Lazy / Mason / LspInfo / LazyExtras |
<leader>;t / <leader>;T |
terminal (current file dir / project root) |
<leader>;b |
btop in a floating terminal (if installed) |
<leader>;p |
copy the current file path to the + register |
<leader>;P |
add the current project to the picker list |
<leader>;L |
LazyVim changelog |
| key | action |
|---|---|
<leader>ft / <leader>fT |
terminal (project root / current file dir) |
<leader>fD |
search dotfiles |
<leader>b. |
delete all empty buffers |
<leader>c/ |
insert a :set ts/sw snippet as a comment |
<C-s> |
write file |
| key | action |
|---|---|
<C-h/j/k/l> |
move to left / lower / upper / right window |
<C-Arrows> |
resize window |
<leader>ws / wv / wc / wo |
split below / right, close, close others |
<leader><tab>] / [ / d / o |
next / previous / close / close other tabs |
- macros play through a
noautocmdwrapper, so autocmds don't fire while playing (seeconfig/keymaps/init.lua). - disable auto-pairs while recording manually - macros don't toggle it; use
<C-v>where you'd otherwise fight the pairs.
https://git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git
https://neovim.io/doc/user/dev_tools.html#dev-tools-backtrace
misc/troubleshooting/minimal.lua boots lazy.nvim with its own NVIM_APP_NAME
and data dir - good for bisecting plugin issues.
In order to re-config lspconfig, first set vim.o.exrc = true,
then new a .nvim.lua file in project root (see misc/clangd/.nvim.lua).
require("lspconfig").clangd.setup({
cmd = {
"clangd",
"--background-index",
"--clang-tidy",
"--header-insertion=iwyu",
"--completion-style=detailed",
"--function-arg-placeholders",
"--fallback-style=llvm",
"--query-driver=/usr/bin/c++",
},
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
})The POSIX standard supports the following classes or categories of characters (note that classes must be defined within brackets):
| POSIX class | Equivalent to | Matches |
|---|---|---|
[:alnum:] |
[A-Za-z0-9] |
digits, uppercase and lowercase letters |
[:alpha:] |
[A-Za-z] |
upper- and lowercase letters |
[:ascii:] |
[\x00-\x7F] |
ASCII characters |
[:blank:] |
[ \t] |
space and TAB characters only |
[:cntrl:] |
[\x00-\x1F\x7F] |
Control characters |
[:digit:] |
[0-9] |
digits |
[:graph:] |
[^[:cntrl:]] |
graphic characters (all characters which have graphic representation) |
[:lower:] |
[a-z] |
lowercase letters |
[:print:] |
[[:graph:]] |
graphic characters and space |
[:punct:] |
[-!"#$%&'()*+,./:;<=>?@[]^_`{|}~] |
all punctuation characters (all graphic characters except letters and digits) |
[:space:] |
[ \t\n\r\f\v] |
all blank (whitespace) characters, including spaces, tabs, new lines, carriage returns, form feeds, and vertical tabs |
[:upper:] |
[A-Z] |
uppercase letters |
[:word:] |
[A-Za-z0-9_] |
word characters |
[:xdigit:] |
[0-9A-Fa-f] |
hexadecimal digits |
a[[:digit:]]bmatchesa0b,a1b, ...,a9b.a[:digit:]bis invalid, character classes must be enclosed in brackets[[:digit:]abc]matches any digit, as well asa,b, andc.[abc[:digit:]]is the same as the previous, matching any digit, as well asa,b, andc[^ABZ[:lower:]]matches any character except lowercase letters,A,B, andZ.
:vim pattern % | copen:g/pattern/d " matched
:g!/pattern/d " unmatched- put
config.ymlto~/AppData/Roaming/lazygit/config.yml.
git fetch --unshallow# remove all leading # in lua files
find -name "*.lua" -exec sh -c "echo -n {}'>>>>>>\n'; sed -i 's/#region/region/' {}; sed -i 's/#endregion/endregion/' {}" \;Use module = false and then :Lazy load <plugin> after startup.
return {
{
-- may take long time due to network issues
'pwntester/octo.nvim',
-- event = "VeryLazy", -- don't use event if use module
module = false, -- NOTE: do not automatically load it
init = function()
-- will be overwritten by setup later
vim.api.nvim_create_user_command('Octo', function()
vim.cmd[[Lazy load octo.nvim]]
LazyVim.info(":Lazy load octo.nvim")
end, { desc = ":Lazy load octo.nvim" })
end,
cmd = { "Octo" },
config = function() require("octo").setup({}) end,
},
}Tip
When using gO to open toc, press o instead of enter
https://github.com/kevinhwang91/nvim-bqf/tree/main?tab=readme-ov-file#function-table