sxwpb

joined 2 years ago
[–] sxwpb@lemmy.world 2 points 1 year ago* (last edited 1 year ago) (1 children)

what about using exrc (with like a .nvim.lua file inside the repos) with the content of

dofile(“../init.lua”)
-- maybe more repo specific config here

and then say ~/work-clientA/init.lua with all client specific changes there.

this would still require creating two separate files but the client setup will be the same for all client repos, and additionally you can add repo specific changes.

[–] sxwpb@lemmy.world 6 points 1 year ago (1 children)

Nice, many people have a nvidia graphics pc. This seems very helpful for all non technical users.

2
submitted 1 year ago* (last edited 1 year ago) by sxwpb@lemmy.world to c/neovim@programming.dev
 

Hello, I wanted to share a small keymap I made. It lets you inspect unsaved changes in the current file. It uses diff mode, in a vertical split.

To close the diff mode, just press q in the scratch buffer.

vim.keymap.set(
	'n',
	'<M-C-D>',
	function()
		local tmpft = vim.bo.filetype
		vim.cmd.vnew()
		vim.bo.filetype = tmpft
		vim.bo.buftype = 'nofile'
		vim.keymap.set(
			'n',
			'q',
			'<cmd>bw<cr>',
			{ noremap = true, silent = true, buffer = true }
		)
		vim.cmd('silent r#|0d_')
		vim.bo.modifiable = false
		vim.cmd('diffthis|wincmd p|diffthis')
	end,
	{ noremap = true }
)

edit: I discovered that this functionality is actually documented in the help pages (:h :DiffOrig). It’s basically the same action but bound to a command