Nvim: Update all plugins

This commit is contained in:
Robert Kmieć
2025-04-23 01:37:19 +02:00
parent 43e7fb01f5
commit c665c5ba37
16 changed files with 268 additions and 162 deletions

View File

@@ -0,0 +1,29 @@
local api = vim.api
local autocmd = api.nvim_create_autocmd
local augroup = api.nvim_create_augroup
local opt = vim.opt
local o = vim.o
local g = vim.g
local fn = vim.fn
autocmd("BufWritePre", {
desc = "Autocreate a dir when saving a file",
group = augroup("auto_create_dir", { clear = true }),
callback = function(event)
if event.match:match("^%w%w+:[\\/][\\/]") then
return
end
local file = vim.uv.fs_realpath(event.match) or event.match
fn.mkdir(fn.fnamemodify(file, ":p:h"), "p")
end,
})
autocmd("BufReadPost", {
desc = "Auto jump to last position",
group = augroup("auto-last-position", { clear = true }),
callback = function(args)
local position = api.nvim_buf_get_mark(args.buf, [["]])
local winid = fn.bufwinid(args.buf)
pcall(api.nvim_win_set_cursor, winid, position)
end,
})

View File

@@ -15,7 +15,7 @@ vim.opt.undofile = true
vim.opt.conceallevel = 1
vim.opt.shell = '/bin/bash'
--vim.opt.shell = '/bin/bash'
vim.opt.number = true
--vim.o.relativenumber = 1
@@ -33,7 +33,7 @@ vim.opt.splitright = true
-- gui settings
vim.opt.guifont="IBM Plex Mono Text:h9:e-subpixelantyalias"
vim.g.neovide_cursor_vfx_mode = 'pixiedust'
vim.g.neovide_refresh_rate = 120
vim.g.neovide_refresh_rate = 165
vim.g.neovide_refresh_rate_idle = 5
vim.g.neovide_remember_window_size = 0
@@ -107,32 +107,4 @@ vim.opt.wildignore = [[
*/tmp/*,*.so,*.swp,*.zip,**/node_modules/**,**/target/**,**.terraform/**"
]]
-- Only setup gnvim when it attaches.
vim.api.nvim_create_autocmd({'UIEnter'}, {
callback = function(event)
local chanid = vim.v.event['chan']
local chan = vim.api.nvim_get_chan_info(chanid)
if chan.client and chan.client.name ~= 'gnvim' then
return
end
-- Gnvim brings its own runtime files.
local gnvim = require('gnvim')
-- Set the font
vim.opt.guifont = 'iM WritingMonoS Nerd Font'
-- Increase/decrease font.
vim.keymap.set('n', '<c-+>', function() gnvim.font_size(1) end)
vim.keymap.set('n', '<c-->', function() gnvim.font_size(-1) end)
gnvim.setup({
cursor = {
blink_transition = 300
}
})
end
})
vim.g.loaded_perl_provider = 0

View File

@@ -11,7 +11,7 @@ map('t', '<ESC><ESC>', '<C-\\><C-n>', default_options)
map('i', 'jj', '<ESC>', default_options)
map('i', 'jk', '<ESC>', default_options)
--map('i', ':w<CR>', '<Esc>:w<CR>', default_options)
map('n', 'Q', '<cmd>q', default_options)
map('n', 'Q', ':q', default_options)
-- Reselect visual block after incrementing/decrementing
map('v', '<c-a>', '<c-a>gv', default_options)