Ihar Hancharenka d1bbe8417f m
2024-05-03 10:39:45 +03:00

73 строки
2.1 KiB
Plaintext

https://nvchad.com/docs/features/
~/.local/share/nvim/
cloned
https://github.com/NvChad/NvChad
~/.config/nvim/
lua/
plugins
??? put extra stuff here ???
https://github.com/NvChad/NvChad/blob/v2.5/lua/nvconfig.lua
init.lua
configs
conform.lua
lazy.lua
lspconfig.lua
chadrc.lua
mappings.lua
options.lua
~/.config/nvim/lua/custom/
https://github.com/search?q=language%3Alua+config.lua&type=repositories
samples
https://github.com/creativenull/dotfiles/blob/main/config/nvim/init.lua
https://github.com/creativenull/dotfiles/blob/main/config/nvim/init.lua#L70
last position restore
-- ---
-- When editing a file, always jump to the last known cursor position.
-- Don't do it when the position is invalid, when inside an event handler
-- (happens when dropping a file on gvim) and for a commit message (it's
-- likely a different one than last time).
vim.api.nvim_create_autocmd('BufReadPost', {
-- !!! -- group = vim.g.user.event,
callback = function(args)
local valid_line = vim.fn.line([['"]]) >= 1 and vim.fn.line([['"]]) < vim.fn.line('$')
local not_commit = vim.b[args.buf].filetype ~= 'commit'
if valid_line and not_commit then
vim.cmd([[normal! g`"]])
end
end,
})
at my rhino:
~/.config/nvim/lua/custom/init.lua
-- local autocmd = vim.api.nvim_create_autocmd
-- Auto resize panes when resizing nvim window
-- autocmd("VimResized", {
-- pattern = "*",
-- command = "tabdo wincmd =",
-- })
-- ---
-- When editing a file, always jump to the last known cursor position.
-- Don't do it when the position is invalid, when inside an event handler
-- (happens when dropping a file on gvim) and for a commit message (it's
-- likely a different one than last time).
vim.api.nvim_create_autocmd('BufReadPost', {
-- group = vim.g.user.event,
callback = function(args)
local valid_line = vim.fn.line([['"]]) >= 1 and vim.fn.line([['"]]) < vim.fn.line('$')
local not_commit = vim.b[args.buf].filetype ~= 'commit'
if valid_line and not_commit then
vim.cmd([[normal! g`"]])
end
end,
})