feat(nvim+tmux): fetch and reload config

This commit is contained in:
thek4n 2024-04-12 08:50:16 +03:00
parent 622e6b478e
commit 74270c1516
3 changed files with 19 additions and 1 deletions

View File

@ -29,7 +29,7 @@ multiplier = 3
[window] [window]
dynamic_title = true dynamic_title = true
opacity = 0.87 opacity = 0.8
[window.dimensions] [window.dimensions]
columns = 150 columns = 150

View File

@ -140,6 +140,23 @@ map("n", "<Leader>pm", "<cmd>Mason<CR>",
{desc = "LSP Manager"}) {desc = "LSP Manager"})
local function reload_config()
vim.cmd.source('~/.config/nvim/init.lua')
vim.notify('Config reloaded...', vim.log.levels.INFO)
end
local function fetch_and_reload_config()
vim.fn.system('git -C ~/dotfiles pull')
reload_config()
end
map("n", "<Leader>pr", reload_config,
{desc = "Reload config"})
map("n", "<Leader>pR", fetch_and_reload_config,
{desc = "Fetch and reload config"})
vim.cmd( vim.cmd(
[[ [[
menu Encoding.koi8-r :e ++enc=koi8-r ++ff=unix<CR> menu Encoding.koi8-r :e ++enc=koi8-r ++ff=unix<CR>

View File

@ -50,6 +50,7 @@ bind l confirm-before -p "lock tmux? (y/n)" lock-session
# Reload config # Reload config
bind r source-file ~/.config/tmux/tmux.conf \; display-message "Config reloaded..." bind r source-file ~/.config/tmux/tmux.conf \; display-message "Config reloaded..."
bind R if-shell "git -C ~/dotfiles pull" "source-file '$HOME/.config/tmux/tmux.conf' \; display-message 'Config reloaded...'" "display-message 'Error while fetching config'"
# Panes navigation # Panes navigation