summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBotond Hende <contact@wazul.moe>2026-04-03 21:26:57 +0200
committerBotond Hende <contact@wazul.moe>2026-04-03 21:26:57 +0200
commit8ae45351a21097dc339db76051da8cf76e797f6d (patch)
tree1a1b50f9d32f3fc25a3ef80be0979603a33f72cb
parentdd3f491a90df5349afcba7388ad356f0fbbf3cd5 (diff)
removed autodecrypt gpg files from nvim init.lua
-rw-r--r--home/.config/nvim/init.lua50
1 files changed, 0 insertions, 50 deletions
diff --git a/home/.config/nvim/init.lua b/home/.config/nvim/init.lua
index d3ca6dc..7b434d8 100644
--- a/home/.config/nvim/init.lua
+++ b/home/.config/nvim/init.lua
@@ -17,53 +17,3 @@ end
vim.keymap.set('', '<M-Up>', ':move-2<CR>', { silent = true })
vim.keymap.set('', '<M-Down>', ':move+1<CR>', { silent = true })
vim.keymap.set('t', '<Esc>', '<C-\\><C-n>', { silent = true })
-
---auto decrypt/encrypt with gpg
-
-local gpgGroup = vim.api.nvim_create_augroup('customGpg', { clear = true })
-
--- autocmds execute in the order in which they were defined.
--- https://neovim.io/doc/user/autocmd.html#autocmd-define
-
-vim.api.nvim_create_autocmd({ 'BufReadPre', 'FileReadPre' }, {
- pattern = '*.gpg',
- group = gpgGroup,
- callback = function ()
- -- Make sure nothing is written to shada file while editing an encrypted file.
- vim.opt_local.shada = nil
- -- We don't want a swap file, as it writes unencrypted data to disk
- vim.opt_local.swapfile = false
- -- Switch to binary mode to read the encrypted file
- vim.opt_local.bin = true
-
- vim.cmd("let ch_save = &ch|set ch=2")
- end
-})
-
-vim.api.nvim_create_autocmd({ 'BufReadPost', 'FileReadPost' }, {
- pattern = '*.gpg',
- group = gpgGroup,
- callback = function ()
- vim.cmd("'[,']!gpg --decrypt 2> /dev/null")
-
- -- Switch to normal mode for editing
- vim.opt_local.bin = false
-
- vim.cmd('let &ch = ch_save|unlet ch_save')
- vim.cmd(":doautocmd BufReadPost " .. vim.fn.expand("%:r"))
- end
-})
-
--- Convert all text to encrypted text before writing
-vim.api.nvim_create_autocmd({ 'BufWritePre', 'FileWritePre' }, {
- pattern = '*.gpg',
- group = gpgGroup,
- command = "'[,']!gpg --default-recipient-self -ae 2>/dev/null",
-})
--- Undo the encryption so we are back in the normal text, directly
--- after the file has been written.
-vim.api.nvim_create_autocmd({ 'BufWritePost', 'FileWritePost' }, {
- pattern = '*.gpg',
- group = gpgGroup,
- command = 'u'
-})