├── Makefile ├── README.md ├── alacritty └── alacritty.yml ├── arch_install_tools.sh ├── firefox ├── tridactylrc └── userChrome.css ├── gnome └── gnome-settings.ini ├── hammerspoon └── init.lua ├── install.sh ├── jetbrains ├── .ideavimrc └── ide_keymaps.zip ├── karabiner └── karabiner.json ├── kitty └── kitty.conf ├── lazydocker └── config.yml ├── lvim ├── codedarker.lua ├── config.lua └── htmldjango.vim ├── obsidian └── .obsidian.vimrc ├── powerlevel10k └── .p10k.zsh ├── scripts └── copy_filepath.sh ├── tmux ├── .tmux.conf └── .tmux.conf.macos ├── ubuntu_install_tools.sh ├── vifm └── vifmrc ├── vim └── .vimrc └── zsh ├── .zshrc ├── .zshrc_macos └── oh-my-zsh └── custom ├── aliases-pub-macos.zsh ├── aliases-pub.zsh ├── env-pub-macos.zsh └── env-pub.zsh /Makefile: -------------------------------------------------------------------------------- 1 | magic: 2 | ./install.sh 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dotfiles 2 | Best configs for best tools (by my mom's rating) 3 | --- 4 | ## Usage 5 | ```sh 6 | git clone --depth=1 https://github.com/shitcoding/dotfiles 7 | cd dotfiles 8 | make magic 9 | ``` 10 | 11 | --- 12 | ## Configs for 13 | ### Alacritty 14 | Goes to `~/.config/alacritty/alacritty.yml` 15 | 16 | 17 | ### Tmux 18 | Goes to `~/.tmux.conf` 19 | 20 | 21 | ### Vim 22 | Goes to `~/.vimrc` 23 | 24 | 25 | ### Zsh 26 | Goes to `~/.zshrc` 27 | 28 | 29 | ### Powerlevel10k prompt 30 | Goes to `~/.p10k.zsh` 31 | -------------------------------------------------------------------------------- /alacritty/alacritty.yml: -------------------------------------------------------------------------------- 1 | window: 2 | dimensions: 3 | columns: 80 4 | lines: 42 5 | 6 | position: 7 | x: 0 8 | y: 0 9 | 10 | decorations: none 11 | 12 | # Values for `startup_mode`: 13 | # - Windowed 14 | # - Maximized 15 | # - Fullscreen 16 | startup_mode: Maximized 17 | 18 | opacity: 0.90 19 | 20 | scrolling: 21 | history: 10000 22 | 23 | 24 | font: 25 | normal: 26 | family: MesloLGS Nerd Font Mono 27 | style: Regular 28 | bold: 29 | family: MesloLGS Nerd Font Mono 30 | style: Bold 31 | italic: 32 | family: MesloLGS Nerd Font Mono 33 | style: Italic 34 | bold_italic: 35 | family: MesloLGS Nerd Font Mono 36 | style: Bold Italic 37 | size: 10.0 38 | 39 | offset: 40 | x: 0 41 | y: 0 42 | 43 | 44 | # If `true`, bold text is drawn using the bright color variants. 45 | draw_bold_text_with_bright_colors: true 46 | 47 | 48 | ######################################### 49 | # Makc.co Hepburn Color scheme 50 | ######################################## 51 | colors: 52 | cursor: 53 | text: CellBackground 54 | cursor: CellForeground 55 | primary: 56 | background: '#000000' 57 | foreground: '#fbf1c7' 58 | normal: 59 | black: '#282828' 60 | red: '#cc241d' 61 | green: '#98971a' 62 | yellow: '#d79921' 63 | blue: '#458588' 64 | magenta: '#b16286' 65 | cyan: '#689d6a' 66 | white: '#a89984' 67 | bright: 68 | black: '#928374' 69 | red: '#fb4934' 70 | green: '#b8bb26' 71 | yellow: '#fabd2f' 72 | blue: '#83a598' 73 | magenta: '#d3869b' 74 | cyan: '#8ec07c' 75 | white: '#ebdbb2' 76 | 77 | indexed_colors: 78 | # - { index: 16, color: '#dc9656' } 79 | - { index: 17, color: '#a16946' } 80 | - { index: 18, color: '#282828' } 81 | - { index: 19, color: '#383838' } 82 | - { index: 20, color: '#b8b8b8' } 83 | - { index: 21, color: '#e8e8e8' } 84 | 85 | selection: 86 | text: '#ffffff' 87 | background: '#dc3232' 88 | white: '#ffffff' 89 | 90 | ######################################### 91 | # End of Makc.co Hepburn Color scheme 92 | ######################################## 93 | 94 | 95 | 96 | selection: 97 | # This string contains all characters that are used as separators for 98 | # "semantic words" in Alacritty. 99 | semantic_escape_chars: ",│`|:\"' ()[]{}<>\t." 100 | 101 | # When set to `true`, selected text will be copied to the primary clipboard. 102 | #save_to_clipboard: false 103 | 104 | cursor: 105 | unfocused_hollow: true 106 | 107 | 108 | 109 | 110 | key_bindings: 111 | - { key: Q, mods: Control|Shift, action: Quit } 112 | # - { key: V, mods: Control, action: Paste } # Paste with Ctrl-v 113 | -------------------------------------------------------------------------------- /arch_install_tools.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Update packages 4 | sudo pacman -Syu --noconfirm 5 | 6 | # Install useful tools: zsh, oh-my-zsh, p10k prompt, tmux, LunarVim, etc. 7 | 8 | # Install zsh, oh-my-zsh, plugins, set up config ########### 9 | # Download dotfiles 10 | git clone https://github.com/shitcoding/dotfiles ~/.dotfiles 11 | 12 | #Install zsh, oh-my-zsh and plugins ########################### 13 | # Set up zsh and other tools 14 | sudo pacman -S curl git zsh wget fzf alacritty rustup --noconfirm 15 | sudo chsh -s $(which zsh) $USER 16 | # Set up oh-my-zsh 17 | sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended 18 | # Install oh-my-zsh plugins 19 | git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting 20 | git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions 21 | git clone https://github.com/joshskidmore/zsh-fzf-history-search ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-fzf-history-search 22 | 23 | # Fix permissions issues for downloaded plugins 24 | chown -R $(whoami):$(whoami) $HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions 25 | chown -R $(whoami):$(whoami) $HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting 26 | chown -R $(whoami):$(whoami) $HOME/.oh-my-zsh/custom/plugins/zsh-fzf-history-search 27 | 28 | # Install nerd fonts 29 | sudo pacman -S ttf-inconsolata-nerd ttf-meslo-nerd ttf-hack-nerd ttf-firacode-nerd ttf-iosevka-nerd --noconfirm 30 | 31 | # Install powerlevel10k prompt 32 | git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k 33 | 34 | # Copy zsh dotfiles, aliases, env vars 35 | cp ~/.dotfiles/zsh/.zshrc ~/.zshrc 36 | cp ~/.dotfiles/powerlevel10k/.p10k.zsh ~/.p10k.zsh 37 | cp ~/.dotfiles/zsh/oh-my-zsh/custom/* $ZSH_CUSTOM 38 | 39 | # Copy alacritty config 40 | mkdir -p ~/.config/alacritty 41 | cp ~/.dotfiles/alacritty/alacritty.yml ~/.config/alacritty/alacritty.yml 42 | 43 | 44 | ############ Install tmux and plugins ########################### 45 | sudo pacman -S tmux xclip --noconfirm 46 | # Install tpm plugin manager 47 | git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm 48 | # Copy tmux config from downloaded dotfiles 49 | cp ~/.dotfiles/tmux/.tmux.conf ~/.tmux.conf 50 | 51 | 52 | ########## Install Lunarvim, set up config and plugins ########### 53 | # Install latest version of Neovim 54 | sudo pacman -S neovim --noconfirm 55 | 56 | # Install LunarVim dependencies 57 | # install rust 58 | sudo curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh 59 | sudo pacman -S make unzip python3-pip python3 python3-venv -y 60 | #Install nvm, nodejs, npm 61 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash 62 | source ~/.zshrc > /dev/null 63 | nvm install node 64 | nvm install-latest-npm 65 | 66 | # Install LunarVim + its nodejs/python/rust dependencies 67 | bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/install.sh) << EOF 68 | y 69 | y 70 | y 71 | EOF 72 | # Add path to lvim executable to system $PATH 73 | echo "export PATH=$HOME/.local/bin:$PATH" >> $ZSH_CUSTOM/env.zsh 74 | 75 | # Set lvim config from dotfiles 76 | cp $HOME/.dotfiles/lvim/config.lua $HOME/.config/lvim/config.lua 77 | mkdir -p $HOME/.config/lvim/after/ftplugin/ 78 | cp $HOME/.dotfiles/lvim/htmldjango.vim $HOME/.config/lvim/after/ftplugin/htmldjango.vim 79 | 80 | 81 | ###### Various tools ############################ 82 | # paru 83 | rustup default stable 84 | mkdir -p ~/Utils 85 | cd ~/Utils 86 | git clone https://aur.archlinux.org/paru.git 87 | cd paru 88 | makepkg -si 89 | 90 | # logo-ls 91 | paru -S logo-ls --noconfirm --skipreview 92 | 93 | # Gnome extensions 94 | sudo pacman -S gnome-shell-extensions gnome-browser-connector --noconfirm 95 | # Load Gnome config from dotfiles 96 | dconf load / < ~/.dotfiles/gnome/gnome-settings.ini 97 | 98 | # Install Firefox and Tridactyl firefox extension and copy config from dotfiles 99 | sudo pacman -S firefox firefox-tridactyl --noconfirm 100 | paru -S firefox-tridactyl-native --noconfirm --skipreview 101 | mkdir -p ~/.config/tridactyl/ 102 | cp ~/.dotfiles/firefox/tridactylrc ~/.config/tridactyl/tridactylrc 103 | -------------------------------------------------------------------------------- /firefox/tridactylrc: -------------------------------------------------------------------------------- 1 | " General Settings 2 | set configversion 2.0 3 | " open floating neovim window for input mode 4 | set editorcmd kitty --class floatingAppFocus -- lvim %f 5 | set theme midnight 6 | set update.lastchecktime 1705396334974 7 | 8 | " Binds 9 | bind * tabduplicate 10 | bind --mode=ex ex.hide_and_clear 11 | bind --mode=hint hint.reset 12 | bind --mode=input composite unfocus | mode normal 13 | bind --mode=insert !s xdotool key Down 14 | bind --mode=insert !s xdotool key Up 15 | bind ;M composite hint -Jpipe img src | tabopen images.google.com/searchbyimage?image_url= 16 | bind ;O hint -W fillcmdline_notrail open 17 | bind ;T hint -W fillcmdline_notrail tabopen 18 | bind ;W hint -W fillcmdline_notrail winopen 19 | bind ;m composite hint -Jpipe img src | open images.google.com/searchbyimage?image_url= 20 | bind scrollpage 0.5 21 | bind scrollpage -0.5 22 | bind B back 23 | bind H tabfirst 24 | bind I focusinput -I 25 | bind J tabnext 26 | bind K tabprev 27 | bind L tablast 28 | bind M tabmove -1 29 | bind gb tabprev 30 | bind gi composite focusinput -l | editor 31 | bind gnM tabopen https://github.com/tridactyl/tridactyl/wiki/Exemplar-.tridactylrc-files 32 | bind goM open https://github.com/tridactyl/tridactyl/wiki/Exemplar-.tridactylrc-files 33 | bind gr reader 34 | bind gwM winopen https://github.com/tridactyl/tridactyl/wiki/Exemplar-.tridactylrc-files 35 | bind m tabmove +1 36 | bind А hint -b 37 | bind Ж fillcmdline_notrail 38 | bind З clipboard tabopen 39 | bind И back 40 | bind Л tabprev 41 | bind О tabnext 42 | bind П scrollto 100 43 | bind Ь tabmove -1 44 | bind а hint 45 | bind в tabclose 46 | bind г undo 47 | bind е fillcmdline tabopen 48 | bind з clipboard open 49 | bind к reload 50 | bind л scrollline -10 51 | bind м hint -h 52 | bind нн clipboard yank 53 | bind о scrollline 10 54 | bind пп scrollto 0 55 | bind пш focusinput -l 56 | bind ь tabmove +1 57 | unbind --mode=insert 58 | unbind --mode=visual 59 | unbind 60 | unbind 61 | unbind bkpconf 62 | 63 | " Aliases """"""""""""""""""""""""""""""""""""""""""""""" 64 | alias bkpconfig mkt! ~/.config/tridactyl/tridactylrc 65 | alias current_url composite get_current_url | fillcmdline_notrail 66 | alias drawingstop no_mouse_mode 67 | """" Create cleaned up tridactylrc config 68 | " https://github.com/tridactyl/tridactyl/wiki/Commentary-of-Gholk's-Tridactylrc#version-control-about-tridactylrc 69 | alias mktridactylrc_fix js const rc=function parseConfig(){let p={conf:[],binds:[],aliases:[],subconfigs:[],aucmds:[],aucons:[],logging:[],nulls:[]};const binding={map:new Map([["normal","nmaps"],["ignore","ignoremaps"],["insert","imaps"],["input","inputmaps"],["ex","exmaps"],["hint","hintmaps"],["visual","vmaps"],["browser","browsermaps"]]),get modeMaps(){return this},init(){const l=this.excludeMapName=[];const ex=tri.config.get("mktridactylrc_exclude_map_name");if(ex)l.push(...ex.split(" "))},customMapName(map){if(map.slice(-4)!="maps"||this.excludeMapName.includes(map))return null;return map.slice(0,-4)},includes(map){let include=false;this.map.forEach(x=>{if(x==map)include=true});if(include)return include;if(this.customMapName(map))return true;return false},get maps2mode(){return this},get(map){let name;this.map.forEach((m,n)=>{if(m==map)name=n});if(!name)name=this.customMapName(map);if(name)return name}};binding.init();p=parseConfigHelper(tri.config.USERCONFIG,p);let d={conf:[],binds:[],aliases:[],subconfigs:[],aucmds:[],aucons:[],logging:[],nulls:[]};d=parseConfigHelper(tri.config.DEFAULTS,d);const s={general:``,binds:``,aliases:``,aucmds:``,aucons:``,subconfigs:``,logging:``,nulls:``};Object.keys(p).forEach(k=>{const defaultConfig=new Set(d[k]);p[k]=p[k].filter(x=>!defaultConfig.has(x)||/^("|$)/.test(x));p[k].sort();if(k!="binds")return;const bindSet=new Set(p[k]);p[k]=p[k].filter((l,i,list)=>{if(l.slice(0,7)=="bindurl"){const noUrl=l.replace(/^bindurl .*? /,"bind ");if(defaultConfig.has(noUrl))return false;if(~list.indexOf(noUrl))return false}else if(l.slice(0,11)=="bind --mode"){const map=[[/^bind --mode=ex/,"bind --mode=insert"],[/^bind --mode=visual/,"bind"]];const parentCommand=map.reduce((l,[re,parent])=>{if(l.match(re))return l.replace(re,parent);else return l},l);if(parentCommand==l)return true;if(bindSet.has(parentCommand))return false;if(defaultConfig.has(parentCommand))return false}return true})});if(p.conf.length>0)s.general=`" General Settings\n${p.conf.join("\n")}\n\n`;if(p.binds.length>0)s.binds=`" Binds\n${p.binds.join("\n")}\n\n`;if(p.aliases.length>0)s.aliases=`" Aliases\n${p.aliases.join("\n")}\n\n`;if(p.aucmds.length>0)s.aucmds=`" Autocmds\n${p.aucmds.join("\n")}\n\n`;if(p.aucons.length>0)s.aucons=`" Autocontainers\n${p.aucons.join("\n")}\n\n`;if(p.subconfigs.length>0)s.subconfigs=`" Subconfig Settings\n${p.subconfigs.join("\n")}\n\n`;if(p.logging.length>0)s.logging=`" Logging\n${p.logging.join("\n")}\n\n`;if(p.nulls.length>0)s.nulls=`" Removed settings\n${p.nulls.join("\n")}\n\n`;const ftdetect=`" For syntax highlighting see https://github.com/tridactyl/vim-tridactyl\n" vim: set filetype=tridactyl`;return`${s.general}${s.binds}${s.subconfigs}${s.aliases}${s.aucmds}${s.aucons}${s.logging}${s.nulls}${ftdetect}`;function parseConfigHelper(pconf,parseobj,prefix=[]){for(const i of Object.keys(pconf)){if(typeof pconf[i]!=="object"){if(prefix[0]==="subconfigs"){const pattern=prefix[1];const subname=prefix.slice(2);parseobj.subconfigs.push(`seturl ${pattern} ${[...subname,i].join(".")} ${pconf[i]}`)}else{parseobj.conf.push(`set ${[...prefix,i].join(".")} ${pconf[i]}`)}}else if(pconf[i]===null){parseobj.nulls.push(`setnull ${[...prefix,i].join(".")}`)}else{for(const e of Object.keys(pconf[i])){if(binding.modeMaps.includes(i)){let cmd="bind";if(prefix[0]==="subconfigs")cmd=cmd+"url "+prefix[1];if(i!=="nmaps"){const mode=binding.maps2mode.get(i);cmd+=` --mode=${mode}`}if(pconf[i][e]===null){parseobj.binds.push(`un${cmd} ${e}`);continue}if(pconf[i][e].length>0){parseobj.binds.push(`${cmd} ${e} ${pconf[i][e]}`)}else{parseobj.binds.push(`un${cmd} ${e}`)}}else if(pconf[i][e]===null){parseobj.nulls.push(`setnull ${i}.${e}`)}else if(i==="exaliases"){if(e==="alias"){parseobj.aliases.push(`command ${e} ${pconf[i][e]}`)}else{parseobj.aliases.push(`alias ${e} ${pconf[i][e]}`)}}else if(i==="autocmds"){for(const a of Object.keys(pconf[i][e])){parseobj.aucmds.push(`autocmd ${e} ${a} ${pconf[i][e][a]}`)}}else if(i==="autocontain"){parseobj.aucons.push(`autocontain ${e} ${pconf[i][e]}`)}else if(i==="logging"){let level;if(pconf[i][e]===0)level="never";if(pconf[i][e]===1)level="error";if(pconf[i][e]===2)level="warning";if(pconf[i][e]===3)level="info";if(pconf[i][e]===4)level="debug";parseobj.logging.push(`set logging.${e} ${level}`)}else if(i==="customthemes"){}else{parseConfigHelper(pconf[i],parseobj,[...prefix,i]);break}}}}return parseobj}}()+"\n";rc; 70 | 71 | -------------------------------------------------------------------------------- /firefox/userChrome.css: -------------------------------------------------------------------------------- 1 | /********************* Tab numbering ********************/ 2 | /* Kudos to https://github.com/tuomassalo/tab-numbering */ 3 | /* Setup: https://www.userchrome.org/how-create-userchrome-css.html */ 4 | 5 | /* 1. Enter about:profile in Firefox, copy "Profile Directory" path */ 6 | /* 2. Create a directory called `chrome` in Profile Directory */ 7 | /* 3. Put userChrome.css into newly created `chrome` directory */ 8 | /* 4. Enter about:config in Firefox and switch parameter 9 | * toolkit.legacyUserProfileCustomizations.stylesheets to True */ 10 | /********************************************************/ 11 | tabs { 12 | counter-reset: tab-counter; 13 | } 14 | 15 | tab:nth-child(1) .tab-content::before, 16 | tab:nth-child(2) .tab-content::before, 17 | tab:nth-child(3) .tab-content::before, 18 | tab:nth-child(4) .tab-content::before, 19 | tab:nth-child(5) .tab-content::before, 20 | tab:nth-child(6) .tab-content::before, 21 | tab:nth-child(7) .tab-content::before, 22 | tab:nth-child(8) .tab-content::before, 23 | tab:nth-child(9) .tab-content::before, 24 | tab:nth-child(10) .tab-content::before, 25 | tab:nth-child(11) .tab-content::before, 26 | tab:nth-child(12) .tab-content::before, 27 | tab:nth-child(13) .tab-content::before, 28 | tab:nth-child(14) .tab-content::before, 29 | tab:nth-child(15) .tab-content::before, 30 | tab:nth-child(16) .tab-content::before, 31 | tab:nth-child(17) .tab-content::before, 32 | tab:nth-child(18) .tab-content::before, 33 | tab:nth-child(19) .tab-content::before, 34 | tab:nth-child(20) .tab-content::before { 35 | counter-increment: tab-counter; 36 | content: counter(tab-counter) ""; 37 | 38 | position: absolute; 39 | left: 3px; 40 | top: 4px; 41 | 42 | opacity: .4; 43 | 44 | font-weight: bold; 45 | font-size: 60%; 46 | } 47 | 48 | 49 | /********************************************************/ 50 | 51 | -------------------------------------------------------------------------------- /gnome/gnome-settings.ini: -------------------------------------------------------------------------------- 1 | [org/gnome/desktop/input-sources] 2 | mru-sources=[('xkb', 'ru'), ('xkb', 'us')] 3 | per-window=true 4 | sources=[('xkb', 'us'), ('xkb', 'ru')] 5 | xkb-options=['lv3:ralt_switch', 'ctrl:swapcaps', 'shift:breaks_caps'] 6 | 7 | [org/gnome/desktop/interface] 8 | clock-show-seconds=true 9 | clock-show-weekday=true 10 | color-scheme='prefer-dark' 11 | enable-animations=true 12 | enable-hot-corners=false 13 | font-antialiasing='rgba' 14 | font-hinting='slight' 15 | gtk-enable-primary-paste=false 16 | show-battery-percentage=true 17 | text-scaling-factor=1.3 18 | 19 | [org/gnome/desktop/peripherals/mouse] 20 | accel-profile='flat' 21 | speed=-0.32352941176470584 22 | 23 | [org/gnome/desktop/peripherals/touchpad] 24 | natural-scroll=false 25 | send-events='enabled' 26 | speed=0.72794117647058831 27 | tap-to-click=true 28 | two-finger-scrolling-enabled=true 29 | 30 | [org/gnome/desktop/wm/keybindings] 31 | activate-window-menu=@as [] 32 | begin-resize=['r'] 33 | move-to-workspace-left=['Left'] 34 | move-to-workspace-right=['Right'] 35 | switch-group=['w'] 36 | switch-group-backward=['w'] 37 | switch-input-source=['space'] 38 | switch-input-source-backward=['space'] 39 | switch-to-workspace-1=['1'] 40 | switch-to-workspace-2=['2'] 41 | switch-to-workspace-3=['3'] 42 | switch-to-workspace-4=['4'] 43 | switch-to-workspace-5=['5'] 44 | switch-to-workspace-6=['6'] 45 | switch-to-workspace-7=['7'] 46 | switch-to-workspace-8=['8'] 47 | switch-to-workspace-9=['9'] 48 | switch-to-workspace-last=['0'] 49 | switch-to-workspace-left=['h'] 50 | switch-to-workspace-right=['l'] 51 | toggle-fullscreen=['f'] 52 | 53 | [org/gnome/desktop/wm/preferences] 54 | button-layout='appmenu:minimize,maximize,close' 55 | num-workspaces=6 56 | workspace-names=@as [] 57 | 58 | 59 | [org/gnome/settings-daemon/plugins/media-keys] 60 | custom-keybindings=['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/'] 61 | next=['Favorites'] 62 | play=['Favorites'] 63 | previous=['Favorites'] 64 | www=['b'] 65 | 66 | [org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0] 67 | binding='t' 68 | command='alacritty' 69 | name='New Alacritty window' 70 | 71 | [org/gnome/settings-daemon/plugins/power] 72 | power-button-action='suspend' 73 | sleep-inactive-ac-type='nothing' 74 | 75 | 76 | [org/gnome/shell/extensions/blur-my-shell] 77 | appfolder-dialog-opacity=0.12 78 | blur-panel=false 79 | brightness=0.40999999999999998 80 | dash-opacity=0.12 81 | debug=false 82 | hidetopbar=false 83 | sigma=31 84 | 85 | [org/gnome/shell/extensions/custom-hot-corners-extended/misc] 86 | internal-flags=['shortcuts-moved'] 87 | keyboard-shortcuts=['reorder-ws-prev h', 'reorder-ws-next l'] 88 | ripple-animation=false 89 | show-osd-monitor-indexes=false 90 | supported-active-extensions=@as [] 91 | watch-corners=false 92 | win-switch-wrap=false 93 | 94 | [org/gnome/shell/extensions/custom-hot-corners-extended/monitor-0-top-left-0] 95 | action='disabled' 96 | 97 | [org/gnome/shell/extensions/custom-hot-corners-extended/monitor-0-top-left-1] 98 | action='disabled' 99 | 100 | [org/gnome/shell/extensions/custom-hot-corners-extended/monitor-0-top-left-2] 101 | action='disabled' 102 | 103 | [org/gnome/shell/extensions/custom-hot-corners-extended/monitor-0-top-left-3] 104 | action='disabled' 105 | 106 | [org/gnome/shell/extensions/custom-hot-corners-extended/monitor-0-top-left-4] 107 | action='disabled' 108 | 109 | [org/gnome/shell/extensions/custom-hot-corners-extended/monitor-0-top-left-5] 110 | action='disabled' 111 | 112 | [org/gnome/shell/extensions/custom-hot-corners-extended/monitor-0-top-left-6] 113 | ctrl=true 114 | 115 | [org/gnome/shell/extensions/custom-hot-corners-extended/monitor-1-top-left-6] 116 | ctrl=true 117 | 118 | [org/gnome/shell/extensions/custom-hot-corners-extended/monitor-2-top-left-6] 119 | ctrl=true 120 | 121 | [org/gnome/shell/extensions/just-perfection] 122 | accessibility-menu=false 123 | activities-button=false 124 | double-super-to-appgrid=false 125 | panel-button-padding-size=0 126 | panel-indicator-padding-size=0 127 | panel-size=34 128 | show-prefs-intro=false 129 | startup-status=0 130 | theme=false 131 | workspace-wrap-around=true 132 | 133 | [org/gnome/shell/extensions/mediacontrols] 134 | backlist-apps=['youtube.com'] 135 | colored-player-icon=false 136 | element-order=['controls', 'icon', 'title', 'menu'] 137 | extension-index=100 138 | extension-position='left' 139 | max-widget-width=438 140 | mouse-actions=['toggle_info', 'toggle_menu', 'raise', 'none', 'none', 'none', 'none', 'none'] 141 | seperator-chars=['[', ']'] 142 | show-control-icons=false 143 | show-next-icon=false 144 | show-playpause-icon=false 145 | show-prev-icon=false 146 | show-seperators=false 147 | show-sources-menu=true 148 | track-label=['track', ' | ', 'artist'] 149 | 150 | [org/gnome/shell/extensions/multi-monitors-add-on] 151 | available-indicators=['workspace-indicator'] 152 | show-activities=true 153 | show-app-menu=true 154 | show-indicator=false 155 | show-panel=true 156 | thumbnails-slider-position='none' 157 | 158 | -------------------------------------------------------------------------------- /hammerspoon/init.lua: -------------------------------------------------------------------------------- 1 | -- Hammerspoon config 2 | 3 | ---------------- Switch to the last space with cmd-0 -------------------- 4 | -- Set MCwaitTime for fast but stable animation 5 | hs.spaces.MCwaitTime = 0.3 6 | 7 | -- Function to get the UUID of the main built-in display with multiple spaces 8 | local function getTargetScreenUUID() 9 | local allSpaces = hs.spaces.allSpaces() 10 | if not allSpaces then 11 | print("Error fetching all spaces") 12 | return nil 13 | end 14 | 15 | for screenUUID, spaces in pairs(allSpaces) do 16 | local screen = hs.screen.find(screenUUID) 17 | if screen and screen:name() == "Built-in Retina Display" and #spaces > 1 then 18 | return screenUUID 19 | end 20 | end 21 | 22 | print("No suitable screen found with multiple spaces.") 23 | return nil 24 | end 25 | 26 | -- Function to switch to the last space on a specific screen 27 | local function switchToLastSpace() 28 | local inspect = require("hs.inspect") 29 | local allSpaces, err = hs.spaces.allSpaces() 30 | 31 | if not allSpaces then 32 | print("Error fetching all spaces:", err) 33 | return 34 | end 35 | 36 | -- Dynamically get the UUID of the target screen 37 | local screenUUID = getTargetScreenUUID() 38 | if not screenUUID then 39 | print("Target screen UUID not found.") 40 | return 41 | end 42 | 43 | -- Check if the UUID exists in allSpaces 44 | if allSpaces[screenUUID] then 45 | -- Get the last space for this screen 46 | local lastSpaceID = allSpaces[screenUUID][#allSpaces[screenUUID]] 47 | print("Last Space ID:", lastSpaceID) 48 | 49 | -- Attempt to switch to this space 50 | local success, errorMsg = hs.spaces.gotoSpace(lastSpaceID) 51 | if not success then 52 | print("Failed to switch to last space:", errorMsg) 53 | end 54 | else 55 | print("Screen UUID not found in allSpaces.") 56 | end 57 | end 58 | 59 | -- Bind the function to Cmd-0 60 | hs.hotkey.bind({"cmd"}, "0", switchToLastSpace) 61 | ------------------------------------------------------------------------- 62 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copy dotfiles to appropriate locations 4 | cp ./alacritty/alacritty.yml ~/.config/alacritty/alacritty.yml 5 | cp ./tmux/.tmux.conf ~/.tmux.conf 6 | cp ./vim/.vimrc ~/.vimrc 7 | cp ./zsh/.zshrc ~/.zshrc 8 | cp ./powerlevel10k/.p10k.zsh ~/.p10k.zsh 9 | -------------------------------------------------------------------------------- /jetbrains/.ideavimrc: -------------------------------------------------------------------------------- 1 | " ####################################################### 2 | " Plugins 3 | " ####################################################### 4 | set surround 5 | set NERDTree 6 | 7 | 8 | 9 | " ####################################################### 10 | " General Settings 11 | " ####################################################### 12 | " Space as leader key 13 | nnoremap 14 | let mapleader=" " 15 | 16 | nnoremap 17 | 18 | nnoremap 19 | 20 | set number relativenumber 21 | 22 | 23 | " Fix issues with delete key in vim insert mode 24 | set backspace=indent,eol,start 25 | 26 | " Tabs settings for Python 27 | set tabstop=4 28 | set shiftwidth=4 29 | set smarttab 30 | set expandtab 31 | set softtabstop=4 "4 spaces in tab 32 | 33 | " Recommanded ideavim settings 34 | set ideajoin 35 | set ideaput 36 | set ideamarks 37 | 38 | set clipboard+=unnamed 39 | 40 | 41 | 42 | " " Switch to English lang in normal mode, restore input lang in insert mode 43 | " " https://plugins.jetbrains.com/plugin/9615-ideavimextension 44 | " set keep-english-in-normal-and-restore-in-insert 45 | 46 | " ####################################################### 47 | " Key Bindings 48 | " ####################################################### 49 | " H / L - go to the beginning/end of the line in normal mode 50 | nnoremap H ^ 51 | nnoremap L $ 52 | " Same for Cyrillic layout 53 | nnoremap Р ^ 54 | nnoremap Д $ 55 | 56 | " H / L - mark to the beginning/end (not including line break) 57 | " of the line in visual mode 58 | vnoremap H ^ 59 | vnoremap L g_ 60 | " Same for Cyrillic layout 61 | vnoremap Р ^ 62 | vnoremap Д g_ 63 | 64 | " ---------- Switching between tabs ------------ 65 | " `g` - Switch to tab number 66 | nnoremap g1 1gt 67 | nnoremap g2 2gt 68 | nnoremap g3 3gt 69 | nnoremap g4 4gt 70 | nnoremap g5 5gt 71 | nnoremap g6 6gt 72 | nnoremap g7 7gt 73 | nnoremap g8 8gt 74 | nnoremap g9 9gt 75 | 76 | " `J` - Go to the next tab 77 | nmap J (NextTab) 78 | " `K` - Go to the previous tab 79 | nmap K (PreviousTab) 80 | 81 | " `m` - Move current tab to the right 82 | nnoremap m :tabmove +1 83 | " `M` - Move current tab to the left 84 | nnoremap M :tabmove -1 85 | 86 | 87 | " Window navigation keymaps 88 | nmap h 89 | nmap j 90 | nmap k 91 | nmap l 92 | nmap :q 93 | 94 | " Code navigation keymaps 95 | nmap gb (Back) 96 | nmap gf (Forward) 97 | nmap gd (GotoDeclaration) 98 | nmap gu (FindUsages) 99 | nmap gl (ShowErrorDescription) 100 | 101 | " Stay in visual mode after (un)indenting 102 | vmap < >gv^ 104 | 105 | " Reload .ideavimrc without restarting the IDE 106 | nmap ir (IdeaVim.ReloadVimRc.reload) 107 | 108 | " find things 109 | nmap f :find 110 | 111 | " Other windows access 112 | nmap e :NERDTreeFocus 113 | 114 | 115 | " NERDTree keymaps : open/close a node with l/h 116 | let g:NERDTreeMapActivateNode="l" 117 | let g:NERDTreeMapCloseDir="h" 118 | 119 | " Save current file with C-s 120 | nmap :w 121 | 122 | " Comment out the line 123 | nnoremap / :action CommentByLineComment 124 | vmap / :action CommentByLineComment 125 | -------------------------------------------------------------------------------- /jetbrains/ide_keymaps.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shitcoding/dotfiles/c5f1c1913a0d40ce42853364e0b47af4fd1e0e7c/jetbrains/ide_keymaps.zip -------------------------------------------------------------------------------- /karabiner/karabiner.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": [ 3 | { 4 | "complex_modifications": { 5 | "rules": [ 6 | { 7 | "description": "Emacs-like text editing shortcuts for macOS", 8 | "manipulators": [ 9 | { 10 | "conditions": [ 11 | { 12 | "bundle_identifiers": [ 13 | "^org\\.gnu\\.Emacs$", 14 | "^org\\.gnu\\.AquamacsEmacs$", 15 | "^org\\.gnu\\.Aquamacs$", 16 | "^org\\.pqrs\\.terminals\\..*$", 17 | "^com\\.googlecode\\.iterm2$", 18 | "^com\\.apple\\.Terminal$", 19 | "^org\\.alacritty$", 20 | "^vim$", 21 | "^nvim$", 22 | "^lvim$", 23 | "^tmux$", 24 | "^md\\.obsidian$" 25 | ], 26 | "type": "frontmost_application_unless" 27 | } 28 | ], 29 | "from": { 30 | "key_code": "w", 31 | "modifiers": { 32 | "mandatory": ["control"], 33 | "optional": ["any"] 34 | } 35 | }, 36 | "to": [ 37 | { 38 | "key_code": "delete_or_backspace", 39 | "modifiers": ["option"] 40 | } 41 | ], 42 | "type": "basic" 43 | }, 44 | { 45 | "conditions": [ 46 | { 47 | "bundle_identifiers": [ 48 | "^org\\.gnu\\.Emacs$", 49 | "^org\\.gnu\\.AquamacsEmacs$", 50 | "^org\\.gnu\\.Aquamacs$", 51 | "^org\\.pqrs\\.terminals\\..*$", 52 | "^com\\.googlecode\\.iterm2$", 53 | "^com\\.apple\\.Terminal$", 54 | "^org\\.alacritty$", 55 | "^vim$", 56 | "^nvim$", 57 | "^lvim$", 58 | "^tmux$", 59 | "^md\\.obsidian$", 60 | "^org\\.mozilla\\.firefox$" 61 | ], 62 | "type": "frontmost_application_unless" 63 | } 64 | ], 65 | "from": { 66 | "key_code": "u", 67 | "modifiers": { 68 | "mandatory": ["control"], 69 | "optional": ["any"] 70 | } 71 | }, 72 | "to": [ 73 | { 74 | "key_code": "delete_or_backspace", 75 | "modifiers": ["command"] 76 | } 77 | ], 78 | "type": "basic" 79 | }, 80 | { 81 | "conditions": [ 82 | { 83 | "bundle_identifiers": [ 84 | "^org\\.gnu\\.Emacs$", 85 | "^org\\.gnu\\.AquamacsEmacs$", 86 | "^org\\.gnu\\.Aquamacs$", 87 | "^org\\.pqrs\\.terminals\\..*$", 88 | "^com\\.googlecode\\.iterm2$", 89 | "^com\\.apple\\.Terminal$", 90 | "^org\\.alacritty$", 91 | "^vim$", 92 | "^nvim$", 93 | "^lvim$", 94 | "^tmux$", 95 | "^md\\.obsidian$" 96 | ], 97 | "type": "frontmost_application_unless" 98 | } 99 | ], 100 | "from": { 101 | "key_code": "d", 102 | "modifiers": { 103 | "mandatory": ["option"], 104 | "optional": ["any"] 105 | } 106 | }, 107 | "to": [ 108 | { 109 | "key_code": "delete_forward", 110 | "modifiers": ["option"] 111 | } 112 | ], 113 | "type": "basic" 114 | }, 115 | { 116 | "conditions": [ 117 | { 118 | "bundle_identifiers": [ 119 | "^org\\.gnu\\.Emacs$", 120 | "^org\\.gnu\\.AquamacsEmacs$", 121 | "^org\\.gnu\\.Aquamacs$", 122 | "^org\\.pqrs\\.terminals\\..*$", 123 | "^com\\.googlecode\\.iterm2$", 124 | "^com\\.apple\\.Terminal$", 125 | "^org\\.alacritty$", 126 | "^vim$", 127 | "^nvim$", 128 | "^lvim$", 129 | "^tmux$", 130 | "^md\\.obsidian$" 131 | ], 132 | "type": "frontmost_application_unless" 133 | } 134 | ], 135 | "from": { 136 | "key_code": "b", 137 | "modifiers": { 138 | "mandatory": ["option"], 139 | "optional": ["any"] 140 | } 141 | }, 142 | "to": [ 143 | { 144 | "key_code": "left_arrow", 145 | "modifiers": ["option"] 146 | } 147 | ], 148 | "type": "basic" 149 | }, 150 | { 151 | "conditions": [ 152 | { 153 | "bundle_identifiers": [ 154 | "^org\\.gnu\\.Emacs$", 155 | "^org\\.gnu\\.AquamacsEmacs$", 156 | "^org\\.gnu\\.Aquamacs$", 157 | "^org\\.pqrs\\.terminals\\..*$", 158 | "^com\\.googlecode\\.iterm2$", 159 | "^com\\.apple\\.Terminal$", 160 | "^org\\.alacritty$", 161 | "^vim$", 162 | "^nvim$", 163 | "^lvim$", 164 | "^tmux$", 165 | "^md\\.obsidian$" 166 | ], 167 | "type": "frontmost_application_unless" 168 | } 169 | ], 170 | "from": { 171 | "key_code": "f", 172 | "modifiers": { 173 | "mandatory": ["option"], 174 | "optional": ["any"] 175 | } 176 | }, 177 | "to": [ 178 | { 179 | "key_code": "right_arrow", 180 | "modifiers": ["option"] 181 | } 182 | ], 183 | "type": "basic" 184 | }, 185 | { 186 | "conditions": [ 187 | { 188 | "bundle_identifiers": [ 189 | "^org\\.gnu\\.Emacs$", 190 | "^org\\.gnu\\.AquamacsEmacs$", 191 | "^org\\.gnu\\.Aquamacs$", 192 | "^org\\.pqrs\\.terminals\\..*$", 193 | "^com\\.googlecode\\.iterm2$", 194 | "^com\\.apple\\.Terminal$", 195 | "^org\\.alacritty$", 196 | "^vim$", 197 | "^nvim$", 198 | "^lvim$", 199 | "^tmux$", 200 | "^md\\.obsidian$", 201 | "^org\\.mozilla\\.firefox$" 202 | ], 203 | "type": "frontmost_application_unless" 204 | } 205 | ], 206 | "from": { 207 | "key_code": "d", 208 | "modifiers": { 209 | "mandatory": ["control"], 210 | "optional": ["any"] 211 | } 212 | }, 213 | "to": [ 214 | { 215 | "key_code": "delete_forward", 216 | "modifiers": [] 217 | } 218 | ], 219 | "type": "basic" 220 | }, 221 | { 222 | "conditions": [ 223 | { 224 | "bundle_identifiers": [ 225 | "^org\\.gnu\\.Emacs$", 226 | "^org\\.gnu\\.AquamacsEmacs$", 227 | "^org\\.gnu\\.Aquamacs$", 228 | "^org\\.pqrs\\.terminals\\..*$", 229 | "^com\\.googlecode\\.iterm2$", 230 | "^com\\.apple\\.Terminal$", 231 | "^org\\.alacritty$", 232 | "^vim$", 233 | "^nvim$", 234 | "^lvim$", 235 | "^tmux$", 236 | "^md\\.obsidian$" 237 | ], 238 | "type": "frontmost_application_unless" 239 | } 240 | ], 241 | "from": { 242 | "key_code": "a", 243 | "modifiers": { 244 | "mandatory": ["control"], 245 | "optional": ["any"] 246 | } 247 | }, 248 | "to": [ 249 | { 250 | "key_code": "left_arrow", 251 | "modifiers": ["command"] 252 | } 253 | ], 254 | "type": "basic" 255 | }, 256 | { 257 | "conditions": [ 258 | { 259 | "bundle_identifiers": [ 260 | "^org\\.gnu\\.Emacs$", 261 | "^org\\.gnu\\.AquamacsEmacs$", 262 | "^org\\.gnu\\.Aquamacs$", 263 | "^org\\.pqrs\\.terminals\\..*$", 264 | "^com\\.googlecode\\.iterm2$", 265 | "^com\\.apple\\.Terminal$", 266 | "^org\\.alacritty$", 267 | "^vim$", 268 | "^nvim$", 269 | "^lvim$", 270 | "^tmux$", 271 | "^md\\.obsidian$" 272 | ], 273 | "type": "frontmost_application_unless" 274 | } 275 | ], 276 | "from": { 277 | "key_code": "e", 278 | "modifiers": { 279 | "mandatory": ["control"], 280 | "optional": ["any"] 281 | } 282 | }, 283 | "to": [ 284 | { 285 | "key_code": "right_arrow", 286 | "modifiers": ["command"] 287 | } 288 | ], 289 | "type": "basic" 290 | }, 291 | { 292 | "conditions": [ 293 | { 294 | "bundle_identifiers": [ 295 | "^org\\.gnu\\.Emacs$", 296 | "^org\\.gnu\\.AquamacsEmacs$", 297 | "^org\\.gnu\\.Aquamacs$", 298 | "^org\\.pqrs\\.terminals\\..*$", 299 | "^com\\.googlecode\\.iterm2$", 300 | "^com\\.apple\\.Terminal$", 301 | "^org\\.alacritty$", 302 | "^vim$", 303 | "^nvim$", 304 | "^lvim$", 305 | "^tmux$", 306 | "^md\\.obsidian$" 307 | ], 308 | "type": "frontmost_application_unless" 309 | } 310 | ], 311 | "from": { 312 | "key_code": "b", 313 | "modifiers": { 314 | "mandatory": ["control"], 315 | "optional": ["any"] 316 | } 317 | }, 318 | "to": [ 319 | { 320 | "key_code": "delete_or_backspace", 321 | "modifiers": [] 322 | } 323 | ], 324 | "type": "basic" 325 | } 326 | ] 327 | }, 328 | { 329 | "description": "Cmd+HJKL to Ctrl+A then HJKL for tmux navigation (Alacritty only)", 330 | "manipulators": [ 331 | { 332 | "conditions": [ 333 | { 334 | "bundle_identifiers": [ 335 | "^org\\.alacritty$", 336 | "^com\\.googlecode\\.iterm2$", 337 | "^com\\.apple\\.Terminal$", 338 | "^tmux$" 339 | ], 340 | "type": "frontmost_application_if" 341 | } 342 | ], 343 | "description": "Cmd+H to Ctrl+A then H", 344 | "from": { 345 | "key_code": "h", 346 | "modifiers": { "mandatory": ["command"] } 347 | }, 348 | "to": [ 349 | { 350 | "key_code": "a", 351 | "modifiers": ["control"] 352 | }, 353 | { "key_code": "h" } 354 | ], 355 | "type": "basic" 356 | }, 357 | { 358 | "conditions": [ 359 | { 360 | "bundle_identifiers": [ 361 | "^org\\.alacritty$", 362 | "^com\\.googlecode\\.iterm2$", 363 | "^com\\.apple\\.Terminal$", 364 | "^tmux$" 365 | ], 366 | "type": "frontmost_application_if" 367 | } 368 | ], 369 | "description": "Cmd+J to Ctrl+A then J", 370 | "from": { 371 | "key_code": "j", 372 | "modifiers": { "mandatory": ["command"] } 373 | }, 374 | "to": [ 375 | { 376 | "key_code": "a", 377 | "modifiers": ["control"] 378 | }, 379 | { "key_code": "j" } 380 | ], 381 | "type": "basic" 382 | }, 383 | { 384 | "conditions": [ 385 | { 386 | "bundle_identifiers": [ 387 | "^org\\.alacritty$", 388 | "^com\\.googlecode\\.iterm2$", 389 | "^com\\.apple\\.Terminal$", 390 | "^tmux$" 391 | ], 392 | "type": "frontmost_application_if" 393 | } 394 | ], 395 | "description": "Cmd+K to Ctrl+A then K", 396 | "from": { 397 | "key_code": "k", 398 | "modifiers": { "mandatory": ["command"] } 399 | }, 400 | "to": [ 401 | { 402 | "key_code": "a", 403 | "modifiers": ["control"] 404 | }, 405 | { "key_code": "k" } 406 | ], 407 | "type": "basic" 408 | }, 409 | { 410 | "conditions": [ 411 | { 412 | "bundle_identifiers": [ 413 | "^org\\.alacritty$", 414 | "^com\\.googlecode\\.iterm2$", 415 | "^com\\.apple\\.Terminal$", 416 | "^tmux$" 417 | ], 418 | "type": "frontmost_application_if" 419 | } 420 | ], 421 | "description": "Cmd+L to Ctrl+A then L", 422 | "from": { 423 | "key_code": "l", 424 | "modifiers": { "mandatory": ["command"] } 425 | }, 426 | "to": [ 427 | { 428 | "key_code": "a", 429 | "modifiers": ["control"] 430 | }, 431 | { "key_code": "l" } 432 | ], 433 | "type": "basic" 434 | } 435 | ] 436 | }, 437 | { 438 | "description": "Left Cmd → F3 for Mission Control when pressed alone, regular Cmd otherwise", 439 | "manipulators": [ 440 | { 441 | "from": { 442 | "key_code": "left_command", 443 | "modifiers": { "optional": ["any"] } 444 | }, 445 | "to": [{ "key_code": "left_command" }], 446 | "to_if_alone": [{ "key_code": "f3" }], 447 | "type": "basic" 448 | } 449 | ] 450 | }, 451 | { 452 | "description": "Left Ctrl + hjkl to arrow keys with exclusions and pass Ctrl-Cmd-H/L/K to BTT", 453 | "manipulators": [ 454 | { 455 | "description": "Pass through Ctrl-Cmd-H for BetterTouchTool", 456 | "from": { 457 | "key_code": "h", 458 | "modifiers": { 459 | "mandatory": ["control", "command"], 460 | "optional": ["any"] 461 | } 462 | }, 463 | "to": [ 464 | { 465 | "key_code": "h", 466 | "modifiers": ["control", "command"] 467 | } 468 | ], 469 | "type": "basic" 470 | }, 471 | { 472 | "description": "Pass through Ctrl-Cmd-L for BetterTouchTool", 473 | "from": { 474 | "key_code": "l", 475 | "modifiers": { 476 | "mandatory": ["control", "command"], 477 | "optional": ["any"] 478 | } 479 | }, 480 | "to": [ 481 | { 482 | "key_code": "l", 483 | "modifiers": ["control", "command"] 484 | } 485 | ], 486 | "type": "basic" 487 | }, 488 | { 489 | "description": "Pass through Ctrl-Cmd-K for BetterTouchTool", 490 | "from": { 491 | "key_code": "k", 492 | "modifiers": { 493 | "mandatory": ["control", "command"], 494 | "optional": ["any"] 495 | } 496 | }, 497 | "to": [ 498 | { 499 | "key_code": "k", 500 | "modifiers": ["control", "command"] 501 | } 502 | ], 503 | "type": "basic" 504 | }, 505 | { 506 | "conditions": [ 507 | { 508 | "bundle_identifiers": [ 509 | "^org\\.alacritty$", 510 | "^com\\.googlecode\\.iterm2$", 511 | "^com\\.apple\\.Terminal$", 512 | "^tmux$", 513 | "^vim$", 514 | "^nvim$" 515 | ], 516 | "type": "frontmost_application_unless" 517 | } 518 | ], 519 | "from": { 520 | "key_code": "h", 521 | "modifiers": { 522 | "mandatory": ["control"], 523 | "optional": ["any"] 524 | } 525 | }, 526 | "to": [{ "key_code": "left_arrow" }], 527 | "type": "basic" 528 | }, 529 | { 530 | "conditions": [ 531 | { 532 | "bundle_identifiers": [ 533 | "^org\\.alacritty$", 534 | "^com\\.googlecode\\.iterm2$", 535 | "^com\\.apple\\.Terminal$", 536 | "^tmux$", 537 | "^vim$", 538 | "^nvim$" 539 | ], 540 | "type": "frontmost_application_unless" 541 | } 542 | ], 543 | "from": { 544 | "key_code": "j", 545 | "modifiers": { 546 | "mandatory": ["control"], 547 | "optional": ["any"] 548 | } 549 | }, 550 | "to": [{ "key_code": "down_arrow" }], 551 | "type": "basic" 552 | }, 553 | { 554 | "conditions": [ 555 | { 556 | "bundle_identifiers": [ 557 | "^org\\.alacritty$", 558 | "^com\\.googlecode\\.iterm2$", 559 | "^com\\.apple\\.Terminal$", 560 | "^tmux$", 561 | "^vim$", 562 | "^nvim$" 563 | ], 564 | "type": "frontmost_application_unless" 565 | } 566 | ], 567 | "from": { 568 | "key_code": "k", 569 | "modifiers": { 570 | "mandatory": ["control"], 571 | "optional": ["any"] 572 | } 573 | }, 574 | "to": [{ "key_code": "up_arrow" }], 575 | "type": "basic" 576 | }, 577 | { 578 | "conditions": [ 579 | { 580 | "bundle_identifiers": [ 581 | "^org\\.alacritty$", 582 | "^com\\.googlecode\\.iterm2$", 583 | "^com\\.apple\\.Terminal$", 584 | "^tmux$", 585 | "^vim$", 586 | "^nvim$" 587 | ], 588 | "type": "frontmost_application_unless" 589 | } 590 | ], 591 | "from": { 592 | "key_code": "l", 593 | "modifiers": { 594 | "mandatory": ["control"], 595 | "optional": ["any"] 596 | } 597 | }, 598 | "to": [{ "key_code": "right_arrow" }], 599 | "type": "basic" 600 | } 601 | ] 602 | }, 603 | { 604 | "description": "Ctrl Key → Hyper Key (⌃⌥⇧⌘)", 605 | "manipulators": [ 606 | { 607 | "from": { 608 | "key_code": "left_control", 609 | "modifiers": { "optional": ["caps_lock"] } 610 | }, 611 | "to": [ 612 | { 613 | "key_code": "left_shift", 614 | "modifiers": ["left_command", "left_control", "left_option"] 615 | } 616 | ], 617 | "type": "basic" 618 | } 619 | ] 620 | }, 621 | { 622 | "description": "Caps→Esc/Ctrl if held", 623 | "manipulators": [ 624 | { 625 | "from": { 626 | "key_code": "caps_lock", 627 | "modifiers": { "optional": ["any"] } 628 | }, 629 | "to": [{ "key_code": "left_control" }], 630 | "to_if_alone": [{ "key_code": "escape" }], 631 | "type": "basic" 632 | } 633 | ] 634 | }, 635 | { 636 | "description": "double left shift to cap_lock", 637 | "manipulators": [ 638 | { 639 | "conditions": [ 640 | { 641 | "name": "left_shift pressed", 642 | "type": "variable_if", 643 | "value": 1 644 | } 645 | ], 646 | "from": { 647 | "key_code": "left_shift", 648 | "modifiers": { "optional": ["any"] } 649 | }, 650 | "to": [{ "key_code": "caps_lock" }], 651 | "type": "basic" 652 | }, 653 | { 654 | "from": { 655 | "key_code": "left_shift", 656 | "modifiers": { "optional": ["any"] } 657 | }, 658 | "to": [ 659 | { 660 | "set_variable": { 661 | "name": "left_shift pressed", 662 | "value": 1 663 | } 664 | }, 665 | { "key_code": "left_shift" } 666 | ], 667 | "to_delayed_action": { 668 | "to_if_canceled": [ 669 | { 670 | "set_variable": { 671 | "name": "left_shift pressed", 672 | "value": 0 673 | } 674 | } 675 | ], 676 | "to_if_invoked": [ 677 | { 678 | "set_variable": { 679 | "name": "left_shift pressed", 680 | "value": 0 681 | } 682 | } 683 | ] 684 | }, 685 | "type": "basic" 686 | } 687 | ] 688 | } 689 | ] 690 | }, 691 | "name": "Default profile", 692 | "selected": true, 693 | "virtual_hid_keyboard": { "keyboard_type_v2": "ansi" } 694 | } 695 | ] 696 | } -------------------------------------------------------------------------------- /kitty/kitty.conf: -------------------------------------------------------------------------------- 1 | # vim:fileencoding=utf-8:ft=conf:foldmethod=marker 2 | 3 | #: Fonts {{{ 4 | 5 | font_family Meslo LG S Regular Nerd Font Complete 6 | bold_font Meslo LG S Bold Nerd Font Complete 7 | italic_font Meslo LG S Italic Nerd Font Complete 8 | bold_italic_font Meslo LG S Bold Italic Nerd Font Complete 9 | 10 | font_size 11.0 11 | 12 | #: }}} 13 | 14 | #: Cursor customization {{{ 15 | 16 | cursor_blink_interval 0 17 | 18 | #: }}} 19 | 20 | 21 | #: Mouse {{{ 22 | 23 | # mouse_hide_wait 3.0 24 | 25 | #: Hide mouse cursor after the specified number of seconds of the 26 | #: mouse not being used. Set to zero to disable mouse cursor hiding. 27 | #: Set to a negative value to hide the mouse cursor immediately when 28 | #: typing text. Disabled by default on macOS as getting it to work 29 | #: robustly with the ever-changing sea of bugs that is Cocoa is too 30 | #: much effort. 31 | 32 | # url_color #0087bd 33 | # url_style curly 34 | 35 | #: The color and style for highlighting URLs on mouse-over. url_style 36 | #: can be one of: none, single, double, curly 37 | 38 | # open_url_with default 39 | 40 | #: The program with which to open URLs that are clicked on. The 41 | #: special value default means to use the operating system's default 42 | #: URL handler. 43 | 44 | # url_prefixes http https file ftp gemini irc gopher mailto news git 45 | 46 | #: The set of URL prefixes to look for when detecting a URL under the 47 | #: mouse cursor. 48 | 49 | # detect_urls yes 50 | 51 | #: Detect URLs under the mouse. Detected URLs are highlighted with an 52 | #: underline and the mouse cursor becomes a hand over them. Even if 53 | #: this option is disabled, URLs are still clickable. 54 | 55 | # url_excluded_characters 56 | 57 | #: Additional characters to be disallowed from URLs, when detecting 58 | #: URLs under the mouse cursor. By default, all characters legal in 59 | #: URLs are allowed. 60 | 61 | # copy_on_select no 62 | 63 | #: Copy to clipboard or a private buffer on select. With this set to 64 | #: clipboard, simply selecting text with the mouse will cause the text 65 | #: to be copied to clipboard. Useful on platforms such as macOS that 66 | #: do not have the concept of primary selections. You can instead 67 | #: specify a name such as a1 to copy to a private kitty buffer 68 | #: instead. Map a shortcut with the paste_from_buffer action to paste 69 | #: from this private buffer. For example:: 70 | 71 | #: map cmd+shift+v paste_from_buffer a1 72 | 73 | #: Note that copying to the clipboard is a security risk, as all 74 | #: programs, including websites open in your browser can read the 75 | #: contents of the system clipboard. 76 | 77 | # strip_trailing_spaces never 78 | 79 | #: Remove spaces at the end of lines when copying to clipboard. A 80 | #: value of smart will do it when using normal selections, but not 81 | #: rectangle selections. always will always do it. 82 | 83 | # select_by_word_characters @-./_~?&=%+# 84 | 85 | #: Characters considered part of a word when double clicking. In 86 | #: addition to these characters any character that is marked as an 87 | #: alphanumeric character in the unicode database will be matched. 88 | 89 | # click_interval -1.0 90 | 91 | #: The interval between successive clicks to detect double/triple 92 | #: clicks (in seconds). Negative numbers will use the system default 93 | #: instead, if available, or fallback to 0.5. 94 | 95 | # focus_follows_mouse no 96 | 97 | #: Set the active window to the window under the mouse when moving the 98 | #: mouse around 99 | 100 | # pointer_shape_when_grabbed arrow 101 | 102 | #: The shape of the mouse pointer when the program running in the 103 | #: terminal grabs the mouse. Valid values are: arrow, beam and hand 104 | 105 | # default_pointer_shape beam 106 | 107 | #: The default shape of the mouse pointer. Valid values are: arrow, 108 | #: beam and hand 109 | 110 | # pointer_shape_when_dragging beam 111 | 112 | #: The default shape of the mouse pointer when dragging across text. 113 | #: Valid values are: arrow, beam and hand 114 | 115 | #: Mouse actions {{{ 116 | 117 | #: Mouse buttons can be remapped to perform arbitrary actions. The 118 | #: syntax for doing so is: 119 | 120 | #: .. code-block:: none 121 | 122 | #: mouse_map button-name event-type modes action 123 | 124 | #: Where ``button-name`` is one of ``left``, ``middle``, ``right`` or 125 | #: ``b1 ... b8`` with added keyboard modifiers, for example: 126 | #: ``ctrl+shift+left`` refers to holding the ctrl+shift keys while 127 | #: clicking with the left mouse button. The number ``b1 ... b8`` can 128 | #: be used to refer to upto eight buttons on a mouse. 129 | 130 | #: ``event-type`` is one ``press``, ``release``, ``doublepress``, 131 | #: ``triplepress``, ``click`` and ``doubleclick``. ``modes`` 132 | #: indicates whether the action is performed when the mouse is grabbed 133 | #: by the program running in the terminal, or not. It can have one or 134 | #: more or the values, ``grabbed,ungrabbed``. ``grabbed`` refers to 135 | #: when the program running in the terminal has requested mouse 136 | #: events. Note that the click and double click events have a delay of 137 | #: click_interval to disambiguate from double and triple presses. 138 | 139 | #: You can run kitty with the kitty --debug-input command line option 140 | #: to see mouse events. See the builtin actions below to get a sense 141 | #: of what is possible. 142 | 143 | #: If you want to unmap an action map it to ``no-op``. For example, to 144 | #: disable opening of URLs with a plain click:: 145 | 146 | #: mouse_map left click ungrabbed no-op 147 | 148 | #: .. note:: 149 | #: Once a selection is started, releasing the button that started it will 150 | #: automatically end it and no release event will be dispatched. 151 | 152 | # mouse_map left click ungrabbed mouse_click_url_or_select 153 | # mouse_map shift+left click grabbed,ungrabbed mouse_click_url_or_select 154 | # mouse_map ctrl+shift+left release grabbed,ungrabbed mouse_click_url 155 | 156 | #: Variant with ctrl+shift is present because the simple click based 157 | #: version has an unavoidable delay of click_interval, to disambiguate 158 | #: clicks from double clicks. 159 | 160 | # mouse_map ctrl+shift+left press grabbed discard_event 161 | 162 | #: Prevent this press event from being sent to the program that has 163 | #: grabbed the mouse, as the corresponding release event is used to 164 | #: open a URL. 165 | 166 | # mouse_map middle release ungrabbed paste_from_selection 167 | # mouse_map left press ungrabbed mouse_selection normal 168 | # mouse_map ctrl+alt+left press ungrabbed mouse_selection rectangle 169 | # mouse_map left doublepress ungrabbed mouse_selection word 170 | # mouse_map left triplepress ungrabbed mouse_selection line 171 | 172 | #: Select the entire line 173 | 174 | # mouse_map ctrl+alt+left triplepress ungrabbed mouse_selection line_from_point 175 | 176 | #: Select from the clicked point to the end of the line 177 | 178 | # mouse_map right press ungrabbed mouse_selection extend 179 | # mouse_map shift+middle release ungrabbed,grabbed paste_selection 180 | # mouse_map shift+left press ungrabbed,grabbed mouse_selection normal 181 | # mouse_map shift+ctrl+alt+left press ungrabbed,grabbed mouse_selection rectangle 182 | # mouse_map shift+left doublepress ungrabbed,grabbed mouse_selection word 183 | # mouse_map shift+left triplepress ungrabbed,grabbed mouse_selection line 184 | 185 | #: Select the entire line 186 | 187 | # mouse_map shift+ctrl+alt+left triplepress ungrabbed,grabbed mouse_selection line_from_point 188 | 189 | #: Select from the clicked point to the end of the line 190 | 191 | # mouse_map shift+right press ungrabbed,grabbed mouse_selection extend 192 | #: }}} 193 | 194 | #: }}} 195 | 196 | 197 | #: Terminal bell {{{ 198 | 199 | # enable_audio_bell yes 200 | 201 | #: Enable/disable the audio bell. Useful in environments that require 202 | #: silence. 203 | 204 | # visual_bell_duration 0.0 205 | 206 | #: Visual bell duration. Flash the screen when a bell occurs for the 207 | #: specified number of seconds. Set to zero to disable. 208 | 209 | # window_alert_on_bell yes 210 | 211 | #: Request window attention on bell. Makes the dock icon bounce on 212 | #: macOS or the taskbar flash on linux. 213 | 214 | # bell_on_tab yes 215 | 216 | #: Show a bell symbol on the tab if a bell occurs in one of the 217 | #: windows in the tab and the window is not the currently focused 218 | #: window 219 | 220 | # command_on_bell none 221 | 222 | #: Program to run when a bell occurs. 223 | 224 | #: }}} 225 | 226 | #: Window layout {{{ 227 | 228 | # remember_window_size yes 229 | initial_window_width 500 230 | initial_window_height 300 231 | 232 | 233 | inactive_text_alpha 0.4 234 | 235 | hide_window_decorations yes 236 | 237 | 238 | 239 | #: }}} 240 | 241 | #: Color scheme {{{ 242 | 243 | background_opacity 0.9 244 | 245 | #: }}} 246 | 247 | 248 | 249 | #: Keyboard shortcuts {{{ 250 | 251 | #: Keys are identified simply by their lowercase unicode characters. 252 | #: For example: ``a`` for the A key, ``[`` for the left square bracket 253 | #: key, etc. For functional keys, such as ``Enter or Escape`` the 254 | #: names are present at https://sw.kovidgoyal.net/kitty/keyboard- 255 | #: protocol.html#functional-key-definitions. For a list of modifier 256 | #: names, see: GLFW mods 257 | #: 258 | 259 | #: On Linux you can also use XKB key names to bind keys that are not 260 | #: supported by GLFW. See XKB keys 261 | #: for a list of key names. The name to use is the part 263 | #: after the XKB_KEY_ prefix. Note that you can only use an XKB key 264 | #: name for keys that are not known as GLFW keys. 265 | 266 | #: Finally, you can use raw system key codes to map keys, again only 267 | #: for keys that are not known as GLFW keys. To see the system key 268 | #: code for a key, start kitty with the kitty --debug-input option. 269 | #: Then kitty will output some debug text for every key event. In that 270 | #: text look for ``native_code`` the value of that becomes the key 271 | #: name in the shortcut. For example: 272 | 273 | #: .. code-block:: none 274 | 275 | #: on_key_input: glfw key: 65 native_code: 0x61 action: PRESS mods: 0x0 text: 'a' 276 | 277 | #: Here, the key name for the A key is 0x61 and you can use it with:: 278 | 279 | #: map ctrl+0x61 something 280 | 281 | #: to map ctrl+a to something. 282 | 283 | #: You can use the special action no_op to unmap a keyboard shortcut 284 | #: that is assigned in the default configuration:: 285 | 286 | #: map kitty_mod+space no_op 287 | 288 | #: You can combine multiple actions to be triggered by a single 289 | #: shortcut, using the syntax below:: 290 | 291 | #: map key combine action1 action2 action3 ... 292 | 293 | #: For example:: 294 | 295 | #: map kitty_mod+e combine : new_window : next_layout 296 | 297 | #: this will create a new window and switch to the next available 298 | #: layout 299 | 300 | #: You can use multi-key shortcuts using the syntax shown below:: 301 | 302 | #: map key1>key2>key3 action 303 | 304 | #: For example:: 305 | 306 | #: map ctrl+f>2 set_font_size 20 307 | 308 | # kitty_mod ctrl+shift 309 | 310 | #: The value of kitty_mod is used as the modifier for all default 311 | #: shortcuts, you can change it in your kitty.conf to change the 312 | #: modifiers for all the default shortcuts. 313 | 314 | # clear_all_shortcuts no 315 | 316 | #: You can have kitty remove all shortcut definition seen up to this 317 | #: point. Useful, for instance, to remove the default shortcuts. 318 | 319 | # kitten_alias hints hints --hints-offset=0 320 | 321 | #: You can create aliases for kitten names, this allows overriding the 322 | #: defaults for kitten options and can also be used to shorten 323 | #: repeated mappings of the same kitten with a specific group of 324 | #: options. For example, the above alias changes the default value of 325 | #: kitty +kitten hints --hints-offset to zero for all mappings, 326 | #: including the builtin ones. 327 | 328 | #: Clipboard {{{ 329 | 330 | # map kitty_mod+c copy_to_clipboard 331 | 332 | #: There is also a copy_or_interrupt action that can be optionally 333 | #: mapped to Ctrl+c. It will copy only if there is a selection and 334 | #: send an interrupt otherwise. Similarly, copy_and_clear_or_interrupt 335 | #: will copy and clear the selection or send an interrupt if there is 336 | #: no selection. 337 | 338 | # map kitty_mod+v paste_from_clipboard 339 | # map kitty_mod+s paste_from_selection 340 | # map kitty_mod+o pass_selection_to_program 341 | 342 | #: You can also pass the contents of the current selection to any 343 | #: program using pass_selection_to_program. By default, the system's 344 | #: open program is used, but you can specify your own, the selection 345 | #: will be passed as a command line argument to the program, for 346 | #: example:: 347 | 348 | #: map kitty_mod+o pass_selection_to_program firefox 349 | 350 | #: You can pass the current selection to a terminal program running in 351 | #: a new kitty window, by using the @selection placeholder:: 352 | 353 | #: map kitty_mod+y new_window less @selection 354 | 355 | #: }}} 356 | 357 | #: Scrolling {{{ 358 | 359 | # map kitty_mod+up scroll_line_up 360 | # map kitty_mod+down scroll_line_down 361 | # map kitty_mod+page_up scroll_page_up 362 | # map kitty_mod+page_down scroll_page_down 363 | # map kitty_mod+home scroll_home 364 | # map kitty_mod+end scroll_end 365 | # map kitty_mod+h show_scrollback 366 | 367 | #: You can pipe the contents of the current screen + history buffer as 368 | #: STDIN to an arbitrary program using the ``launch`` function. For 369 | #: example, the following opens the scrollback buffer in less in an 370 | #: overlay window:: 371 | 372 | #: map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay less +G -R 373 | 374 | #: For more details on piping screen and buffer contents to external 375 | #: programs, see launch. 376 | 377 | #: }}} 378 | 379 | #: Window management {{{ 380 | 381 | # map kitty_mod+enter new_window 382 | 383 | #: You can open a new window running an arbitrary program, for 384 | #: example:: 385 | 386 | #: map kitty_mod+y launch mutt 387 | 388 | #: You can open a new window with the current working directory set to 389 | #: the working directory of the current window using:: 390 | 391 | #: map ctrl+alt+enter launch --cwd=current 392 | 393 | #: You can open a new window that is allowed to control kitty via the 394 | #: kitty remote control facility by prefixing the command line with @. 395 | #: Any programs running in that window will be allowed to control 396 | #: kitty. For example:: 397 | 398 | #: map ctrl+enter launch --allow-remote-control some_program 399 | 400 | #: You can open a new window next to the currently active window or as 401 | #: the first window, with:: 402 | 403 | #: map ctrl+n launch --location=neighbor some_program 404 | #: map ctrl+f launch --location=first some_program 405 | 406 | #: For more details, see launch. 407 | 408 | # map kitty_mod+n new_os_window 409 | 410 | #: Works like new_window above, except that it opens a top level OS 411 | #: kitty window. In particular you can use new_os_window_with_cwd to 412 | #: open a window with the current working directory. 413 | 414 | # map kitty_mod+w close_window 415 | # map kitty_mod+] next_window 416 | # map kitty_mod+[ previous_window 417 | # map kitty_mod+f move_window_forward 418 | # map kitty_mod+b move_window_backward 419 | # map kitty_mod+` move_window_to_top 420 | # map kitty_mod+r start_resizing_window 421 | # map kitty_mod+1 first_window 422 | # map kitty_mod+2 second_window 423 | # map kitty_mod+3 third_window 424 | # map kitty_mod+4 fourth_window 425 | # map kitty_mod+5 fifth_window 426 | # map kitty_mod+6 sixth_window 427 | # map kitty_mod+7 seventh_window 428 | # map kitty_mod+8 eighth_window 429 | # map kitty_mod+9 ninth_window 430 | # map kitty_mod+0 tenth_window 431 | #: }}} 432 | 433 | #: Tab management {{{ 434 | 435 | # map kitty_mod+right next_tab 436 | # map kitty_mod+left previous_tab 437 | # map kitty_mod+t new_tab 438 | # map kitty_mod+q close_tab 439 | # map shift+cmd+w close_os_window 440 | # map kitty_mod+. move_tab_forward 441 | # map kitty_mod+, move_tab_backward 442 | # map kitty_mod+alt+t set_tab_title 443 | 444 | #: You can also create shortcuts to go to specific tabs, with 1 being 445 | #: the first tab, 2 the second tab and -1 being the previously active 446 | #: tab, and any number larger than the last tab being the last tab:: 447 | 448 | #: map ctrl+alt+1 goto_tab 1 449 | #: map ctrl+alt+2 goto_tab 2 450 | 451 | #: Just as with new_window above, you can also pass the name of 452 | #: arbitrary commands to run when using new_tab and use 453 | #: new_tab_with_cwd. Finally, if you want the new tab to open next to 454 | #: the current tab rather than at the end of the tabs list, use:: 455 | 456 | #: map ctrl+t new_tab !neighbor [optional cmd to run] 457 | #: }}} 458 | 459 | #: Layout management {{{ 460 | 461 | # map kitty_mod+l next_layout 462 | 463 | #: You can also create shortcuts to switch to specific layouts:: 464 | 465 | #: map ctrl+alt+t goto_layout tall 466 | #: map ctrl+alt+s goto_layout stack 467 | 468 | #: Similarly, to switch back to the previous layout:: 469 | 470 | #: map ctrl+alt+p last_used_layout 471 | #: }}} 472 | 473 | #: Font sizes {{{ 474 | 475 | #: You can change the font size for all top-level kitty OS windows at 476 | #: a time or only the current one. 477 | 478 | # map kitty_mod+equal change_font_size all +2.0 479 | # map kitty_mod+minus change_font_size all -2.0 480 | # map kitty_mod+backspace change_font_size all 0 481 | 482 | #: To setup shortcuts for specific font sizes:: 483 | 484 | #: map kitty_mod+f6 change_font_size all 10.0 485 | 486 | #: To setup shortcuts to change only the current OS window's font 487 | #: size:: 488 | 489 | #: map kitty_mod+f6 change_font_size current 10.0 490 | #: }}} 491 | 492 | #: Select and act on visible text {{{ 493 | 494 | #: Use the hints kitten to select text and either pass it to an 495 | #: external program or insert it into the terminal or copy it to the 496 | #: clipboard. 497 | 498 | # map kitty_mod+e kitten hints 499 | 500 | #: Open a currently visible URL using the keyboard. The program used 501 | #: to open the URL is specified in open_url_with. 502 | 503 | # map kitty_mod+p>f kitten hints --type path --program - 504 | 505 | #: Select a path/filename and insert it into the terminal. Useful, for 506 | #: instance to run git commands on a filename output from a previous 507 | #: git command. 508 | 509 | # map kitty_mod+p>shift+f kitten hints --type path 510 | 511 | #: Select a path/filename and open it with the default open program. 512 | 513 | # map kitty_mod+p>l kitten hints --type line --program - 514 | 515 | #: Select a line of text and insert it into the terminal. Use for the 516 | #: output of things like: ls -1 517 | 518 | # map kitty_mod+p>w kitten hints --type word --program - 519 | 520 | #: Select words and insert into terminal. 521 | 522 | # map kitty_mod+p>h kitten hints --type hash --program - 523 | 524 | #: Select something that looks like a hash and insert it into the 525 | #: terminal. Useful with git, which uses sha1 hashes to identify 526 | #: commits 527 | 528 | # map kitty_mod+p>n kitten hints --type linenum 529 | 530 | #: Select something that looks like filename:linenum and open it in 531 | #: vim at the specified line number. 532 | 533 | # map kitty_mod+p>y kitten hints --type hyperlink 534 | 535 | #: Select a hyperlink (i.e. a URL that has been marked as such by the 536 | #: terminal program, for example, by ls --hyperlink=auto). 537 | 538 | 539 | #: The hints kitten has many more modes of operation that you can map 540 | #: to different shortcuts. For a full description see kittens/hints. 541 | #: }}} 542 | 543 | #: Miscellaneous {{{ 544 | 545 | # map kitty_mod+f11 toggle_fullscreen 546 | # map kitty_mod+f10 toggle_maximized 547 | # map kitty_mod+u kitten unicode_input 548 | # map kitty_mod+f2 edit_config_file 549 | # map kitty_mod+escape kitty_shell window 550 | 551 | #: Open the kitty shell in a new window/tab/overlay/os_window to 552 | #: control kitty using commands. 553 | 554 | # map kitty_mod+a>m set_background_opacity +0.1 555 | # map kitty_mod+a>l set_background_opacity -0.1 556 | # map kitty_mod+a>1 set_background_opacity 1 557 | # map kitty_mod+a>d set_background_opacity default 558 | # map kitty_mod+delete clear_terminal reset active 559 | 560 | #: You can create shortcuts to clear/reset the terminal. For example:: 561 | 562 | #: # Reset the terminal 563 | #: map kitty_mod+f9 clear_terminal reset active 564 | #: # Clear the terminal screen by erasing all contents 565 | #: map kitty_mod+f10 clear_terminal clear active 566 | #: # Clear the terminal scrollback by erasing it 567 | #: map kitty_mod+f11 clear_terminal scrollback active 568 | #: # Scroll the contents of the screen into the scrollback 569 | #: map kitty_mod+f12 clear_terminal scroll active 570 | 571 | #: If you want to operate on all windows instead of just the current 572 | #: one, use all instead of active. 573 | 574 | #: It is also possible to remap Ctrl+L to both scroll the current 575 | #: screen contents into the scrollback buffer and clear the screen, 576 | #: instead of just clearing the screen, for example, for ZSH add the 577 | #: following to ~/.zshrc: 578 | 579 | #: .. code-block:: sh 580 | 581 | #: scroll-and-clear-screen() { 582 | #: printf '\n%.0s' {1..$LINES} 583 | #: zle clear-screen 584 | #: } 585 | #: zle -N scroll-and-clear-screen 586 | #: bindkey '^l' scroll-and-clear-screen 587 | 588 | # map kitty_mod+f5 load_config_file 589 | 590 | #: Reload kitty.conf, applying any changes since the last time it was 591 | #: loaded. Note that a handful of settings cannot be dynamically 592 | #: changed and require a full restart of kitty. You can also map a 593 | #: keybinding to load a different config file, for example:: 594 | 595 | #: map f5 load_config /path/to/alternative/kitty.conf 596 | 597 | #: Note that all setting from the original kitty.conf are discarded, 598 | #: in other words the new conf settings *replace* the old ones. 599 | 600 | # map kitty_mod+f6 debug_config 601 | 602 | #: Show details about exactly what configuration kitty is running with 603 | #: and its host environment. Useful for debugging issues. 604 | 605 | 606 | #: You can tell kitty to send arbitrary (UTF-8) encoded text to the 607 | #: client program when pressing specified shortcut keys. For example:: 608 | 609 | #: map ctrl+alt+a send_text all Special text 610 | 611 | #: This will send "Special text" when you press the ctrl+alt+a key 612 | #: combination. The text to be sent is a python string literal so you 613 | #: can use escapes like \x1b to send control codes or \u21fb to send 614 | #: unicode characters (or you can just input the unicode characters 615 | #: directly as UTF-8 text). The first argument to send_text is the 616 | #: keyboard modes in which to activate the shortcut. The possible 617 | #: values are normal or application or kitty or a comma separated 618 | #: combination of them. The special keyword all means all modes. The 619 | #: modes normal and application refer to the DECCKM cursor key mode 620 | #: for terminals, and kitty refers to the special kitty extended 621 | #: keyboard protocol. 622 | 623 | #: Another example, that outputs a word and then moves the cursor to 624 | #: the start of the line (same as pressing the Home key):: 625 | 626 | #: map ctrl+alt+a send_text normal Word\x1b[H 627 | #: map ctrl+alt+a send_text application Word\x1bOH 628 | 629 | #: }}} 630 | 631 | #: }}} 632 | -------------------------------------------------------------------------------- /lazydocker/config.yml: -------------------------------------------------------------------------------- 1 | # Lazydocker config docs: 2 | # https://github.com/jesseduffield/lazydocker/blob/master/docs/Config.md 3 | # https://pkg.go.dev/github.com/jesseduffield/lazydocker/pkg/config 4 | 5 | # Config goes to: $HOME/.config/lazydocker/config.yml 6 | 7 | commandTemplates: 8 | dockerCompose: docker compose 9 | gui: 10 | containerStatusHealthStyle: "icon" 11 | showBottomLine: false 12 | returnImmediately: true # Immediately return to Lazydocker after running exec on container 13 | logs: 14 | timestamps: false 15 | since: '60m' # set to '' to show all logs 16 | tail: '' # set to 200 to show last 200 lines of logs 17 | -------------------------------------------------------------------------------- /lvim/codedarker.lua: -------------------------------------------------------------------------------- 1 | -- stylua: ignore 2 | -- Put the theme file to: 3 | -- `$HOME/.local/share/lunarvim/site/pack/packer/start/lualine.nvim/lua/lualine/themes/codedarker.lua` 4 | local colors = { 5 | gray = '#3C3C3C', 6 | lightred = '#D16969', 7 | blue = '#569CD6', 8 | pink = '#C586C0', 9 | black = '#111111', 10 | white = '#D4D4D4', 11 | green = '#608B4E', 12 | } 13 | 14 | return { 15 | normal = { 16 | b = { fg = colors.green, bg = colors.black }, 17 | a = { fg = colors.black, bg = colors.green, gui = 'bold' }, 18 | c = { fg = colors.white, bg = colors.black }, 19 | }, 20 | visual = { 21 | b = { fg = colors.pink, bg = colors.black }, 22 | a = { fg = colors.black, bg = colors.pink, gui = 'bold' }, 23 | }, 24 | inactive = { 25 | b = { fg = colors.black, bg = colors.blue }, 26 | a = { fg = colors.white, bg = colors.gray, gui = 'bold' }, 27 | }, 28 | replace = { 29 | b = { fg = colors.lightred, bg = colors.black }, 30 | a = { fg = colors.black, bg = colors.lightred, gui = 'bold' }, 31 | c = { fg = colors.white, bg = colors.black }, 32 | }, 33 | insert = { 34 | b = { fg = colors.blue, bg = colors.black }, 35 | a = { fg = colors.black, bg = colors.blue, gui = 'bold' }, 36 | c = { fg = colors.white, bg = colors.black }, 37 | }, 38 | } 39 | -------------------------------------------------------------------------------- /lvim/config.lua: -------------------------------------------------------------------------------- 1 | --################################################################################################ 2 | --############################### General Settings ############################################### 3 | --################################################################################################ 4 | 5 | lvim.log.level = "warn" 6 | lvim.transparent_window = true 7 | vim.opt.cmdheight = 1 -- set command line height to 1 instead of 2 8 | vim.opt.scrolloff = 0 -- make zt put the current line to the top of the window 9 | vim.opt.timeoutlen = 50 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------------------------- 15 | ------------------------------ Helper functions, shortcuts, etc ---------------------------------- 16 | -------------------------------------------------------------------------------------------------- 17 | 18 | -- Shorten the key mapping function and mapping options for convenience 19 | local keymap = vim.api.nvim_set_keymap 20 | local opts = { noremap = true, silent = true } 21 | 22 | -- Helper function to get shell output 23 | local function get_shell_command_output(command) 24 | local handle = io.popen(command) 25 | local output = handle:read("*a") 26 | handle:close() 27 | return output and vim.trim(output) or nil 28 | end 29 | 30 | 31 | 32 | 33 | 34 | --################################################################################################ 35 | --############################### Styling settings ############################################### 36 | --################################################################################################ 37 | lvim.colorscheme = "vscode" 38 | vim.cmd("au ColorScheme * hi LineNr guibg=NONE") -- transparent background of line numbers 39 | 40 | -- Lualine settings ------------------------------------------------------------------------------ 41 | lvim.builtin.lualine.style = "default" 42 | lvim.builtin.lualine.sections.lualine_a = { "mode" } 43 | -- show relative path instead of just filename 44 | lvim.builtin.lualine.sections.lualine_c = { { "filename", path = 1, } } 45 | lvim.builtin.lualine.inactive_sections.lualine_c = { { "filename", path = 1, } } 46 | lvim.builtin.lualine.options.globalstatus = false 47 | lvim.builtin.lualine.options.disabled_filetypes = { 'lazy', 'NvimTree' } 48 | 49 | -- Bufferline settings --------------------------------------------------------------------------- 50 | lvim.builtin.bufferline.options.show_buffer_close_icons = false -- no tab close icons 51 | lvim.builtin.bufferline.options.tab_size = 10 -- change tabs width from default 18 to 10 52 | 53 | 54 | 55 | 56 | 57 | -- ############################################################################################### 58 | -- ################################# Keymappings ################################################# 59 | -- ############################################################################################### 60 | 61 | ------------------------[view all the defaults by pressing Lk]---------------------------- 62 | -- unmap a default keymapping 63 | -- vim.keymap.del("n", "") 64 | -- override a default keymapping 65 | -- lvim.keys.normal_mode[""] = ":q" -- or vim.keymap.set("n", "", ":q" ) 66 | 67 | 68 | -- Set Space as a Leader key 69 | lvim.leader = "space" 70 | 71 | -- Save file with Ctrl-S 72 | lvim.keys.normal_mode[""] = ":w" 73 | 74 | -- Enable hotkeys for Russian layout 75 | vim.cmd( 76 | "set langmap=ФИСВУАПРШОЛДЬТЩЗЙКЫЕГМЦЧНЯ;ABCDEFGHIJKLMNOPQRSTUVWXYZ,фисвуапршолдьтщзйкыегмцчня;abcdefghijklmnopqrstuvwxyz") 77 | 78 | -- Remap LSP hover popup menu from K to gh to navigate between tabs with J / K 79 | lvim.lsp.buffer_mappings.normal_mode["K"] = nil 80 | keymap('n', 'gh', 'lua vim.lsp.buf.hover()', opts) 81 | 82 | -- Remap joining lines from J to gj to navigate between tabs with J / K 83 | keymap('n', 'gj', 'J', opts) 84 | 85 | -- Remap adding mark from `m` to ` m` to move tabs left / right with m / M 86 | keymap('n', 'm', 'm', opts) 87 | 88 | 89 | 90 | -- H / L - go to the beginning/end of the line in normal mode 91 | keymap('n', 'H', '^', opts) 92 | keymap('n', 'L', '$', opts) 93 | 94 | -- Same for Cyrillic layout 95 | keymap('n', 'Р', '^', opts) 96 | keymap('n', 'Д', '$', opts) 97 | 98 | -- H / L - mark to the beginning/end (not including line break) 99 | -- of the line in visual mode 100 | keymap('v', 'H', '^', opts) 101 | keymap('v', 'L', 'g_', opts) 102 | 103 | -- Same for Cyrillic layout 104 | keymap('v', 'Р', '^', opts) 105 | keymap('v', 'Д', 'g_', opts) 106 | 107 | -- Override mappings for moving screen one line up/down w/o moving the cursor 108 | lvim.keys.normal_mode[""] = "" 109 | lvim.keys.normal_mode[""] = "" 110 | 111 | 112 | 113 | 114 | ------------------------------------------------------------------------- 115 | ----------------------------- Resizing splits --------------------------- 116 | ------------------------------------------------------------------------- 117 | -- `+arrow key` - resize the split by rows/columns 118 | vim.cmd([[ 119 | nnoremap :exe ':resize +' . v:count1 120 | ]]) 121 | 122 | vim.cmd([[ 123 | nnoremap :exe ':resize -' . v:count1 124 | ]]) 125 | 126 | vim.cmd([[ 127 | nnoremap :exe ':vertical-resize +' . v:count1 128 | ]]) 129 | 130 | vim.cmd([[ 131 | nnoremap :exe ':vertical-resize -' . v:count1 132 | ]]) 133 | ------------------------------------------------------------------ 134 | 135 | 136 | 137 | -- Clear search highlights on pressing `\` (backslash) 138 | keymap('n', '\\', ':noh', opts) 139 | 140 | 141 | -- Fix for vim-numbertoggle plugin not switching from absolute 142 | -- to relative line numbers when leaving Insert mode with 143 | keymap('i', '', ':set rnu', opts) 144 | 145 | 146 | ---------------------------------------------------------------------------- 147 | --------------------- Visual mode customizing ------------------------------ 148 | ---------------------------------------------------------------------------- 149 | -- Stay in visual mode after changing indent with `<` / `>` 150 | keymap("v", "<", "", ">gv", opts) 152 | 153 | 154 | -- Don't paste replaced text after pasting some text on its' place 155 | lvim.keys.visual_block_mode = { 156 | ["p"] = "P", 157 | ["P"] = "p", 158 | } 159 | 160 | -- Move selected text up and down in visual mode 161 | keymap("v", "", ":m .+1==", opts) 162 | keymap("v", "", ":m .-2==", opts) 163 | 164 | -- Move selected text up and down in visual block mode 165 | keymap("x", "J", ":move '>+1gv-gv", opts) 166 | keymap("x", "K", ":move '<-2gv-gv", opts) 167 | keymap("x", "", ":move '>+1gv-gv", opts) 168 | keymap("x", "", ":move '<-2gv-gv", opts) 169 | 170 | 171 | 172 | ------------------------------------------------------------------------ 173 | ---------------------- Buffer tabs navigation -------------------------- 174 | ------------------------------------------------------------------------ 175 | -- `g` - Switch to tab number 176 | keymap('n', 'g1', ':BufferLineGoToBuffer 1', opts) 177 | keymap('n', 'g2', ':BufferLineGoToBuffer 2', opts) 178 | keymap('n', 'g3', ':BufferLineGoToBuffer 3', opts) 179 | keymap('n', 'g4', ':BufferLineGoToBuffer 4', opts) 180 | keymap('n', 'g5', ':BufferLineGoToBuffer 5', opts) 181 | keymap('n', 'g6', ':BufferLineGoToBuffer 6', opts) 182 | keymap('n', 'g7', ':BufferLineGoToBuffer 7', opts) 183 | keymap('n', 'g8', ':BufferLineGoToBuffer 8', opts) 184 | keymap('n', 'g9', ':BufferLineGoToBuffer 9', opts) 185 | 186 | -- J / K - Go to the next / previous tab 187 | keymap('n', 'J', ':BufferLineCycleNext', opts) 188 | keymap('n', 'K', ':BufferLineCyclePrev', opts) 189 | 190 | -- `m` - Move current tab to the right 191 | keymap('n', 'm', ':BufferLineMoveNext', opts) 192 | -- `M` - Move current tab to the left 193 | keymap('n', 'M', ':BufferLineMovePrev', opts) 194 | 195 | 196 | 197 | --------------------------------------------------------------------- 198 | ------------------ DIRTY BUT COOL HACKS ZONE ------------------------ 199 | --------------------------------------------------------------------- 200 | 201 | -- `o` / `O` - Add blank lines (default=1) 202 | -- Insert a blank line below / above current line (not moving the cursor), 203 | -- see https://stackoverflow.com/a/16136133/6064933 204 | vim.keymap.set("n", "o", "printf('m`%so``', v:count1)", { 205 | expr = true, 206 | desc = "insert line below", 207 | }) 208 | 209 | vim.keymap.set("n", "O", "printf('m`%sO``', v:count1)", { 210 | expr = true, 211 | desc = "insert line above", 212 | }) 213 | 214 | 215 | 216 | --------------------------------------------------------------------- 217 | -------------- Emacs-like shortcuts in command line mode ------------ 218 | --------------------------------------------------------------------- 219 | -- go to start of line 220 | vim.cmd("cnoremap ") 221 | -- go back one character 222 | vim.cmd("cnoremap ") 223 | -- delete character under cursor 224 | vim.cmd("cnoremap ") 225 | -- go to end of line 226 | vim.cmd("cnoremap ") 227 | -- go forward one character 228 | -- [Note / TODO]: remap below overrides standard mapping 229 | -- for opening command-line window, maybe it's better not to do so. 230 | vim.cmd("cnoremap ") 231 | -- go back one word 232 | vim.cmd("cnoremap ") 233 | -- go forward one word 234 | vim.cmd("cnoremap ") 235 | 236 | 237 | 238 | --############################################################################################ 239 | --####################### Plugin related key bindings ######################################## 240 | --############################################################################################ 241 | 242 | ---------------------------------------------------------------------------------------------- 243 | --------------------------- Telescope key bindings ------------------------------------------- 244 | ---------------------------------------------------------------------------------------------- 245 | -- Change Telescope navigation to use j and k for navigation and n and p for history 246 | -- in both input and normal mode. 247 | -- we use protected-mode (pcall) just in case the plugin wasn't loaded yet. 248 | local _, actions = pcall(require, "telescope.actions") 249 | lvim.builtin.telescope.defaults.mappings = { 250 | -- for input mode 251 | i = { 252 | [""] = actions.move_selection_next, 253 | [""] = actions.move_selection_previous, 254 | [""] = actions.cycle_history_next, 255 | [""] = actions.cycle_history_prev, 256 | }, 257 | -- for normal mode 258 | n = { 259 | [""] = actions.move_selection_next, 260 | [""] = actions.move_selection_previous, 261 | }, 262 | } 263 | 264 | 265 | 266 | 267 | ------------------------------------------------------------------------------------------- 268 | ---------------------- Additional bindings for which-key plugin --------------------------- 269 | ------------------------------------------------------------------------------------------- 270 | lvim.builtin.which_key.mappings["P"] = { "Telescope projects", "Projects" } 271 | 272 | -- Buffer view/settings bindings 273 | lvim.builtin.which_key.mappings["v"] = { 274 | name = "+View", 275 | w = { "set wrap!", "Toggle line wrap" }, 276 | } 277 | 278 | lvim.builtin.which_key.mappings.l['R'] = { "LspRestart", "Restart LSP" } 279 | 280 | -- Telescope bindings 281 | lvim.builtin.which_key.mappings["t"] = { 282 | name = "+Telescope", 283 | l = { "Telescope live_grep", "Live grep" }, 284 | g = { ":execute 'Telescope live_grep default_text=' . expand('')", "Grep word under cursor" }, 285 | s = { "Telescope search_history", "Search history" }, 286 | f = { "Telescope find_files", "Find files" }, 287 | c = { "Telescope command_history", "Command history" }, 288 | j = { "Telescope jumplist", "Jumplist" }, 289 | } 290 | 291 | -- spectre bindings 292 | lvim.builtin.which_key.mappings["r"] = { 293 | name = "+Spectre", 294 | r = { "lua require('spectre').toggle()", "Toggle Spectre" }, 295 | w = { "lua require('spectre').open_visual({select_word=true})", "Search current word" }, 296 | f = { "lua require('spectre').open_file_search({select_word=true})", "Search on current file" }, 297 | } 298 | 299 | -- trouble.nvim bindings 300 | lvim.builtin.which_key.mappings["T"] = { 301 | name = "+Trouble", 302 | r = { "Trouble lsp_references", "References" }, 303 | f = { "Trouble lsp_definitions", "Definitions" }, 304 | d = { "Trouble document_diagnostics", "Diagnostics" }, 305 | q = { "Trouble quickfix", "QuickFix" }, 306 | l = { "Trouble loclist", "LocationList" }, 307 | w = { "Trouble workspace_diagnostics", "Wordspace Diagnostics" }, 308 | } 309 | 310 | -- persistence.nvim bindings 311 | lvim.builtin.which_key.mappings["S"] = { 312 | name = "Session", 313 | c = { "lua require('persistence').load()", "Restore last session for current dir" }, 314 | l = { "lua require('persistence').load({ last = true })", "Restore last session" }, 315 | Q = { "lua require('persistence').stop()", "Quit without saving session" }, 316 | } 317 | 318 | -- -- Copilot.nvim bindings // disabled by now 319 | -- lvim.builtin.which_key.mappings["C"] = { 320 | -- name = "Copilot", 321 | -- p = { "Copilot panel", "Copilot panel" }, 322 | -- s = { "Copilot status", "Copilot status" }, 323 | -- e = { "Copilot enableecho 'Copilot enabled'", "Copilot enable" }, 324 | -- d = { "Copilot disableecho 'Copilot disabled'", "Copilot disable" }, 325 | -- } 326 | 327 | --------------------------------------------------------------------- 328 | ------ Live grep selected text in visual mode with `g` ------ 329 | --------------------------------------------------------------------- 330 | function vim.getVisualSelection() -- Helper function to get selected text 331 | vim.cmd('noau normal! "vy"') 332 | local text = vim.fn.getreg('v') 333 | vim.fn.setreg('v', {}) 334 | 335 | text = string.gsub(text, "\n", "") 336 | if #text > 0 then 337 | return text 338 | else 339 | return '' 340 | end 341 | end 342 | 343 | local tb = require('telescope.builtin') 344 | 345 | -- which-key binding for `g` in visual mode 346 | lvim.builtin.which_key.vmappings['g'] = { 347 | function() 348 | local text = vim.getVisualSelection() 349 | tb.live_grep({ default_text = text }) 350 | end, 351 | "Live grep selected text" 352 | } 353 | --------------------------------------------------------------------- 354 | 355 | 356 | 357 | ------------------------------------------------------------------------------------------- 358 | 359 | 360 | 361 | 362 | --######################################################################################### 363 | --############################## Plugins config ########################################### 364 | --######################################################################################### 365 | 366 | 367 | --========================================================================================= 368 | --=================== User Config for Lvim preinstalled plugins =========================== 369 | --========================================================================================= 370 | 371 | lvim.builtin.alpha.active = true 372 | lvim.builtin.alpha.mode = "dashboard" 373 | lvim.builtin.terminal.active = true -- enable builtin terminal (`Ctrl+\` to toggle) 374 | 375 | -- Nvim-Tree options 376 | lvim.builtin.nvimtree.setup.view.side = "left" 377 | lvim.builtin.nvimtree.setup.renderer.icons.show.git = true 378 | lvim.builtin.nvimtree.setup.renderer.indent_markers.enable = true 379 | lvim.builtin.nvimtree.setup.view.number = true 380 | lvim.builtin.nvimtree.setup.view.relativenumber = true 381 | lvim.builtin.nvimtree.setup.filters.dotfiles = true 382 | lvim.builtin.nvimtree.setup.filters.custom = { ".git", ".cache", "__pycache__" } 383 | -- Fix for nvim-tree conflict with project.nvim plugin // NOTE: It fucks up cwd in nvim-tree - disabling by now 384 | lvim.builtin.nvimtree.setup.respect_buf_cwd = true 385 | -- lvim.builtin.nvimtree.setup.sync_root_with_cwd = true 386 | -- lvim.builtin.nvimtree.setup.update_focused_file.enable = true 387 | -- lvim.builtin.nvimtree.setup.update_focused_file.update_root = true 388 | lvim.builtin.project.manual_mode = true 389 | 390 | 391 | 392 | 393 | --========================================================================================= 394 | --============================== User Installed Plugins =================================== 395 | --========================================================================================= 396 | 397 | lvim.plugins = { 398 | -- vim-numbertoggle: Toggles between hybrid and absolute line numbers automatically 399 | -- NOTE: Add `set-option -g focus-events on` to .tmux.conf if you're using Tmux 400 | { "jeffkreeftmeijer/vim-numbertoggle" }, 401 | -- Autoinstall LSPs/linters/formatters from predefined list via Mason 402 | { "WhoIsSethDaniel/mason-tool-installer.nvim" }, 403 | { "Mofiqul/vscode.nvim" }, -- vscode colorscheme 404 | { "wellle/targets.vim" }, 405 | { "tpope/vim-surround" }, 406 | { "tpope/vim-repeat" }, 407 | { "mattn/emmet-vim" }, 408 | -- persistence.nvim: Save nvim sessions automatically 409 | { 410 | "folke/persistence.nvim", 411 | event = "BufReadPre", -- this will only start session saving when an actual file was opened 412 | -- module = "persistence", 413 | config = function() 414 | require("persistence").setup { 415 | dir = vim.fn.expand(vim.fn.stdpath "config" .. "/session/"), 416 | options = { "buffers", "curdir", "tabpages", "winsize" }, 417 | } 418 | end, 419 | }, 420 | -- A pretty diagnostics, references, telescope results, quickfix and location list 421 | { "folke/trouble.nvim" }, 422 | -- hex color codes colorizer 423 | { 424 | "norcalli/nvim-colorizer.lua", 425 | config = function() 426 | require("colorizer").setup({ "css", "scss", "html", "javascript", "tmux" }, { 427 | RGB = true, -- #RGB hex codes 428 | RRGGBB = true, -- #RRGGBB hex codes 429 | RRGGBBAA = true, -- #RRGGBBAA hex codes 430 | rgb_fn = true, -- CSS rgb() and rgba() functions 431 | hsl_fn = true, -- CSS hsl() and hsla() functions 432 | css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB 433 | css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn 434 | }) 435 | end, 436 | }, 437 | -- Python extension for nvim-dap 438 | "mfussenegger/nvim-dap-python", 439 | -- Python Venv Selector 440 | { 441 | "linux-cultist/venv-selector.nvim", 442 | dependencies = { 443 | "neovim/nvim-lspconfig", 444 | "nvim-telescope/telescope.nvim", 445 | -- for DAP support 446 | "mfussenegger/nvim-dap-python" 447 | }, 448 | config = true, 449 | opts = { 450 | search_workspace = false, 451 | search = true, 452 | dap_enabled = false, 453 | name = { ".venv" }, 454 | fd_binary_name = "fd", 455 | notify_user_on_activate = true, 456 | 457 | }, 458 | event = "VeryLazy", -- Optional: needed only if you want to type `:VenvSelect` without a keymapping 459 | }, 460 | ---------------------------------------------------------------- 461 | -- nvim-spectre: Search and replace plugin 462 | { 463 | "windwp/nvim-spectre", 464 | event = "BufRead", 465 | config = function() 466 | require('spectre').setup({ 467 | color_devicons = true, 468 | highlight = { 469 | ui = "String", 470 | search = "DiffChange", 471 | replace = "DiffAdd" 472 | }, 473 | }) 474 | end, 475 | }, 476 | ---------------------------------------------------------------- 477 | -- -- Copilot.lua settings // disabled by now 478 | -- { 479 | -- "zbirenbaum/copilot.lua", 480 | -- cmd = "Copilot", 481 | -- event = "VeryLazy", 482 | -- config = function() 483 | -- require("copilot").setup({ 484 | -- panel = { 485 | -- auto_refresh = true, 486 | -- keymap = { 487 | -- jump_prev = "[", 488 | -- jump_next = "]", 489 | -- accept = "", 490 | -- refresh = "gr", 491 | -- open = "" 492 | -- }, 493 | -- layout = { 494 | -- ratio = 0.3 495 | -- }, 496 | -- }, 497 | -- suggestion = { 498 | -- enabled = true, 499 | -- auto_trigger = false, 500 | -- keymap = { 501 | -- accept = "", 502 | -- accept_word = "", 503 | -- accept_line = "", 504 | -- next = "", 505 | -- prev = "", 506 | -- dismiss = "", 507 | -- }, 508 | -- }, 509 | -- filetypes = { 510 | -- -- Explicitly specify filetypes to use Copilot 511 | -- javascript = true, 512 | -- typescript = true, 513 | -- html = true, 514 | -- css = true, 515 | -- django = true, 516 | -- python = true, 517 | -- lua = true, 518 | -- ["*"] = false, -- disable for all other filetypes 519 | -- }, 520 | -- }) 521 | -- -- vim.g.copilot_assume_mapped = true 522 | -- -- vim.g.copilot_no_tab_map = true 523 | -- -- -- Get copilot proxy from pass command (requires pass installed) 524 | -- -- vim.g.copilot_proxy = get_shell_command_output("pass copilot_proxy") 525 | -- end, 526 | -- }, 527 | } 528 | 529 | 530 | 531 | 532 | --==================================================================== 533 | --=========== Additional config for user installed plugins =========== 534 | --==================================================================== 535 | 536 | --------------------- mason-tool-installer setup --------------------- 537 | require('mason-tool-installer').setup { 538 | ensure_installed = { 539 | 'bash-language-server', 540 | 'dockerfile-language-server', 541 | 'vim-language-server', 542 | 'yaml-language-server', 543 | 'stylua', 544 | 'shellcheck', 545 | 'editorconfig-checker', 546 | 'pyright', 547 | 'flake8', 548 | 'black', 549 | 'blue', 550 | 'debugpy', 551 | 'css-lsp', 552 | }, 553 | auto_update = true, 554 | } 555 | 556 | 557 | 558 | 559 | 560 | 561 | --######################################################################################### 562 | --############# Autocommands (https://neovim.io/doc/user/autocmd.html) #################### 563 | --######################################################################################### 564 | 565 | -- Reload LunarVim config after launch, to make work bindings / hotkeys 566 | -- that use dirty hacks and black magic =) 567 | vim.api.nvim_create_autocmd("VimEnter", { 568 | command = "LvimReload", 569 | }) 570 | 571 | 572 | -- -- Disable Copilot on Neovim startup 573 | -- vim.api.nvim_create_autocmd("VimEnter", { 574 | -- command = "Copilot disable", 575 | -- }) 576 | 577 | -- set filetype to SQL for .ddl files 578 | vim.api.nvim_create_autocmd("BufEnter", { 579 | pattern = { "*.ddl" }, 580 | command = "setfiletype sql", 581 | }) 582 | 583 | -- Other examples of autocommands usage: 584 | -- vim.api.nvim_create_autocmd("BufEnter", { 585 | -- pattern = { "*.json", "*.jsonc" }, 586 | -- -- enable wrap mode for json files only 587 | -- command = "setlocal wrap", 588 | -- }) 589 | -- 590 | -- vim.api.nvim_create_autocmd("FileType", { 591 | -- pattern = "zsh", 592 | -- callback = function() 593 | -- -- let treesitter use bash highlight for zsh files as well 594 | -- require("nvim-treesitter.highlight").attach(0, "bash") 595 | -- end, 596 | -- }) 597 | 598 | 599 | 600 | 601 | 602 | 603 | --########################################################################################### 604 | --############################# LSP, linters, DAP settings ################################## 605 | --########################################################################################### 606 | 607 | 608 | --------------------------------------------------------------------------------------------- 609 | ------------------------------- Treesitter / LSP config ------------------------------------- 610 | --------------------------------------------------------------------------------------------- 611 | -- if you don't want all the parsers change this to a table of the ones you want 612 | lvim.builtin.treesitter.ensure_installed = { 613 | "bash", 614 | "c", 615 | "javascript", 616 | "json", 617 | "lua", 618 | "python", 619 | "typescript", 620 | "tsx", 621 | "css", 622 | "rust", 623 | "java", 624 | "yaml", 625 | } 626 | 627 | lvim.builtin.treesitter.ignore_install = { "haskell" } 628 | lvim.builtin.treesitter.highlight.enabled = true 629 | 630 | -- make sure server will always be installed even if the server is in skipped_servers list 631 | lvim.lsp.installer.setup.ensure_installed = { 632 | "lua_ls", 633 | "jsonls", 634 | } 635 | 636 | -- ---@usage disable automatic installation of servers 637 | -- lvim.lsp.automatic_servers_installation = false 638 | 639 | ---configure a server manually. !!Requires `:LvimCacheReset` to take effect!! 640 | ---see the full default list `:lua print(vim.inspect(lvim.lsp.automatic_configuration.skipped_servers))` 641 | --vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" }) -- disable autoinstallation of pyright 642 | -- local opts = {} -- check the lspconfig documentation for a list of all possible options 643 | -- require("lvim.lsp.manager").setup("pyright", opts) 644 | 645 | --################################################################################################## 646 | --####################################### Python LSP setup ######################################### 647 | --################################################################################################## 648 | 649 | -------------------- Pyright setup ----------------------------------------------------------------- 650 | require("lspconfig").pyright.setup { 651 | settings = { 652 | python = { 653 | analysis = { 654 | typeCheckingMode = "off", 655 | } 656 | } 657 | } 658 | } 659 | 660 | -- NOTE: Disabling by now, don't know how to use ruff-lsp together with pyright 661 | -- -------------------- Ruff-lsp setup ----------------------------------------------------------------- 662 | -- -- remove `ruff_lsp` from `skipped_servers` list 663 | -- lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server) 664 | -- return server ~= "ruff_lsp" 665 | -- end, lvim.lsp.automatic_configuration.skipped_servers) 666 | -- -- See: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#ruff_lsp 667 | -- -- For the default config, along with instructions on how to customize the settings 668 | -- local on_attach = function(client, bufnr) 669 | -- -- Disable hover in favor of Pyright 670 | -- client.server_capabilities.hoverProvider = false 671 | -- end 672 | 673 | -- require('lspconfig').ruff_lsp.setup { 674 | -- on_attach = on_attach, 675 | -- init_options = { 676 | -- settings = { 677 | -- -- Any extra CLI arguments for `ruff` go here. 678 | -- args = {}, 679 | -- } 680 | -- } 681 | -- } 682 | 683 | 684 | --################################################################################################## 685 | --######################################## SQL LSP setup ########################################### 686 | --################################################################################################## 687 | -- (requires some dirty hacks / black magic) 688 | -- https://github.com/LunarVim/LunarVim/discussions/4210#discussioncomment-6083169 689 | lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server) 690 | return server ~= "sqlls" 691 | end, lvim.lsp.automatic_configuration.skipped_servers) 692 | 693 | require("lvim.lsp.manager").setup("sqlls", { 694 | cmd = { "sql-language-server", "up", "--method", "stdio" }, 695 | filetypes = { "sql", "mysql", "ddl" }, 696 | root_dir = function() return vim.loop.cwd() end, 697 | }) 698 | -------------------------------------------------------------- 699 | 700 | 701 | 702 | -- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. !!Requires `:LvimCacheReset` to take effect!! 703 | -- ---`:LvimInfo` lists which server(s) are skipped for the current filetype 704 | -- vim.tbl_map(function(server) 705 | -- return server ~= "emmet_ls" 706 | -- end, lvim.lsp.automatic_configuration.skipped_servers) 707 | 708 | -- -- you can set a custom on_attach function that will be used for all the language servers 709 | -- -- See 710 | -- lvim.lsp.on_attach_callback = function(client, bufnr) 711 | -- local function buf_set_option(...) 712 | -- vim.api.nvim_buf_set_option(bufnr, ...) 713 | -- end 714 | -- --Enable completion triggered by 715 | -- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") 716 | -- end 717 | 718 | 719 | 720 | --------------------------------------------------------------------------------------------- 721 | ---------------------------------- Formatters config ---------------------------------------- 722 | --------------------------------------------------------------------------------------------- 723 | -- set a formatter, this will override the language server formatting capabilities (if it exists) 724 | local formatters = require "lvim.lsp.null-ls.formatters" 725 | formatters.setup { 726 | -- Python formatter 727 | { 728 | command = "blue", 729 | filetypes = { "python" }, 730 | }, 731 | -- { 732 | -- command = "black", 733 | -- filetypes = { "python" }, 734 | -- extra_args = { "--line-length=79" } 735 | -- }, 736 | { command = "isort", filetypes = { "python" } }, 737 | -- SQL formatter 738 | { 739 | command = "sqlfmt", 740 | filetypes = { "sql" }, 741 | }, 742 | -- { 743 | -- -- each formatter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration 744 | -- command = "prettier", 745 | -- ---@usage arguments to pass to the formatter 746 | -- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}` 747 | -- extra_args = { "--print-with", "100" }, 748 | -- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports. 749 | -- filetypes = { "typescript", "typescriptreact" }, 750 | -- }, 751 | } 752 | 753 | 754 | 755 | --------------------------------------------------------------------------------------------- 756 | ----------------------------------- Linters config ------------------------------------------ 757 | --------------------------------------------------------------------------------------------- 758 | -- set additional linters 759 | local linters = require "lvim.lsp.null-ls.linters" 760 | linters.setup { 761 | { 762 | command = "flake8", 763 | filetypes = { "python" }, 764 | prefer_local = ".venv/bin" -- prefer local .venv flake8 installation in order to use plugins like wemake-style-guide 765 | }, 766 | -- { 767 | -- -- each linter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration 768 | -- command = "shellcheck", 769 | -- ---@usage arguments to pass to the formatter 770 | -- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}` 771 | -- extra_args = { "--severity", "warning" }, 772 | -- }, 773 | -- { 774 | -- command = "codespell", 775 | -- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports. 776 | -- filetypes = { "javascript", "python" }, 777 | -- }, 778 | } 779 | 780 | 781 | 782 | --------------------------------------------------------------------------------------------- 783 | ------------------------------------- DAP config ------------------------------------------ 784 | --------------------------------------------------------------------------------------------- 785 | -- Setup dap for python 786 | lvim.builtin.dap.active = true 787 | local mason_path = vim.fn.glob(vim.fn.stdpath "data" .. "/mason/") 788 | pcall(function() require("dap-python").setup(mason_path .. "packages/debugpy/venv/bin/python") end) 789 | 790 | -- Supported test frameworks are unittest, pytest and django. By default it 791 | -- tries to detect the runner by probing for pytest.ini and manage.py, if 792 | -- neither are present it defaults to unittest. 793 | pcall(function() require("dap-python").test_runner = "pytest" end) 794 | -------------------------------------------------------------------------------- /lvim/htmldjango.vim: -------------------------------------------------------------------------------- 1 | " Additional Django template surroundings for vim-surround plugin 2 | " (put this file inside $LUNARVIM_CONFIG_DIR/after/ftplugin/ directory) 3 | "---------------------------------------------------------------- 4 | 5 | " 'Sv' or 'S{' - variable 6 | let b:surround_{char2nr("v")} = "{{ \r }}" 7 | let b:surround_{char2nr("{")} = "{{ \r }}" 8 | " 'S%' - other template tags 9 | let b:surround_{char2nr("%")} = "{% \r %}" 10 | " 'Sb' - block 11 | let b:surround_{char2nr("b")} = "{% block \1block name: \1 %} \r {% endblock \1\1 %}" 12 | " 'SB' - block with newlines 13 | let b:surround_{char2nr("B")} = "{% block \1block name: \1 %}\n\r\n{% endblock \1\1 %}" 14 | " 'Si' - if statement 15 | let b:surround_{char2nr("i")} = "{% if \1condition: \1 %}\r{% endif %}" 16 | " 'Sw' - with statement 17 | let b:surround_{char2nr("w")} = "{% with \1with: \1 %}\r{% endwith %}" 18 | " 'Sf' - for statement 19 | let b:surround_{char2nr("f")} = "{% for \1for loop: \1 %}\r{% endfor %}" 20 | " 'SF' - for statement with newlines 21 | let b:surround_{char2nr("F")} = "{% for \1for loop: \1 %}\n\r\n{% endfor %}\n" 22 | " 'Sc' - comment 23 | let b:surround_{char2nr("c")} = "{% comment %}\r{% endcomment %}" 24 | -------------------------------------------------------------------------------- /obsidian/.obsidian.vimrc: -------------------------------------------------------------------------------- 1 | " .obsidian.vimrc config for Obsidian Vim mode 2 | " Note: Needs this plugin in order to work: 3 | " https://github.com/esm7/obsidian-vimrc-support 4 | 5 | 6 | 7 | """""""""""""""""""""" Various mappings """"""""""""""""""""" 8 | " Unmap Space to use as a leader key 9 | unmap 10 | 11 | " H and L to go to the beginning/end of line 12 | nmap H ^ 13 | nmap L $ 14 | vmap H ^ 15 | vmap L $ 16 | 17 | " Quickly remove search highlights 18 | nmap \ :nohl 19 | 20 | 21 | " Yank to system clipboard 22 | set clipboard=unnamed 23 | 24 | " gj - Join the current line with the line beyond with a space in between 25 | noremap gj J 26 | 27 | " Switch tabs in normal mode with J / K 28 | unmap J 29 | exmap nexttab obcommand workspace:next-tab 30 | exmap prevtab obcommand workspace:previous-tab 31 | nmap J :nexttab 32 | nmap K :prevtab 33 | 34 | " Close the current tab with ZZ / ZQ 35 | exmap closetab obcommand workspace:close 36 | nmap ZZ :closetab 37 | nmap ZQ :closetab 38 | 39 | 40 | " Reload Obsidian 41 | exmap reload_obsidian obcommand app:reload 42 | map :reload_obsidian 43 | map :reload_obsidian 44 | 45 | 46 | " Surround text (like with vim-surround plugin) 47 | " NOTE: must use 'map' and not 'nmap' 48 | exmap surround_double_quotes surround " " 49 | exmap surround_single_quotes surround ' ' 50 | exmap surround_backtick surround ` ` 51 | exmap surround_brackets surround ( ) 52 | exmap surround_square_brackets surround [ ] 53 | exmap surround_curly_brackets surround { } 54 | exmap surround_superscript surround 55 | exmap surround_subscript surround 56 | 57 | nunmap S 58 | vunmap S 59 | map S" :surround_double_quotes 60 | map S' :surround_single_quotes 61 | map S` :surround_backtick 62 | map Sb :surround_brackets 63 | map S( :surround_brackets 64 | map S) :surround_brackets 65 | map S[ :surround_square_brackets 66 | map S] :surround_square_brackets 67 | map S{ :surround_curly_brackets 68 | map S} :surround_curly_brackets 69 | map S^ :surround_superscript 70 | map S_ :surround_subscript 71 | 72 | " Same bindings for Russian layout 73 | nunmap Ы 74 | vunmap Ы 75 | map Ы" :surround_double_quotes 76 | map Ы' :surround_single_quotes 77 | map Ы` :surround_asterisc 78 | map Ыb :surround_brackets 79 | map Ы( :surround_brackets 80 | map Ы) :surround_brackets 81 | map Ы[ :surround_square_brackets 82 | map Ы] :surround_square_brackets 83 | map Ы{ :surround_curly_brackets 84 | map Ы} :surround_curly_brackets 85 | 86 | 87 | """""""""""""" Begin Mappings for Russian layout """""""""""""" 88 | imap 89 | nmap 90 | vmap 91 | 92 | imap 93 | nmap 94 | vmap 95 | 96 | nmap 97 | nmap 98 | vmap 99 | vmap 100 | 101 | 102 | nmap й q 103 | nmap Й Q 104 | nmap ц w 105 | nmap Ц W 106 | nmap у e 107 | nmap У E 108 | nmap к r 109 | nmap К R 110 | nmap е t 111 | nmap Е T 112 | nmap н y 113 | nmap Н Y 114 | nmap г u 115 | nmap Г U 116 | nmap ш i 117 | nmap Ш I 118 | nmap щ o 119 | nmap Щ O 120 | nmap з p 121 | nmap З P 122 | nmap х [ 123 | nmap Х { 124 | nmap ъ ] 125 | nmap Ъ } 126 | vmap й q 127 | vmap Й Q 128 | vmap ц w 129 | vmap Ц W 130 | vmap у e 131 | vmap У E 132 | vmap к r 133 | vmap К R 134 | vmap е t 135 | vmap Е T 136 | vmap н y 137 | vmap Н Y 138 | vmap г u 139 | vmap Г U 140 | vmap ш i 141 | vmap Ш I 142 | vmap щ o 143 | vmap Щ O 144 | vmap з p 145 | vmap З P 146 | vmap х [ 147 | vmap Х { 148 | vmap ъ ] 149 | vmap Ъ } 150 | 151 | nmap ф a 152 | nmap Ф A 153 | nmap ы s 154 | nmap Ы S 155 | nmap в d 156 | nmap В D 157 | nmap а f 158 | nmap А F 159 | nmap п g 160 | nmap П G 161 | nmap р h 162 | nmap Р H 163 | nmap о j 164 | nmap О J 165 | nmap л k 166 | nmap Л K 167 | nmap д l 168 | nmap Д L 169 | nmap ж ; 170 | nmap Ж : 171 | nmap э ' 172 | nmap Э " 173 | vmap ф a 174 | vmap Ф A 175 | vmap ы s 176 | vmap Ы S 177 | vmap в d 178 | vmap В D 179 | vmap а f 180 | vmap А F 181 | vmap п g 182 | vmap П G 183 | vmap р h 184 | vmap Р ^ 185 | vmap о j 186 | vmap О J 187 | vmap л k 188 | vmap Л K 189 | vmap д l 190 | vmap Д $ 191 | vmap ж ; 192 | vmap Ж : 193 | vmap э ' 194 | vmap Э " 195 | 196 | nmap я z 197 | nmap Я Z 198 | nmap ч x 199 | nmap Ч X 200 | nmap с c 201 | nmap С C 202 | nmap м v 203 | nmap М V 204 | nmap и b 205 | nmap И B 206 | nmap т n 207 | nmap Т N 208 | nmap ь m 209 | nmap Ь M 210 | nmap б , 211 | nmap Б < 212 | nmap ю . 213 | nmap Ю > 214 | vmap я z 215 | vmap Я Z 216 | vmap ч x 217 | vmap Ч X 218 | vmap с c 219 | vmap С C 220 | vmap м v 221 | vmap М V 222 | vmap и b 223 | vmap И B 224 | vmap т n 225 | vmap Т N 226 | vmap ь m 227 | vmap Ь M 228 | vmap б , 229 | vmap Б < 230 | vmap ю . 231 | vmap Ю > 232 | 233 | nmap ё ` 234 | nmap Ё ~ 235 | nmap № # 236 | nmap ? & 237 | vmap ё ` 238 | vmap Ё ~ 239 | vmap № # 240 | 241 | 242 | """""""""""""" End of Mappings for Russian layout """""""""""""" 243 | 244 | -------------------------------------------------------------------------------- /scripts/copy_filepath.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copy filepath to clipboard 4 | FILEPATH=$1 5 | realpath $FILEPATH | tr -d "\n" | xclip -selection clipboard 6 | -------------------------------------------------------------------------------- /tmux/.tmux.conf: -------------------------------------------------------------------------------- 1 | ########################################################################## 2 | ##### Key Bindings #################################################### 3 | ########################################################################## 4 | # Note: 5 | # `+key`: simultaneously press and key 6 | # ` key`: press and then press the key 7 | 8 | # Bind to Ctrl+A instead of Ctrl+B 9 | unbind C-b 10 | set -g prefix C-a 11 | 12 | # Use Vim hjkl keys for moving between windows and resizing panes 13 | setw -g mode-keys vi 14 | 15 | # Turn on the mouse 16 | setw -g mouse on 17 | 18 | # ` hjkl`: switch between panes 19 | bind h select-pane -L 20 | bind j select-pane -D 21 | bind k select-pane -U 22 | bind l select-pane -R 23 | 24 | # `+hjkl` (without ): switch between panes 25 | bind -n M-h select-pane -L 26 | bind -n M-j select-pane -D 27 | bind -n M-k select-pane -U 28 | bind -n M-l select-pane -R 29 | 30 | # `+z` (without ): zoom current pane 31 | bind -n M-z resize-pane -Z 32 | 33 | # `+Number` (without ): Change to window `Number` 34 | bind -n M-1 select-window -t 1 35 | bind -n M-2 select-window -t 2 36 | bind -n M-3 select-window -t 3 37 | bind -n M-4 select-window -t 4 38 | bind -n M-5 select-window -t 5 39 | bind -n M-6 select-window -t 6 40 | bind -n M-7 select-window -t 7 41 | bind -n M-8 select-window -t 8 42 | bind -n M-9 select-window -t 9 43 | 44 | 45 | # Enter copy/yank mode with ` y` instead of ` [` 46 | unbind [ 47 | bind -n C-y copy-mode 48 | 49 | # Vim keys in copypaste/yank mode (hjkl, v, y) 50 | set-window-option -g mode-keys vi 51 | bind -T copy-mode-vi v send -X begin-selection 52 | bind -T copy-mode-vi y send -X copy-selection 53 | 54 | # Open new panes/splits in current working directory 55 | bind '"' split-window -v -c "#{pane_current_path}" 56 | bind % split-window -h -c "#{pane_current_path}" 57 | 58 | 59 | # Navigating between windows _______________________________________ 60 | unbind n 61 | unbind p 62 | 63 | # `+h`: select previous window (next to the left) 64 | bind -r C-h previous-window 65 | # `+l`: select next window (next to the right) 66 | bind -r C-l next-window 67 | 68 | # `Ctrl+Space`: switch to the last active window 69 | bind -n C-Space last-window 70 | 71 | # `+k`: move the current window to the left in windows list 72 | bind -r C-k swap-window -t -1 \; previous-window 73 | # `+j`: move the current window to the right in windows list 74 | bind -r C-j swap-window -t +1 \; next-window 75 | 76 | 77 | # Change current window number: ` Alt+n` 78 | bind M-n command-prompt -p "Change window number (enter number):" "move-window -t '%%'" 79 | 80 | 81 | # Moving panes/windows between windows/sessions ____________________ 82 | # Move pane to another window with v 83 | bind v command-prompt -p "Move pane to window (enter window number):" "join-pane -t :'%%'" 84 | 85 | # Send (break) pane to new window with b 86 | bind b break-pane -t : 87 | 88 | # Move window to another session with +v 89 | bind M-v command-prompt -p "Move window to session (enter session name):" "move-window -t '%%':" 90 | 91 | #____________________________________________________________________ 92 | 93 | # ` r`: reload .tmux.conf config 94 | bind r source-file ~/.tmux.conf \; display -d 500 '~/.tmux.conf sourced' 95 | 96 | 97 | # TODO: Fix the binding so it doesn't require shell script file 98 | # ` L`: Clear all panes of the current window with `Ctrl+l` 99 | unbind L # Unbind default binding (open last session) 100 | bind L run-shell "${HOME}/.scripts/tmux_clear_all_panes.sh" 101 | 102 | 103 | 104 | 105 | ########################################################################## 106 | 107 | 108 | 109 | ########################################################################## 110 | #### General Settings #################################################### 111 | ########################################################################## 112 | set -g history-limit 5000 # boost history 113 | 114 | set -g base-index 1 # start windows numbering from 1 instead of 0 115 | setw -g pane-base-index 1 # start panes numbering from 1 instead of 0 116 | 117 | ########################################################################## 118 | 119 | 120 | 121 | ########################################################################## 122 | ############### Begin TPM Plugin Manager Settings #################### 123 | ########################################################################## 124 | # List of plugins 125 | set -g @plugin 'tmux-plugins/tpm' # TPM plugin manager 126 | 127 | # A set of sensible tmux options 128 | set -g @plugin 'tmux-plugins/tmux-sensible' 129 | 130 | # tmux-yank - yank to system clipboard in copy mode 131 | set -g @plugin 'tmux-plugins/tmux-yank' 132 | 133 | # Save and restore tmux sessions and windows 134 | # ` +s` to save 135 | # ` +r` to restore 136 | set -g @plugin 'tmux-plugins/tmux-resurrect' 137 | 138 | # tmux-fzf 139 | set -g @plugin 'sainnhe/tmux-fzf' 140 | 141 | 142 | # Initialize TMUX plugin manager 143 | run '~/.tmux/plugins/tpm/tpm' 144 | ########################################################################## 145 | ##### End of TPM Plugin Manager Settings ##################### 146 | ########################################################################## 147 | 148 | 149 | 150 | 151 | ########################################################################## 152 | ##### Color Scheme Settings (modified Gruvbox theme) ################# 153 | ########################################################################## 154 | 155 | # window separators 156 | set-option -wg window-status-separator "" 157 | 158 | # monitor window changes 159 | set-option -wg monitor-activity on 160 | set-option -wg monitor-bell on 161 | 162 | # set statusbar update interval 163 | set-option -g status-interval 1 164 | 165 | ### colorscheme ###################################################### 166 | 167 | # change window screen colors 168 | set-option -wg mode-style bg="#fe8019",fg="#262626" 169 | 170 | # default statusbar colors (terminal bg should be #282828) 171 | set-option -g status-style bg=terminal,fg="#b0b1ab" 172 | 173 | # default window title colors 174 | set-option -wg window-status-style bg="#262626",fg="#7c6f64" 175 | 176 | # colors for windows with activity 177 | set-option -wg window-status-activity-style bg="#262626",fg="#b0b1ab" 178 | 179 | # colors for windows with bells 180 | set-option -wg window-status-bell-style bg="#262626",fg="#fe8019" 181 | 182 | # active window title colors 183 | set-option -wg window-status-current-style bg="#fe8019",fg="#262626" 184 | 185 | # pane border 186 | set-option -g pane-active-border-style fg="#fe8019" 187 | set-option -g pane-border-style fg="#262626" 188 | 189 | # message info 190 | set-option -g message-style bg="#fe8019",fg="#262626" 191 | 192 | # writing commands inactive 193 | set-option -g message-command-style bg="#b0b1ab",fg="#262626" 194 | 195 | # pane number display 196 | set-option -g display-panes-active-colour "#fe8019" 197 | set-option -g display-panes-colour "#262626" 198 | 199 | # clock 200 | set-option -wg clock-mode-colour "#fe8019" 201 | 202 | # copy mode highlighting 203 | %if #{>=:#{version},3.2} 204 | set-option -wg copy-mode-match-style "bg=#b0b1ab,fg=#262626" 205 | set-option -wg copy-mode-current-match-style "bg=#fe8019,fg=#262626" 206 | %endif 207 | 208 | # statusbar formatting 209 | # "#fe8019" MUST be in lowercase here (conflicts with statusline alias otherwise) 210 | set-option -g status-left "#[bg=#b0b1ab, fg=#262626]#{?client_prefix,#[bg=#fe8019],#[bg=#b0b1ab]} #{session_name} " 211 | set-option -g status-right "#[bg=#b0b1ab, fg=#262626]#{?client_prefix,#[bg=#fe8019],#[bg=#b0b1ab]} #{host_short} " 212 | 213 | set-option -wg window-status-current-format "#{?window_zoomed_flag,#[fg=default bold],#[fg=default]} #{window_index} #{window_name} " 214 | set-option -wg window-status-format "#{?window_zoomed_flag,#[fg=default bold],#[fg=default]} #{window_index} #{window_name} " 215 | 216 | 217 | ########################################################################## 218 | ##### End of Color Scheme Settings ################################## 219 | ########################################################################## 220 | 221 | 222 | 223 | ########################################################################## 224 | ##### Begin User installed plugins settings ################ 225 | ########################################################################## 226 | # Make tmux-resurrect plugin restore additional programs 227 | set -g @resurrect-processes 'vim nvim lvim htop btop nvitop lazygit' 228 | 229 | 230 | 231 | # tmux-fzf settings 232 | # Info: https://github.com/sainnhe/tmux-fzf 233 | TMUX_FZF_LAUNCH_KEY="C-f" 234 | TMUX_FZF_ORDER="keybinding|session|window|pane|command" 235 | 236 | ########################################################################## 237 | ##### End of User installed plugins settings ############### 238 | ########################################################################## 239 | 240 | 241 | ########################################################################## 242 | ##### Begin Various Fixes ################################## 243 | ########################################################################## 244 | set-option -g focus-events on # fix for vim-numbertoggle Vim plugin 245 | 246 | # Fix weird colors for Powerlevel10k in tmux 247 | set -g default-terminal "xterm-256color" 248 | set -ag terminal-overrides ",xterm-256color:Tc" 249 | 250 | ########################################################################## 251 | ##### End of Various Fixes ################################# 252 | ########################################################################## 253 | -------------------------------------------------------------------------------- /tmux/.tmux.conf.macos: -------------------------------------------------------------------------------- 1 | ########################################################################## 2 | ##### Key Bindings #################################################### 3 | ########################################################################## 4 | # Note: 5 | # `+key`: simultaneously press and key 6 | # ` key`: press and then press the key 7 | 8 | # Bind to Ctrl+A instead of Ctrl+B 9 | unbind C-b 10 | set -g prefix C-a 11 | 12 | # Use Vim hjkl keys for moving between windows and resizing panes 13 | setw -g mode-keys vi 14 | 15 | # Turn on the mouse 16 | setw -g mouse on 17 | 18 | # # ` hjkl`: switch between panes 19 | bind h select-pane -L 20 | bind j select-pane -D 21 | bind k select-pane -U 22 | bind l select-pane -R 23 | 24 | # `+hjkl` (without ): switch between panes 25 | # bind -n M-h select-pane -L 26 | # bind -n M-j select-pane -D 27 | # bind -n M-k select-pane -U 28 | # bind -n M-l select-pane -R 29 | 30 | # `+z` (without ): zoom current pane 31 | bind -n M-z resize-pane -Z 32 | 33 | # `+Number` (without ): Change to window `Number` 34 | bind -n M-1 select-window -t 1 35 | bind -n M-2 select-window -t 2 36 | bind -n M-3 select-window -t 3 37 | bind -n M-4 select-window -t 4 38 | bind -n M-5 select-window -t 5 39 | bind -n M-6 select-window -t 6 40 | bind -n M-7 select-window -t 7 41 | bind -n M-8 select-window -t 8 42 | bind -n M-9 select-window -t 9 43 | 44 | 45 | # Enter copy/yank mode with ` y` instead of ` [` 46 | unbind [ 47 | bind -n C-y copy-mode 48 | 49 | # Vim keys in copypaste/yank mode (hjkl, v, y) 50 | set-window-option -g mode-keys vi 51 | bind -T copy-mode-vi v send -X begin-selection 52 | bind -T copy-mode-vi y send -X copy-selection 53 | 54 | # Open new panes/splits in current working directory 55 | bind '"' split-window -v -c "#{pane_current_path}" 56 | bind % split-window -h -c "#{pane_current_path}" 57 | 58 | 59 | # Navigating between windows _______________________________________ 60 | unbind n 61 | unbind p 62 | 63 | # `Ctrl+Space`: switch to the last active window 64 | bind -n C-Space last-window 65 | 66 | # # `+h`: select previous window (next to the left) 67 | # bind -r C-h previous-window 68 | # # `+l`: select next window (next to the right) 69 | # bind -r C-l next-window 70 | 71 | # `+k`: move the current window to the left in windows list 72 | bind -r C-k swap-window -t -1 \; previous-window 73 | # `+j`: move the current window to the right in windows list 74 | bind -r C-j swap-window -t +1 \; next-window 75 | 76 | # `