Этот коммит содержится в:
Ihar Hancharenka 2024-02-01 12:26:11 +03:00
родитель 9233873ec1
Коммит 58d9c16cb4

18
os/editors/neovim/dist/nvchad/cfg.txt поставляемый
Просмотреть файл

@ -6,3 +6,21 @@ https://github.com/NvChad/NvChad/issues/1868
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,
})