From 8ad8a313ec62de2843a1cd11f669d5b74a6f3c06 Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Fri, 28 Jun 2024 11:43:45 +0200 Subject: [PATCH] Update config. Add lazygit to neovim. Add Broot support. --- .chezmoiignore | 3 ++- dot_config/kitty/kitty.conf.tmpl | 4 ++-- dot_config/nvim/lua/plugins/format.lua | 9 ++++++++- dot_config/nvim/lua/plugins/git.lua | 19 +++++++++++++++++++ dot_config/nvim/lua/plugins/lsp.lua | 3 +++ dot_tmux.conf.tmpl | 3 ++- dot_zshrc.tmpl | 2 ++ 7 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 dot_config/nvim/lua/plugins/git.lua diff --git a/.chezmoiignore b/.chezmoiignore index 18c230a..ba8febb 100644 --- a/.chezmoiignore +++ b/.chezmoiignore @@ -4,7 +4,7 @@ LICENSE .msmtprc .mbsyncrc .irssi/* -{{ if eq .chezmoi.os "darwin" }} +{{ if ne .chezmoi.os "openbsd" }} .muttrc .mutt/* .Xresources @@ -13,6 +13,7 @@ LICENSE .config/nvim/after .config/nvim/lua/plugins/editor.lua .config/nvim/lua/plugins/lsp.lua +.config/nvim/lua/plugins/git.lua .config/nvim/lua/plugins/treesitter.lua .config/nvim/lua/plugins/format.lua .config/nvim/lua/plugins/telescope.lua diff --git a/dot_config/kitty/kitty.conf.tmpl b/dot_config/kitty/kitty.conf.tmpl index a22aba4..ea42be6 100644 --- a/dot_config/kitty/kitty.conf.tmpl +++ b/dot_config/kitty/kitty.conf.tmpl @@ -201,7 +201,7 @@ tab_bar_style separator tab_separator " ┇" -# shell . +shell /usr/local/bin/fish #: The shell program to execute. The default value of . means to use #: whatever shell is set as the default shell for the current user. @@ -209,7 +209,7 @@ tab_separator " ┇" #: --login to ensure that the shell starts in interactive mode and #: reads its startup rc files. -# editor . +editor nvim #: The console editor to use when editing the kitty config file or #: similar tasks. A value of . means to use the environment variable diff --git a/dot_config/nvim/lua/plugins/format.lua b/dot_config/nvim/lua/plugins/format.lua index 5f14a59..5a5552c 100644 --- a/dot_config/nvim/lua/plugins/format.lua +++ b/dot_config/nvim/lua/plugins/format.lua @@ -18,12 +18,19 @@ return { -- Define your formatters formatters_by_ft = { lua = { "stylua" }, + fish = { "fish_indent" }, perl = { "perltidy" }, python = { "isort", "black" }, javascript = { { "prettierd", "prettier" } }, + sh = { "shfmt" }, }, -- Set up format-on-save - format_on_save = { timeout_ms = 1000, lsp_fallback = true }, + format_on_save = { + timeout_ms = 3000, + async = false, + quit = false, + lsp_fallback = true + }, -- Customize formatters formatters = { shfmt = { diff --git a/dot_config/nvim/lua/plugins/git.lua b/dot_config/nvim/lua/plugins/git.lua new file mode 100644 index 0000000..156990b --- /dev/null +++ b/dot_config/nvim/lua/plugins/git.lua @@ -0,0 +1,19 @@ +return { + "kdheepak/lazygit.nvim", + cmd = { + "LazyGit", + "LazyGitConfig", + "LazyGitCurrentFile", + "LazyGitFilter", + "LazyGitFilterCurrentFile", + }, + -- optional for floating window border decoration + dependencies = { + "nvim-lua/plenary.nvim", + }, + -- setting the keybinding for LazyGit with 'keys' is recommended in + -- order to load the plugin when the command is run for the first time + keys = { + { "gg", "LazyGit", desc = "LazyGit" } + } +} diff --git a/dot_config/nvim/lua/plugins/lsp.lua b/dot_config/nvim/lua/plugins/lsp.lua index b28e910..6a3be8c 100644 --- a/dot_config/nvim/lua/plugins/lsp.lua +++ b/dot_config/nvim/lua/plugins/lsp.lua @@ -29,6 +29,9 @@ return { inlay_hints = { enabled = false, }, + document_highlight = { + enabled = true, + }, }, config = function(_, opts) local lsp = require('lspconfig') diff --git a/dot_tmux.conf.tmpl b/dot_tmux.conf.tmpl index f16c939..bac8974 100644 --- a/dot_tmux.conf.tmpl +++ b/dot_tmux.conf.tmpl @@ -70,6 +70,7 @@ set -g @catppuccin_window_current_color "#5E81AC" set -g @catppuccin_status_background "#434C5E" set -g @catppuccin_host_text "#{host_short}" +set -g @catppuccin_battery_text "#{battery_color_fg}#{battery_percentage}%%#[default]" set -g @catppuccin_host_icon " " set -g @catppuccin_user_icon " " set -g @catppuccin_date_time_text "%H:%M" @@ -78,13 +79,13 @@ set -g @catppuccin_battery_icon "󰂎" set -g @catppuccin_session_icon " " # List of plugins +set -g @plugin 'catppuccin/tmux' set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-battery' set -g @plugin 'tmux-plugins/tmux-yank' set -g @plugin 'tmux-plugins/tmux-pain-control' set -g @plugin 'tmux-plugins/tmux-logging' set -g @plugin 'tmux-plugins/tmux-resurrect' -set -g @plugin 'catppuccin/tmux' # Initialize TMUX plugin manager run -b '~/.tmux/plugins/tpm/tpm' diff --git a/dot_zshrc.tmpl b/dot_zshrc.tmpl index 81847ce..8521caa 100644 --- a/dot_zshrc.tmpl +++ b/dot_zshrc.tmpl @@ -74,3 +74,5 @@ export PATH=/opt/homebrew/bin:$PATH {{- end }} {{- end }} eval "$(atuin init zsh)" + +source $HOME/.config/broot/launcher/bash/br