Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
roktas committed Oct 19, 2023
1 parent 9e0ee5c commit 8439b7e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 16 deletions.
11 changes: 8 additions & 3 deletions nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -754,11 +754,8 @@ require("lazy").setup({

-- Ruby

lspconfig.solargraph.setup({})

lspconfig.rubocop.setup({})


local _timers = {}

local function setup_diagnostics(client, buffer)
Expand Down Expand Up @@ -973,6 +970,14 @@ vim.keymap.set("x", "p", "\"_dP")
vim.keymap.set("n", "n", "nzzzv", { noremap = true })
vim.keymap.set("n", "N", "Nzzzv", { noremap = true })

if vim.env.TMUX then
-- Why "sleep 10ms"? Workaround for neovim/neovim#21856
vim.cmd([[
autocmd BufReadPost,FileReadPost,BufNewFile,FocusGained * call system("tmux rename-window '" . expand("%:t") . "'")
autocmd VimLeave,FocusLost * call system("tmux setw automatic-rename") | sleep 10m
]])
end

------------------------------------------------------------------------------------------------------------------------
-- Commands
------------------------------------------------------------------------------------------------------------------------
Expand Down
36 changes: 23 additions & 13 deletions tmux/tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,29 @@ setab=\e[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m'

set -g terminal-overrides 'xterm*:smcup@:rmcup@'

set -g history-limit 10000
set -g history-limit 50000
set -g set-titles on
set -g set-titles-string "#W"

set -g prefix C-a
unbind C-a
bind C-a last-window

setw -g automatic-rename pn
setw -g automatic-rename on
setw -g aggressive-resize on
setw -g monitor-activity on

set -g status-style bg=default,fg=default
set -g status-interval 1
set -g status-justify centre
set -g status-right " #[fg=cyan]#(LC_TIME=tr_TR.UTF-8 date +'%%A') #[fg=cyan,bold]%Y-%m-%d#[default] #[fg=white,bold]%H:%M#[default]:%S#[default] "
set -g status-left-length 32
set -g status-left " #[fg=cyan,bold]#h#[default]"

set -g status-fg default
set -g status-bg default
set -g message-style bg=default,fg=yellow,bold

setw -g window-status-format "#[fg=colour250,bold]#I #W#F#[fg=default]"
setw -g window-status-current-format " #[fg=cyan,bold]#I#[fg=default] #[fg=white,bold]#W#[fg=default] "

set -g status-right " #[fg=colour250]%a %Y-%m-%d#[default] #[fg=white,bold]%H:%M#[default]"

set -g message-bg default
set -g message-fg yellow
set -g message-attr bold
setw -g window-status-format "#[fg=cyan,bold]#I#[default] #W#F#[fg=default] "
setw -g window-status-current-format "#[bg=white,fg=black,bold] #I #[default] #[fg=white,bold]#W#[fg=default]"

unbind '"'
bind '"' split-window -c "#{pane_current_path}"
Expand All @@ -45,6 +43,18 @@ bind % split-window -h -c "#{pane_current_path}"
unbind c
bind c new-window -c "#{pane_current_path}" -n 'sh' '$SHELL'

# Environment
# Tweaks

set -ag update-environment ' LC_TMUX_ALONE'

if-shell '[ -n "$SSH_CONNECTION" ]' 'set -g prefix2 C-b; unbind C-b; bind C-b last-window; set -g status-position top'

unbind -T root F9; bind -T root F9 run-shell " \
if [ #I = 9 ]; then \
tmux last-window; \
elif tmux list-windows -F '##I' | grep -w -q 9; then \
tmux select-window -t9; \
else \
tmux new-window -c '#{pane_current_path}' -n play -t9; \
fi \
"

0 comments on commit 8439b7e

Please sign in to comment.