From 22ec07aede4a80e628390d1d09ccba6c37069786 Mon Sep 17 00:00:00 2001 From: jakobst1n Date: Wed, 13 Mar 2024 18:25:26 +0100 Subject: Tweaks --- Common/bashrc.m4 | 2 ++ Common/helix/config.toml | 15 +++++++++++++ Common/nvim/lua/lsp-conf.lua | 2 +- Makefile.m4 | 8 +++++++ configure | 11 +++++----- linux/tmux.conf.m4 | 50 +++++++++++++++++++++----------------------- 6 files changed, 56 insertions(+), 32 deletions(-) create mode 100644 Common/helix/config.toml diff --git a/Common/bashrc.m4 b/Common/bashrc.m4 index 54e287b..524bf83 100644 --- a/Common/bashrc.m4 +++ b/Common/bashrc.m4 @@ -144,4 +144,6 @@ source "$SSH_DIR/ssh-agent.env" > /dev/null # Enable FZF history [ -f ~/.fzf.bash ] && source ~/.fzf.bash +m4_ifelse(DT_DISTRO, `fedora', m4_dnl source /usr/share/fzf/shell/key-bindings.bash +)m4_dnl diff --git a/Common/helix/config.toml b/Common/helix/config.toml new file mode 100644 index 0000000..ea5006f --- /dev/null +++ b/Common/helix/config.toml @@ -0,0 +1,15 @@ +theme = "everforest_light" + +[editor] +mouse = true +gutters = ["diff"] +auto-completion = true +auto-format = false + +[editor.cursor-shape] +insert = "bar" +normal = "block" +select = "underline" + +[editor.file-picker] +hidden = false diff --git a/Common/nvim/lua/lsp-conf.lua b/Common/nvim/lua/lsp-conf.lua index 83daed3..7709c83 100644 --- a/Common/nvim/lua/lsp-conf.lua +++ b/Common/nvim/lua/lsp-conf.lua @@ -40,7 +40,7 @@ vim.diagnostic.config({ virtual_text = false, signs = true, update_in_insert = true, - underline = true, + underline = false, severity_sort = false, float = { border = 'rounded', diff --git a/Makefile.m4 b/Makefile.m4 index 171cef5..26b3a3d 100644 --- a/Makefile.m4 +++ b/Makefile.m4 @@ -56,6 +56,9 @@ $(M4_SYSFILE): $(CONFIG_FILE) echo "`m4_define'(\``$$key'', \``$$value'')`m4_dnl'" >> $(M4_SYSFILE); \ done < $(CONFIG_FILE) +Makefile: Makefile.m4 $(M4_SYSFILE) + $(call M4_EXEC) + m4_ifelse(DT_OTHER_SYMLINKS, `yes', `m4_dnl $(HOME_DIR)/.vimrc: Common/vimrc $(call create_dotfile_symlink,Common/vimrc,.vimrc) @@ -159,6 +162,11 @@ m4_ifelse(DT_NEOVIM, `yes', `m4_dnl $(HOME_DIR)/.config/nvim/: /usr/local/bin/nvim $(call create_symlink,$(SRC_DIR)/Common/nvim,$(HOME_DIR)/.config/nvim) +')m4_dnl +m4_ifelse(DT_HELIX, `yes', `m4_dnl +$(HOME_DIR)/.config/helix: Common/helix + $(call create_dotfile_symlink,Common/helix,.config/helix) + ')m4_dnl # General package manager stuff diff --git a/configure b/configure index 4a2d17e..9e13757 100755 --- a/configure +++ b/configure @@ -4,11 +4,8 @@ set -uo pipefail CONFIG_FILE="config" function generate_makefile { - rm Makefile m4 -P Makefile.m4 > Makefile - rm system.m4 - make system.m4 - echo 'm4_include(`system.m4'"'"')m4_dnl' | cat - Makefile.m4 | m4 -P > Makefile + make Makefile } if [ -f "${CONFIG_FILE}" ]; then @@ -48,6 +45,7 @@ fi : "${DT_BASH:=yes}" : "${DT_HOMEBIN:=no}" : "${DT_TMUX:=yes}" +: "${DT_HELIX:=no}" radiolist_on() { local value="$1" @@ -167,7 +165,8 @@ FEATURES="$(dialog --stdout \ 10 "QTile" $(checklist_on "${DT_QTILE}") \ 11 "Bash" $(checklist_on "${DT_BASH}") \ 12 "home folder bin dir" $(checklist_on "${DT_HOMEBIN}") \ - 13 "tmux" $(checklist_on "${DT_NEOVIM}"))" + 13 "tmux" $(checklist_on "${DT_NEOVIM}") \ + 14 "Helix" $(checklist_on "${DT_HELIX}"))" if [ "$?" -eq 1 ]; then exit 0; fi DT_TOOLS=no @@ -183,6 +182,7 @@ DT_QTILE=no DT_BASH=no DT_HOMEBIN=no DT_TMUX=no +DT_HELIX=no for choice in ${FEATURES}; do case $choice in @@ -199,6 +199,7 @@ for choice in ${FEATURES}; do 11) DT_BASH=yes;; 12) DT_HOMEBIN=yes;; 13) DT_TMUX=yes;; + 14) DT_HELIX=yes;; esac done diff --git a/linux/tmux.conf.m4 b/linux/tmux.conf.m4 index ae6ca78..40c05ea 100644 --- a/linux/tmux.conf.m4 +++ b/linux/tmux.conf.m4 @@ -1,13 +1,10 @@ # -- general ------------------------------------------------------------------- -#set -g default-terminal "screen-256color" -#set -g default-terminal "screen-256color-bce" +# Options are 'screen-256color', 'screen-256color-bce' set -g default-terminal "xterm-256color" - -#set -as terminal-overrides ",*:U8=0" -#set-option -sa terminal-overrides ',xterm-256color:RGB' +# Options are ',*:U8=0', ',xterm-256color:Tc', 'xterm-256color:RGB' set-option -ga terminal-overrides ",xterm-256color:Tc" -set -s escape-time 0 # faster command sequences +set -s escape-time 0 # faster command sequences set -s focus-events on # -- display ------------------------------------------------------------------- @@ -53,10 +50,7 @@ set -g visual-bell on set -g bell-action any # Scroll in shell -#set -g terminal-overrides 'xterm*:smcup@:rmcup@' -#set -wg xterm-keys 1 set -g mouse on -#set-option -s set-clipboard off # Sync panes bind-key = set-window-option synchronize-panes @@ -64,27 +58,31 @@ bind-key = set-window-option synchronize-panes # -- macros -------------------------------------------------------------------- bind-key s send-keys "DT_GIT_USER " +m4_changequote({, })m4_dnl +m4_ifelse(DT_TMUX_NAVIGATOR, `yes', { # -- vim-tmux-navigator -------------------------------------------------------- # Smart pane switching with awareness of Vim splits. # this doesn't work, haven't checked why. chaning from vim to neovim could be it # See: https://github.com/christoomey/vim-tmux-navigator -# is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ -# | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" -# bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' -# bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' -# bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' -# bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R' -# tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")' -# if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \ -# "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'" -# if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \ -# "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'" -# -# bind-key -T copy-mode-vi 'C-h' select-pane -L -# bind-key -T copy-mode-vi 'C-j' select-pane -D -# bind-key -T copy-mode-vi 'C-k' select-pane -U -# bind-key -T copy-mode-vi 'C-l' select-pane -R -# bind-key -T copy-mode-vi 'C-\' select-pane -l +is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" +bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' +bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' +bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' +bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R' +tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")' +if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \ + "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'" +if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \ + "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'" + +bind-key -T copy-mode-vi 'C-h' select-pane -L +bind-key -T copy-mode-vi 'C-j' select-pane -D +bind-key -T copy-mode-vi 'C-k' select-pane -U +bind-key -T copy-mode-vi 'C-l' select-pane -R +bind-key -T copy-mode-vi 'C-\' select-pane -l +})m4_dnl +m4_changequote(`, ')m4_dnl # -- Utility ------------------------------------------------------------------ bind-key r source-file ~/.tmux.conf -- cgit v1.2.3