From 92fe04a180e3cfca16c3ef4150a5a1eec879b665 Mon Sep 17 00:00:00 2001 From: stefan Date: Tue, 20 May 2025 15:17:01 -0400 Subject: (form) sync --- modules/foot.nix | 1 + modules/neovim/default.nix | 4 ++++ modules/neovim/nvim/lua/config/keybinds.lua | 8 +++++++ modules/neovim/nvim/lua/config/noice.lua | 14 +++++++++++ modules/neovim/nvim/lua/config/settings.lua | 5 ++-- modules/neovim/nvim/lua/config/tmux.lua | 5 ++++ modules/tmux/default.nix | 17 ++++++++++++- modules/zsh/themes/stefan.zsh-theme | 37 ++++++++++++++++------------- 8 files changed, 72 insertions(+), 19 deletions(-) create mode 100644 modules/neovim/nvim/lua/config/noice.lua create mode 100644 modules/neovim/nvim/lua/config/tmux.lua (limited to 'modules') diff --git a/modules/foot.nix b/modules/foot.nix index b909ee2..9927e7d 100644 --- a/modules/foot.nix +++ b/modules/foot.nix @@ -36,6 +36,7 @@ in }; colors = { + alpha=0.8; # foreground="cacaca"; # background="0f0f0f"; # regular0="0f0f0f"; diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix index 03b8831..807ab74 100644 --- a/modules/neovim/default.nix +++ b/modules/neovim/default.nix @@ -47,6 +47,7 @@ in (nvim-treesitter.withPlugins (p: with p; [ tree-sitter-nix tree-sitter-make + tree-sitter-cmake tree-sitter-verilog tree-sitter-scheme tree-sitter-llvm @@ -75,7 +76,10 @@ in plenary-nvim mini-icons oil-nvim + tmux-nvim + # noice-nvim nvim-lspconfig + # blink-cmp # tinted-vim base16-nvim telescope-nvim diff --git a/modules/neovim/nvim/lua/config/keybinds.lua b/modules/neovim/nvim/lua/config/keybinds.lua index 5481d37..551fc14 100644 --- a/modules/neovim/nvim/lua/config/keybinds.lua +++ b/modules/neovim/nvim/lua/config/keybinds.lua @@ -37,6 +37,14 @@ nmap('wm', '', { desc = "Focus window left of the current one" nmap('wn', '', { desc = "Focus window below the current one" }) nmap('we', '', { desc = "Focus window above the current one" }) nmap('wi', '', { desc = "Focus window right of the current one" }) +-- nmap('', '', { desc = "Focus window left of the current one" }) +-- nmap('', '', { desc = "Focus window below the current one" }) +-- nmap('', '', { desc = "Focus window above the current one" }) +-- nmap('', '', { desc = "Focus window right of the current one" }) +nmap('', function() require("tmux").move_left() end, { desc = "Focus window left of the current one" }) +nmap('', function() require("tmux").move_bottom() end, { desc = "Focus window below the current one" }) +nmap('', function() require("tmux").move_top() end, { desc = "Focus window above the current one" }) +nmap('', function() require("tmux").move_right() end, { desc = "Focus window right of the current one" }) -- nmap('fo', 'Telescope find_files', { silent = true }) nmap('fo', 'FzfLua files', { silent = true }) diff --git a/modules/neovim/nvim/lua/config/noice.lua b/modules/neovim/nvim/lua/config/noice.lua new file mode 100644 index 0000000..29f7a1d --- /dev/null +++ b/modules/neovim/nvim/lua/config/noice.lua @@ -0,0 +1,14 @@ +require("noice").setup({ + lsp = { + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + [ "vim.lsp.util.sylize_markdown" ] = true, + }, + + presets = { + command_palette = true, + log_message_to_split = true, + lsp_doc_border = true, + }, + }, +}) diff --git a/modules/neovim/nvim/lua/config/settings.lua b/modules/neovim/nvim/lua/config/settings.lua index 2ff8821..7baeefa 100644 --- a/modules/neovim/nvim/lua/config/settings.lua +++ b/modules/neovim/nvim/lua/config/settings.lua @@ -11,7 +11,7 @@ vim.o.scrolloff = 15 vim.o.sidescrolloff = 12 vim.o.wrap = false vim.o.lbr = true -vim.o.shortmess = vim.o.shortmess .. "I" +vim.o.shortmess = "tToOCFIsWcCi" vim.o.termguicolors = true vim.opt.fillchars = {eob = " "} vim.o.smd = false @@ -49,5 +49,6 @@ vim.opt.foldenable=true vim.cmd[[set wildchar=]] +vim.g.loaded_matchparen = 1 vim.cmd[[cnoreabbrev ts lua vim.treesitter.start()]] - +require('vim._extui').enable({}) diff --git a/modules/neovim/nvim/lua/config/tmux.lua b/modules/neovim/nvim/lua/config/tmux.lua new file mode 100644 index 0000000..8dbcff4 --- /dev/null +++ b/modules/neovim/nvim/lua/config/tmux.lua @@ -0,0 +1,5 @@ +require("tmux").setup({ + navigation = { + enable_default_keybindings = false, + }, +}) diff --git a/modules/tmux/default.nix b/modules/tmux/default.nix index b14563b..318e1db 100644 --- a/modules/tmux/default.nix +++ b/modules/tmux/default.nix @@ -38,6 +38,13 @@ in set -g @continuum-restore 'on' ''; } + # { + # plugin = vim.tmux-navigatior; + # extraConfig = '' + # set -g + # ''; + # } + ]; extraConfig = '' set -g default-terminal "screen-256color" @@ -78,10 +85,18 @@ in bind e select-pane -U bind i select-pane -R + is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?\.?(view|l?n?vim?x?|fzf)(diff)?(-wrapped)?$'" + + bind-key -n 'M-m' if-shell "$is_vim" 'send-keys M-m' 'select-pane -L' + bind-key -n 'M-n' if-shell "$is_vim" 'send-keys M-n' 'select-pane -D' + bind-key -n 'M-e' if-shell "$is_vim" 'send-keys M-e' 'select-pane -U' + bind-key -n 'M-i' if-shell "$is_vim" 'send-keys M-i' 'select-pane -R' + bind-key -T root m if -F "#{==:#{pane_mode},tree-mode}" "send h" "send m" bind-key -T root n if -F "#{==:#{pane_mode},tree-mode}" "send j" "send n" bind-key -T root e if -F "#{==:#{pane_mode},tree-mode}" "send k" "send e" - bind-key -T root i if -F "#{==:#{pane_mode},tree-mode}" "send l" "send i;" + bind-key -T root i if -F "#{==:#{pane_mode},tree-mode}" "send l" "send i" bind -T copy-mode-vi m send-keys -X cursor-left bind -T copy-mode-vi n send-keys -X cursor-down diff --git a/modules/zsh/themes/stefan.zsh-theme b/modules/zsh/themes/stefan.zsh-theme index dc9a201..4f1c643 100644 --- a/modules/zsh/themes/stefan.zsh-theme +++ b/modules/zsh/themes/stefan.zsh-theme @@ -10,10 +10,14 @@ function gitstatus_prompt_update() { [[ $VCS_STATUS_RESULT == 'ok-sync' ]] || return 0 # not in a repo - local green='%{%F{green}%}' - local red='%{%F{red}%}' - local yellow='%{%F{yellow}%}' - local blue='%{%F{blue}%}' + # local green='%{%F{green}%}' + # local red='%{%F{red}%}' + # local yellow='%{%F{yellow}%}' + # local blue='%{%F{blue}%}' + local green='' + local red='' + local yellow='' + local blue='' local name if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then @@ -59,21 +63,21 @@ INS_MODE='%{%F{reset}%}[%{%F{green}%}i%{%F{reset}%}]' NORMAL_MODE='%{%F{reset}%}[%{%F{yellow}%}n%{%F{reset}%}]' VI_MODE=$INS_MODE -function zle-keymap-select() { - VI_MODE="${${KEYMAP/vicmd/${NORMAL_MODE}}/(main|viins)/${INS_MODE}}" - zle reset-prompt -# zle -R -} - -zle -N zle-keymap-select # hook readline so we can determine mode +# function zle-keymap-select() { +# VI_MODE="${${KEYMAP/vicmd/${NORMAL_MODE}}/(main|viins)/${INS_MODE}}" +# zle reset-prompt +# # zle -R +# } +# +# zle -N zle-keymap-select # hook readline so we can determine mode # normally, SIGINT () will put you in ins, but indictator wont update. # fix: hook TRAPINT, update mode and repropagate the SIGINT # im too lazy to figure out if its possible to keep normal mode and send a sigint -TRAPINT() { - export VI_MODE=$INS_MODE - return $((128+$1)) -} +# TRAPINT() { +# export VI_MODE=$INS_MODE +# return $((128+$1)) +# } source "$(gitstatus-share)/gitstatus.plugin.zsh" || return @@ -86,7 +90,8 @@ setopt prompt_subst prompt_percent no_prompt_bang NEWLINE=$'\n' GIT_PROMPT_INFO=${GITSTATUS_PROMPT:+ $GITSTATUS_PROMPT} -PROMPT='%F{magenta}%~% %f% ${VI_MODE}${NEWLINE}%{%F{yellow}%}λ %b%f% ' +# PROMPT='%F{magenta}%~% %f% ${VI_MODE}${NEWLINE}%{%F{yellow}%}λ %b%f% ' +PROMPT='%~%${NEWLINE} λ %b% ' RPROMPT='$(virtualenv_info)% ${GITSTATUS_PROMPT:+ $GITSTATUS_PROMPT} ' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" -- cgit v1.2.3