# This is a combination of 4 commits.
# This is the 1st commit message: nvim: Restructure lua dir Moved plugins into individual component module files which are automatically required by lazy.nvim. Should make everything a tiny bit more modular, or at least prepare the way for true modularity if I ever have the time on my hands to ensure everything works with missing modules. Moved core settings into their own directory (`core`), and created a `personal` folder which contains functions/plugins I wrote that do not necessarily have to be their own imported plugin yet. Finally, extended the utility functions a little, so we can detect if a plugin exists and change e.g. key maps based on that (once again, extending modularity a little more). Some simple attempts have been made at that in the `mappings.lua` file, though it is nowhere near extensive yet - most keymaps are still set regardless of plugin availability. However, with this slimmer base to work off of, I feel more confident in changing future things about this setup a little more ad-hoc without having as many ripple repercussions as before. # This is the commit message #2: Update settings file with 0.9 options # This is the commit message #3: Move lazy.nvim setup into core module # This is the commit message #4: Rename maps.lua to mappings.lua
This commit is contained in:
parent
5f93ecba7c
commit
f343b1a76d
7 changed files with 74 additions and 29 deletions
37
nvim/.config/nvim/lua/core/autocmds.lua
Normal file
37
nvim/.config/nvim/lua/core/autocmds.lua
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
-- Highlight whatever is being yanked
|
||||
vim.api.nvim_create_autocmd({ "TextYankPost" }, {
|
||||
command = 'silent! lua require"vim.highlight".on_yank{timeout=500}',
|
||||
desc = "Highlight yanked text whenevery yanking something",
|
||||
group = vim.api.nvim_create_augroup("highlightyanks", { clear = true }),
|
||||
})
|
||||
|
||||
-- Special setting for editing gopass files - make sure nothing leaks outside the directories it is supposed to
|
||||
vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
|
||||
pattern = {
|
||||
"/dev/shm/gopass.*",
|
||||
"/dev/shm/pass.?*/?*.txt",
|
||||
"$TMPDIR/pass.?*/?*.txt",
|
||||
"/tmp/pass.?*/?*.txt",
|
||||
},
|
||||
command = "setlocal noswapfile nobackup noundofile nowritebackup viminfo=",
|
||||
desc = "Don't leak any information when editing potential password files",
|
||||
group = vim.api.nvim_create_augroup("passnoleak", { clear = true }),
|
||||
})
|
||||
|
||||
-- fixing neovim opening up at same moment as alacritty (see https://github.com/neovim/neovim/issues/11330)
|
||||
vim.api.nvim_create_autocmd({ "VimEnter" }, {
|
||||
callback = function()
|
||||
local pid, WINCH = vim.fn.getpid(), vim.loop.constants.SIGWINCH
|
||||
vim.defer_fn(function()
|
||||
vim.loop.kill(pid, WINCH)
|
||||
end, 20)
|
||||
end,
|
||||
desc = "Fix neovim sizing issues if opening same time as alacritty",
|
||||
group = vim.api.nvim_create_augroup("alacritty_fixsize", { clear = true }),
|
||||
})
|
||||
|
||||
-- remove line numbers from terminal buffers
|
||||
vim.api.nvim_create_autocmd({ "TermOpen" }, {
|
||||
pattern = "*",
|
||||
command = "setlocal nonumber norelativenumber",
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue