From 3889218d7f3253082ca19e0e09e5788a997a749e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Tingel=C3=B6f?= Date: Wed, 24 Apr 2024 20:44:16 +0200 Subject: [PATCH] Update before re-installation --- templates/.tmux.conf | 81 +++---------- templates/Code/User/keybindings.json | 172 ++++++++++++++++++++++----- templates/Code/User/settings.json | 121 ++++++++++--------- templates/rofi/rofi-power | 2 +- templates/wezterm/wezterm.lua | 20 ++-- 5 files changed, 234 insertions(+), 162 deletions(-) diff --git a/templates/.tmux.conf b/templates/.tmux.conf index 9347dc7..3dc011d 100644 --- a/templates/.tmux.conf +++ b/templates/.tmux.conf @@ -1,7 +1,8 @@ # Basic setup set -g prefix C-a -set -g default-shell {{shell}} -set -g default-terminal "tmux-256color" +set -g default-shell /usr/bin/zsh +set -g default-terminal "$TERM" +set -ag terminal-overrides ",$TERM:Tc" set-option -g focus-events on bind -n WheelDownPane select-pane -t= \; send-keys -M set -ga terminal-overrides ",*256col*:Tc:smcup@:rmcup@" @@ -22,6 +23,8 @@ bind t new-window bind C-S-t new-window bind-key : command-prompt bind-key -n C-z resize-pane -Z +bind-key C-l send-keys "clear && tmux clear-history" \; send-keys "Enter" +bind-key -r f run-shell "tmux neww ~/.local/bin/tmux-sessionizer" set -s escape-time 0 # so you don't end up with window numbers like: 0 1 4 5 6 @@ -48,17 +51,17 @@ set -g status-left '' set -g status-right-length 100 set -g status-left-length 100 -set -g pane-border-style fg='{{base01}}',bold -set -g pane-active-border-style fg='{{base04}}',bold -set -g message-style bg='{{base03}}',fg='{{base0C}}' -set -g status-style bg='{{base01}}',fg='{{base04}}' -set -g status-right '#[bg={{base01}}]#[fg={{base0A}}] #{?window_zoomed_flag,#[bg={{base0A}}],} ' -set -ga status-right '#[bg={{base01}}]#[fg={{base02}}]#{?client_prefix,#[bg={{base0D}}],} ' -set-window-option -g window-status-style fg='{{base05}}',bg=default -set-window-option -g window-status-current-style fg='{{base07}}',bg='{{base01}}' +set -g pane-border-style fg='#24292e',bold +set -g pane-active-border-style fg='#6e7681',bold +set -g message-style bg='#586069',fg='#539bf5' +set -g status-style bg='#24292e',fg='#6e7681' +set -g status-right '#[bg=#24292e]#[fg=#e3b341] #{?window_zoomed_flag,#[bg=#e3b341],} ' +set -ga status-right '#[bg=#24292e]#[fg=#484f58]#{?client_prefix,#[bg=#6cb6ff],} ' +set-window-option -g window-status-style fg='#8b949e',bg='#24292e' +set-window-option -g window-status-current-style fg='#f0f6fc',bg='#24292e' -setw -g window-status-current-format ' #[fg={{base0D}}]#I #W ' -setw -g window-status-format ' #[fg={{base05}}]#I #W ' +setw -g window-status-current-format ' #[fg=#6cb6ff]#I #W ' +setw -g window-status-format ' #[fg=#8b949e]#I #W ' # Movement/resizing # gsettings list-recursively org.gnome.desktop.wm.keybindings | sort | grep "left\|right" @@ -66,10 +69,8 @@ setw -g window-status-format ' #[fg={{base05}}]#I #W ' # gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "[]" bind-key -n C-M-Left previous-window bind-key -n C-M-Right next-window -bind-key Up resize-pane -U 15 -bind-key Down resize-pane -D 15 -bind-key Right resize-pane -R 15 -bind-key Left resize-pane -L 15 +bind-key -n M-Left previous-window +bind-key -n M-Right next-window # v and h are not binded by default, but we never know in the next versions... unbind v @@ -80,10 +81,10 @@ unbind % # Split vertically unbind '"' # Split horizontally bind v split-window -h -c "#{pane_current_path}" -bind h split-window -v -c "#{pane_current_path}" +bind - split-window -v -c "#{pane_current_path}" bind c new-window -c "#{pane_current_path}" -bind - select-layout "even-vertical" +bind = select-layout "even-vertical" bind + select-layout "even-horizontal" bind M-r rotate-window @@ -92,37 +93,6 @@ setw -g aggressive-resize on bind a send-prefix bind C-a send-prefix -# Copy/paste -setw -g mode-keys vi -setw -g mode-style reverse -unbind-key -T copy-mode-vi 'End' -unbind-key -T copy-mode-vi 'Home' -bind Enter copy-mode # enter copy mode -bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard" -bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard' -bind-key -T copy-mode-vi 'Home' send -X start-of-line -bind-key -T copy-mode-vi 'End' send -X end-of-line -bind-key -T copy-mode-vi S-up send -X page-up -bind-key -T copy-mode-vi S-down send -X page-down -run -b 'tmux bind -t vi-copy v begin-selection 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi v send -X begin-selection 2> /dev/null || true' -run -b 'tmux bind -t vi-copy C-v rectangle-toggle 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi C-v send -X rectangle-toggle 2> /dev/null || true' -run -b 'tmux bind -t vi-copy y copy-selection 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/null || true' -run -b 'tmux bind -t vi-copy Escape cancel 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi Escape send -X cancel 2> /dev/null || true' -run -b 'tmux bind -t vi-copy H start-of-line 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi H send -X start-of-line 2> /dev/null || true' -run -b 'tmux bind -t vi-copy L end-of-line 2> /dev/null || true' -run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true' -bind-key -T copy-mode-vi 'C-Left' select-pane -L -bind-key -T copy-mode-vi 'C-Down' select-pane -D -bind-key -T copy-mode-vi 'C-Up' select-pane -U -bind-key -T copy-mode-vi 'C-Right' select-pane -R -bind-key -T copy-mode-vi 'C-\' select-pane -l -bind-key -T copy-mode-vi 'C-Space' select-pane -t:.+ - # Mouse copy paste improvements set -g mouse on bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'" @@ -143,19 +113,6 @@ bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xc bind -n C-k send-keys C-k bind -n C-l send-keys C-l -# Smart pane switching with awareness of Vim splits. -# 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 'M-Left' if-shell "$is_vim" 'send-keys C-Left' 'select-pane -L' -bind-key -n 'M-Right' if-shell "$is_vim" 'send-keys C-Right' 'select-pane -R' -bind-key -n 'M-Up' if-shell "$is_vim" 'send-keys C-Up' 'select-pane -U' -bind-key -n 'M-Down' if-shell "$is_vim" 'send-keys C-Down' 'select-pane -D' -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 -n 'C-Space' if-shell "$is_vim" 'send-keys C-Space' 'select-pane -t:.+' # List of plugins diff --git a/templates/Code/User/keybindings.json b/templates/Code/User/keybindings.json index 5967373..f3b9d4b 100644 --- a/templates/Code/User/keybindings.json +++ b/templates/Code/User/keybindings.json @@ -23,10 +23,6 @@ "key": "ctrl+w", "command": "-workbench.action.closeActiveEditor" }, - { - "key": "ctrl+e", - "command": "workbench.action.toggleSidebarVisibility" - }, { "key": "alt+numpad1", "command": "-workbench.view.explorer", @@ -121,10 +117,6 @@ "command": "-editor.action.codeAction", "when": "editorTextFocus" }, - { - "key": "ctrl+alt+v", - "command": "python.refactorExtractVariable" - }, { "key": "ctrl+s", "command": "-workbench.action.files.saveAll" @@ -173,8 +165,7 @@ }, { "key": "ctrl+p", - "command": "workbench.action.openRecent", - "when": "editorFocus" + "command": "workbench.action.openRecent" }, { "key": "ctrl+r", @@ -184,30 +175,10 @@ "key": "ctrl+p", "command": "-workbench.action.quickOpen" }, - { - "key": "[IntlBackslash] d", - "command": "editor.action.marker.next", - "when": "editorFocus" - }, - { - "key": "alt+f8", - "command": "-editor.action.marker.next", - "when": "editorFocus" - }, - { - "key": "shift+[IntlBackslash] d", - "command": "editor.action.marker.prev", - "when": "editorFocus" - }, - { - "key": "shift+alt+f8", - "command": "-editor.action.marker.prev", - "when": "editorFocus" - }, { "key": "down", "command": "search.action.focusNextSearchResult", - "when": "hasSearchResult || inSearchEditor" + "when": "inSearchEditor" }, { "key": "f4", @@ -217,7 +188,7 @@ { "key": "up", "command": "search.action.focusPreviousSearchResult", - "when": "hasSearchResult || inSearchEditor" + "when": "inSearchEditor" }, { "key": "shift+f4", @@ -341,5 +312,140 @@ { "key": "ctrl+y", "command": "editor.action.duplicateSelection" + }, + { + "key": "f8", + "command": "-editor.action.marker.nextInFiles", + "when": "editorFocus" + }, + { + "key": "ctrl+shift+i", + "command": "workbench.action.files.newUntitledFile" + }, + { + "key": "alt+insert", + "command": "-workbench.action.files.newUntitledFile", + "when": "!editorTextFocus || editorTextFocus && !editorHasCodeActionsProvider" + }, + { + "key": "ctrl+e", + "command": "workbench.action.toggleSidebarVisibility" + }, + { + "key": "ctrl+b", + "command": "-workbench.action.toggleSidebarVisibility" + }, + { + "key": "ctrl+o", + "command": "-workbench.action.files.openFileFolder", + "when": "isMacNative && openFolderWorkspaceSupport" + }, + { + "key": "backspace", + "command": "-extension.vim_backspace", + "when": "editorTextFocus && vim.active && !inDebugRepl" + }, + { + "key": "ctrl+n", + "command": "workbench.action.quickOpen" + }, + { + "key": "ctrl+e", + "command": "-workbench.action.quickOpen" + }, + { + "key": "ctrl+r", + "command": "editor.action.startFindReplaceAction", + "when": "editorFocus || editorIsOpen" + }, + { + "key": "ctrl+h", + "command": "-editor.action.startFindReplaceAction", + "when": "editorFocus || editorIsOpen" + }, + { + "key": "ctrl+shift+d", + "command": "editor.action.copyLinesDownAction", + "when": "editorTextFocus && !editorReadonly" + }, + { + "key": "ctrl+shift+alt+down", + "command": "-editor.action.copyLinesDownAction", + "when": "editorTextFocus && !editorReadonly" + }, + { + "key": "ctrl+w", + "command": "editor.action.smartSelect.expand", + "when": "editorTextFocus" + }, + { + "key": "shift+alt+right", + "command": "-editor.action.smartSelect.expand", + "when": "editorTextFocus" + }, + { + "key": "ctrl+shift+w", + "command": "editor.action.smartSelect.shrink", + "when": "editorTextFocus" + }, + { + "key": "shift+alt+left", + "command": "-editor.action.smartSelect.shrink", + "when": "editorTextFocus" + }, + { + "key": "ctrl+shift+r", + "command": "-command-runner.run" + }, + { + "key": "ctrl+shift+j", + "command": "-json.shortcut" + }, + { + "key": "ctrl+shift+j", + "command": "editor.action.joinLines" + }, + { + "key": "ctrl+k ctrl+k", + "command": "-editor.action.defineKeybinding", + "when": "resource == 'vscode-userdata:/home/epedape/.config/Code/User/keybindings.json'" + }, + { + "key": "shift+alt+f5", + "command": "-workbench.action.compareEditor.previousChange", + "when": "textCompareEditorVisible" + }, + { + "key": "ctrl+shift+n", + "command": "welcome.showNewFileEntries" + }, + { + "key": "ctrl+alt+meta+n", + "command": "-welcome.showNewFileEntries" + }, + { + "key": "ctrl+shift+n", + "command": "-workbench.action.newWindow" + }, + { + "key": "ctrl+o", + "command": "-workbench.action.files.openFile", + "when": "true" + }, + { + "key": "ctrl+alt+n", + "command": "find-it-faster.findFiles" + }, + { + "key": "ctrl+shift+j", + "command": "-find-it-faster.findFiles" + }, + { + "key": "ctrl+alt+u", + "command": "find-it-faster.findWithinFiles" + }, + { + "key": "ctrl+shift+u", + "command": "-find-it-faster.findWithinFiles" } -] \ No newline at end of file +] diff --git a/templates/Code/User/settings.json b/templates/Code/User/settings.json index 1431079..2e4bc18 100644 --- a/templates/Code/User/settings.json +++ b/templates/Code/User/settings.json @@ -91,31 +91,26 @@ ] } }, - "terminal.external.linuxExec": "{{terminal}}", "terminal.integrated.defaultProfile.linux": "zsh", "window.titleBarStyle": "custom", - "workbench.iconTheme": null, "terminal.integrated.copyOnSelection": true, "terminal.integrated.inheritEnv": true, - "editor.fontFamily": "'Fira Code Retina', 'Sauce Code Pro Nerd Font', 'MesloLGS NF', 'Iosevka Extended', 'DejaVu Sans Mono', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'", - "terminal.integrated.fontFamily": "Sauce Code Pro Nerd Font", - "editor.formatOnPaste": true, - "editor.formatOnSave": false, - "editor.formatOnType": true, - "editor.suggestSelection": "first", + "editor.fontFamily": "'JetBrainsMono', 'Sauce Code Pro Nerd Font', 'MesloLGS NF', 'Iosevka Extended', 'DejaVu Sans Mono', 'Droid Sans Mono', 'monospace', 'Droid Sans Fallback'", + "terminal.integrated.fontFamily": "'JetBrainsMono', 'Sauce Code Pro Nerd Font', 'MesloLGS NF', 'Iosevka Extended', 'DejaVu Sans Mono', 'Droid Sans Mono', 'monospace', 'Droid Sans Fallback'", + "editor.formatOnPaste": false, "editor.rulers": [ 100, 120 ], "terminal.integrated.allowChords": false, - "workbench.colorTheme": "Catppuccin Frappé", + "workbench.colorTheme": "GitHub Dark", "go.toolsManagement.autoUpdate": true, "terminal.integrated.env.linux": { - "EDITOR": "lvim", - "VISUAL": "lvim", + "EDITOR": "code", + "VISUAL": "code", "PATH": "${env:HOME}/.local/bin/:${env:PATH}", }, - "python.languageServer": "Pylance", + "python.languageServer": "Default", "python.envFile": "${workspaceFolder}/.env", "python.testing.pytestEnabled": true, "python.testing.pytestArgs": [ @@ -127,7 +122,7 @@ ], "pylint.args": [ "--disable", - "C0115,C0301,C0114,W0611", + "C0115,C0301,C0114,W0611,E0401", "--msg-template={msg_id}:{line:3d},{column}: {obj}: {msg}" ], "flake8.args": [ @@ -144,8 +139,8 @@ 120 ], "editor.codeActionsOnSave": { - "source.organizeImports": true, - "source.formatOnSave": true + "source.organizeImports": "explicit", + "source.formatOnSave": "explicit" } }, "yaml.completion": true, @@ -190,15 +185,10 @@ "~/.local/share/nvim/lazy/", "/usr/local/share/nvim/runtime/lua/" ], - "terminal.explorerKind": "external", - "terminal.integrated.drawBoldTextInBrightColors": false, - "terminal.integrated.enablePersistentSessions": false, "files.trimTrailingWhitespace": true, - "editor.formatOnSaveMode": "modifications", "vs-kubernetes": { "vs-kubernetes.crd-code-completion": "disabled" }, - "workbench.statusBar.visible": false, "editor.stickyScroll.enabled": true, "editor.stickyTabStops": true, "editor.smoothScrolling": true, @@ -208,40 +198,13 @@ "search.showLineNumbers": true, "search.smartCase": true, "files.autoSave": "onFocusChange", - "vim.easymotion": true, - "vim.neovimPath": "/usr/bin/nvim", - "vim.replaceWithRegister": true, - "vim.sneakReplacesF": true, - "vim.sneak": true, - "vim.smartRelativeLine": true, - "vim.targets.enable": true, - "vim.useSystemClipboard": true, - "vim.visualstar": true, - "vim.argumentObjectClosingDelimiters": [ - ")", - "]" - ], - "vim.argumentObjectOpeningDelimiters": [ - "(", - "[" - ], - "vim.handleKeys": { - "": false, - "": false, - "": true, - "": false, - "": false, - "": false, - "": false - }, - "vim.leader": "", "go.useLanguageServer": true, "[go]": { - "editor.snippetSuggestions": "none", + "editor.snippetSuggestions": "inline", "editor.formatOnSave": true, "editor.codeActionsOnSave": { - "source.organizeImports": true + "source.organizeImports": "explicit", + "source.fixAll": "explicit" } }, "gopls": { @@ -250,18 +213,14 @@ "buildFlags": [ "-tags", "mage" - ] + ], + "formatting.gofumpt": true, }, - "go.lintTool": "golangci-lint", "go.lintOnSave": "package", "gitlens.advanced.messages": { "suppressFileNotUnderSourceControlWarning": true }, "editor.inlineSuggest.enabled": true, - "search.mode": "newEditor", - "search.defaultViewMode": "tree", - "search.collapseResults": "alwaysCollapse", - "window.zoomLevel": -1, "security.workspace.trust.untrustedFiles": "open", "todohighlight.keywords": [ { @@ -287,5 +246,51 @@ ], "files.associations": { "*.txt": "jsonl" - } -} \ No newline at end of file + }, + "git.openRepositoryInParentFolders": "never", + "workbench.startupEditor": "none", + "window.menuBarVisibility": "compact", + "editor.codeActionsOnSave": {}, + "editor.minimap.showSlider": "always", + "editor.fontSize": 15, + "[json]": { + "editor.defaultFormatter": "vscode.json-language-features" + }, + "[yaml]": { + "editor.defaultFormatter": "redhat.vscode-yaml" + }, + "[javascript]": { + "editor.defaultFormatter": "vscode.typescript-language-features" + }, + "debug.console.fontFamily": "JetbrainsMono", + "debug.console.fontSize": 15, + "debug.console.lineHeight": 21, + "go.coverageOptions": "showCoveredCodeOnly", + "go.showWelcome": false, + "go.editorContextMenuCommands": { + "fillStruct": true, + "testPackage": true, + "playground": false + }, + "go.delveConfig": { + "dlvLoadConfig": { + "followPointers": true, + "maxVariableRecurse": 1, + "maxStringLen": 10000, + "maxArrayValues": 10000, + "maxStructFields": -1 + } + }, + "gitlens.autolinks": [ + { + "prefix": "ADPPRG-", + "url": "https://eteamproject.internal.ericsson.com/browse/ADPPRG-" + }, + { + "prefix": "Change-Id: " + } + ], + "editor.formatOnSaveMode": "modifications", + "terminal.integrated.scrollback": 30000, + "editor.wordSeparators": "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?." +} diff --git a/templates/rofi/rofi-power b/templates/rofi/rofi-power index 158496d..f608465 100755 --- a/templates/rofi/rofi-power +++ b/templates/rofi/rofi-power @@ -18,7 +18,7 @@ case $chosen in systemctl poweroff ;; $lock) - dbus-send --type=method_call --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock + i3lock -c {{base01}} ;; $suspend) systemctl suspend diff --git a/templates/wezterm/wezterm.lua b/templates/wezterm/wezterm.lua index 1faa4ca..429f6aa 100644 --- a/templates/wezterm/wezterm.lua +++ b/templates/wezterm/wezterm.lua @@ -19,12 +19,12 @@ return { }), harfbuzz_features = { "calt=0", "clig=0", "liga=0" }, adjust_window_size_when_changing_font_size = false, - color_scheme = "Tokyo Night Moon", + color_scheme = "OneDark (base16)", hide_tab_bar_if_only_one_tab = true, exit_behavior = "Close", window_background_opacity = 1, default_prog = { "/usr/bin/zsh" }, - font_size = 13, + font_size = 12, max_fps = 120, scrollback_lines = 99999, enable_wayland = false, @@ -34,9 +34,9 @@ return { check_for_updates = false, audible_bell = "Disabled", window_padding = { - left = 5, - right = 5, - top = 10, + left = 0, + right = 0, + top = 0, bottom = 0, }, initial_cols = 110, @@ -52,7 +52,7 @@ return { tab_max_width = 50, disable_default_key_bindings = false, window_close_confirmation = "NeverPrompt", - selection_word_boundary = " \t\n{[}]():\"'", + selection_word_boundary = " \t\n*?_-.[]~=&;!#$%^(){}<>\"'", keys = { { key = "s", @@ -124,8 +124,12 @@ return { format = "$0", }, { - regex = [[\b[tT](\d+)\b]], - format = "https://example.com/tasks/?t=$1", + regex = [[\b(ADPPRG-\d+)\b]], + format = "https://eteamproject.internal.ericsson.com/browse/$0", + }, + { + regex = [[\bChange-Id: ([\d\a-z]+)\b]], + format = "https://gerrit.ericsson.se/#/q/$1", }, }, mouse_bindings = {