├── X ├── Xmodmap ├── xmobarrc ├── Xresources ├── xmonad.hs ├── gnome-terminal-conf.xml ├── awesome-battery.lua └── awesome-rc.lua ├── nvim ├── init.lua ├── ftplugin │ ├── javascript.lua │ ├── typescriptreact.lua │ └── typescript.lua ├── after │ └── plugin │ │ ├── fugitive.lua │ │ ├── undotree.lua │ │ ├── sourcegraph.lua │ │ ├── nvim-tree.lua │ │ ├── telescope.lua │ │ ├── null-ls.lua │ │ ├── prettier.lua │ │ ├── treesitter.lua │ │ └── lsp.lua ├── lua │ └── vverma │ │ ├── init.lua │ │ ├── set.lua │ │ ├── remap.lua │ │ └── packer.lua └── local.lua ├── npm └── npmrc ├── .gitignore ├── vim ├── gitrebase.snippets ├── typescript.snippets ├── go.snippets └── vimrc ├── git ├── gitignore_global └── gitconfig ├── bin ├── git-pr-target └── git-push-to-target ├── darwin-nix-config ├── Makefile ├── bashrc ├── flake.lock ├── flake.nix └── home-manager.nix ├── linux-nix-config ├── Makefile ├── flake.nix ├── bashrc ├── flake.lock └── home-manager.nix ├── bash ├── bash_profile ├── profile └── bashrc ├── install ├── tmux └── tmux.conf └── kitty.conf /X/Xmodmap: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /nvim/init.lua: -------------------------------------------------------------------------------- 1 | require("vverma") 2 | -------------------------------------------------------------------------------- /npm/npmrc: -------------------------------------------------------------------------------- 1 | save=true 2 | save-exact=true 3 | -------------------------------------------------------------------------------- /nvim/ftplugin/javascript.lua: -------------------------------------------------------------------------------- 1 | typescript.lua -------------------------------------------------------------------------------- /nvim/ftplugin/typescriptreact.lua: -------------------------------------------------------------------------------- 1 | typescript.lua -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | vim/bundle 2 | vim/tmp 3 | nvim/plugin/packer_compiled.lua 4 | -------------------------------------------------------------------------------- /nvim/after/plugin/fugitive.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set("n", "gs", vim.cmd.Git); 2 | -------------------------------------------------------------------------------- /vim/gitrebase.snippets: -------------------------------------------------------------------------------- 1 | snippet grp 2 | exec git push-to-target 3 | endsnippet 4 | -------------------------------------------------------------------------------- /git/gitignore_global: -------------------------------------------------------------------------------- 1 | .*.swp 2 | *.pyc 3 | *.o 4 | tags.tmp 5 | tags 6 | .mypy_cache 7 | -------------------------------------------------------------------------------- /nvim/after/plugin/undotree.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) 2 | -------------------------------------------------------------------------------- /bin/git-pr-target: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | 5 | hub pr -b master -h $(git pt --query) -f 6 | -------------------------------------------------------------------------------- /nvim/lua/vverma/init.lua: -------------------------------------------------------------------------------- 1 | require("vverma.remap") 2 | require("vverma.set") 3 | require("vverma.packer") 4 | -------------------------------------------------------------------------------- /darwin-nix-config/Makefile: -------------------------------------------------------------------------------- 1 | switch: 2 | nix run nix-darwin -- switch --flake ~/dotfiles/darwin-nix-config 3 | 4 | -------------------------------------------------------------------------------- /linux-nix-config/Makefile: -------------------------------------------------------------------------------- 1 | switch: 2 | nix run nixpkgs#home-manager -- switch --flake ~/dotfiles/linux-nix-config .#vaibhav 3 | -------------------------------------------------------------------------------- /nvim/ftplugin/typescript.lua: -------------------------------------------------------------------------------- 1 | vim.opt_local.tabstop = 2 2 | vim.opt_local.softtabstop = 2 3 | vim.opt_local.shiftwidth = 2 4 | -------------------------------------------------------------------------------- /vim/typescript.snippets: -------------------------------------------------------------------------------- 1 | snippet import 2 | import { $1 } from 'src/`!p snip.rv = t[1].replace('_', '/')`'; 3 | endsnippet 4 | -------------------------------------------------------------------------------- /nvim/after/plugin/sourcegraph.lua: -------------------------------------------------------------------------------- 1 | vim.g.sourcegraph_vim_url = "https:/betteromics.sourcegraph.com/" 2 | 3 | vim.keymap.set("n", "gh", "SourcegraphCopyUrl") 4 | -------------------------------------------------------------------------------- /bash/bash_profile: -------------------------------------------------------------------------------- 1 | if [ -f /etc/profile ]; then 2 | source /etc/profile 3 | fi 4 | 5 | command -v brew > /dev/null 2>&1 && eval "$(brew shellenv)" 6 | 7 | source $HOME/.bashrc 8 | -------------------------------------------------------------------------------- /vim/go.snippets: -------------------------------------------------------------------------------- 1 | snippet main 2 | package main 3 | 4 | func main() { 5 | if err := mainHelper(); err != nil { 6 | log.Fatalf("%+v", err) 7 | } 8 | } 9 | 10 | func mainHelper() error { 11 | return nil 12 | } 13 | endsnippet 14 | -------------------------------------------------------------------------------- /nvim/after/plugin/nvim-tree.lua: -------------------------------------------------------------------------------- 1 | -- empty setup using defaults 2 | require("nvim-tree").setup({ 3 | disable_netrw = true, 4 | hijack_netrw = true, 5 | sync_root_with_cwd = true, 6 | respect_buf_cwd = true, 7 | git = { 8 | enable = true, 9 | ignore = true, 10 | timeout = 500, 11 | }, 12 | update_focused_file = { 13 | enable = true, 14 | update_root = true 15 | }, 16 | }) 17 | 18 | vim.keymap.set('n', 'n', ':NvimTreeToggle', {noremap = true, silent = true}) 19 | -------------------------------------------------------------------------------- /nvim/after/plugin/telescope.lua: -------------------------------------------------------------------------------- 1 | local builtin = require('telescope.builtin') 2 | vim.keymap.set('n', 'ff', builtin.find_files, {}) 3 | -- Find the .git directory or file in the current directory or its ancestors 4 | local git_dir = vim.fn.finddir('.git', '.;') 5 | 6 | -- If the .git directory or file is found, the current directory is a Git repository 7 | if git_dir ~= '' then 8 | vim.keymap.set('n', '', builtin.git_files, {}) 9 | else 10 | vim.keymap.set('n', '', builtin.find_files, {}) 11 | end 12 | vim.keymap.set('n', '', ':Telescope live_grep default_text=', {}) 13 | vim.keymap.set('n', 'b', builtin.buffers, {}) 14 | -------------------------------------------------------------------------------- /nvim/lua/vverma/set.lua: -------------------------------------------------------------------------------- 1 | vim.opt.guicursor = "" 2 | vim.opt.nu = true 3 | vim.opt.tabstop = 4 4 | vim.opt.softtabstop = 4 5 | vim.opt.shiftwidth = 4 6 | vim.opt.expandtab = true 7 | vim.opt.smartindent = true 8 | 9 | vim.opt.swapfile = false 10 | vim.opt.backup = false 11 | vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" 12 | vim.opt.undofile = true 13 | 14 | vim.opt.hlsearch = false 15 | vim.opt.incsearch = true 16 | vim.opt.ignorecase = true 17 | vim.opt.smartcase = true 18 | vim.opt.termguicolors = true 19 | 20 | vim.opt.updatetime = 50 21 | vim.opt.colorcolumn = "80" 22 | 23 | vim.opt.wildmenu = true 24 | vim.opt.wildmode = "longest:list" 25 | 26 | vim.opt.mouse = "r" 27 | 28 | -- disable netrw in favor of nvim-tree 29 | vim.g.loaded_netrw = 1 30 | vim.g.loaded_netrwPlugin = 1 31 | 32 | -------------------------------------------------------------------------------- /linux-nix-config/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "My Ubuntu Nix"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; 6 | home-manager = { 7 | url = "github:nix-community/home-manager"; 8 | inputs.nixpkgs.follows = "nixpkgs"; 9 | }; 10 | }; 11 | outputs = { 12 | nixpkgs, 13 | home-manager, 14 | ... 15 | }: let 16 | # system = "aarch64-linux"; If you are running on ARM powered computer 17 | system = "x86_64-linux"; 18 | pkgs = nixpkgs.legacyPackages.${system}; 19 | in { 20 | homeConfigurations = { 21 | vaibhav = home-manager.lib.homeManagerConfiguration { 22 | inherit pkgs; 23 | modules = [ 24 | ./home-manager.nix 25 | ]; 26 | }; 27 | }; 28 | }; 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /nvim/after/plugin/null-ls.lua: -------------------------------------------------------------------------------- 1 | local null_ls = require("null-ls") 2 | 3 | local group = vim.api.nvim_create_augroup("lsp_format_on_save", { clear = false }) 4 | 5 | null_ls.setup({ 6 | on_attach = function(client, bufnr) 7 | if client.supports_method("textDocument/formatting") then 8 | vim.keymap.set("n", "f", function() 9 | vim.lsp.buf.format({ bufnr = vim.api.nvim_get_current_buf() }) 10 | end, { buffer = bufnr, desc = "[lsp] format" }) 11 | end 12 | 13 | if client.supports_method("textDocument/rangeFormatting") then 14 | vim.keymap.set("x", "f", function() 15 | vim.lsp.buf.format({ bufnr = vim.api.nvim_get_current_buf() }) 16 | end, { buffer = bufnr, desc = "[lsp] format" }) 17 | end 18 | end, 19 | }) 20 | -------------------------------------------------------------------------------- /bash/profile: -------------------------------------------------------------------------------- 1 | # ~/.profile: executed by the command interpreter for login shells. 2 | # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login 3 | # exists. 4 | # see /usr/share/doc/bash/examples/startup-files for examples. 5 | # the files are located in the bash-doc package. 6 | 7 | # the default umask is set in /etc/profile; for setting the umask 8 | # for ssh logins, install and configure the libpam-umask package. 9 | #umask 022 10 | 11 | # if running bash 12 | if [ -n "$BASH_VERSION" ]; then 13 | # include .bashrc if it exists 14 | if [ -f "$HOME/.bashrc" ]; then 15 | . "$HOME/.bashrc" 16 | fi 17 | fi 18 | 19 | # set PATH so it includes user's private bin if it exists 20 | if [ -d "$HOME/bin" ] ; then 21 | PATH="$HOME/bin:$PATH" 22 | fi 23 | 24 | export CLICOLOR=1 25 | export LSCOLORS=ExFxCxDxBxegedabagacad 26 | -------------------------------------------------------------------------------- /X/xmobarrc: -------------------------------------------------------------------------------- 1 | Config { font = "-*-Fixed-Bold-R-Normal-*-13-*-*-*-*-*-*-*" 2 | , bgColor = "black" 3 | , fgColor = "grey" 4 | , position = TopW L 90 5 | , commands = [ Run Weather "EGPF" ["-t"," F","-L","64","-H","77","--normal","green","--high","red","--low","lightblue"] 36000 6 | , Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10 7 | , Run Memory ["-t","Mem: %"] 10 8 | , Run Battery [] 10 9 | , Run Swap [] 10 10 | , Run Date "%a %b %_d %l:%M" "date" 10 11 | , Run StdinReader 12 | ] 13 | , sepChar = "%" 14 | , alignSep = "}{" 15 | , template = "%StdinReader% }{ %cpu% | %memory% * %swap% %battery% %date% | %EGPF%" 16 | } 17 | -------------------------------------------------------------------------------- /nvim/after/plugin/prettier.lua: -------------------------------------------------------------------------------- 1 | local prettier = require("prettier") 2 | 3 | prettier.setup({ 4 | bin = 'prettier', -- or `'prettierd'` (v0.23.3+) 5 | filetypes = { 6 | "css", 7 | "graphql", 8 | "html", 9 | "javascript", 10 | "javascriptreact", 11 | "json", 12 | "less", 13 | "markdown", 14 | "scss", 15 | "typescript", 16 | "typescriptreact", 17 | "yaml", 18 | }, 19 | ["null-ls"] = { 20 | condition = function() 21 | return prettier.config_exists({ 22 | -- if `false`, skips checking `package.json` for `"prettier"` key 23 | check_package_json = true, 24 | }) 25 | end, 26 | runtime_condition = function(params) 27 | -- return false to skip running prettier 28 | return true 29 | end, 30 | timeout = 5000, 31 | } 32 | }) 33 | 34 | -------------------------------------------------------------------------------- /nvim/after/plugin/treesitter.lua: -------------------------------------------------------------------------------- 1 | require'nvim-treesitter.configs'.setup { 2 | -- A list of parser names, or "all" (the five listed parsers should always be installed) 3 | ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "javascript", "typescript" }, 4 | 5 | -- Install parsers synchronously (only applied to `ensure_installed`) 6 | sync_install = false, 7 | 8 | -- Automatically install missing parsers when entering buffer 9 | -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally 10 | auto_install = true, 11 | 12 | indent = { 13 | enable = true 14 | }, 15 | 16 | highlight = { 17 | enable = true, 18 | 19 | -- Setting this to true will run `:h syntax` and tree-sitter at the same time. 20 | -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). 21 | -- Using this option may slow down your editor, and you may see some duplicate highlights. 22 | -- Instead of true it can also be a list of languages 23 | additional_vim_regex_highlighting = false, 24 | }, 25 | } 26 | -------------------------------------------------------------------------------- /X/Xresources: -------------------------------------------------------------------------------- 1 | !URxvt*font: xft:monospace:pixelsize=12 2 | URxvt.perl-ext-common: default,clipboard 3 | xterm*background: #121212 4 | xterm*foreground: #DDDDDD 5 | 6 | 7 | xterm*faceName: monospace 8 | xterm*faceSize: 10 9 | XTerm*VT100.translations: #override : select-end(PRIMARY, CLIPBOARD, CUT_BUFFER0) 10 | 11 | URxvt.keysym.Control-M-c: perl:clipboard:copy 12 | URxvt.keysym.Control-M-v: perl:clipboard:paste 13 | 14 | emacs*cursorColor: Orchid 15 | 16 | *foreground: #DDDDDD 17 | *background: #121212 18 | !black 19 | *color0: #353535 20 | *color8: #666666 21 | !red 22 | *color1: #AE4747 23 | *color9: #EE6363 24 | !green 25 | *color2: #556B2F 26 | *color10: #9ACD32 27 | !brown/yellow 28 | *color3: #DAA520 29 | *color11: #FFC125 30 | !blue 31 | *color4: #6F99B4 32 | *color12: #7C96B0 33 | !magenta 34 | *color5: #8B7B8B 35 | *color13: #D8BFD8 36 | !cyan 37 | *color6: #A7A15E 38 | *color14: #F0E68C 39 | !white 40 | *color7: #DDDDDD 41 | *color15: #FFFFFF 42 | -------------------------------------------------------------------------------- /bin/git-push-to-target: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # git-push-to-target: Push this commit to a branch specified in its 4 | # commit description. 5 | # 6 | # Copyright (c) 2017 William Chargin. Released under the MIT license. 7 | 8 | set -eu 9 | 10 | DIRECTIVE='vaibhav-branch' # any regex metacharacters should be escaped 11 | BRANCH_PREFIX='vaibhav/' 12 | 13 | target_branch() { 14 | directive="$( \ 15 | git show --pretty='%B' \ 16 | | sed -n 's/^'"${DIRECTIVE}"': \([[:alnum:]_-]*\)/\1/p' \ 17 | ; )" 18 | if [ -z "${directive}" ]; then 19 | printf >&2 'error: missing "%s" directive\n' "${DIRECTIVE}" 20 | return 1 21 | fi 22 | if [ "$(printf '%s\n' "${directive}" | wc -l)" -gt 1 ]; then 23 | printf >&2 'error: multiple "%s" directives\n' "${DIRECTIVE}" 24 | return 1 25 | fi 26 | printf '%s%s\n' "${BRANCH_PREFIX}" "${directive}" 27 | } 28 | 29 | main() { 30 | if [ "${1:-}" = "--query" ]; then 31 | target_branch 32 | return 33 | fi 34 | remote="${1:-origin}" 35 | branch="$(target_branch)" 36 | set -x 37 | git push --force-with-lease "${remote}" HEAD:refs/heads/"${branch}" 38 | } 39 | 40 | main "$@" 41 | -------------------------------------------------------------------------------- /git/gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Vaibhav Verma 3 | email = vaibhav.verma@scale.com 4 | [color] 5 | ui = true 6 | [diff] 7 | tool = nvimdiff 8 | [difftool] 9 | prompt = false 10 | [alias] 11 | s = status 12 | st = status 13 | d = difftool 14 | co = checkout 15 | l = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit 16 | p = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellowllow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -p 17 | po = push --set-upstream origin HEAD 18 | pr = pull-request 19 | pt = push-to-target 20 | rc = rebase --continue 21 | can = commit -a --amend --no-edit 22 | prt = pr-target 23 | pullr = pull --rebase 24 | rbm = rebase -i origin/master 25 | 26 | [core] 27 | filemode = false 28 | excludesfile = ~/.gitignore_global 29 | editor = /usr/bin/env vim 30 | [log] 31 | date = local 32 | [push] 33 | default = simple 34 | [rebase] 35 | autoStash = true 36 | [filter "lfs"] 37 | clean = git-lfs clean -- %f 38 | smudge = git-lfs smudge -- %f 39 | process = git-lfs filter-process 40 | required = true 41 | [submodule] 42 | recurse = true 43 | -------------------------------------------------------------------------------- /X/xmonad.hs: -------------------------------------------------------------------------------- 1 | import XMonad 2 | import XMonad.Hooks.DynamicLog 3 | import XMonad.Hooks.ManageDocks 4 | import XMonad.Util.Run(spawnPipe) 5 | import XMonad.Util.EZConfig(additionalKeys) 6 | import System.IO 7 | 8 | main = do 9 | xmproc <- spawnPipe "/usr/bin/xmobar /home/vverna/.xmobarrc" 10 | 11 | xmonad $ defaultConfig 12 | { manageHook = manageDocks <+> manageHook defaultConfig 13 | , layoutHook = avoidStruts $ layoutHook defaultConfig 14 | , logHook = dynamicLogWithPP xmobarPP 15 | { ppOutput = hPutStrLn xmproc 16 | , ppTitle = xmobarColor "green" "" . shorten 50 17 | } 18 | , modMask = mod4Mask -- Rebind Mod to the Windows key 19 | , terminal = "urxvt" 20 | } `additionalKeys` 21 | [ ((mod4Mask .|. shiftMask, xK_z), spawn "xscreensaver-command -lock") 22 | , ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s") 23 | , ((0, xK_Print), spawn "scrot") 24 | -- XF86AudioMute 25 | , ((0 , 0x1008ff12), spawn "amixer -q set PCM toggle") 26 | -- XF86AudioLowerVolume 27 | , ((0 , 0x1008ff11), spawn "amixer -q set PCM 9- unmute") 28 | -- XF86AudioRaiseVolume 29 | , ((0 , 0x1008ff13), spawn "amixer -q set PCM 9+ unmute") 30 | ] 31 | -------------------------------------------------------------------------------- /linux-nix-config/bashrc: -------------------------------------------------------------------------------- 1 | # Figure out how many colors we have now. 2 | hash tput && COLORS=$(tput colors) 3 | 4 | # Save some color codes based on our colour space. 5 | if [[ $COLORS -ge 256 ]]; then 6 | COLOR_ROOT='\[\e[38;5;9m\]' 7 | COLOR_SUDO='\[\e[38;5;11m\]' 8 | COLOR_USER='\[\e[38;5;10m\]' 9 | COLOR_NORM='\[\e[0m\]' 10 | elif [[ $COLORS -ge 8 ]]; then 11 | COLOR_ROOT='\[\e[1;31m\]' 12 | COLOR_SUDO='\[\e[1;33m\]' 13 | COLOR_USER='\[\e[1;32m\]' 14 | COLOR_NORM='\[\e[0m\]' 15 | else 16 | COLOR_ROOT= 17 | COLOR_SUDO= 18 | COLOR_USER= 19 | COLOR_NORM= 20 | fi 21 | 22 | # Decide on color for prompt. 23 | if [[ $EUID -eq 0 ]]; then 24 | COLOR_PROMPT=${COLOR_ROOT} 25 | elif [[ -n $SUDO_USER ]]; then 26 | COLOR_PROMPT=${COLOR_SUDO} 27 | else 28 | COLOR_PROMPT=${COLOR_USER} 29 | fi 30 | 31 | PROMPT_COMMAND='history -a' 32 | PS1='[\u@\h:\w]$(prompt return)\$' 33 | PS1='[\u@\h:\w]\$' 34 | PS1="${COLOR_PROMPT}${PS1}${COLOR_NORM} " 35 | 36 | # Keep the times of the commands in history. 37 | HISTTIMEFORMAT="%F %T " 38 | 39 | #Ctrl - D to logout. 40 | unset ignoreeof 41 | 42 | export FIGNORE=$FIGNORE:.pyc:.o:.gitignore 43 | 44 | GREP_OPTS="--color=auto --exclude-dir=.git" 45 | LS_OPTS="--color=auto" 46 | 47 | alias ls="ls ${LS_OPTS}" 48 | alias grep="grep ${GREP_OPTS}" 49 | 50 | [[ -e ~/.bashrc.local ]] && source ~/.bashrc.local 51 | -------------------------------------------------------------------------------- /linux-nix-config/flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "home-manager": { 4 | "inputs": { 5 | "nixpkgs": [ 6 | "nixpkgs" 7 | ] 8 | }, 9 | "locked": { 10 | "lastModified": 1723986931, 11 | "narHash": "sha256-Fy+KEvDQ+Hc8lJAV3t6leXhZJ2ncU5/esxkgt3b8DEY=", 12 | "owner": "nix-community", 13 | "repo": "home-manager", 14 | "rev": "2598861031b78aadb4da7269df7ca9ddfc3e1671", 15 | "type": "github" 16 | }, 17 | "original": { 18 | "owner": "nix-community", 19 | "repo": "home-manager", 20 | "type": "github" 21 | } 22 | }, 23 | "nixpkgs": { 24 | "locked": { 25 | "lastModified": 1724208548, 26 | "narHash": "sha256-8Aiur5lv2L8o9ErxHqS2F293MHiHCoRG8C4vCwhkeXo=", 27 | "owner": "nixos", 28 | "repo": "nixpkgs", 29 | "rev": "4c30668e1edb7348169407f218fa7c71a94b17f3", 30 | "type": "github" 31 | }, 32 | "original": { 33 | "owner": "nixos", 34 | "ref": "nixpkgs-unstable", 35 | "repo": "nixpkgs", 36 | "type": "github" 37 | } 38 | }, 39 | "root": { 40 | "inputs": { 41 | "home-manager": "home-manager", 42 | "nixpkgs": "nixpkgs" 43 | } 44 | } 45 | }, 46 | "root": "root", 47 | "version": 7 48 | } 49 | -------------------------------------------------------------------------------- /darwin-nix-config/bashrc: -------------------------------------------------------------------------------- 1 | # Figure out how many colors we have now. 2 | hash tput && COLORS=$(tput colors) 3 | 4 | # Save some color codes based on our colour space. 5 | if [[ $COLORS -ge 256 ]]; then 6 | COLOR_ROOT='\[\e[38;5;9m\]' 7 | COLOR_SUDO='\[\e[38;5;11m\]' 8 | COLOR_USER='\[\e[38;5;10m\]' 9 | COLOR_NORM='\[\e[0m\]' 10 | elif [[ $COLORS -ge 8 ]]; then 11 | COLOR_ROOT='\[\e[1;31m\]' 12 | COLOR_SUDO='\[\e[1;33m\]' 13 | COLOR_USER='\[\e[1;32m\]' 14 | COLOR_NORM='\[\e[0m\]' 15 | else 16 | COLOR_ROOT= 17 | COLOR_SUDO= 18 | COLOR_USER= 19 | COLOR_NORM= 20 | fi 21 | 22 | # Decide on color for prompt. 23 | if [[ $EUID -eq 0 ]]; then 24 | COLOR_PROMPT=${COLOR_ROOT} 25 | elif [[ -n $SUDO_USER ]]; then 26 | COLOR_PROMPT=${COLOR_SUDO} 27 | else 28 | COLOR_PROMPT=${COLOR_USER} 29 | fi 30 | 31 | PROMPT_COMMAND='history -a' 32 | PS1='[\u@\h:\w]$(prompt return)\$' 33 | PS1='[\u@\h:\w]\$' 34 | PS1="${COLOR_PROMPT}${PS1}${COLOR_NORM} " 35 | 36 | # Keep the times of the commands in history. 37 | HISTTIMEFORMAT="%F %T " 38 | 39 | #Ctrl - D to logout. 40 | unset ignoreeof 41 | 42 | export FIGNORE=$FIGNORE:.pyc:.o:.gitignore 43 | 44 | GREP_OPTS="--color=auto --exclude-dir=.git" 45 | LS_OPTS="--color=auto" 46 | 47 | alias ls="ls ${LS_OPTS}" 48 | alias grep="grep ${GREP_OPTS}" 49 | 50 | [[ -e ~/.bashrc.local ]] && source ~/.bashrc.local 51 | -------------------------------------------------------------------------------- /nvim/lua/vverma/remap.lua: -------------------------------------------------------------------------------- 1 | vim.g.mapleader = "," 2 | vim.keymap.set("n", "n", vim.cmd.Ex) 3 | vim.keymap.set("i", "jk", "", {noremap=true}) 4 | vim.keymap.set("i", "jj", "", {noremap=true}) 5 | 6 | -- move command in visual mode 7 | vim.keymap.set("v", "J", ":m '>+1gv=gv") 8 | vim.keymap.set("v", "K", ":m '<-2gv=gv") 9 | 10 | vim.keymap.set("n", "J", "mzJ`z") 11 | vim.keymap.set("n", "", "zz") 12 | vim.keymap.set("n", "", "zz") 13 | vim.keymap.set("n", "n", "nzzzv") 14 | vim.keymap.set("n", "N", "Nzzzv") 15 | 16 | -- greatest remap ever 17 | vim.keymap.set("x", "p", [["_dP]]) 18 | 19 | -- next greatest remap ever : asbjornHaland 20 | -- copies to system clipboard 21 | vim.keymap.set({"n", "v"}, "y", [["+y]]) 22 | vim.keymap.set("n", "Y", [["+Y]]) 23 | 24 | vim.keymap.set({"n", "v"}, "d", [["_d]]) 25 | 26 | vim.keymap.set("n", "Q", "") 27 | vim.keymap.set("n", "q:", "") 28 | 29 | -- quickfix commands 30 | vim.keymap.set("n", "", "cnextzz") 31 | vim.keymap.set("n", "", "cprevzz") 32 | vim.keymap.set("n", "k", "lnextzz") 33 | vim.keymap.set("n", "j", "lprevzz") 34 | 35 | vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) 36 | 37 | vim.keymap.set("n", "vpp", "e ~/.config/nvim/lua/vverma/packer.lua"); 38 | 39 | vim.keymap.set("n", "", function() 40 | vim.cmd("so") 41 | end) 42 | 43 | if vim.api.nvim_win_get_option(0, "diff") then 44 | vim.keymap.set("n", "qq", ":qa", {noremap=true}) 45 | end 46 | -------------------------------------------------------------------------------- /X/gnome-terminal-conf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | solid 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Monospace 10 14 | 15 | 16 | 17 | #2E2E34343636:#CCCC00000000:#4E4E9A9A0606:#C4C4A0A00000:#34346565A4A4:#757550507B7B:#060698209A9A:#D3D3D7D7CFCF:#555557575353:#EFEF29292929:#8A8AE2E23434:#FCFCE9E94F4F:#72729F9FCFCF:#ADAD7F7FA8A8:#3434E2E2E2E2:#EEEEEEEEECEC 18 | 19 | 20 | 21 | #000000000000 22 | 23 | 24 | Default 25 | 26 | 27 | #000000000000 28 | 29 | 30 | #FFFFFFFFFFFF 31 | 32 | 33 | -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu 4 | 5 | cd "${HOME}" 6 | 7 | mkdir -p "${HOME}/.config/nvim" 8 | mkdir -p "${HOME}/.config/kitty" 9 | 10 | # Link in files, replacing whatever's already there. 11 | ln -fs "${HOME}/dotfiles/bash/bashrc" "${HOME}/.bashrc" 12 | ln -fs "${HOME}/dotfiles/bash/bash_profile" "${HOME}/.bash_profile" 13 | ln -fs "${HOME}/dotfiles/X/Xmodmap" "${HOME}/.Xmodmap" 14 | ln -fs "${HOME}/dotfiles/git/gitconfig" "${HOME}/.gitconfig" 15 | ln -fs "${HOME}/dotfiles/git/gitignore_global" "${HOME}/.gitignore_global" 16 | ln -fs "${HOME}/dotfiles/npm/npmrc" "${HOME}/.npmrc" 17 | ln -fs "${HOME}/dotfiles/tmux/tmux.conf" "${HOME}/.tmux.conf" 18 | ln -fs "${HOME}/dotfiles/vim/vimrc" "${HOME}/.vimrc" 19 | ln -fs "${HOME}/dotfiles/nvim" "${HOME}/.config/" 20 | ln -fs "${HOME}/dotfiles/X/Xresources" "${HOME}/.Xresources" 21 | ln -fs "${HOME}/dotfiles/kitty.conf" "${HOME}/..config/kitty/kitty.conf" 22 | 23 | # Link in directories, removing whatever's already there first. 24 | if [ -e "${HOME}/.vim/bundle" ]; then 25 | rm -rf "${HOME}/.vim/bundle" 26 | fi 27 | 28 | curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ 29 | https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 30 | 31 | mkdir -p "${HOME}/.gconf/apps/gnome-terminal/profiles/Default" 32 | ln -fs "${HOME}/dotfiles/X/gnome-terminal-conf.xml" "${HOME}/.gconf/apps/gnome-terminal/profiles/Default/%gconf.xml" 33 | 34 | mkdir -p "${HOME}/.vim/UltiSnips" 35 | ln -fs "${HOME}/dotfiles/vim/gitrebase.snippets" "${HOME}/.vim/UltiSnips/gitrebase.snippets" 36 | 37 | mkdir -p "${HOME}/bin" 38 | ln -fs ${HOME}/dotfiles/bin/git-push-to-target ${HOME}/bin/git-push-to-target 39 | ln -fs ${HOME}/dotfiles/bin/git-pr-target ${HOME}/bin/git-pr-target 40 | 41 | vim +PlugInstall +qall 42 | -------------------------------------------------------------------------------- /nvim/after/plugin/lsp.lua: -------------------------------------------------------------------------------- 1 | local lsp = require('lsp-zero') 2 | 3 | lsp.preset("recommended") 4 | 5 | lsp.ensure_installed({ 6 | 'tsserver', 7 | 'eslint', 8 | 'pyright', 9 | }) 10 | 11 | local cmp = require('cmp') 12 | local cmp_select = {behavior = cmp.SelectBehavior.Select} 13 | local cmp_mappings = lsp.defaults.cmp_mappings({ 14 | [''] = cmp.mapping.select_prev_item(cmp_select), 15 | [''] = cmp.mapping.select_next_item(cmp_select), 16 | [''] = cmp.mapping.confirm({ select = true }), 17 | [""] = cmp.mapping.complete(), 18 | }) 19 | 20 | cmp_mappings[''] = nil 21 | cmp_mappings[''] = nil 22 | 23 | lsp.setup_nvim_cmp({ 24 | mapping = cmp_mappings 25 | }) 26 | 27 | lsp.set_preferences({ 28 | suggest_lsp_servers = false, 29 | sign_icons = { 30 | error = 'E', 31 | warn = 'W', 32 | hint = 'H', 33 | info = 'I' 34 | } 35 | }) 36 | 37 | lsp.on_attach(function(client, bufnr) 38 | local opts = {buffer = bufnr, remap = false} 39 | 40 | vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) 41 | vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) 42 | vim.keymap.set("n", "vws", function() vim.lsp.buf.workspace_symbol() end, opts) 43 | vim.keymap.set("n", "vd", function() vim.diagnostic.open_float() end, opts) 44 | vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) 45 | vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) 46 | vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) 47 | vim.keymap.set("n", "vrr", function() vim.lsp.buf.references() end, opts) 48 | vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts) 49 | vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) 50 | end) 51 | 52 | lsp.setup() 53 | 54 | vim.diagnostic.config({ 55 | virtual_text = true 56 | }) 57 | -------------------------------------------------------------------------------- /tmux/tmux.conf: -------------------------------------------------------------------------------- 1 | # Prefix 2 | unbind-key C-b 3 | set-option -g prefix C-a 4 | bind-key a send-prefix 5 | bind-key C-a last-window 6 | 7 | #urxvt tab like window switching (-n: no prior escape seq) 8 | bind -n S-down new-window 9 | bind -n S-left prev 10 | bind -n S-right next 11 | bind -n C-left swap-window -t -1 12 | bind -n C-right swap-window -t +1 13 | 14 | # Bindings 15 | bind-key '/' confirm-before "kill-window" 16 | bind-key '\' confirm-before "kill-server" 17 | bind-key '_' split-window -v 18 | bind-key '|' split-window -h 19 | bind-key Tab select-pane -t :.+ 20 | 21 | # Vim-like pane resize 22 | bind-key -r '+' resize-pane -U 5 23 | bind-key -r '-' resize-pane -D 5 24 | bind-key -r '<' resize-pane -L 5 25 | bind-key -r '>' resize-pane -R 5 26 | 27 | # Vim-like pane switching 28 | bind-key h select-pane -L 29 | bind-key j select-pane -D 30 | bind-key k select-pane -U 31 | bind-key l select-pane -R 32 | 33 | # Vim-like pane swapping 34 | bind-key J swap-pane -D 35 | bind-key K swap-pane -U 36 | 37 | bind-key = select-layout even-horizontal 38 | 39 | # Activity 40 | set-window-option -g monitor-activity on 41 | 42 | # History 43 | set-option -g history-limit 100000 44 | 45 | # Indices 46 | set-option -g base-index 1 47 | 48 | # Modes 49 | set-window-option -g mode-keys vi 50 | 51 | # Resize 52 | set-window-option -g aggressive-resize on 53 | 54 | # Status bar 55 | set-option -g status-left '[#S]' 56 | set-option -g status-right '[#H] #(date +"%F %T")' 57 | if-shell 'test `tput colors` -eq 256' 'set-option -g status-bg colour237' 58 | if-shell 'test `tput colors` -eq 256' 'set-option -g status-fg colour248' 59 | if-shell 'test `tput colors` -eq 256' 'set-window-option -g window-status-current-format "#[fg=colour231]#I:#W#F"' 60 | if-shell 'test `tput colors` -eq 256' 'set-window-option -g window-status-format "#[fg=colour16]#I:#W#F"' 61 | 62 | # Terminal 63 | CONTAINING_TERM=$TERM 64 | set-option -g terminal-overrides 'xterm*:smcup@:rmcup@' 65 | set-option -s escape-time 0 66 | if-shell 'test `tput colors` -eq 256' 'set-option -g default-terminal "tmux-256color"' 67 | 68 | # Titles 69 | set-window-option -g automatic-rename off 70 | -------------------------------------------------------------------------------- /darwin-nix-config/flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "darwin": { 4 | "inputs": { 5 | "nixpkgs": [ 6 | "nixpkgs" 7 | ] 8 | }, 9 | "locked": { 10 | "lastModified": 1726168587, 11 | "narHash": "sha256-4RdrCa1pldPyuEHXiN9MhMPCvkUObO517XqixSz064c=", 12 | "owner": "LnL7", 13 | "repo": "nix-darwin", 14 | "rev": "122ff62d68c9068706393001d5884b66bc0067c4", 15 | "type": "github" 16 | }, 17 | "original": { 18 | "owner": "LnL7", 19 | "repo": "nix-darwin", 20 | "type": "github" 21 | } 22 | }, 23 | "home-manager": { 24 | "inputs": { 25 | "nixpkgs": [ 26 | "nixpkgs" 27 | ] 28 | }, 29 | "locked": { 30 | "lastModified": 1719827415, 31 | "narHash": "sha256-pvh+1hStXXAZf0sZ1xIJbWGx4u+OGBC1rVx6Wsw0fBw=", 32 | "owner": "nix-community", 33 | "repo": "home-manager", 34 | "rev": "f2e3c19867262dbe84fdfab42467fc8dd83a2005", 35 | "type": "github" 36 | }, 37 | "original": { 38 | "owner": "nix-community", 39 | "ref": "release-23.11", 40 | "repo": "home-manager", 41 | "type": "github" 42 | } 43 | }, 44 | "nixpkgs": { 45 | "locked": { 46 | "lastModified": 1719957072, 47 | "narHash": "sha256-gvFhEf5nszouwLAkT9nWsDzocUTqLWHuL++dvNjMp9I=", 48 | "owner": "NixOS", 49 | "repo": "nixpkgs", 50 | "rev": "7144d6241f02d171d25fba3edeaf15e0f2592105", 51 | "type": "github" 52 | }, 53 | "original": { 54 | "owner": "NixOS", 55 | "ref": "nixpkgs-23.11-darwin", 56 | "repo": "nixpkgs", 57 | "type": "github" 58 | } 59 | }, 60 | "nixpkgs-unstable": { 61 | "locked": { 62 | "lastModified": 1726108120, 63 | "narHash": "sha256-Ji5wO1lLG99grI0qCRb6FyRPpH9tfdfD1QP/r7IlgfM=", 64 | "owner": "NixOS", 65 | "repo": "nixpkgs", 66 | "rev": "111ed8812c10d7dc3017de46cbf509600c93f551", 67 | "type": "github" 68 | }, 69 | "original": { 70 | "owner": "NixOS", 71 | "ref": "nixpkgs-unstable", 72 | "repo": "nixpkgs", 73 | "type": "github" 74 | } 75 | }, 76 | "root": { 77 | "inputs": { 78 | "darwin": "darwin", 79 | "home-manager": "home-manager", 80 | "nixpkgs": "nixpkgs", 81 | "nixpkgs-unstable": "nixpkgs-unstable" 82 | } 83 | } 84 | }, 85 | "root": "root", 86 | "version": 7 87 | } 88 | -------------------------------------------------------------------------------- /X/awesome-battery.lua: -------------------------------------------------------------------------------- 1 | local io = io 2 | local math = math 3 | local naughty = naughty 4 | local beautiful = beautiful 5 | local tonumber = tonumber 6 | local tostring = tostring 7 | local print = print 8 | local pairs = pairs 9 | 10 | module("battery") 11 | 12 | local limits = {{25, 5}, 13 | {12, 3}, 14 | { 7, 1}, 15 | {0}} 16 | 17 | function get_bat_state (adapter) 18 | local fcur = io.open("/sys/class/power_supply/"..adapter.."/charge_now") 19 | local fcap = io.open("/sys/class/power_supply/"..adapter.."/charge_full") 20 | local fsta = io.open("/sys/class/power_supply/"..adapter.."/status") 21 | local cur = fcur:read() 22 | local cap = fcap:read() 23 | local sta = fsta:read() 24 | fcur:close() 25 | fcap:close() 26 | fsta:close() 27 | local battery = math.floor(cur * 100 / cap) 28 | if sta:match("Charging") then 29 | dir = 1 30 | elseif sta:match("Discharging") then 31 | dir = -1 32 | else 33 | dir = 0 34 | battery = "" 35 | end 36 | return battery, dir 37 | end 38 | 39 | function getnextlim (num) 40 | for ind, pair in pairs(limits) do 41 | lim = pair[1]; step = pair[2]; nextlim = limits[ind+1][1] or 0 42 | if num > nextlim then 43 | repeat 44 | lim = lim - step 45 | until num > lim 46 | if lim < nextlim then 47 | lim = nextlim 48 | end 49 | return lim 50 | end 51 | end 52 | end 53 | 54 | 55 | function batclosure (adapter) 56 | local nextlim = limits[1][1] 57 | return function () 58 | local prefix = "⚡" 59 | local battery, dir = get_bat_state(adapter) 60 | if dir == -1 then 61 | dirsign = "↓" 62 | prefix = "Bat:" 63 | if battery <= nextlim then 64 | naughty.notify({title = "⚡ Beware! ⚡", 65 | text = "Battery charge is low ( ⚡ "..battery.."%)!", 66 | timeout = 7, 67 | position = "bottom_right", 68 | fg = beautiful.fg_focus, 69 | bg = beautiful.bg_focus 70 | }) 71 | nextlim = getnextlim(battery) 72 | end 73 | elseif dir == 1 then 74 | dirsign = "↑" 75 | nextlim = limits[1][1] 76 | else 77 | dirsign = "" 78 | end 79 | if dir ~= 0 then battery = battery.."%" end 80 | return " "..prefix.." "..dirsign..battery..dirsign.." " 81 | end 82 | end 83 | -------------------------------------------------------------------------------- /darwin-nix-config/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Example Darwin system flake"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-23.11-darwin"; 6 | nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; 7 | 8 | darwin.url = "github:LnL7/nix-darwin"; 9 | darwin.inputs.nixpkgs.follows = "nixpkgs"; 10 | 11 | home-manager = { 12 | url = "github:nix-community/home-manager/release-23.11"; 13 | inputs.nixpkgs.follows = "nixpkgs"; 14 | }; 15 | }; 16 | 17 | outputs = inputs@{ self, darwin, nixpkgs, nixpkgs-unstable, home-manager }: 18 | let 19 | mkDarwinSystem = { hostname, username, system }: darwin.lib.darwinSystem { 20 | modules = [ 21 | ({pkgs, ...}: { 22 | environment.systemPackages = with pkgs; [ 23 | coreutils 24 | ]; 25 | 26 | services.nix-daemon.enable = true; 27 | 28 | nix.settings.experimental-features = "nix-command flakes"; 29 | 30 | system.configurationRevision = self.rev or self.dirtyRev or null; 31 | 32 | system.stateVersion = 4; 33 | 34 | nixpkgs.hostPlatform = "aarch64-darwin"; 35 | nixpkgs.config.allowUnfree = true; 36 | nixpkgs.config.allowUnsupportedSystem = true; 37 | 38 | users.users.${username} = { 39 | home = "/Users/${username}"; 40 | shell = pkgs.bash; 41 | }; 42 | }) 43 | home-manager.darwinModules.home-manager 44 | { 45 | home-manager.useGlobalPkgs = true; 46 | home-manager.useUserPackages = true; 47 | home-manager.users.${username} = import ./home-manager.nix { 48 | username = username; 49 | }; 50 | home-manager.extraSpecialArgs = { 51 | pkgs-unstable = import nixpkgs-unstable { 52 | inherit system; 53 | config.allowUnfree = true; 54 | }; 55 | }; 56 | } 57 | ]; 58 | }; 59 | in 60 | { 61 | darwinConfigurations = { 62 | "Vaibhavs-MacBook-Pro" = mkDarwinSystem { 63 | hostname = "Vaibhavs-MacBook-Pro"; 64 | username = "vverma"; 65 | system = "aarch64-darwin"; 66 | }; 67 | "vvscale" = mkDarwinSystem { 68 | hostname = "vvscale"; 69 | username = "vaibhav.verma"; 70 | system = "aarch64-darwin"; 71 | }; 72 | "SCMM0VDYF00M0" = mkDarwinSystem { 73 | hostname = "SCMM0VDYF00M0"; 74 | username = "vaibhav.verma"; 75 | system = "aarch64-darwin"; 76 | }; 77 | }; 78 | 79 | # Expose the package set, including overlays, for convenience. 80 | darwinPackages = builtins.mapAttrs (hostname: config: config.pkgs) self.darwinConfigurations; 81 | }; 82 | } 83 | -------------------------------------------------------------------------------- /nvim/lua/vverma/packer.lua: -------------------------------------------------------------------------------- 1 | -- This file can be loaded by calling `lua require('plugins')` from your init.vim 2 | 3 | -- Only required if you have packer configured as `opt` 4 | vim.cmd [[packadd packer.nvim]] 5 | 6 | return require('packer').startup(function(use) 7 | -- Packer can manage itself 8 | use 'wbthomason/packer.nvim' 9 | use { 10 | 'nvim-telescope/telescope.nvim', tag = '0.1.4', 11 | requires = { {'nvim-lua/plenary.nvim'}, { 'BurntSushi/ripgrep' } } 12 | } 13 | 14 | use 'tomasr/molokai' 15 | use ({ 16 | 'junegunn/seoul256.vim', 17 | config = function() 18 | vim.cmd('colorscheme seoul256') 19 | end 20 | }) 21 | use ({ 22 | 'nanotech/jellybeans.vim', 23 | config = function() 24 | if vim.api.nvim_win_get_option(0, "diff") then 25 | vim.cmd('colorscheme jellybeans') 26 | end 27 | end 28 | }) 29 | 30 | use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate'}) 31 | use 'mbbill/undotree' 32 | use 'tpope/vim-fugitive' 33 | use { 34 | 'VonHeikemen/lsp-zero.nvim', 35 | branch = 'v1.x', 36 | requires = { 37 | -- LSP Support 38 | {'neovim/nvim-lspconfig'}, -- Required 39 | {'williamboman/mason.nvim'}, -- Optional 40 | {'williamboman/mason-lspconfig.nvim'}, -- Optional 41 | 42 | -- Autocompletion 43 | {'hrsh7th/nvim-cmp'}, -- Required 44 | {'hrsh7th/cmp-nvim-lsp'}, -- Required 45 | {'hrsh7th/cmp-buffer'}, -- Optional 46 | {'hrsh7th/cmp-path'}, -- Optional 47 | {'saadparwaiz1/cmp_luasnip'}, -- Optional 48 | {'hrsh7th/cmp-nvim-lua'}, -- Optional 49 | 50 | -- Snippets 51 | {'L3MON4D3/LuaSnip'}, -- Required 52 | {'rafamadriz/friendly-snippets'}, -- Optional 53 | } 54 | } 55 | 56 | use "github/copilot.vim" 57 | 58 | use { 59 | 'nvim-tree/nvim-tree.lua', 60 | requires = { 61 | 'nvim-tree/nvim-web-devicons', 62 | }, 63 | } 64 | use 'tpope/vim-commentary' 65 | 66 | use { 67 | "folke/trouble.nvim", 68 | requires = "nvim-tree/nvim-web-devicons", 69 | config = function() 70 | require("trouble").setup { 71 | -- your configuration comes here 72 | -- or leave it empty to use the default settings 73 | -- refer to the configuration section below 74 | } 75 | end 76 | } 77 | 78 | use('jose-elias-alvarez/null-ls.nvim') 79 | use('MunifTanjim/prettier.nvim') 80 | use 'LnL7/vim-nix' 81 | 82 | end) 83 | -------------------------------------------------------------------------------- /nvim/local.lua: -------------------------------------------------------------------------------- 1 | local vim = vim 2 | local Plug = vim.fn['plug#'] 3 | 4 | vim.call('plug#begin') 5 | 6 | -- Core dependencies first 7 | Plug('nvim-lua/plenary.nvim') 8 | Plug('nvim-telescope/telescope.nvim', { tag = '0.1.8' }) 9 | 10 | -- Then plugins that depend on them 11 | Plug('pwntester/octo.nvim', { 12 | requires = { 13 | 'nvim-lua/plenary.nvim', 14 | 'nvim-tree/nvim-web-devicons', 15 | 'nvim-telescope/telescope.nvim', 16 | } 17 | }) 18 | 19 | Plug('knsh14/vim-github-link') 20 | 21 | vim.call('plug#end') 22 | 23 | -- Telescope configuration 24 | local builtin = require('telescope.builtin') 25 | vim.keymap.set('n', 'ff', builtin.find_files, {}) 26 | vim.keymap.set({'n', 'v'}, 'gh', ':GetCurrentBranchLink', {}) 27 | 28 | -- Find the .git directory or file in the current directory or its ancestors 29 | local git_dir = vim.fn.finddir('.git', '.;') 30 | 31 | -- If the .git directory or file is found, the current directory is a Git repository 32 | if git_dir ~= '' then 33 | vim.keymap.set('n', '', builtin.git_files, {}) 34 | else 35 | vim.keymap.set('n', '', builtin.find_files, {}) 36 | end 37 | vim.keymap.set('n', '', ':Telescope live_grep default_text=', {}) 38 | vim.keymap.set('n', 'b', builtin.buffers, {}) 39 | 40 | -- Configure octo.nvim 41 | require('octo').setup({ 42 | enable_builtin = true, 43 | mappings = { 44 | pull_request = { 45 | add_comment = { lhs = "ca", desc = "add comment" }, 46 | next_comment = { lhs = "]c", desc = "go to next comment" }, 47 | prev_comment = { lhs = "[c", desc = "go to previous comment" }, 48 | review_start = { lhs = "vs", desc = "start a review for the current PR" }, 49 | review_resume = { lhs = "vr", desc = "resume a pending review for the current PR" }, 50 | }, 51 | 52 | review_diff = { 53 | submit_review = { lhs = "vs", desc = "submit review" }, 54 | discard_review = { lhs = "vd", desc = "discard review" }, 55 | add_review_comment = { lhs = "ca", desc = "add a new review comment" }, 56 | next_thread = { lhs = "]t", desc = "move to next thread" }, 57 | prev_thread = { lhs = "[t", desc = "move to previous thread" }, 58 | select_next_entry = { lhs = "]q", desc = "move to next changed file" }, 59 | select_prev_entry = { lhs = "[q", desc = "move to previous changed file" }, 60 | select_first_entry = { lhs = "[Q", desc = "move to first changed file" }, 61 | select_last_entry = { lhs = "]Q", desc = "move to last changed file" }, 62 | close_review_tab = { lhs = "", desc = "close review tab" }, 63 | toggle_viewed = { lhs = "", desc = "toggle viewer viewed state" }, 64 | goto_file = { lhs = "gf", desc = "go to file" }, 65 | }, 66 | } 67 | }) 68 | 69 | -------------------------------------------------------------------------------- /bash/bashrc: -------------------------------------------------------------------------------- 1 | # Don't do anything if not running interactively. 2 | [[ -z "$PS1" ]] && return 3 | 4 | # Use vi as my text editor. 5 | export EDITOR=vim 6 | 7 | # None of this UTF8 drawing characters nonsense. 8 | export NCURSES_NO_UTF8_ACS=1 9 | 10 | # Keep plenty of history. 11 | unset HISTFILESIZE 12 | HISTSIZE=1000000 13 | 14 | #Ctrl - D to logout. 15 | unset ignoreeof 16 | 17 | # Ignore duplicate commands and whitespace in history. 18 | HISTCONTROL=ignoreboth 19 | 20 | # Ignore ls in my history. 21 | export HISTIGNORE=ls 22 | 23 | # Keep the times of the commands in history. 24 | HISTTIMEFORMAT='%F %T ' 25 | 26 | # Don't check for mail all the time, it's irritating. 27 | unset MAILCHECK 28 | 29 | # Autocorrect fudged paths in cd calls. 30 | shopt -s cdspell &>/dev/null 31 | 32 | # Update columns and rows if window size changes. 33 | shopt -s checkwinsize &>/dev/null 34 | 35 | # Put multi-line commands onto one line of history. 36 | shopt -s cmdhist &>/dev/null 37 | 38 | # Autocorrect fudged paths during completion. 39 | shopt -s dirspell &>/dev/null 40 | 41 | # Include dotfiles in pattern matching. 42 | shopt -s dotglob &>/dev/null 43 | 44 | # Enable advanced pattern matching. 45 | shopt -s extglob &>/dev/null 46 | 47 | # Enable double-starring paths. 48 | shopt -s globstar &>/dev/null 49 | 50 | # Append rather than overwrite Bash history. 51 | shopt -s histappend &>/dev/null 52 | 53 | # Turn off annoying and useless flow control keys. 54 | hash stty &>/dev/null && stty -ixon 55 | 56 | # Use completion, if available. 57 | [[ -e /etc/bash_completion ]] && source /etc/bash_completion 58 | 59 | export FIGNORE=$FIGNORE:.pyc:.o:.gitignore 60 | 61 | # SSH agent setup, if available. 62 | [[ -e "${HOME}/.ssh/agent" ]] && source "${HOME}/.ssh/agent" 63 | 64 | # Add various paths if they exist and aren't already in here. 65 | DIRS="${HOME}/bin 66 | /usr/local/bin 67 | /usr/local/sbin 68 | /usr/sbin 69 | /sbin 70 | /usr/local/opt/coreutils/libexec/gnubin 71 | /opt/homebrew/opt/coreutils/libexec/gnubin 72 | /usr/local/opt/findutils/libexec/gnubin 73 | /usr/local/opt/gettext/bin 74 | /usr/local/opt/gnu-indent/libexec/gnubin 75 | /usr/local/opt/gnu-sed/libexec/gnubin 76 | /usr/local/opt/gnu-tar/libexec/gnubin 77 | /usr/local/opt/grep/libexec/gnubin 78 | /Users/vaibhav.verma/Library/Python/3.8/bin 79 | /Users/vverma/Library/Python/3.9/bin 80 | ./node_modules/.bin 81 | /usr/local/go/bin 82 | /opt/homebrew/bin 83 | /usr/local/opt/coreutils/libexec/gnubin 84 | /opt/homebrew/opt/grep/libexec/gnubin 85 | $HOME/.gem/ruby/2.5.0/bin 86 | $HOME/.cargo/bin 87 | $GOPATH/bin" 88 | for DIR in $DIRS; do 89 | if [[ -d "$DIR" ]] && [[ ":${PATH}:" != *":${DIR}:"* ]]; then 90 | if [[ -n "$PATH" ]]; then 91 | PATH="${DIR}:${PATH}" 92 | else 93 | PATH=$DIR 94 | fi 95 | fi 96 | done 97 | 98 | # If we're using an xterm, force 256 colors. 99 | case "$TERM" in 100 | xterm*) TERM=xterm-256color;; 101 | esac 102 | 103 | # If we're a screen terminal within a 256 color outer, force a 256 color 104 | # screen terminal too. This deals with a tmux race condition bug. 105 | case "$CONTAINING_TERM" in 106 | *256color) 107 | TERM=screen-256color 108 | unset CONTAINING_TERM 109 | ;; 110 | esac 111 | 112 | # Figure out how many colors we have now. 113 | hash tput && COLORS=$(tput colors) 114 | 115 | # Save some color codes based on our colour space. 116 | if [[ $COLORS -ge 256 ]]; then 117 | COLOR_ROOT='\[\e[38;5;9m\]' 118 | COLOR_SUDO='\[\e[38;5;11m\]' 119 | COLOR_USER='\[\e[38;5;10m\]' 120 | COLOR_NORM='\[\e[0m\]' 121 | elif [[ $COLORS -ge 8 ]]; then 122 | COLOR_ROOT='\[\e[1;31m\]' 123 | COLOR_SUDO='\[\e[1;33m\]' 124 | COLOR_USER='\[\e[1;32m\]' 125 | COLOR_NORM='\[\e[0m\]' 126 | else 127 | COLOR_ROOT= 128 | COLOR_SUDO= 129 | COLOR_USER= 130 | COLOR_NORM= 131 | fi 132 | 133 | # Reset options for ls and grep. 134 | LS_OPTS= 135 | GREP_OPTS= 136 | 137 | # If we have a color terminal, we'll use color for ls and grep. 138 | if [[ $COLORS -ge 8 ]]; then 139 | hash dircolors &>/dev/null && eval "$(dircolors -b)" 140 | if ls --help 2>/dev/null | grep -- --color &>/dev/null; then 141 | LS_OPTS="${LS_OPTS} --color=auto" 142 | fi 143 | if grep --help | grep -- --color &>/dev/null; then 144 | GREP_OPTS="${GREP_OPTS} --color=auto" 145 | fi 146 | fi 147 | 148 | # Set up more options for grep; exclude version control files. 149 | if ls --help 2>/dev/null | grep -- --exclude &>/dev/null; then 150 | for PATTERN in .git .gitignore .gitmodules; do 151 | GREP_OPTS="${GREP_OPTS} --exclude=${PATTERN}" 152 | done 153 | fi 154 | if grep --help | grep -- --exclude-dir &>/dev/null; then 155 | for PATTERN in .cvs .git .hg .svn; do 156 | GREP_OPTS="${GREP_OPTS} --exclude-dir=${PATTERN}" 157 | done 158 | fi 159 | 160 | # Alias ls and grep with the options we've collected. 161 | alias ls="ls ${LS_OPTS}" 162 | alias grep="grep ${GREP_OPTS}" 163 | alias vi="vim" 164 | alias view="vim -R" 165 | alias k="kubectl" 166 | 167 | # I always do this, and I hate slow train. 168 | alias sl='ls' 169 | 170 | alias ta='tmux a -t' 171 | alias tn='tmux new -s' 172 | 173 | # Decide on color for prompt. 174 | if [[ $EUID -eq 0 ]]; then 175 | COLOR_PROMPT=${COLOR_ROOT} 176 | elif [[ -n $SUDO_USER ]]; then 177 | COLOR_PROMPT=${COLOR_SUDO} 178 | else 179 | COLOR_PROMPT=${COLOR_USER} 180 | fi 181 | 182 | # Frontend to controlling prompt. 183 | function prompt { 184 | case "$1" in 185 | 186 | # Turn complex coloured prompt on. 187 | on) 188 | PROMPT_COMMAND='history -a' 189 | PS1='[\u@\h:\w]$(prompt return)\$' 190 | PS1='[\u@\h:\w]\$' 191 | PS1="${COLOR_PROMPT}${PS1}${COLOR_NORM} " 192 | ;; 193 | 194 | # Revert to simple inexpensive prompt. 195 | off) 196 | PROMPT_COMMAND= 197 | PS1='\$ ' 198 | ;; 199 | 200 | # Git prompt function. 201 | git) 202 | git branch &>/dev/null || return 1 203 | HEAD="$(git symbolic-ref HEAD 2>/dev/null)" 204 | BRANCH="${HEAD##*/}" 205 | [[ -n "$(git status 2>/dev/null | \ 206 | grep -F 'working directory clean')" ]] || STATUS="!" 207 | printf '(git:%s)' "${BRANCH:-unknown}${STATUS}" 208 | ;; 209 | 210 | # Mercurial prompt function. 211 | hg) 212 | hg branch &>/dev/null || return 1 213 | BRANCH="$(hg branch 2>/dev/null)" 214 | [[ -n "$(hg status 2>/dev/null)" ]] && STATUS="!" 215 | printf '(hg:%s)' "${BRANCH:-unknown}${STATUS}" 216 | ;; 217 | 218 | # Subversion prompt function. 219 | svn) 220 | svn info &>/dev/null || return 1 221 | URL="$(svn info 2>/dev/null | \ 222 | awk -F': ' '$1 == "URL" {print $2}')" 223 | ROOT="$(svn info 2>/dev/null | \ 224 | awk -F': ' '$1 == "Repository Root" {print $2}')" 225 | BRANCH=${URL/$ROOT} 226 | BRANCH=${BRANCH#/} 227 | BRANCH=${BRANCH#branches/} 228 | BRANCH=${BRANCH%%/*} 229 | [[ -n "$(svn status 2>/dev/null)" ]] && STATUS="!" 230 | printf '(svn:%s)' "${BRANCH:-unknown}${STATUS}" 231 | ;; 232 | 233 | # VCS wrapper prompt function. 234 | vcs) 235 | prompt git || prompt svn || prompt hg 236 | ;; 237 | 238 | # Return status prompt function. 239 | return) 240 | RETURN=$? 241 | [[ $RETURN -ne 0 ]] && printf '<%d>' ${RETURN} 242 | ;; 243 | 244 | # Job count prompt function. 245 | jobs) 246 | [[ -n "$(jobs)" ]] && printf '{%d}' $(jobs | sed -n '$=') 247 | ;; 248 | esac 249 | } 250 | 251 | export MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH" 252 | 253 | #some machines dont keep my sudo. 254 | alias sudo="sudo -E" 255 | 256 | ew() { 257 | TMUX_SERVER_NAME="$(tmux display-message -p '#S' 2>/dev/null)" 258 | if [[ -n "$TMUX" ]]; then 259 | cd -P "~/code/betteromics/$TMUX_SERVER_NAME" 260 | fi 261 | } 262 | 263 | do_giff() { 264 | ffmpeg -i "$1" -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=6 > "$1.gif"; 265 | } 266 | 267 | alias giff=do_giff 268 | 269 | # Run local file if it exists. 270 | [[ -e "${HOME}/.bashrc.local" ]] && source "${HOME}/.bashrc.local" 271 | 272 | [[ -z $WORKON_HOME ]] && export WORKON_HOME=~/.virtualenvs 273 | 274 | [[ -e "/usr/local/bin/virtualenvwrapper.sh" ]] && source /usr/local/bin/virtualenvwrapper.sh 275 | 276 | # Start with full-fledged prompt. 277 | prompt on 278 | 279 | # if fd exists as a command then use it for fzf 280 | if command -v fd &> /dev/null 281 | then 282 | # Setting fd as the default source for fzf 283 | export FZF_DEFAULT_COMMAND='fd --strip-cwd-prefix' 284 | # To apply the command to CTRL-T as well 285 | export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" 286 | fi 287 | 288 | [ -f ~/.fzf.bash ] && source ~/.fzf.bash 289 | 290 | export BASH_SILENCE_DEPRECATION_WARNING=1 291 | 292 | export NVM_DIR="$HOME/.nvm" 293 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm 294 | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion 295 | -------------------------------------------------------------------------------- /X/awesome-rc.lua: -------------------------------------------------------------------------------- 1 | -- Standard awesome library 2 | require("awful") 3 | require("awful.autofocus") 4 | require("awful.rules") 5 | -- Theme handling library 6 | require("beautiful") 7 | -- Notification library 8 | require("naughty") 9 | 10 | -- Load Debian menu entries 11 | require("debian.menu") 12 | 13 | -- {{{ Variable definitions 14 | -- Themes define colours, icons, and wallpapers 15 | beautiful.init("/usr/share/awesome/themes/default/theme.lua") 16 | 17 | -- This is used later as the default terminal and editor to run. 18 | terminal = "gnome-terminal" 19 | editor = os.getenv("EDITOR") or "editor" 20 | editor_cmd = terminal .. " -e " .. editor 21 | 22 | -- Default modkey. 23 | -- Usually, Mod4 is the key with a logo between Control and Alt. 24 | -- If you do not like this or do not have such a key, 25 | -- I suggest you to remap Mod4 to another key using xmodmap or other tools. 26 | -- However, you can use another modifier like Mod1, but it may interact with others. 27 | modkey = "Mod4" 28 | 29 | -- Table of layouts to cover with awful.layout.inc, order matters. 30 | layouts = 31 | { 32 | awful.layout.suit.floating, 33 | awful.layout.suit.tile, 34 | awful.layout.suit.tile.left, 35 | awful.layout.suit.tile.bottom, 36 | awful.layout.suit.tile.top, 37 | awful.layout.suit.fair, 38 | awful.layout.suit.fair.horizontal, 39 | awful.layout.suit.spiral, 40 | awful.layout.suit.spiral.dwindle, 41 | awful.layout.suit.max, 42 | awful.layout.suit.max.fullscreen, 43 | awful.layout.suit.magnifier 44 | } 45 | -- }}} 46 | 47 | -- {{{ Tags 48 | -- Define a tag table which hold all screen tags. 49 | tags = {} 50 | for s = 1, screen.count() do 51 | -- Each screen has its own tag table. 52 | tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, layouts[1]) 53 | end 54 | -- }}} 55 | 56 | -- {{{ Menu 57 | -- Create a laucher widget and a main menu 58 | myawesomemenu = { 59 | { "manual", terminal .. " -e man awesome" }, 60 | { "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" }, 61 | { "restart", awesome.restart }, 62 | { "quit", awesome.quit } 63 | } 64 | 65 | mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, 66 | { "Debian", debian.menu.Debian_menu.Debian }, 67 | { "open terminal", terminal } 68 | } 69 | }) 70 | 71 | mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), 72 | menu = mymainmenu }) 73 | -- }}} 74 | 75 | -- {{{ Wibox 76 | -- Create a textclock widget 77 | mytextclock = awful.widget.textclock({ align = "right" }) 78 | 79 | -- Create a systray 80 | mysystray = widget({ type = "systray" }) 81 | 82 | -- Create a wibox for each screen and add it 83 | mywibox = {} 84 | mypromptbox = {} 85 | mylayoutbox = {} 86 | mytaglist = {} 87 | mytaglist.buttons = awful.util.table.join( 88 | awful.button({ }, 1, awful.tag.viewonly), 89 | awful.button({ modkey }, 1, awful.client.movetotag), 90 | awful.button({ }, 3, awful.tag.viewtoggle), 91 | awful.button({ modkey }, 3, awful.client.toggletag), 92 | awful.button({ }, 4, awful.tag.viewnext), 93 | awful.button({ }, 5, awful.tag.viewprev) 94 | ) 95 | 96 | mytasklist = {} 97 | mytasklist.buttons = awful.util.table.join( 98 | awful.button({ }, 1, function (c) 99 | if not c:isvisible() then 100 | awful.tag.viewonly(c:tags()[1]) 101 | end 102 | client.focus = c 103 | c:raise() 104 | end), 105 | awful.button({ }, 3, function () 106 | if instance then 107 | instance:hide() 108 | instance = nil 109 | else 110 | instance = awful.menu.clients({ width=250 }) 111 | end 112 | end), 113 | awful.button({ }, 4, function () 114 | awful.client.focus.byidx(1) 115 | if client.focus then client.focus:raise() end 116 | end), 117 | awful.button({ }, 5, function () 118 | awful.client.focus.byidx(-1) 119 | if client.focus then client.focus:raise() end 120 | end)) 121 | 122 | for s = 1, screen.count() do 123 | -- Create a promptbox for each screen 124 | mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright }) 125 | -- Create an imagebox widget which will contains an icon indicating which layout we're using. 126 | -- We need one layoutbox per screen. 127 | mylayoutbox[s] = awful.widget.layoutbox(s) 128 | mylayoutbox[s]:buttons(awful.util.table.join( 129 | awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), 130 | awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), 131 | awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), 132 | awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end))) 133 | -- Create a taglist widget 134 | mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, mytaglist.buttons) 135 | 136 | -- Create a tasklist widget 137 | mytasklist[s] = awful.widget.tasklist(function(c) 138 | return awful.widget.tasklist.label.currenttags(c, s) 139 | end, mytasklist.buttons) 140 | 141 | -- Create the wibox 142 | mywibox[s] = awful.wibox({ position = "top", screen = s }) 143 | -- Add widgets to the wibox - order matters 144 | mywibox[s].widgets = { 145 | { 146 | mylauncher, 147 | mytaglist[s], 148 | mypromptbox[s], 149 | layout = awful.widget.layout.horizontal.leftright 150 | }, 151 | mylayoutbox[s], 152 | mytextclock, 153 | s == 1 and mysystray or nil, 154 | mytasklist[s], 155 | layout = awful.widget.layout.horizontal.rightleft 156 | } 157 | end 158 | -- }}} 159 | 160 | -- {{{ Mouse bindings 161 | root.buttons(awful.util.table.join( 162 | awful.button({ }, 3, function () mymainmenu:toggle() end), 163 | awful.button({ }, 4, awful.tag.viewnext), 164 | awful.button({ }, 5, awful.tag.viewprev) 165 | )) 166 | -- }}} 167 | 168 | -- {{{ Key bindings 169 | globalkeys = awful.util.table.join( 170 | awful.key({ modkey, }, "Left", awful.tag.viewprev ), 171 | awful.key({ modkey, }, "Right", awful.tag.viewnext ), 172 | awful.key({ modkey, }, "Escape", awful.tag.history.restore), 173 | 174 | awful.key({ modkey, }, "j", 175 | function () 176 | awful.client.focus.byidx( 1) 177 | if client.focus then client.focus:raise() end 178 | end), 179 | awful.key({ modkey, }, "k", 180 | function () 181 | awful.client.focus.byidx(-1) 182 | if client.focus then client.focus:raise() end 183 | end), 184 | awful.key({ modkey, }, "w", function () mymainmenu:show({keygrabber=true}) end), 185 | 186 | -- Layout manipulation 187 | awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), 188 | awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), 189 | awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end), 190 | awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), 191 | awful.key({ modkey, }, "u", awful.client.urgent.jumpto), 192 | awful.key({ modkey, }, "Tab", 193 | function () 194 | awful.client.focus.history.previous() 195 | if client.focus then 196 | client.focus:raise() 197 | end 198 | end), 199 | 200 | -- Standard program 201 | awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), 202 | awful.key({ modkey, "Control" }, "r", awesome.restart), 203 | awful.key({ modkey, "Shift" }, "q", awesome.quit), 204 | 205 | awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), 206 | awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), 207 | awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), 208 | awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), 209 | awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), 210 | awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), 211 | awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), 212 | awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), 213 | 214 | -- Prompt 215 | awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end), 216 | 217 | -- Volume keyboard control 218 | awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn_with_shell('amixer set Master 2%+') end), 219 | awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn_with_shell('amixer set Master 2%-') end), 220 | awful.key({ }, "XF86AudioMute", function () awful.util.spawn_with_shell('amixer set Master toggle')end), 221 | 222 | awful.key({ }, "XF86MonBrightnessDown", function () awful.util.spawn_with_shell('sudo /home/vverna/bin/brightness down') end), 223 | awful.key({ }, "XF86MonBrightnessUp", function () awful.util.spawn_with_shell('sudo /home/vverna/bin/brightness up') end), 224 | 225 | awful.key({ modkey }, "x", 226 | function () 227 | awful.prompt.run({ prompt = "Run Lua code: " }, 228 | mypromptbox[mouse.screen].widget, 229 | awful.util.eval, nil, 230 | awful.util.getdir("cache") .. "/history_eval") 231 | end) 232 | ) 233 | 234 | clientkeys = awful.util.table.join( 235 | awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), 236 | awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), 237 | awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), 238 | awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), 239 | awful.key({ modkey, }, "o", awful.client.movetoscreen ), 240 | awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end), 241 | awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), 242 | awful.key({ modkey, }, "n", function (c) c.minimized = not c.minimized end), 243 | awful.key({ modkey, }, "m", 244 | function (c) 245 | c.maximized_horizontal = not c.maximized_horizontal 246 | c.maximized_vertical = not c.maximized_vertical 247 | end) 248 | ) 249 | 250 | -- Compute the maximum number of digit we need, limited to 9 251 | keynumber = 0 252 | for s = 1, screen.count() do 253 | keynumber = math.min(9, math.max(#tags[s], keynumber)); 254 | end 255 | 256 | -- Bind all key numbers to tags. 257 | -- Be careful: we use keycodes to make it works on any keyboard layout. 258 | -- This should map on the top row of your keyboard, usually 1 to 9. 259 | for i = 1, keynumber do 260 | globalkeys = awful.util.table.join(globalkeys, 261 | awful.key({ modkey }, "#" .. i + 9, 262 | function () 263 | local screen = mouse.screen 264 | if tags[screen][i] then 265 | awful.tag.viewonly(tags[screen][i]) 266 | end 267 | end), 268 | awful.key({ modkey, "Control" }, "#" .. i + 9, 269 | function () 270 | local screen = mouse.screen 271 | if tags[screen][i] then 272 | awful.tag.viewtoggle(tags[screen][i]) 273 | end 274 | end), 275 | awful.key({ modkey, "Shift" }, "#" .. i + 9, 276 | function () 277 | if client.focus and tags[client.focus.screen][i] then 278 | awful.client.movetotag(tags[client.focus.screen][i]) 279 | end 280 | end), 281 | awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, 282 | function () 283 | if client.focus and tags[client.focus.screen][i] then 284 | awful.client.toggletag(tags[client.focus.screen][i]) 285 | end 286 | end)) 287 | end 288 | 289 | clientbuttons = awful.util.table.join( 290 | awful.button({ }, 1, function (c) client.focus = c; c:raise() end), 291 | awful.button({ modkey }, 1, awful.mouse.client.move), 292 | awful.button({ modkey }, 3, awful.mouse.client.resize)) 293 | 294 | -- Set keys 295 | root.keys(globalkeys) 296 | -- }}} 297 | 298 | -- {{{ Rules 299 | awful.rules.rules = { 300 | -- All clients will match this rule. 301 | { rule = { }, 302 | properties = { border_width = beautiful.border_width, 303 | border_color = beautiful.border_normal, 304 | focus = true, 305 | keys = clientkeys, 306 | buttons = clientbuttons } }, 307 | { rule = { class = "MPlayer" }, 308 | properties = { floating = true } }, 309 | { rule = { class = "pinentry" }, 310 | properties = { floating = true } }, 311 | { rule = { class = "gimp" }, 312 | properties = { floating = true } }, 313 | -- Set Firefox to always map on tags number 2 of screen 1. 314 | -- { rule = { class = "Firefox" }, 315 | -- properties = { tag = tags[1][2] } }, 316 | } 317 | -- }}} 318 | 319 | -- {{{ Signals 320 | -- Signal function to execute when a new client appears. 321 | client.add_signal("manage", function (c, startup) 322 | -- Add a titlebar 323 | -- awful.titlebar.add(c, { modkey = modkey }) 324 | 325 | -- Enable sloppy focus 326 | c:add_signal("mouse::enter", function(c) 327 | if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier 328 | and awful.client.focus.filter(c) then 329 | client.focus = c 330 | end 331 | end) 332 | 333 | if not startup then 334 | -- Set the windows at the slave, 335 | -- i.e. put it at the end of others instead of setting it master. 336 | -- awful.client.setslave(c) 337 | 338 | -- Put windows in a smart way, only if they does not set an initial position. 339 | if not c.size_hints.user_position and not c.size_hints.program_position then 340 | awful.placement.no_overlap(c) 341 | awful.placement.no_offscreen(c) 342 | end 343 | end 344 | end) 345 | 346 | client.add_signal("focus", function(c) c.border_color = beautiful.border_focus end) 347 | client.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) 348 | -- }}} 349 | 350 | -- Execute Network Manager 351 | awful.util.spawn_with_shell("run_once nm-applet") 352 | -------------------------------------------------------------------------------- /darwin-nix-config/home-manager.nix: -------------------------------------------------------------------------------- 1 | { username, ... }: 2 | 3 | { lib, pkgs, pkgs-unstable, ... }: 4 | 5 | let 6 | copilot = pkgs.vimUtils.buildVimPlugin { 7 | name = "copilot"; 8 | src = pkgs.fetchFromGitHub { 9 | owner = "github"; 10 | repo = "copilot.vim"; 11 | rev = "v1.24.0"; 12 | sha256 = "0jd62dx6qzj60az36qc8rsj6aiqfc1jg7c4fgxl5rhjcws6b3wpj"; 13 | }; 14 | }; 15 | prr_vim = pkgs.vimUtils.buildVimPlugin { 16 | name = "prr"; 17 | src = pkgs.fetchFromGitHub { 18 | owner = "danobi"; 19 | repo = "prr"; 20 | rev = "v0.19.0"; 21 | hash = "sha256-HWMGcU/7Jw9W8BgNDPYp59+C/kxgaGktQkAkTkCMzQg="; 22 | }; 23 | }; 24 | in { 25 | home.homeDirectory = lib.mkForce "/Users/${username}"; 26 | home.username = username; 27 | 28 | # Example Home Manager configuration 29 | programs.git = { 30 | enable = true; 31 | userName = "Vaibhav Verma"; 32 | userEmail = "vaibhav.verma@scale.com"; 33 | 34 | aliases = { 35 | s = "status"; 36 | st = "status"; 37 | d = "difftool"; 38 | co = "checkout"; 39 | l = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; 40 | p = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -p"; 41 | po = "push --set-upstream origin HEAD"; 42 | pr = "pull-request"; 43 | pt = "push-to-target"; 44 | rc = "rebase --continue"; 45 | can = "commit -a --amend --no-edit"; 46 | prt = "pr-target"; 47 | pullr = "pull --rebase"; 48 | rbm = "rebase -i origin/master"; 49 | rom = "!git fetch && git rebase origin/master"; 50 | }; 51 | 52 | extraConfig = { 53 | init.defaultBranch = "main"; 54 | diff.tool = "nvimdiff"; 55 | difftool.prompt = false; 56 | color.ui = true; 57 | core.filemode = false; 58 | core.editor = "nvim"; 59 | log.date = "local"; 60 | pull.rebase = "true"; 61 | push.default = "simple"; 62 | rebase.autoStash = true; 63 | filter.lfs.clean = "git-lfs clean -- %f"; 64 | filter.lfs.smudge = "git-lfs smudge -- %f"; 65 | filter.lfs.process = "git-lfs filter-process"; 66 | filter.lfs.required = true; 67 | submodule.recurse = true; 68 | remote.origin.prune = true; 69 | }; 70 | }; 71 | 72 | programs.bash = { 73 | enable = true; 74 | enableCompletion = true; 75 | 76 | shellOptions = lib.mkOptionDefault [ 77 | "cdspell" 78 | "checkjobs" 79 | "checkwinsize" 80 | "cmdhist" 81 | "dirspell" 82 | "extglob" 83 | "globstar" 84 | "histappend" 85 | "histreedit" 86 | ]; 87 | 88 | 89 | historyIgnore = [ 90 | "ls" 91 | ]; 92 | 93 | historyControl = [ "erasedups" "ignorespace" ]; 94 | 95 | initExtra = builtins.readFile ./bashrc; 96 | 97 | shellAliases = { 98 | "view" = "nvim -R"; 99 | "k" = "kubectl"; 100 | "ta" = "tmux a -t"; 101 | }; 102 | }; 103 | 104 | home.packages = with pkgs; [ 105 | awscli2 106 | bat 107 | fd 108 | ffmpeg 109 | git 110 | htop 111 | httpie 112 | imagemagick 113 | jless 114 | jq 115 | moreutils 116 | pandoc 117 | ripgrep 118 | silver-searcher 119 | teleport 120 | tldr 121 | tree 122 | unzip 123 | visidata 124 | zip 125 | yq-go 126 | ]; 127 | 128 | home.stateVersion = "23.11"; 129 | 130 | programs.fzf = { 131 | enable = true; 132 | enableBashIntegration = true; 133 | defaultCommand = "fd --type f"; 134 | fileWidgetCommand = "fd"; 135 | }; 136 | 137 | programs.zoxide = { 138 | enable = true; 139 | enableBashIntegration = true; 140 | }; 141 | 142 | programs.tmux = { 143 | enable = true; 144 | aggressiveResize = true; 145 | baseIndex = 1; 146 | prefix = "C-a"; 147 | keyMode = "vi"; 148 | escapeTime = 0; 149 | sensibleOnTop = false; 150 | 151 | extraConfig = '' 152 | set -g default-terminal "tmux-256color" 153 | 154 | bind-key a send-prefix 155 | bind-key C-a last-window 156 | 157 | #urxvt tab like window switching (-n: no prior escape seq) 158 | bind -n S-down new-window 159 | bind -n S-left prev 160 | bind -n S-right next 161 | bind -n C-left swap-window -t -1 162 | bind -n C-right swap-window -t +1 163 | 164 | # Bindings 165 | bind-key '/' confirm-before "kill-window" 166 | bind-key '\' confirm-before "kill-server" 167 | bind-key '_' split-window -v 168 | bind-key '|' split-window -h 169 | bind-key Tab select-pane -t :.+ 170 | 171 | # Vim-like pane resize 172 | bind-key -r '+' resize-pane -U 5 173 | bind-key -r '-' resize-pane -D 5 174 | bind-key -r '<' resize-pane -L 5 175 | bind-key -r '>' resize-pane -R 5 176 | 177 | # Vim-like pane switching 178 | bind-key h select-pane -L 179 | bind-key j select-pane -D 180 | bind-key k select-pane -U 181 | bind-key l select-pane -R 182 | 183 | # Vim-like pane swapping 184 | bind-key J swap-pane -D 185 | bind-key K swap-pane -U 186 | 187 | bind-key = select-layout even-horizontal 188 | 189 | # Activity 190 | set-window-option -g monitor-activity on 191 | 192 | # Status bar 193 | set-option -g status-left '[#S]' 194 | set-option -g status-right '[#H] #(date +"%F %T")' 195 | if-shell 'test `tput colors` -eq 256' 'set-option -g status-bg colour237' 196 | if-shell 'test `tput colors` -eq 256' 'set-option -g status-fg colour248' 197 | if-shell 'test `tput colors` -eq 256' 'set-window-option -g window-status-current-format "#[fg=colour231]#I:#W#F"' 198 | if-shell 'test `tput colors` -eq 256' 'set-window-option -g window-status-format "#[fg=colour16]#I:#W#F"' 199 | 200 | # Titles 201 | set-window-option -g automatic-rename on 202 | 203 | # Is supposed to give tmux all the env vars from the invoking shell 204 | set -g default-command "$SHELL" 205 | ''; 206 | }; 207 | 208 | 209 | programs.neovim = { 210 | enable = true; 211 | vimAlias = true; 212 | viAlias = true; 213 | vimdiffAlias = true; 214 | defaultEditor = true; 215 | package = pkgs-unstable.neovim-unwrapped; 216 | extraLuaConfig = '' 217 | vim.opt.guicursor = "" 218 | vim.opt.nu = true 219 | vim.opt.tabstop = 4 220 | vim.opt.softtabstop = 4 221 | vim.opt.shiftwidth = 4 222 | vim.opt.expandtab = true 223 | vim.opt.smartindent = true 224 | 225 | vim.opt.swapfile = false 226 | vim.opt.backup = false 227 | vim.opt.undofile = true 228 | 229 | vim.opt.hlsearch = false 230 | vim.opt.incsearch = true 231 | vim.opt.ignorecase = true 232 | vim.opt.smartcase = true 233 | vim.opt.termguicolors = true 234 | 235 | vim.opt.updatetime = 50 236 | vim.opt.colorcolumn = "80" 237 | 238 | vim.opt.wildmenu = true 239 | vim.opt.wildmode = "longest:list" 240 | 241 | vim.opt.mouse = "r" 242 | 243 | -- disable netrw in favor of nvim-tree 244 | vim.g.loaded_netrw = 1 245 | vim.g.loaded_netrwPlugin = 1 246 | 247 | 248 | -- keymaps 249 | 250 | vim.g.mapleader = "," 251 | vim.keymap.set("n", "n", vim.cmd.Ex) 252 | vim.keymap.set("i", "jk", "", {noremap=true}) 253 | vim.keymap.set("i", "jj", "", {noremap=true}) 254 | 255 | -- move command in visual mode 256 | vim.keymap.set("v", "J", ":m '>+1gv=gv") 257 | vim.keymap.set("v", "K", ":m '<-2gv=gv") 258 | 259 | vim.keymap.set("n", "J", "mzJ`z") 260 | vim.keymap.set("n", "", "zz") 261 | vim.keymap.set("n", "", "zz") 262 | vim.keymap.set("n", "n", "nzzzv") 263 | vim.keymap.set("n", "N", "Nzzzv") 264 | 265 | -- greatest remap ever 266 | vim.keymap.set("x", "p", [["_dP]]) 267 | 268 | -- next greatest remap ever : asbjornHaland 269 | -- copies to system clipboard 270 | vim.keymap.set({"n", "v"}, "y", [["+y]]) 271 | vim.keymap.set("n", "Y", [["+Y]]) 272 | 273 | vim.keymap.set({"n", "v"}, "d", [["_d]]) 274 | 275 | vim.keymap.set("n", "Q", "") 276 | vim.keymap.set("n", "q:", "") 277 | 278 | -- quickfix commands 279 | vim.keymap.set("n", "", "cnextzz") 280 | vim.keymap.set("n", "", "cprevzz") 281 | vim.keymap.set("n", "k", "lnextzz") 282 | vim.keymap.set("n", "j", "lprevzz") 283 | 284 | vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) 285 | 286 | vim.keymap.set("n", "vpp", "e ~/.config/nvim/lua/vverma/packer.lua"); 287 | 288 | vim.keymap.set("n", "", function() 289 | vim.cmd("so") 290 | end) 291 | 292 | if vim.api.nvim_win_get_option(0, "diff") then 293 | vim.keymap.set("n", "qq", ":qa", {noremap=true}) 294 | end 295 | 296 | ''; 297 | plugins = with pkgs.vimPlugins; [ 298 | { 299 | plugin = prr_vim; 300 | runtime = { 301 | "ftplugin/prr.vim".source = "${prr_vim}/vim/ftplugin/prr.vim"; 302 | "ftdetect/prr.vim".source = "${prr_vim}/vim/ftdetect/prr.vim"; 303 | "syntax/prr.vim".source = "${prr_vim}/vim/syntax/prr.vim"; 304 | }; 305 | } 306 | { 307 | plugin = nvim-treesitter.withAllGrammars; 308 | type = "lua"; 309 | config = '' 310 | 311 | require'nvim-treesitter.configs'.setup { 312 | indent = { 313 | enable = true 314 | }, 315 | 316 | highlight = { 317 | enable = true, 318 | 319 | -- Setting this to true will run `:h syntax` and tree-sitter at the same time. 320 | -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). 321 | -- Using this option may slow down your editor, and you may see some duplicate highlights. 322 | -- Instead of true it can also be a list of languages 323 | additional_vim_regex_highlighting = false, 324 | }, 325 | } 326 | 327 | ''; 328 | } 329 | { 330 | plugin = seoul256-vim; 331 | type = "lua"; 332 | config = "vim.cmd('colorscheme seoul256')"; 333 | } 334 | { 335 | plugin = undotree; 336 | type = "lua"; 337 | config = '' vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) ''; 338 | } 339 | { 340 | plugin = vim-fugitive; 341 | type = "lua"; 342 | config = ''vim.keymap.set("n", "gs", vim.cmd.Git);''; 343 | } 344 | { plugin = nvim-web-devicons; } 345 | { 346 | plugin = nvim-tree-lua; 347 | type = "lua"; 348 | config = '' 349 | require("nvim-tree").setup({ 350 | disable_netrw = true, 351 | hijack_netrw = true, 352 | sync_root_with_cwd = true, 353 | respect_buf_cwd = true, 354 | git = { 355 | enable = true, 356 | ignore = true, 357 | timeout = 500, 358 | }, 359 | update_focused_file = { 360 | enable = true, 361 | update_root = true 362 | }, 363 | }) 364 | 365 | vim.keymap.set('n', 'n', ':NvimTreeToggle', {noremap = true, silent = true}) 366 | ''; 367 | } 368 | { plugin = vim-commentary; } 369 | { plugin = trouble-nvim; } 370 | { plugin = vim-nix; } 371 | { 372 | plugin = vim-prettier; 373 | runtime = { 374 | "ftplugin/javascript.lua".text = '' 375 | vim.opt_local.tabstop = 2 376 | vim.opt_local.softtabstop = 2 377 | vim.opt_local.shiftwidth = 2 378 | ''; 379 | "ftplugin/typescript.lua".text = '' 380 | vim.opt_local.tabstop = 2 381 | vim.opt_local.softtabstop = 2 382 | vim.opt_local.shiftwidth = 2 383 | ''; 384 | "ftplugin/typescriptreact.lua".text = '' 385 | vim.opt_local.tabstop = 2 386 | vim.opt_local.softtabstop = 2 387 | vim.opt_local.shiftwidth = 2 388 | ''; 389 | }; 390 | type = "lua"; 391 | config = ''vim.keymap.set("n", "f", function() vim.cmd("Prettier") end)''; 392 | } 393 | 394 | # lsp plugins 395 | { plugin = nvim-lspconfig; } 396 | { plugin = mason-nvim; } 397 | { plugin = mason-lspconfig-nvim; } 398 | { plugin = nvim-cmp; } 399 | { plugin = cmp-nvim-lsp; } 400 | { 401 | plugin = lsp-zero-nvim; 402 | type="lua"; 403 | config = '' 404 | local lsp_zero = require('lsp-zero') 405 | 406 | lsp_zero.on_attach(function(client, bufnr) 407 | local opts = {buffer = bufnr, remap = false} 408 | 409 | vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) 410 | vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) 411 | vim.keymap.set("n", "vws", function() vim.lsp.buf.workspace_symbol() end, opts) 412 | vim.keymap.set("n", "vd", function() vim.diagnostic.open_float() end, opts) 413 | vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) 414 | vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) 415 | vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) 416 | vim.keymap.set("n", "vrr", function() vim.lsp.buf.references() end, opts) 417 | vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts) 418 | vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) 419 | end) 420 | 421 | -- When you don't have mason.nvim installed 422 | -- You'll need to list the servers installed in your system 423 | lsp_zero.setup_servers({'tsserver', 'eslint', 'pyright'}) 424 | lsp_zero.setup() 425 | 426 | 427 | -- Completions 428 | local cmp = require('cmp') 429 | local cmp_select = {behavior = cmp.SelectBehavior.Select} 430 | 431 | cmp.setup({ 432 | -- not sure why this doesn't work 433 | -- formatting = lsp_zero.cmp_format(), 434 | mapping = cmp.mapping.preset.insert({ 435 | [''] = cmp.mapping.select_prev_item(cmp_select), 436 | [''] = cmp.mapping.select_next_item(cmp_select), 437 | [''] = cmp.mapping.confirm({ select = true }), 438 | [''] = cmp.mapping.confirm({ select = true }), 439 | [''] = cmp.mapping.complete(), 440 | ['Tab'] = nil, 441 | [''] = nil, 442 | }), 443 | }) 444 | 445 | -- Try to load the local.lua file if it exists 446 | local local_file = vim.fn.expand("~/.config/nvim/local.lua") 447 | if vim.fn.filereadable(local_file) == 1 then 448 | dofile(local_file) 449 | end 450 | 451 | ''; 452 | } 453 | # vim-plug is for plugins that are annoying to install using nix 454 | { 455 | plugin = vim-plug; 456 | runtime = { 457 | "autoload/plug.vim".source = "${vim-plug}/plug.vim"; 458 | }; 459 | } 460 | ]; 461 | }; 462 | 463 | } 464 | 465 | -------------------------------------------------------------------------------- /linux-nix-config/home-manager.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, lib, ... }: 2 | 3 | let 4 | telescope = pkgs.vimUtils.buildVimPlugin { 5 | name = "telescope"; 6 | src = pkgs.fetchFromGitHub { 7 | owner = "nvim-telescope"; 8 | repo = "telescope.nvim"; 9 | rev = "0.1.5"; 10 | sha256 = "1n28aiq1k12rvk2l1vr0wrdxb5016xz1bw8fqsc4zf15cg4nk50z"; 11 | }; 12 | }; 13 | plenary = pkgs.vimUtils.buildVimPlugin { 14 | name = "plenary"; 15 | src = pkgs.fetchFromGitHub { 16 | owner = "nvim-lua"; 17 | repo = "plenary.nvim"; 18 | rev = "0.1.4"; 19 | sha256 = "1sn7vpsbwpyndsjyxb4af8fvz4sfhlbavvw6jjsv3h18sdvkh7nd"; 20 | }; 21 | }; 22 | copilot = pkgs.vimUtils.buildVimPlugin { 23 | name = "copilot"; 24 | src = pkgs.fetchFromGitHub { 25 | owner = "github"; 26 | repo = "copilot.vim"; 27 | rev = "v1.24.0"; 28 | sha256 = "0jd62dx6qzj60az36qc8rsj6aiqfc1jg7c4fgxl5rhjcws6b3wpj"; 29 | }; 30 | }; 31 | in { 32 | home.username = "vaibhav"; 33 | home.homeDirectory = "/home/vaibhav"; 34 | home.stateVersion = "23.05"; 35 | programs.home-manager.enable = true; 36 | 37 | # Example Home Manager configuration 38 | programs.git = { 39 | enable = true; 40 | userName = "Vaibhav Verma"; 41 | userEmail = "vaibhav.verma@scale.com"; 42 | 43 | aliases = { 44 | s = "status"; 45 | st = "status"; 46 | d = "difftool"; 47 | co = "checkout"; 48 | l = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; 49 | p = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -p"; 50 | po = "push --set-upstream origin HEAD"; 51 | pr = "pull-request"; 52 | pt = "push-to-target"; 53 | rc = "rebase --continue"; 54 | can = "commit -a --amend --no-edit"; 55 | prt = "pr-target"; 56 | pullr = "pull --rebase"; 57 | rbm = "rebase -i origin/master"; 58 | }; 59 | 60 | extraConfig = { 61 | init.defaultBranch = "main"; 62 | diff.tool = "nvimdiff"; 63 | difftool.prompt = false; 64 | color.ui = true; 65 | core.filemode = false; 66 | core.editor = "nvim"; 67 | log.date = "local"; 68 | pull.rebase = "true"; 69 | push.default = "simple"; 70 | rebase.autoStash = true; 71 | filter.lfs.clean = "git-lfs clean -- %f"; 72 | filter.lfs.smudge = "git-lfs smudge -- %f"; 73 | filter.lfs.process = "git-lfs filter-process"; 74 | filter.lfs.required = true; 75 | submodule.recurse = true; 76 | remote.origin.prune = true; 77 | }; 78 | }; 79 | 80 | programs.bash = { 81 | enable = true; 82 | enableCompletion = true; 83 | 84 | shellOptions = lib.mkOptionDefault [ 85 | "cdspell" 86 | "checkjobs" 87 | "checkwinsize" 88 | "cmdhist" 89 | "dirspell" 90 | "extglob" 91 | "globstar" 92 | "histappend" 93 | "histreedit" 94 | ]; 95 | 96 | 97 | historyIgnore = [ 98 | "ls" 99 | ]; 100 | 101 | historyControl = [ "erasedups" "ignorespace" ]; 102 | 103 | initExtra = builtins.readFile ./bashrc; 104 | 105 | shellAliases = { 106 | "view" = "nvim -R"; 107 | "k" = "kubectl"; 108 | "ta" = "tmux a -t"; 109 | }; 110 | }; 111 | 112 | home.packages = with pkgs; [ 113 | awscli2 114 | bat 115 | corepack 116 | fd 117 | ffmpeg 118 | git 119 | htop 120 | imagemagick 121 | jless 122 | jq 123 | moreutils 124 | nodejs_22 125 | pandoc 126 | pyright 127 | typescript-language-server 128 | vscode-langservers-extracted 129 | python311 130 | python311Packages.lxml 131 | python311Packages.pip 132 | python311Packages.pipx 133 | silver-searcher 134 | tree 135 | unzip 136 | zip 137 | yq-go 138 | ]; 139 | 140 | programs.fzf = { 141 | enable = true; 142 | enableBashIntegration = true; 143 | defaultCommand = "fd --type f"; 144 | fileWidgetCommand = "fd"; 145 | }; 146 | 147 | programs.zoxide = { 148 | enable = true; 149 | enableBashIntegration = true; 150 | }; 151 | 152 | programs.tmux = { 153 | enable = true; 154 | aggressiveResize = true; 155 | baseIndex = 1; 156 | prefix = "C-a"; 157 | keyMode = "vi"; 158 | escapeTime = 0; 159 | sensibleOnTop = false; 160 | 161 | extraConfig = '' 162 | set -g default-terminal "tmux-256color" 163 | 164 | bind-key a send-prefix 165 | bind-key C-a last-window 166 | 167 | #urxvt tab like window switching (-n: no prior escape seq) 168 | bind -n S-down new-window 169 | bind -n S-left prev 170 | bind -n S-right next 171 | bind -n C-left swap-window -t -1 172 | bind -n C-right swap-window -t +1 173 | 174 | # Bindings 175 | bind-key '/' confirm-before "kill-window" 176 | bind-key '\' confirm-before "kill-server" 177 | bind-key '_' split-window -v 178 | bind-key '|' split-window -h 179 | bind-key Tab select-pane -t :.+ 180 | 181 | # Vim-like pane resize 182 | bind-key -r '+' resize-pane -U 5 183 | bind-key -r '-' resize-pane -D 5 184 | bind-key -r '<' resize-pane -L 5 185 | bind-key -r '>' resize-pane -R 5 186 | 187 | # Vim-like pane switching 188 | bind-key h select-pane -L 189 | bind-key j select-pane -D 190 | bind-key k select-pane -U 191 | bind-key l select-pane -R 192 | 193 | # Vim-like pane swapping 194 | bind-key J swap-pane -D 195 | bind-key K swap-pane -U 196 | 197 | bind-key = select-layout even-horizontal 198 | 199 | # Activity 200 | set-window-option -g monitor-activity on 201 | 202 | # Status bar 203 | set-option -g status-left '[#S]' 204 | set-option -g status-right '[#H] #(date +"%F %T")' 205 | if-shell 'test `tput colors` -eq 256' 'set-option -g status-bg colour237' 206 | if-shell 'test `tput colors` -eq 256' 'set-option -g status-fg colour248' 207 | if-shell 'test `tput colors` -eq 256' 'set-window-option -g window-status-current-format "#[fg=colour231]#I:#W#F"' 208 | if-shell 'test `tput colors` -eq 256' 'set-window-option -g window-status-format "#[fg=colour16]#I:#W#F"' 209 | 210 | # Titles 211 | set-window-option -g automatic-rename on 212 | 213 | # Is supposed to give tmux all the env vars from the invoking shell 214 | set -g default-command "$SHELL" 215 | ''; 216 | }; 217 | 218 | 219 | programs.neovim = { 220 | enable = true; 221 | vimAlias = true; 222 | viAlias = true; 223 | vimdiffAlias = true; 224 | defaultEditor = true; 225 | extraLuaConfig = '' 226 | vim.opt.guicursor = "" 227 | vim.opt.nu = true 228 | vim.opt.tabstop = 4 229 | vim.opt.softtabstop = 4 230 | vim.opt.shiftwidth = 4 231 | vim.opt.expandtab = true 232 | vim.opt.smartindent = true 233 | 234 | vim.opt.swapfile = false 235 | vim.opt.backup = false 236 | vim.opt.undofile = true 237 | 238 | vim.opt.hlsearch = false 239 | vim.opt.incsearch = true 240 | vim.opt.ignorecase = true 241 | vim.opt.smartcase = true 242 | vim.opt.termguicolors = true 243 | 244 | vim.opt.updatetime = 50 245 | vim.opt.colorcolumn = "80" 246 | 247 | vim.opt.wildmenu = true 248 | vim.opt.wildmode = "longest:list" 249 | 250 | vim.opt.mouse = "r" 251 | 252 | -- disable netrw in favor of nvim-tree 253 | vim.g.loaded_netrw = 1 254 | vim.g.loaded_netrwPlugin = 1 255 | 256 | 257 | -- keymaps 258 | 259 | vim.g.mapleader = "," 260 | vim.keymap.set("n", "n", vim.cmd.Ex) 261 | vim.keymap.set("i", "jk", "", {noremap=true}) 262 | vim.keymap.set("i", "jj", "", {noremap=true}) 263 | 264 | -- move command in visual mode 265 | vim.keymap.set("v", "J", ":m '>+1gv=gv") 266 | vim.keymap.set("v", "K", ":m '<-2gv=gv") 267 | 268 | vim.keymap.set("n", "J", "mzJ`z") 269 | vim.keymap.set("n", "", "zz") 270 | vim.keymap.set("n", "", "zz") 271 | vim.keymap.set("n", "n", "nzzzv") 272 | vim.keymap.set("n", "N", "Nzzzv") 273 | 274 | -- greatest remap ever 275 | vim.keymap.set("x", "p", [["_dP]]) 276 | 277 | -- next greatest remap ever : asbjornHaland 278 | -- copies to system clipboard 279 | vim.keymap.set({"n", "v"}, "y", [["+y]]) 280 | vim.keymap.set("n", "Y", [["+Y]]) 281 | 282 | vim.keymap.set({"n", "v"}, "d", [["_d]]) 283 | 284 | vim.keymap.set("n", "Q", "") 285 | vim.keymap.set("n", "q:", "") 286 | 287 | -- quickfix commands 288 | vim.keymap.set("n", "", "cnextzz") 289 | vim.keymap.set("n", "", "cprevzz") 290 | vim.keymap.set("n", "k", "lnextzz") 291 | vim.keymap.set("n", "j", "lprevzz") 292 | 293 | vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) 294 | 295 | vim.keymap.set("n", "vpp", "e ~/.config/nvim/lua/vverma/packer.lua"); 296 | 297 | vim.keymap.set("n", "", function() 298 | vim.cmd("so") 299 | end) 300 | 301 | if vim.api.nvim_win_get_option(0, "diff") then 302 | vim.keymap.set("n", "qq", ":qa", {noremap=true}) 303 | end 304 | 305 | 306 | ''; 307 | plugins = with pkgs.vimPlugins; [ 308 | { 309 | plugin = telescope; 310 | type = "lua"; 311 | config = '' 312 | local builtin = require('telescope.builtin') 313 | vim.keymap.set('n', 'ff', builtin.find_files, {}) 314 | -- Find the .git directory or file in the current directory or its ancestors 315 | local git_dir = vim.fn.finddir('.git', '.;') 316 | 317 | -- If the .git directory or file is found, the current directory is a Git repository 318 | if git_dir ~= ''' then 319 | vim.keymap.set('n', '', builtin.git_files, {}) 320 | else 321 | vim.keymap.set('n', '', builtin.find_files, {}) 322 | end 323 | vim.keymap.set('n', '', ':Telescope live_grep default_text=', {}) 324 | vim.keymap.set('n', 'b', builtin.buffers, {}) 325 | 326 | ''; 327 | } 328 | { plugin = plenary; } 329 | { 330 | plugin = nvim-treesitter.withAllGrammars; 331 | type = "lua"; 332 | config = '' 333 | 334 | require'nvim-treesitter.configs'.setup { 335 | indent = { 336 | enable = true 337 | }, 338 | 339 | highlight = { 340 | enable = true, 341 | 342 | -- Setting this to true will run `:h syntax` and tree-sitter at the same time. 343 | -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). 344 | -- Using this option may slow down your editor, and you may see some duplicate highlights. 345 | -- Instead of true it can also be a list of languages 346 | additional_vim_regex_highlighting = false, 347 | }, 348 | } 349 | 350 | ''; 351 | } 352 | { 353 | plugin = seoul256-vim; 354 | type = "lua"; 355 | config = "vim.cmd('colorscheme seoul256')"; 356 | } 357 | { 358 | plugin = jellybeans-nvim; 359 | type = "lua"; 360 | config = '' 361 | if vim.api.nvim_win_get_option(0, "diff") then 362 | vim.cmd('colorscheme jellybeans-nvim') 363 | end 364 | ''; 365 | } 366 | { 367 | plugin = undotree; 368 | type = "lua"; 369 | config = '' vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) ''; 370 | } 371 | { 372 | plugin = vim-fugitive; 373 | type = "lua"; 374 | config = ''vim.keymap.set("n", "gs", vim.cmd.Git);''; 375 | } 376 | { plugin = copilot; } 377 | { plugin = nvim-web-devicons; } 378 | { 379 | plugin = nvim-tree-lua; 380 | type = "lua"; 381 | config = '' 382 | require("nvim-tree").setup({ 383 | disable_netrw = true, 384 | hijack_netrw = true, 385 | sync_root_with_cwd = true, 386 | respect_buf_cwd = true, 387 | git = { 388 | enable = true, 389 | ignore = true, 390 | timeout = 500, 391 | }, 392 | update_focused_file = { 393 | enable = true, 394 | update_root = true 395 | }, 396 | }) 397 | 398 | vim.keymap.set('n', 'n', ':NvimTreeToggle', {noremap = true, silent = true}) 399 | ''; 400 | } 401 | { plugin = vim-commentary; } 402 | { plugin = trouble-nvim; } 403 | { plugin = vim-nix; } 404 | { 405 | plugin = vim-prettier; 406 | runtime = { 407 | "ftplugin/javascript.lua".text = '' 408 | vim.opt_local.tabstop = 2 409 | vim.opt_local.softtabstop = 2 410 | vim.opt_local.shiftwidth = 2 411 | ''; 412 | "ftplugin/typescript.lua".text = '' 413 | vim.opt_local.tabstop = 2 414 | vim.opt_local.softtabstop = 2 415 | vim.opt_local.shiftwidth = 2 416 | ''; 417 | "ftplugin/typescriptreact.lua".text = '' 418 | vim.opt_local.tabstop = 2 419 | vim.opt_local.softtabstop = 2 420 | vim.opt_local.shiftwidth = 2 421 | ''; 422 | }; 423 | type = "lua"; 424 | config = ''vim.keymap.set("n", "f", function() vim.cmd("Prettier") end)''; 425 | } 426 | 427 | # lsp plugins 428 | { plugin = nvim-lspconfig; } 429 | { plugin = mason-nvim; } 430 | { plugin = mason-lspconfig-nvim; } 431 | { plugin = nvim-cmp; } 432 | { plugin = cmp-nvim-lsp; } 433 | { 434 | plugin = lsp-zero-nvim; 435 | type="lua"; 436 | config = '' 437 | local lsp_zero = require('lsp-zero') 438 | 439 | lsp_zero.on_attach(function(client, bufnr) 440 | local opts = {buffer = bufnr, remap = false} 441 | 442 | vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) 443 | vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) 444 | vim.keymap.set("n", "vws", function() vim.lsp.buf.workspace_symbol() end, opts) 445 | vim.keymap.set("n", "vd", function() vim.diagnostic.open_float() end, opts) 446 | vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) 447 | vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) 448 | vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) 449 | vim.keymap.set("n", "vrr", function() vim.lsp.buf.references() end, opts) 450 | vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts) 451 | vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) 452 | end) 453 | 454 | -- When you don't have mason.nvim installed 455 | -- You'll need to list the servers installed in your system 456 | lsp_zero.setup_servers({'tsserver', 'eslint', 'pyright'}) 457 | lsp_zero.setup() 458 | 459 | 460 | -- Completions 461 | local cmp = require('cmp') 462 | local cmp_select = {behavior = cmp.SelectBehavior.Select} 463 | 464 | cmp.setup({ 465 | -- not sure why this doesn't work 466 | -- formatting = lsp_zero.cmp_format(), 467 | mapping = cmp.mapping.preset.insert({ 468 | [''] = cmp.mapping.select_prev_item(cmp_select), 469 | [''] = cmp.mapping.select_next_item(cmp_select), 470 | [''] = cmp.mapping.confirm({ select = true }), 471 | [''] = cmp.mapping.confirm({ select = true }), 472 | [''] = cmp.mapping.complete(), 473 | ['Tab'] = nil, 474 | [''] = nil, 475 | }), 476 | }) 477 | 478 | ''; 479 | } 480 | ]; 481 | }; 482 | 483 | } 484 | 485 | 486 | -------------------------------------------------------------------------------- /vim/vimrc: -------------------------------------------------------------------------------- 1 | " Compatibility 2 | set nocompatible 3 | 4 | " Filetypes 5 | filetype off 6 | 7 | " Backups {{{ 8 | set backup " enable backups 9 | set noswapfile " it's 2013, Vim. 10 | 11 | set backupdir=~/.vim/tmp/backup/ " backups 12 | set directory=~/.vim/tmp/swap/ " swap files 13 | 14 | if has('persistent_undo') 15 | set undodir=~/.vim/tmp/undo/ " undo files 16 | 17 | 18 | " Make those folders automatically if they don't already exist. 19 | if !isdirectory(expand(&undodir)) 20 | call mkdir(expand(&undodir), "p") 21 | endif 22 | endif 23 | 24 | if !isdirectory(expand(&backupdir)) 25 | call mkdir(expand(&backupdir), "p") 26 | endif 27 | if !isdirectory(expand(&directory)) 28 | call mkdir(expand(&directory), "p") 29 | endif 30 | 31 | " }}} 32 | 33 | call plug#begin('~/.vim/plugged') 34 | 35 | " All the plugins 36 | Plug 'bling/vim-airline' 37 | Plug 'scrooloose/nerdtree' 38 | Plug 'tpope/vim-fugitive' 39 | Plug 'scrooloose/nerdcommenter' 40 | Plug 'majutsushi/tagbar' 41 | Plug 'xsbeats/vim-blade' 42 | " Plug 'itspriddle/vim-stripper' 43 | Plug 'pangloss/vim-javascript' 44 | Plug 'nathanaelkane/vim-indent-guides' 45 | Plug 'airblade/vim-gitgutter' 46 | Plug 'ConradIrwin/vim-bracketed-paste' 47 | Plug 'mattn/webapi-vim' 48 | Plug 'yssl/QFEnter' 49 | Plug 'tpope/vim-unimpaired' 50 | Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } 51 | Plug 'junegunn/fzf.vim' 52 | Plug 'rking/ag.vim' 53 | Plug 'roxma/nvim-yarp' 54 | Plug 'roxma/vim-hug-neovim-rpc' 55 | Plug 'mdempsky/gocode', { 'rtp': 'vim', 'do': '~/.vim/plugged/gocode/vim/symlink.sh' } 56 | Plug 'psf/black' 57 | Plug 'neoclide/coc.nvim', {'branch': 'release'} 58 | 59 | 60 | Plug 'zchee/deoplete-go', { 'do': 'make'} 61 | Plug 'sgur/vim-editorconfig' 62 | Plug 'rhysd/vim-clang-format' 63 | Plug 'hashivim/vim-terraform' 64 | Plug 'peitalin/vim-jsx-typescript' 65 | Plug 'tpope/vim-abolish' 66 | Plug 'neoclide/coc.nvim', {'branch': 'release'} 67 | Plug 'elzr/vim-json' 68 | Plug 'mogelbrod/vim-jsonpath' 69 | Plug 'patoconnor43/sourcegraph-vim' 70 | 71 | " All the colorschemes. 72 | Plug 'flazz/vim-colorschemes' 73 | Plug 'sjl/badwolf' 74 | Plug 'YorickPeterse/Autumn.vim' 75 | Plug 'nanotech/jellybeans.vim' 76 | Plug 'tomasr/molokai' 77 | Plug 'altercation/vim-colors-solarized' 78 | Plug 'chriskempson/vim-tomorrow-theme' 79 | Plug 'junegunn/seoul256.vim' 80 | Plug 'dense-analysis/ale' 81 | Plug 'elixir-editors/vim-elixir' 82 | 83 | 84 | 85 | filetype plugin indent on 86 | call plug#end() 87 | 88 | let mapleader="," 89 | 90 | " Colorscheme Settings 91 | syntax on 92 | set synmaxcol=800 93 | set t_Co=256 94 | set background=dark 95 | 96 | try 97 | colorscheme molokai 98 | let g:seoul256_background = 233 99 | colorscheme seoul256 100 | catch /^Vim\%((\a\+)\)\=:E185/ 101 | endtry 102 | 103 | "Indentation settings 104 | set tabstop=4 105 | set softtabstop=4 106 | set shiftwidth=4 107 | set expandtab 108 | set autoindent 109 | set smarttab 110 | set hidden 111 | 112 | "Statusline settings" 113 | set laststatus=2 114 | "let g:Powerline_symbols='fancy' 115 | let g:Powerline_cache_enabled=1 116 | " Formatting 117 | set formatoptions=croqn1 118 | silent! set formatoptions+=j 119 | set nojoinspaces 120 | 121 | 122 | "Convenience mappings" 123 | inoremap jj `^ 124 | inoremap JJ `^ 125 | inoremap jk `^ 126 | inoremap JK `^ 127 | cnoremap w!! %!sudo tee > /dev/null % 128 | nnoremap J mzJ`z 129 | 130 | " Search for work under cursor wth Ag 131 | nnoremap K :Ag "\b\b":cw 132 | nnoremap ( /n \<\> 133 | 134 | "Reasonable line movement" 135 | nnoremap j gj 136 | nnoremap k gk 137 | vnoremap j gj 138 | vnoremap k gk 139 | 140 | nnoremap :Ag 141 | 142 | " Matching 143 | silent! runtime macros/matchit.vim 144 | 145 | " Netrw 146 | if has("eval") 147 | let g:netrw_silent = 1 148 | let g:netrw_liststyle = 3 149 | endif 150 | 151 | "Get rid of annoying bell sound" 152 | set noerrorbells visualbell t_vb= 153 | 154 | "NERDTree settings" 155 | let NERDTreeIgnore=['\.pyc$', '\~$', '\.rbc$'] 156 | let NERDTreeMinimalUI=1 157 | let NERDTreeDirArrows=1 158 | 159 | " Messages 160 | set shortmess+=I 161 | 162 | " Miscellaneous 163 | set backspace=indent,eol,start 164 | set modelines=1 165 | set report=0 166 | 167 | set number 168 | set mouse=r 169 | 170 | " Objects 171 | onoremap ir i[ 172 | onoremap ar a[ 173 | vnoremap ir i[ 174 | vnoremap ar a[ 175 | 176 | " Paste 177 | set nopaste 178 | set pastetoggle= 179 | 180 | " Reading 181 | set autoread 182 | 183 | " Scrolling 184 | set scrolloff=5 185 | set sidescrolloff=16 186 | 187 | " Search 188 | if has("extra_search") 189 | set incsearch 190 | set ignorecase 191 | set smartcase 192 | set nohlsearch 193 | nnoremap h :set hlsearch! 194 | nnoremap i :set incsearch! 195 | nnoremap :nohlsearch 196 | endif 197 | 198 | " Spelling 199 | if has("spell") 200 | set spelllang=en_us 201 | nnoremap s :setlocal spell! 202 | endif 203 | 204 | 205 | " Terminal 206 | set ttyfast 207 | set visualbell t_vb= 208 | 209 | " Typos 210 | if has("user_commands") 211 | command! -bang -complete=file -nargs=? E e 212 | command! -bang -complete=file -nargs=? W w 213 | command! -bang -complete=file -nargs=? WQ wq 214 | command! -bang -complete=file -nargs=? Wq wq 215 | command! -bang Q q 216 | command! -bang Qa qa 217 | command! -bang QA qa 218 | command! -bang Wa wa 219 | command! -bang WA wa 220 | endif 221 | 222 | if &diff 223 | colorscheme jellybeans 224 | let g:lite_dfm_normal_bg_cterm=237 225 | nnoremap qq :qa 226 | endif 227 | augroup diffopen 228 | autocmd! 229 | autocmd FilterWritePre * if &diff | colorscheme jellybeans | endif 230 | augroup end 231 | 232 | " Unmaps 233 | noremap 234 | nnoremap Q 235 | 236 | " Visual 237 | if has("virtualedit") 238 | set virtualedit+=block 239 | endif 240 | 241 | " Wildmenu 242 | if has("wildmenu") 243 | set wildmenu 244 | set wildmode=longest:list 245 | if has("wildignore") 246 | set wildignore+=*.a,*.o 247 | set wildignore+=*.bmp,*.gif,*.ico,*.jpg,*.png 248 | set wildignore+=*~,*.swp,*.tmp 249 | set wildignore+=*.pyc 250 | set wildignore+=*.class 251 | endif 252 | if exists("&wildignorecase") 253 | set wildignorecase 254 | endif 255 | endif 256 | 257 | " Windows 258 | if has("windows") 259 | set splitbelow 260 | if has("vertsplit") 261 | set splitright 262 | endif 263 | if exists("&showtabline") 264 | set showtabline=1 265 | endif 266 | endif 267 | 268 | " Yanking 269 | nnoremap Y y$ 270 | 271 | " Local 272 | if filereadable(glob("~/.vimrc.local")) 273 | source ~/.vimrc.local 274 | endif 275 | 276 | " Compile Latex when I save it. 277 | au BufWritePost *.tex "silent !pdflatex %" 278 | 279 | map q: 280 | 281 | set completeopt=menuone,longest 282 | 283 | let g:Powerline_symbols = 'unicode' 284 | let g:UltiSnipsExpandTrigger="" 285 | 286 | " always open nerd tree in current directory 287 | function! ToggleNerdTree() 288 | if g:NERDTree.IsOpen() 289 | NERDTreeToggle 290 | elseif !empty(expand('%')) 291 | NERDTree % 292 | else 293 | NERDTree 294 | endif 295 | endfunction 296 | 297 | " Leader Keybindings 298 | nnoremap n :call ToggleNerdTree() 299 | 300 | nnoremap == = 301 | 302 | au Filetype python inoremap pdb import pdb; pdb.set_trace() 303 | 304 | " open file under cursor in vertical split / tab 305 | nnoremap :vertical wincmd f 306 | nnoremap _ :tab wincmd f 307 | 308 | " splits from quickfix 309 | let g:qfenter_vopen_map = [''] 310 | 311 | " open/close quickfix easily 312 | if !&diff 313 | nnoremap qo :copen 314 | nnoremap qq :ccl 315 | endif 316 | 317 | " The Silver Searcher 318 | if executable('ag') 319 | " Use ag over grep 320 | set grepprg=ag\ --nogroup\ --nocolor 321 | endif 322 | 323 | let g:ackprg = 'ag --nogroup --nocolor --column' 324 | autocmd BufRead,BufNewFile *.avsc setfiletype json 325 | 326 | let hostname = substitute(system('hostname'), '\n', '', '') 327 | nnoremap :GFiles 328 | nnoremap t :GoTestFunc 329 | nnoremap m :History 330 | nnoremap b :Buffers 331 | nnoremap f :GoFillStruct 332 | 333 | " Go specific settings 334 | 335 | let g:go_fmt_command = "goimports" 336 | let g:go_metalinter_autosave = 0 337 | 338 | " run :GoBuild or :GoTestCompile based on the go file 339 | function! s:build_go_files() 340 | call go#cmd#Build(1) 341 | endf 342 | 343 | if has('python') 344 | command! -nargs=* Py python 345 | elseif has('python3') 346 | command! -nargs=* Py python3 347 | endif 348 | 349 | " Converts dates from the current line 350 | function! NormalizeDate() 351 | Py << EOF 352 | 353 | from dateutil.parser import parse 354 | import vim 355 | 356 | vim.current.line = str(parse(vim.current.line).date()) 357 | EOF 358 | endfunction 359 | 360 | let g:ale_linters = {'go': ['goimports'], 'python': ['flake8', 'pylint']} 361 | let g:ale_fixers = {'go': ['goimports']} 362 | " Converts amounts from the current line 363 | function! NormalizePrice() 364 | Py << EOF 365 | 366 | import vim 367 | 368 | amount = vim.current.line 369 | amount = float(amount.strip().replace('$', '').replace(',', '').replace('−', '-')) 370 | 371 | sign = '+' if amount < 0 else '-' 372 | 373 | vim.current.line = '{}{} USD'.format(sign, abs(amount)) 374 | EOF 375 | endfunction 376 | 377 | function! ReverseLines() 378 | :%s/\"\n/|/g 379 | :g/^/m0 380 | :%s/|/\"\r/g 381 | endfunction 382 | 383 | let g:sourcegraph_vim_url = "https:/betteromics.sourcegraph.com/" 384 | 385 | let g:ale_go_gometalinter_options = '--fast' 386 | let g:terraform_align=1 387 | let g:ale_fix_on_save = 1 388 | let g:ale_set_loclist = 0 389 | let g:ale_set_quickfix = 0 390 | 391 | nnoremap gh :SourcegraphCopyUrl 392 | nnoremap tt :call NormalizeDate() 393 | nnoremap $$ :call NormalizePrice() 394 | 395 | autocmd FileType go nmap gb :call build_go_files() 396 | autocmd FileType go nmap gr :GoRun 397 | autocmd FileType go nmap gt :GoTest 398 | autocmd FileType go nmap \| (go-def-vertical) 399 | autocmd FileType go nmap gi (go-info) 400 | autocmd FileType c,cpp ClangFormatAutoEnable 401 | 402 | "COC START 403 | 404 | " Some servers have issues with backup files, see #649 405 | set nobackup 406 | set nowritebackup 407 | 408 | " Having longer updatetime (default is 4000 ms = 4s) leads to noticeable 409 | " delays and poor user experience 410 | set updatetime=300 411 | 412 | " Always show the signcolumn, otherwise it would shift the text each time 413 | " diagnostics appear/become resolved 414 | set signcolumn=yes 415 | 416 | " Use tab for trigger completion with characters ahead and navigate 417 | " NOTE: There's always complete item selected by default, you may want to enable 418 | " no select by `"suggest.noselect": true` in your configuration file 419 | " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by 420 | " other plugin before putting this into your config 421 | inoremap 422 | \ coc#pum#visible() ? coc#pum#next(1) : 423 | \ CheckBackspace() ? "\" : 424 | \ coc#refresh() 425 | inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" 426 | 427 | " Make to accept selected completion item or notify coc.nvim to format 428 | " u breaks current undo, please make your own choice 429 | inoremap coc#pum#visible() ? coc#pum#confirm() 430 | \: "\u\\=coc#on_enter()\" 431 | 432 | function! CheckBackspace() abort 433 | let col = col('.') - 1 434 | return !col || getline('.')[col - 1] =~# '\s' 435 | endfunction 436 | 437 | " Use to trigger completion 438 | if has('nvim') 439 | inoremap coc#refresh() 440 | else 441 | inoremap coc#refresh() 442 | endif 443 | 444 | " Use `[g` and `]g` to navigate diagnostics 445 | " Use `:CocDiagnostics` to get all diagnostics of current buffer in location list 446 | nmap [g (coc-diagnostic-prev) 447 | nmap ]g (coc-diagnostic-next) 448 | 449 | " GoTo code navigation 450 | nmap gd (coc-definition) 451 | nmap gy (coc-type-definition) 452 | nmap gi (coc-implementation) 453 | nmap gr (coc-references) 454 | 455 | " Use K to show documentation in preview window 456 | nnoremap K :call ShowDocumentation() 457 | 458 | function! ShowDocumentation() 459 | if CocAction('hasProvider', 'hover') 460 | call CocActionAsync('doHover') 461 | else 462 | call feedkeys('K', 'in') 463 | endif 464 | endfunction 465 | 466 | " Highlight the symbol and its references when holding the cursor 467 | autocmd CursorHold * silent call CocActionAsync('highlight') 468 | 469 | " Symbol renaming 470 | nmap rn (coc-rename) 471 | 472 | " Formatting selected code 473 | xmap f (coc-format-selected) 474 | nmap f (coc-format-selected) 475 | 476 | augroup mygroup 477 | autocmd! 478 | " Setup formatexpr specified filetype(s) 479 | autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') 480 | " Update signature help on jump placeholder 481 | autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') 482 | augroup end 483 | 484 | " Applying code actions to the selected code block 485 | " Example: `aap` for current paragraph 486 | xmap a (coc-codeaction-selected) 487 | nmap a (coc-codeaction-selected) 488 | 489 | " Remap keys for applying code actions at the cursor position 490 | nmap ac (coc-codeaction-cursor) 491 | " Remap keys for apply code actions affect whole buffer 492 | nmap as (coc-codeaction-source) 493 | " Apply the most preferred quickfix action to fix diagnostic on the current line 494 | nmap qf (coc-fix-current) 495 | 496 | " Remap keys for applying refactor code actions 497 | nmap re (coc-codeaction-refactor) 498 | xmap r (coc-codeaction-refactor-selected) 499 | nmap r (coc-codeaction-refactor-selected) 500 | 501 | " Run the Code Lens action on the current line 502 | nmap cl (coc-codelens-action) 503 | 504 | " Map function and class text objects 505 | " NOTE: Requires 'textDocument.documentSymbol' support from the language server 506 | xmap if (coc-funcobj-i) 507 | omap if (coc-funcobj-i) 508 | xmap af (coc-funcobj-a) 509 | omap af (coc-funcobj-a) 510 | xmap ic (coc-classobj-i) 511 | omap ic (coc-classobj-i) 512 | xmap ac (coc-classobj-a) 513 | omap ac (coc-classobj-a) 514 | 515 | " Remap and to scroll float windows/popups 516 | if has('nvim-0.4.0') || has('patch-8.2.0750') 517 | nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" 518 | nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" 519 | inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" 520 | inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" 521 | vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" 522 | vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" 523 | endif 524 | 525 | " Use CTRL-S for selections ranges 526 | " Requires 'textDocument/selectionRange' support of language server 527 | nmap (coc-range-select) 528 | xmap (coc-range-select) 529 | 530 | " Add `:Format` command to format current buffer 531 | command! -nargs=0 Format :call CocActionAsync('format') 532 | 533 | " Add `:Fold` command to fold current buffer 534 | command! -nargs=? Fold :call CocAction('fold', ) 535 | 536 | " Add `:OR` command for organize imports of the current buffer 537 | command! -nargs=0 OR :call CocActionAsync('runCommand', 'editor.action.organizeImport') 538 | 539 | " Add (Neo)Vim's native statusline support 540 | " NOTE: Please see `:h coc-status` for integrations with external plugins that 541 | " provide custom statusline: lightline.vim, vim-airline 542 | set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} 543 | 544 | " Mappings for CoCList 545 | " Show all diagnostics 546 | nnoremap a :CocList diagnostics 547 | " Manage extensions 548 | nnoremap e :CocList extensions 549 | " Show commands 550 | nnoremap c :CocList commands 551 | " Find symbol of current document 552 | nnoremap o :CocList outline 553 | " Search workspace symbols 554 | nnoremap s :CocList -I symbols 555 | " Do default action for next item 556 | nnoremap j :CocNext 557 | " Do default action for previous item 558 | nnoremap k :CocPrev 559 | " Resume latest coc list 560 | nnoremap p :CocListResume 561 | 562 | 563 | " COC END 564 | 565 | au BufWritePost *.py !black % 566 | au BufWritePost *.js !prettier --write % 567 | set secure 568 | -------------------------------------------------------------------------------- /kitty.conf: -------------------------------------------------------------------------------- 1 | # vim:fileencoding=utf-8:foldmethod=marker 2 | 3 | #: Fonts {{{ 4 | 5 | #: kitty has very powerful font management. You can configure 6 | #: individual font faces and even specify special fonts for particular 7 | #: characters. 8 | 9 | # font_family monospace 10 | # bold_font auto 11 | # italic_font auto 12 | # bold_italic_font auto 13 | 14 | #: You can specify different fonts for the bold/italic/bold-italic 15 | #: variants. To get a full list of supported fonts use the `kitty 16 | #: +list-fonts` command. By default they are derived automatically, by 17 | #: the OSes font system. When bold_font or bold_italic_font is set to 18 | #: auto on macOS, the priority of bold fonts is semi-bold, bold, 19 | #: heavy. Setting them manually is useful for font families that have 20 | #: many weight variants like Book, Medium, Thick, etc. For example:: 21 | 22 | #: font_family Operator Mono Book 23 | #: bold_font Operator Mono Medium 24 | #: italic_font Operator Mono Book Italic 25 | #: bold_italic_font Operator Mono Medium Italic 26 | 27 | # font_size 11.0 28 | 29 | #: Font size (in pts) 30 | 31 | # force_ltr no 32 | 33 | #: kitty does not support BIDI (bidirectional text), however, for RTL 34 | #: scripts, words are automatically displayed in RTL. That is to say, 35 | #: in an RTL script, the words "HELLO WORLD" display in kitty as 36 | #: "WORLD HELLO", and if you try to select a substring of an RTL- 37 | #: shaped string, you will get the character that would be there had 38 | #: the the string been LTR. For example, assuming the Hebrew word 39 | #: ירושלים, selecting the character that on the screen appears to be ם 40 | #: actually writes into the selection buffer the character י. kitty's 41 | #: default behavior is useful in conjunction with a filter to reverse 42 | #: the word order, however, if you wish to manipulate RTL glyphs, it 43 | #: can be very challenging to work with, so this option is provided to 44 | #: turn it off. Furthermore, this option can be used with the command 45 | #: line program GNU FriBidi 46 | #: to get BIDI 47 | #: support, because it will force kitty to always treat the text as 48 | #: LTR, which FriBidi expects for terminals. 49 | 50 | # symbol_map 51 | 52 | #: E.g. symbol_map U+E0A0-U+E0A3,U+E0C0-U+E0C7 PowerlineSymbols 53 | 54 | #: Map the specified Unicode codepoints to a particular font. Useful 55 | #: if you need special rendering for some symbols, such as for 56 | #: Powerline. Avoids the need for patched fonts. Each Unicode code 57 | #: point is specified in the form `U+`. You 58 | #: can specify multiple code points, separated by commas and ranges 59 | #: separated by hyphens. This option can be specified multiple times. 60 | #: The syntax is:: 61 | 62 | #: symbol_map codepoints Font Family Name 63 | 64 | # narrow_symbols 65 | 66 | #: E.g. narrow_symbols U+E0A0-U+E0A3,U+E0C0-U+E0C7 1 67 | 68 | #: Usually, for Private Use Unicode characters and some symbol/dingbat 69 | #: characters, if the character is followed by one or more spaces, 70 | #: kitty will use those extra cells to render the character larger, if 71 | #: the character in the font has a wide aspect ratio. Using this 72 | #: option you can force kitty to restrict the specified code points to 73 | #: render in the specified number of cells (defaulting to one cell). 74 | #: This option can be specified multiple times. The syntax is:: 75 | 76 | #: narrow_symbols codepoints [optionally the number of cells] 77 | 78 | # disable_ligatures never 79 | 80 | #: Choose how you want to handle multi-character ligatures. The 81 | #: default is to always render them. You can tell kitty to not render 82 | #: them when the cursor is over them by using cursor to make editing 83 | #: easier, or have kitty never render them at all by using always, if 84 | #: you don't like them. The ligature strategy can be set per-window 85 | #: either using the kitty remote control facility or by defining 86 | #: shortcuts for it in kitty.conf, for example:: 87 | 88 | #: map alt+1 disable_ligatures_in active always 89 | #: map alt+2 disable_ligatures_in all never 90 | #: map alt+3 disable_ligatures_in tab cursor 91 | 92 | #: Note that this refers to programming ligatures, typically 93 | #: implemented using the calt OpenType feature. For disabling general 94 | #: ligatures, use the font_features option. 95 | 96 | # font_features 97 | 98 | #: E.g. font_features none 99 | 100 | #: Choose exactly which OpenType features to enable or disable. This 101 | #: is useful as some fonts might have features worthwhile in a 102 | #: terminal. For example, Fira Code includes a discretionary feature, 103 | #: zero, which in that font changes the appearance of the zero (0), to 104 | #: make it more easily distinguishable from Ø. Fira Code also includes 105 | #: other discretionary features known as Stylistic Sets which have the 106 | #: tags ss01 through ss20. 107 | 108 | #: For the exact syntax to use for individual features, see the 109 | #: HarfBuzz documentation . 111 | 112 | #: Note that this code is indexed by PostScript name, and not the font 113 | #: family. This allows you to define very precise feature settings; 114 | #: e.g. you can disable a feature in the italic font but not in the 115 | #: regular font. 116 | 117 | #: On Linux, font features are first read from the FontConfig database 118 | #: and then this option is applied, so they can be configured in a 119 | #: single, central place. 120 | 121 | #: To get the PostScript name for a font, use `kitty +list-fonts 122 | #: --psnames`: 123 | 124 | #: .. code-block:: sh 125 | 126 | #: $ kitty +list-fonts --psnames | grep Fira 127 | #: Fira Code 128 | #: Fira Code Bold (FiraCode-Bold) 129 | #: Fira Code Light (FiraCode-Light) 130 | #: Fira Code Medium (FiraCode-Medium) 131 | #: Fira Code Regular (FiraCode-Regular) 132 | #: Fira Code Retina (FiraCode-Retina) 133 | 134 | #: The part in brackets is the PostScript name. 135 | 136 | #: Enable alternate zero and oldstyle numerals:: 137 | 138 | #: font_features FiraCode-Retina +zero +onum 139 | 140 | #: Enable only alternate zero in the bold font:: 141 | 142 | #: font_features FiraCode-Bold +zero 143 | 144 | #: Disable the normal ligatures, but keep the calt feature which (in 145 | #: this font) breaks up monotony:: 146 | 147 | #: font_features TT2020StyleB-Regular -liga +calt 148 | 149 | #: In conjunction with force_ltr, you may want to disable Arabic 150 | #: shaping entirely, and only look at their isolated forms if they 151 | #: show up in a document. You can do this with e.g.:: 152 | 153 | #: font_features UnifontMedium +isol -medi -fina -init 154 | 155 | # modify_font 156 | 157 | #: Modify font characteristics such as the position or thickness of 158 | #: the underline and strikethrough. The modifications can have the 159 | #: suffix px for pixels or % for percentage of original value. No 160 | #: suffix means use pts. For example:: 161 | 162 | #: modify_font underline_position -2 163 | #: modify_font underline_thickness 150% 164 | #: modify_font strikethrough_position 2px 165 | 166 | #: Additionally, you can modify the size of the cell in which each 167 | #: font glyph is rendered and the baseline at which the glyph is 168 | #: placed in the cell. For example:: 169 | 170 | #: modify_font cell_width 80% 171 | #: modify_font cell_height -2px 172 | #: modify_font baseline 3 173 | 174 | #: Note that modifying the baseline will automatically adjust the 175 | #: underline and strikethrough positions by the same amount. 176 | #: Increasing the baseline raises glyphs inside the cell and 177 | #: decreasing it lowers them. Decreasing the cell size might cause 178 | #: rendering artifacts, so use with care. 179 | 180 | # box_drawing_scale 0.001, 1, 1.5, 2 181 | 182 | #: The sizes of the lines used for the box drawing Unicode characters. 183 | #: These values are in pts. They will be scaled by the monitor DPI to 184 | #: arrive at a pixel value. There must be four values corresponding to 185 | #: thin, normal, thick, and very thick lines. 186 | 187 | # undercurl_style thin-sparse 188 | 189 | #: The style with which undercurls are rendered. This option takes the 190 | #: form (thin|thick)-(sparse|dense). Thin and thick control the 191 | #: thickness of the undercurl. Sparse and dense control how often the 192 | #: curl oscillates. With sparse the curl will peak once per character, 193 | #: with dense twice. 194 | 195 | # text_composition_strategy platform 196 | 197 | #: Control how kitty composites text glyphs onto the background color. 198 | #: The default value of platform tries for text rendering as close to 199 | #: "native" for the platform kitty is running on as possible. 200 | 201 | #: A value of legacy uses the old (pre kitty 0.28) strategy for how 202 | #: glyphs are composited. This will make dark text on light 203 | #: backgrounds look thicker and light text on dark backgrounds 204 | #: thinner. It might also make some text appear like the strokes are 205 | #: uneven. 206 | 207 | #: You can fine tune the actual contrast curve used for glyph 208 | #: composition by specifying up to two space-separated numbers for 209 | #: this setting. 210 | 211 | #: The first number is the gamma adjustment, which controls the 212 | #: thickness of dark text on light backgrounds. Increasing the value 213 | #: will make text appear thicker. The default value for this is 1.0 on 214 | #: Linux and 1.7 on macOS. Valid values are 0.01 and above. The result 215 | #: is scaled based on the luminance difference between the background 216 | #: and the foreground. Dark text on light backgrounds receives the 217 | #: full impact of the curve while light text on dark backgrounds is 218 | #: affected very little. 219 | 220 | #: The second number is an additional multiplicative contrast. It is 221 | #: percentage ranging from 0 to 100. The default value is 0 on Linux 222 | #: and 30 on macOS. 223 | 224 | #: If you wish to achieve similar looking thickness in light and dark 225 | #: themes, a good way to experiment is start by setting the value to 226 | #: 1.0 0 and use a dark theme. Then adjust the second parameter until 227 | #: it looks good. Then switch to a light theme and adjust the first 228 | #: parameter until the perceived thickness matches the dark theme. 229 | 230 | # text_fg_override_threshold 0 231 | 232 | #: The minimum accepted difference in luminance between the foreground 233 | #: and background color, below which kitty will override the 234 | #: foreground color. It is percentage ranging from 0 to 100. If the 235 | #: difference in luminance of the foreground and background is below 236 | #: this threshold, the foreground color will be set to white if the 237 | #: background is dark or black if the background is light. The default 238 | #: value is 0, which means no overriding is performed. Useful when 239 | #: working with applications that use colors that do not contrast well 240 | #: with your preferred color scheme. 241 | 242 | #: }}} 243 | 244 | #: Cursor customization {{{ 245 | 246 | # cursor #cccccc 247 | 248 | #: Default cursor color. If set to the special value none the cursor 249 | #: will be rendered with a "reverse video" effect. It's color will be 250 | #: the color of the text in the cell it is over and the text will be 251 | #: rendered with the background color of the cell. Note that if the 252 | #: program running in the terminal sets a cursor color, this takes 253 | #: precedence. Also, the cursor colors are modified if the cell 254 | #: background and foreground colors have very low contrast. 255 | 256 | # cursor_text_color #111111 257 | 258 | #: The color of text under the cursor. If you want it rendered with 259 | #: the background color of the cell underneath instead, use the 260 | #: special keyword: background. Note that if cursor is set to none 261 | #: then this option is ignored. 262 | 263 | # cursor_shape block 264 | 265 | #: The cursor shape can be one of block, beam, underline. Note that 266 | #: when reloading the config this will be changed only if the cursor 267 | #: shape has not been set by the program running in the terminal. This 268 | #: sets the default cursor shape, applications running in the terminal 269 | #: can override it. In particular, shell integration 270 | #: in kitty sets 271 | #: the cursor shape to beam at shell prompts. You can avoid this by 272 | #: setting shell_integration to no-cursor. 273 | 274 | # cursor_beam_thickness 1.5 275 | 276 | #: The thickness of the beam cursor (in pts). 277 | 278 | # cursor_underline_thickness 2.0 279 | 280 | #: The thickness of the underline cursor (in pts). 281 | 282 | # cursor_blink_interval -1 283 | 284 | #: The interval to blink the cursor (in seconds). Set to zero to 285 | #: disable blinking. Negative values mean use system default. Note 286 | #: that the minimum interval will be limited to repaint_delay. 287 | 288 | # cursor_stop_blinking_after 15.0 289 | 290 | #: Stop blinking cursor after the specified number of seconds of 291 | #: keyboard inactivity. Set to zero to never stop blinking. 292 | 293 | #: }}} 294 | 295 | #: Scrollback {{{ 296 | 297 | # scrollback_lines 2000 298 | 299 | #: Number of lines of history to keep in memory for scrolling back. 300 | #: Memory is allocated on demand. Negative numbers are (effectively) 301 | #: infinite scrollback. Note that using very large scrollback is not 302 | #: recommended as it can slow down performance of the terminal and 303 | #: also use large amounts of RAM. Instead, consider using 304 | #: scrollback_pager_history_size. Note that on config reload if this 305 | #: is changed it will only affect newly created windows, not existing 306 | #: ones. 307 | 308 | # scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER 309 | 310 | #: Program with which to view scrollback in a new window. The 311 | #: scrollback buffer is passed as STDIN to this program. If you change 312 | #: it, make sure the program you use can handle ANSI escape sequences 313 | #: for colors and text formatting. INPUT_LINE_NUMBER in the command 314 | #: line above will be replaced by an integer representing which line 315 | #: should be at the top of the screen. Similarly CURSOR_LINE and 316 | #: CURSOR_COLUMN will be replaced by the current cursor position or 317 | #: set to 0 if there is no cursor, for example, when showing the last 318 | #: command output. 319 | 320 | # scrollback_pager_history_size 0 321 | 322 | #: Separate scrollback history size (in MB), used only for browsing 323 | #: the scrollback buffer with pager. This separate buffer is not 324 | #: available for interactive scrolling but will be piped to the pager 325 | #: program when viewing scrollback buffer in a separate window. The 326 | #: current implementation stores the data in UTF-8, so approximately 327 | #: 10000 lines per megabyte at 100 chars per line, for pure ASCII, 328 | #: unformatted text. A value of zero or less disables this feature. 329 | #: The maximum allowed size is 4GB. Note that on config reload if this 330 | #: is changed it will only affect newly created windows, not existing 331 | #: ones. 332 | 333 | # scrollback_fill_enlarged_window no 334 | 335 | #: Fill new space with lines from the scrollback buffer after 336 | #: enlarging a window. 337 | 338 | # wheel_scroll_multiplier 5.0 339 | 340 | #: Multiplier for the number of lines scrolled by the mouse wheel. 341 | #: Note that this is only used for low precision scrolling devices, 342 | #: not for high precision scrolling devices on platforms such as macOS 343 | #: and Wayland. Use negative numbers to change scroll direction. See 344 | #: also wheel_scroll_min_lines. 345 | 346 | # wheel_scroll_min_lines 1 347 | 348 | #: The minimum number of lines scrolled by the mouse wheel. The scroll 349 | #: multiplier wheel_scroll_multiplier only takes effect after it 350 | #: reaches this number. Note that this is only used for low precision 351 | #: scrolling devices like wheel mice that scroll by very small amounts 352 | #: when using the wheel. With a negative number, the minimum number of 353 | #: lines will always be added. 354 | 355 | # touch_scroll_multiplier 1.0 356 | 357 | #: Multiplier for the number of lines scrolled by a touchpad. Note 358 | #: that this is only used for high precision scrolling devices on 359 | #: platforms such as macOS and Wayland. Use negative numbers to change 360 | #: scroll direction. 361 | 362 | #: }}} 363 | 364 | #: Mouse {{{ 365 | 366 | # mouse_hide_wait 3.0 367 | 368 | #: Hide mouse cursor after the specified number of seconds of the 369 | #: mouse not being used. Set to zero to disable mouse cursor hiding. 370 | #: Set to a negative value to hide the mouse cursor immediately when 371 | #: typing text. Disabled by default on macOS as getting it to work 372 | #: robustly with the ever-changing sea of bugs that is Cocoa is too 373 | #: much effort. 374 | 375 | # url_color #0087bd 376 | # url_style curly 377 | 378 | #: The color and style for highlighting URLs on mouse-over. url_style 379 | #: can be one of: none, straight, double, curly, dotted, dashed. 380 | 381 | # open_url_with default 382 | 383 | #: The program to open clicked URLs. The special value default with 384 | #: first look for any URL handlers defined via the open_actions 385 | #: facility and if non 386 | #: are found, it will use the Operating System's default URL handler 387 | #: (open on macOS and xdg-open on Linux). 388 | 389 | # url_prefixes file ftp ftps gemini git gopher http https irc ircs kitty mailto news sftp ssh 390 | 391 | #: The set of URL prefixes to look for when detecting a URL under the 392 | #: mouse cursor. 393 | 394 | # detect_urls yes 395 | 396 | #: Detect URLs under the mouse. Detected URLs are highlighted with an 397 | #: underline and the mouse cursor becomes a hand over them. Even if 398 | #: this option is disabled, URLs are still clickable. 399 | 400 | # url_excluded_characters 401 | 402 | #: Additional characters to be disallowed from URLs, when detecting 403 | #: URLs under the mouse cursor. By default, all characters that are 404 | #: legal in URLs are allowed. Additionally, newlines are allowed (but 405 | #: stripped). This is to accommodate programs such as mutt that add 406 | #: hard line breaks even for continued lines. \n can be added to this 407 | #: option to disable this behavior. Special characters can be 408 | #: specified using backslash escapes, to specify a backslash use a 409 | #: double backslash. 410 | 411 | # show_hyperlink_targets no 412 | 413 | #: When the mouse hovers over a terminal hyperlink, show the actual 414 | #: URL that will be activated when the hyperlink is clicked. 415 | 416 | # copy_on_select no 417 | 418 | #: Copy to clipboard or a private buffer on select. With this set to 419 | #: clipboard, selecting text with the mouse will cause the text to be 420 | #: copied to clipboard. Useful on platforms such as macOS that do not 421 | #: have the concept of primary selection. You can instead specify a 422 | #: name such as a1 to copy to a private kitty buffer. Map a shortcut 423 | #: with the paste_from_buffer action to paste from this private 424 | #: buffer. For example:: 425 | 426 | #: copy_on_select a1 427 | #: map shift+cmd+v paste_from_buffer a1 428 | 429 | #: Note that copying to the clipboard is a security risk, as all 430 | #: programs, including websites open in your browser can read the 431 | #: contents of the system clipboard. 432 | 433 | # paste_actions quote-urls-at-prompt 434 | 435 | #: A comma separated list of actions to take when pasting text into 436 | #: the terminal. The supported paste actions are: 437 | 438 | #: quote-urls-at-prompt: 439 | #: If the text being pasted is a URL and the cursor is at a shell prompt, 440 | #: automatically quote the URL (needs shell_integration). 441 | #: confirm: 442 | #: Confirm the paste if bracketed paste mode is not active or there is 443 | #: a large amount of text being pasted. 444 | #: filter: 445 | #: Run the filter_paste() function from the file paste-actions.py in 446 | #: the kitty config directory on the pasted text. The text returned by the 447 | #: function will be actually pasted. 448 | 449 | # strip_trailing_spaces never 450 | 451 | #: Remove spaces at the end of lines when copying to clipboard. A 452 | #: value of smart will do it when using normal selections, but not 453 | #: rectangle selections. A value of always will always do it. 454 | 455 | # select_by_word_characters @-./_~?&=%+# 456 | 457 | #: Characters considered part of a word when double clicking. In 458 | #: addition to these characters any character that is marked as an 459 | #: alphanumeric character in the Unicode database will be matched. 460 | 461 | # select_by_word_characters_forward 462 | 463 | #: Characters considered part of a word when extending the selection 464 | #: forward on double clicking. In addition to these characters any 465 | #: character that is marked as an alphanumeric character in the 466 | #: Unicode database will be matched. 467 | 468 | #: If empty (default) select_by_word_characters will be used for both 469 | #: directions. 470 | 471 | # click_interval -1.0 472 | 473 | #: The interval between successive clicks to detect double/triple 474 | #: clicks (in seconds). Negative numbers will use the system default 475 | #: instead, if available, or fallback to 0.5. 476 | 477 | # focus_follows_mouse no 478 | 479 | #: Set the active window to the window under the mouse when moving the 480 | #: mouse around. 481 | 482 | # pointer_shape_when_grabbed arrow 483 | 484 | #: The shape of the mouse pointer when the program running in the 485 | #: terminal grabs the mouse. Valid values are: arrow, beam and hand. 486 | 487 | # default_pointer_shape beam 488 | 489 | #: The default shape of the mouse pointer. Valid values are: arrow, 490 | #: beam and hand. 491 | 492 | # pointer_shape_when_dragging beam 493 | 494 | #: The default shape of the mouse pointer when dragging across text. 495 | #: Valid values are: arrow, beam and hand. 496 | 497 | #: Mouse actions {{{ 498 | 499 | #: Mouse buttons can be mapped to perform arbitrary actions. The 500 | #: syntax is: 501 | 502 | #: .. code-block:: none 503 | 504 | #: mouse_map button-name event-type modes action 505 | 506 | #: Where button-name is one of left, middle, right, b1 ... b8 with 507 | #: added keyboard modifiers. For example: ctrl+shift+left refers to 508 | #: holding the Ctrl+Shift keys while clicking with the left mouse 509 | #: button. The value b1 ... b8 can be used to refer to up to eight 510 | #: buttons on a mouse. 511 | 512 | #: event-type is one of press, release, doublepress, triplepress, 513 | #: click, doubleclick. modes indicates whether the action is performed 514 | #: when the mouse is grabbed by the program running in the terminal, 515 | #: or not. The values are grabbed or ungrabbed or a comma separated 516 | #: combination of them. grabbed refers to when the program running in 517 | #: the terminal has requested mouse events. Note that the click and 518 | #: double click events have a delay of click_interval to disambiguate 519 | #: from double and triple presses. 520 | 521 | #: You can run kitty with the kitty --debug-input command line option 522 | #: to see mouse events. See the builtin actions below to get a sense 523 | #: of what is possible. 524 | 525 | #: If you want to unmap an action, map it to no_op. For example, to 526 | #: disable opening of URLs with a plain click:: 527 | 528 | #: mouse_map left click ungrabbed no_op 529 | 530 | #: See all the mappable actions including mouse actions here 531 | #: . 532 | 533 | #: .. note:: 534 | #: Once a selection is started, releasing the button that started it will 535 | #: automatically end it and no release event will be dispatched. 536 | 537 | # clear_all_mouse_actions no 538 | 539 | #: Remove all mouse action definitions up to this point. Useful, for 540 | #: instance, to remove the default mouse actions. 541 | 542 | #: Click the link under the mouse or move the cursor 543 | 544 | # mouse_map left click ungrabbed mouse_handle_click selection link prompt 545 | 546 | #:: First check for a selection and if one exists do nothing. Then 547 | #:: check for a link under the mouse cursor and if one exists, click 548 | #:: it. Finally check if the click happened at the current shell 549 | #:: prompt and if so, move the cursor to the click location. Note 550 | #:: that this requires shell integration 551 | #:: to work. 552 | 553 | #: Click the link under the mouse or move the cursor even when grabbed 554 | 555 | # mouse_map shift+left click grabbed,ungrabbed mouse_handle_click selection link prompt 556 | 557 | #:: Same as above, except that the action is performed even when the 558 | #:: mouse is grabbed by the program running in the terminal. 559 | 560 | #: Click the link under the mouse cursor 561 | 562 | # mouse_map ctrl+shift+left release grabbed,ungrabbed mouse_handle_click link 563 | 564 | #:: Variant with Ctrl+Shift is present because the simple click based 565 | #:: version has an unavoidable delay of click_interval, to 566 | #:: disambiguate clicks from double clicks. 567 | 568 | #: Discard press event for link click 569 | 570 | # mouse_map ctrl+shift+left press grabbed discard_event 571 | 572 | #:: Prevent this press event from being sent to the program that has 573 | #:: grabbed the mouse, as the corresponding release event is used to 574 | #:: open a URL. 575 | 576 | #: Paste from the primary selection 577 | 578 | # mouse_map middle release ungrabbed paste_from_selection 579 | 580 | #: Start selecting text 581 | 582 | # mouse_map left press ungrabbed mouse_selection normal 583 | 584 | #: Start selecting text in a rectangle 585 | 586 | # mouse_map ctrl+alt+left press ungrabbed mouse_selection rectangle 587 | 588 | #: Select a word 589 | 590 | # mouse_map left doublepress ungrabbed mouse_selection word 591 | 592 | #: Select a line 593 | 594 | # mouse_map left triplepress ungrabbed mouse_selection line 595 | 596 | #: Select line from point 597 | 598 | # mouse_map ctrl+alt+left triplepress ungrabbed mouse_selection line_from_point 599 | 600 | #:: Select from the clicked point to the end of the line. 601 | 602 | #: Extend the current selection 603 | 604 | # mouse_map right press ungrabbed mouse_selection extend 605 | 606 | #:: If you want only the end of the selection to be moved instead of 607 | #:: the nearest boundary, use move-end instead of extend. 608 | 609 | #: Paste from the primary selection even when grabbed 610 | 611 | # mouse_map shift+middle release ungrabbed,grabbed paste_selection 612 | # mouse_map shift+middle press grabbed discard_event 613 | 614 | #: Start selecting text even when grabbed 615 | 616 | # mouse_map shift+left press ungrabbed,grabbed mouse_selection normal 617 | 618 | #: Start selecting text in a rectangle even when grabbed 619 | 620 | # mouse_map ctrl+shift+alt+left press ungrabbed,grabbed mouse_selection rectangle 621 | 622 | #: Select a word even when grabbed 623 | 624 | # mouse_map shift+left doublepress ungrabbed,grabbed mouse_selection word 625 | 626 | #: Select a line even when grabbed 627 | 628 | # mouse_map shift+left triplepress ungrabbed,grabbed mouse_selection line 629 | 630 | #: Select line from point even when grabbed 631 | 632 | # mouse_map ctrl+shift+alt+left triplepress ungrabbed,grabbed mouse_selection line_from_point 633 | 634 | #:: Select from the clicked point to the end of the line even when 635 | #:: grabbed. 636 | 637 | #: Extend the current selection even when grabbed 638 | 639 | # mouse_map shift+right press ungrabbed,grabbed mouse_selection extend 640 | 641 | #: Show clicked command output in pager 642 | 643 | # mouse_map ctrl+shift+right press ungrabbed mouse_show_command_output 644 | 645 | #:: Requires shell integration 646 | #:: to work. 647 | 648 | #: }}} 649 | 650 | #: }}} 651 | 652 | #: Performance tuning {{{ 653 | 654 | # repaint_delay 10 655 | 656 | #: Delay between screen updates (in milliseconds). Decreasing it, 657 | #: increases frames-per-second (FPS) at the cost of more CPU usage. 658 | #: The default value yields ~100 FPS which is more than sufficient for 659 | #: most uses. Note that to actually achieve 100 FPS, you have to 660 | #: either set sync_to_monitor to no or use a monitor with a high 661 | #: refresh rate. Also, to minimize latency when there is pending input 662 | #: to be processed, this option is ignored. 663 | 664 | # input_delay 3 665 | 666 | #: Delay before input from the program running in the terminal is 667 | #: processed (in milliseconds). Note that decreasing it will increase 668 | #: responsiveness, but also increase CPU usage and might cause flicker 669 | #: in full screen programs that redraw the entire screen on each loop, 670 | #: because kitty is so fast that partial screen updates will be drawn. 671 | 672 | # sync_to_monitor yes 673 | 674 | #: Sync screen updates to the refresh rate of the monitor. This 675 | #: prevents screen tearing 676 | #: when scrolling. 677 | #: However, it limits the rendering speed to the refresh rate of your 678 | #: monitor. With a very high speed mouse/high keyboard repeat rate, 679 | #: you may notice some slight input latency. If so, set this to no. 680 | 681 | #: }}} 682 | 683 | #: Terminal bell {{{ 684 | 685 | # enable_audio_bell yes 686 | 687 | #: The audio bell. Useful to disable it in environments that require 688 | #: silence. 689 | 690 | # visual_bell_duration 0.0 691 | 692 | #: The visual bell duration (in seconds). Flash the screen when a bell 693 | #: occurs for the specified number of seconds. Set to zero to disable. 694 | 695 | # visual_bell_color none 696 | 697 | #: The color used by visual bell. Set to none will fall back to 698 | #: selection background color. If you feel that the visual bell is too 699 | #: bright, you can set it to a darker color. 700 | 701 | # window_alert_on_bell yes 702 | 703 | #: Request window attention on bell. Makes the dock icon bounce on 704 | #: macOS or the taskbar flash on linux. 705 | 706 | # bell_on_tab "🔔 " 707 | 708 | #: Some text or a Unicode symbol to show on the tab if a window in the 709 | #: tab that does not have focus has a bell. If you want to use leading 710 | #: or trailing spaces, surround the text with quotes. See 711 | #: tab_title_template for how this is rendered. 712 | 713 | #: For backwards compatibility, values of yes, y and true are 714 | #: converted to the default bell symbol and no, n, false and none are 715 | #: converted to the empty string. 716 | 717 | # command_on_bell none 718 | 719 | #: Program to run when a bell occurs. The environment variable 720 | #: KITTY_CHILD_CMDLINE can be used to get the program running in the 721 | #: window in which the bell occurred. 722 | 723 | # bell_path none 724 | 725 | #: Path to a sound file to play as the bell sound. If set to none, the 726 | #: system default bell sound is used. Must be in a format supported by 727 | #: the operating systems sound API, such as WAV or OGA on Linux 728 | #: (libcanberra) or AIFF, MP3 or WAV on macOS (NSSound) 729 | 730 | # linux_bell_theme __custom 731 | 732 | #: The XDG Sound Theme kitty will use to play the bell sound. Defaults 733 | #: to the custom theme name used by GNOME and Budgie, falling back to 734 | #: the default freedesktop theme if it does not exist. This option may 735 | #: be removed if Linux ever provides desktop-agnostic support for 736 | #: setting system sound themes. 737 | 738 | #: }}} 739 | 740 | #: Window layout {{{ 741 | 742 | # remember_window_size yes 743 | # initial_window_width 640 744 | # initial_window_height 400 745 | 746 | #: If enabled, the OS Window size will be remembered so that new 747 | #: instances of kitty will have the same size as the previous 748 | #: instance. If disabled, the OS Window will initially have size 749 | #: configured by initial_window_width/height, in pixels. You can use a 750 | #: suffix of "c" on the width/height values to have them interpreted 751 | #: as number of cells instead of pixels. 752 | 753 | # enabled_layouts * 754 | 755 | #: The enabled window layouts. A comma separated list of layout names. 756 | #: The special value all means all layouts. The first listed layout 757 | #: will be used as the startup layout. Default configuration is all 758 | #: layouts in alphabetical order. For a list of available layouts, see 759 | #: the layouts . 760 | 761 | # window_resize_step_cells 2 762 | # window_resize_step_lines 2 763 | 764 | #: The step size (in units of cell width/cell height) to use when 765 | #: resizing kitty windows in a layout with the shortcut 766 | #: start_resizing_window. The cells value is used for horizontal 767 | #: resizing, and the lines value is used for vertical resizing. 768 | 769 | # window_border_width 0.5pt 770 | 771 | #: The width of window borders. Can be either in pixels (px) or pts 772 | #: (pt). Values in pts will be rounded to the nearest number of pixels 773 | #: based on screen resolution. If not specified, the unit is assumed 774 | #: to be pts. Note that borders are displayed only when more than one 775 | #: window is visible. They are meant to separate multiple windows. 776 | 777 | # draw_minimal_borders yes 778 | 779 | #: Draw only the minimum borders needed. This means that only the 780 | #: borders that separate the window from a neighbor are drawn. Note 781 | #: that setting a non-zero window_margin_width overrides this and 782 | #: causes all borders to be drawn. 783 | 784 | # window_margin_width 0 785 | 786 | #: The window margin (in pts) (blank area outside the border). A 787 | #: single value sets all four sides. Two values set the vertical and 788 | #: horizontal sides. Three values set top, horizontal and bottom. Four 789 | #: values set top, right, bottom and left. 790 | 791 | # single_window_margin_width -1 792 | 793 | #: The window margin to use when only a single window is visible (in 794 | #: pts). Negative values will cause the value of window_margin_width 795 | #: to be used instead. A single value sets all four sides. Two values 796 | #: set the vertical and horizontal sides. Three values set top, 797 | #: horizontal and bottom. Four values set top, right, bottom and left. 798 | 799 | # window_padding_width 0 800 | 801 | #: The window padding (in pts) (blank area between the text and the 802 | #: window border). A single value sets all four sides. Two values set 803 | #: the vertical and horizontal sides. Three values set top, horizontal 804 | #: and bottom. Four values set top, right, bottom and left. 805 | 806 | # placement_strategy center 807 | 808 | #: When the window size is not an exact multiple of the cell size, the 809 | #: cell area of the terminal window will have some extra padding on 810 | #: the sides. You can control how that padding is distributed with 811 | #: this option. Using a value of center means the cell area will be 812 | #: placed centrally. A value of top-left means the padding will be 813 | #: only at the bottom and right edges. 814 | 815 | # active_border_color #00ff00 816 | 817 | #: The color for the border of the active window. Set this to none to 818 | #: not draw borders around the active window. 819 | 820 | # inactive_border_color #cccccc 821 | 822 | #: The color for the border of inactive windows. 823 | 824 | # bell_border_color #ff5a00 825 | 826 | #: The color for the border of inactive windows in which a bell has 827 | #: occurred. 828 | 829 | # inactive_text_alpha 1.0 830 | 831 | #: Fade the text in inactive windows by the specified amount (a number 832 | #: between zero and one, with zero being fully faded). 833 | 834 | # hide_window_decorations no 835 | 836 | #: Hide the window decorations (title-bar and window borders) with 837 | #: yes. On macOS, titlebar-only and titlebar-and-corners can be used 838 | #: to only hide the titlebar and the rounded corners. Whether this 839 | #: works and exactly what effect it has depends on the window 840 | #: manager/operating system. Note that the effects of changing this 841 | #: option when reloading config are undefined. When using titlebar- 842 | #: only, it is useful to also set window_margin_width and 843 | #: placement_strategy to prevent the rounded corners from clipping 844 | #: text. Or use titlebar-and-corners. 845 | 846 | # window_logo_path none 847 | 848 | #: Path to a logo image. Must be in PNG format. Relative paths are 849 | #: interpreted relative to the kitty config directory. The logo is 850 | #: displayed in a corner of every kitty window. The position is 851 | #: controlled by window_logo_position. Individual windows can be 852 | #: configured to have different logos either using the launch action 853 | #: or the remote control facility. 855 | 856 | # window_logo_position bottom-right 857 | 858 | #: Where to position the window logo in the window. The value can be 859 | #: one of: top-left, top, top-right, left, center, right, bottom-left, 860 | #: bottom, bottom-right. 861 | 862 | # window_logo_alpha 0.5 863 | 864 | #: The amount the logo should be faded into the background. With zero 865 | #: being fully faded and one being fully opaque. 866 | 867 | # resize_debounce_time 0.1 0.5 868 | 869 | #: The time to wait before redrawing the screen during a live resize 870 | #: of the OS window, when no new resize events have been received, 871 | #: i.e. when resizing is either paused or finished. On platforms such 872 | #: as macOS, where the operating system sends events corresponding to 873 | #: the start and end of a live resize, the second number is used for 874 | #: redraw-after-pause since kitty can distinguish between a pause and 875 | #: end of resizing. On such systems the first number is ignored and 876 | #: redraw is immediate after end of resize. On other systems the 877 | #: first number is used so that kitty is "ready" quickly after the end 878 | #: of resizing, while not also continuously redrawing, to save energy. 879 | 880 | # resize_in_steps no 881 | 882 | #: Resize the OS window in steps as large as the cells, instead of 883 | #: with the usual pixel accuracy. Combined with initial_window_width 884 | #: and initial_window_height in number of cells, this option can be 885 | #: used to keep the margins as small as possible when resizing the OS 886 | #: window. Note that this does not currently work on Wayland. 887 | 888 | # visual_window_select_characters 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 889 | 890 | #: The list of characters for visual window selection. For example, 891 | #: for selecting a window to focus on with focus_visible_window. The 892 | #: value should be a series of unique numbers or alphabets, case 893 | #: insensitive, from the set [0-9A-Z]. Specify your preference as a 894 | #: string of characters. 895 | 896 | # confirm_os_window_close -1 897 | 898 | #: Ask for confirmation when closing an OS window or a tab with at 899 | #: least this number of kitty windows in it by window manager (e.g. 900 | #: clicking the window close button or pressing the operating system 901 | #: shortcut to close windows) or by the close_tab action. A value of 902 | #: zero disables confirmation. This confirmation also applies to 903 | #: requests to quit the entire application (all OS windows, via the 904 | #: quit action). Negative values are converted to positive ones, 905 | #: however, with shell_integration enabled, using negative values 906 | #: means windows sitting at a shell prompt are not counted, only 907 | #: windows where some command is currently running. Note that if you 908 | #: want confirmation when closing individual windows, you can map the 909 | #: close_window_with_confirmation action. 910 | 911 | #: }}} 912 | 913 | #: Tab bar {{{ 914 | 915 | # tab_bar_edge bottom 916 | 917 | #: The edge to show the tab bar on, top or bottom. 918 | 919 | # tab_bar_margin_width 0.0 920 | 921 | #: The margin to the left and right of the tab bar (in pts). 922 | 923 | # tab_bar_margin_height 0.0 0.0 924 | 925 | #: The margin above and below the tab bar (in pts). The first number 926 | #: is the margin between the edge of the OS Window and the tab bar. 927 | #: The second number is the margin between the tab bar and the 928 | #: contents of the current tab. 929 | 930 | # tab_bar_style fade 931 | 932 | #: The tab bar style, can be one of: 933 | 934 | #: fade 935 | #: Each tab's edges fade into the background color. (See also tab_fade) 936 | #: slant 937 | #: Tabs look like the tabs in a physical file. 938 | #: separator 939 | #: Tabs are separated by a configurable separator. (See also 940 | #: tab_separator) 941 | #: powerline 942 | #: Tabs are shown as a continuous line with "fancy" separators. 943 | #: (See also tab_powerline_style) 944 | #: custom 945 | #: A user-supplied Python function called draw_tab is loaded from the file 946 | #: tab_bar.py in the kitty config directory. For examples of how to 947 | #: write such a function, see the functions named draw_tab_with_* in 948 | #: kitty's source code: kitty/tab_bar.py. See also 949 | #: this discussion 950 | #: for examples from kitty users. 951 | #: hidden 952 | #: The tab bar is hidden. If you use this, you might want to create 953 | #: a mapping for the select_tab action which presents you with a list of 954 | #: tabs and allows for easy switching to a tab. 955 | 956 | # tab_bar_align left 957 | 958 | #: The horizontal alignment of the tab bar, can be one of: left, 959 | #: center, right. 960 | 961 | # tab_bar_min_tabs 2 962 | 963 | #: The minimum number of tabs that must exist before the tab bar is 964 | #: shown. 965 | 966 | # tab_switch_strategy previous 967 | 968 | #: The algorithm to use when switching to a tab when the current tab 969 | #: is closed. The default of previous will switch to the last used 970 | #: tab. A value of left will switch to the tab to the left of the 971 | #: closed tab. A value of right will switch to the tab to the right of 972 | #: the closed tab. A value of last will switch to the right-most tab. 973 | 974 | # tab_fade 0.25 0.5 0.75 1 975 | 976 | #: Control how each tab fades into the background when using fade for 977 | #: the tab_bar_style. Each number is an alpha (between zero and one) 978 | #: that controls how much the corresponding cell fades into the 979 | #: background, with zero being no fade and one being full fade. You 980 | #: can change the number of cells used by adding/removing entries to 981 | #: this list. 982 | 983 | # tab_separator " ┇" 984 | 985 | #: The separator between tabs in the tab bar when using separator as 986 | #: the tab_bar_style. 987 | 988 | # tab_powerline_style angled 989 | 990 | #: The powerline separator style between tabs in the tab bar when 991 | #: using powerline as the tab_bar_style, can be one of: angled, 992 | #: slanted, round. 993 | 994 | # tab_activity_symbol none 995 | 996 | #: Some text or a Unicode symbol to show on the tab if a window in the 997 | #: tab that does not have focus has some activity. If you want to use 998 | #: leading or trailing spaces, surround the text with quotes. See 999 | #: tab_title_template for how this is rendered. 1000 | 1001 | # tab_title_max_length 0 1002 | 1003 | #: The maximum number of cells that can be used to render the text in 1004 | #: a tab. A value of zero means that no limit is applied. 1005 | 1006 | # tab_title_template "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}" 1007 | 1008 | #: A template to render the tab title. The default just renders the 1009 | #: title with optional symbols for bell and activity. If you wish to 1010 | #: include the tab-index as well, use something like: {index}:{title}. 1011 | #: Useful if you have shortcuts mapped for goto_tab N. If you prefer 1012 | #: to see the index as a superscript, use {sup.index}. All data 1013 | #: available is: 1014 | 1015 | #: title 1016 | #: The current tab title. 1017 | #: index 1018 | #: The tab index usable with goto_tab N goto_tab shortcuts. 1019 | #: layout_name 1020 | #: The current layout name. 1021 | #: num_windows 1022 | #: The number of windows in the tab. 1023 | #: num_window_groups 1024 | #: The number of window groups (a window group is a window and all of its overlay windows) in the tab. 1025 | #: tab.active_wd 1026 | #: The working directory of the currently active window in the tab 1027 | #: (expensive, requires syscall). Use active_oldest_wd to get 1028 | #: the directory of the oldest foreground process rather than the newest. 1029 | #: tab.active_exe 1030 | #: The name of the executable running in the foreground of the currently 1031 | #: active window in the tab (expensive, requires syscall). Use 1032 | #: active_oldest_exe for the oldest foreground process. 1033 | #: max_title_length 1034 | #: The maximum title length available. 1035 | 1036 | #: Note that formatting is done by Python's string formatting 1037 | #: machinery, so you can use, for instance, {layout_name[:2].upper()} 1038 | #: to show only the first two letters of the layout name, upper-cased. 1039 | #: If you want to style the text, you can use styling directives, for 1040 | #: example: 1041 | #: `{fmt.fg.red}red{fmt.fg.tab}normal{fmt.bg._00FF00}greenbg{fmt.bg.tab}`. 1042 | #: Similarly, for bold and italic: 1043 | #: `{fmt.bold}bold{fmt.nobold}normal{fmt.italic}italic{fmt.noitalic}`. 1044 | #: Note that for backward compatibility, if {bell_symbol} or 1045 | #: {activity_symbol} are not present in the template, they are 1046 | #: prepended to it. 1047 | 1048 | # active_tab_title_template none 1049 | 1050 | #: Template to use for active tabs. If not specified falls back to 1051 | #: tab_title_template. 1052 | 1053 | # active_tab_foreground #000 1054 | # active_tab_background #eee 1055 | # active_tab_font_style bold-italic 1056 | # inactive_tab_foreground #444 1057 | # inactive_tab_background #999 1058 | # inactive_tab_font_style normal 1059 | 1060 | #: Tab bar colors and styles. 1061 | 1062 | # tab_bar_background none 1063 | 1064 | #: Background color for the tab bar. Defaults to using the terminal 1065 | #: background color. 1066 | 1067 | # tab_bar_margin_color none 1068 | 1069 | #: Color for the tab bar margin area. Defaults to using the terminal 1070 | #: background color for margins above and below the tab bar. For side 1071 | #: margins the default color is chosen to match the background color 1072 | #: of the neighboring tab. 1073 | 1074 | #: }}} 1075 | 1076 | #: Color scheme {{{ 1077 | 1078 | # foreground #dddddd 1079 | # background #000000 1080 | 1081 | #: The foreground and background colors. 1082 | 1083 | # background_opacity 1.0 1084 | 1085 | #: The opacity of the background. A number between zero and one, where 1086 | #: one is opaque and zero is fully transparent. This will only work if 1087 | #: supported by the OS (for instance, when using a compositor under 1088 | #: X11). Note that it only sets the background color's opacity in 1089 | #: cells that have the same background color as the default terminal 1090 | #: background, so that things like the status bar in vim, powerline 1091 | #: prompts, etc. still look good. But it means that if you use a color 1092 | #: theme with a background color in your editor, it will not be 1093 | #: rendered as transparent. Instead you should change the default 1094 | #: background color in your kitty config and not use a background 1095 | #: color in the editor color scheme. Or use the escape codes to set 1096 | #: the terminals default colors in a shell script to launch your 1097 | #: editor. Be aware that using a value less than 1.0 is a (possibly 1098 | #: significant) performance hit. When using a low value for this 1099 | #: setting, it is desirable that you set the background color to a 1100 | #: color the matches the general color of the desktop background, for 1101 | #: best text rendering. If you want to dynamically change 1102 | #: transparency of windows, set dynamic_background_opacity to yes 1103 | #: (this is off by default as it has a performance cost). Changing 1104 | #: this option when reloading the config will only work if 1105 | #: dynamic_background_opacity was enabled in the original config. 1106 | 1107 | # background_blur 0 1108 | 1109 | #: Set to a positive value to enable background blur (blurring of the 1110 | #: visuals behind a transparent window) on platforms that support it. 1111 | #: Only takes effect when background_opacity is less than one. On 1112 | #: macOS, this will also control the blur radius (amount of blurring). 1113 | #: Setting it to too high a value will cause severe performance issues 1114 | #: and/or rendering artifacts. Usually, values up to 64 work well. 1115 | #: Note that this might cause performance issues, depending on how the 1116 | #: platform implements it, so use with care. Currently supported on 1117 | #: macOS and KDE/X11. 1118 | 1119 | # background_image none 1120 | 1121 | #: Path to a background image. Must be in PNG format. 1122 | 1123 | # background_image_layout tiled 1124 | 1125 | #: Whether to tile, scale or clamp the background image. The value can 1126 | #: be one of tiled, mirror-tiled, scaled, clamped, centered or 1127 | #: cscaled. The scaled and cscaled values scale the image to the 1128 | #: window size, with cscaled preserving the image aspect ratio. 1129 | 1130 | # background_image_linear no 1131 | 1132 | #: When background image is scaled, whether linear interpolation 1133 | #: should be used. 1134 | 1135 | # dynamic_background_opacity no 1136 | 1137 | #: Allow changing of the background_opacity dynamically, using either 1138 | #: keyboard shortcuts (increase_background_opacity and 1139 | #: decrease_background_opacity) or the remote control facility. 1140 | #: Changing this option by reloading the config is not supported. 1141 | 1142 | # background_tint 0.0 1143 | 1144 | #: How much to tint the background image by the background color. This 1145 | #: option makes it easier to read the text. Tinting is done using the 1146 | #: current background color for each window. This option applies only 1147 | #: if background_opacity is set and transparent windows are supported 1148 | #: or background_image is set. 1149 | 1150 | # background_tint_gaps 1.0 1151 | 1152 | #: How much to tint the background image at the window gaps by the 1153 | #: background color, after applying background_tint. Since this is 1154 | #: multiplicative with background_tint, it can be used to lighten the 1155 | #: tint over the window gaps for a *separated* look. 1156 | 1157 | # dim_opacity 0.4 1158 | 1159 | #: How much to dim text that has the DIM/FAINT attribute set. One 1160 | #: means no dimming and zero means fully dimmed (i.e. invisible). 1161 | 1162 | # selection_foreground #000000 1163 | # selection_background #fffacd 1164 | 1165 | #: The foreground and background colors for text selected with the 1166 | #: mouse. Setting both of these to none will cause a "reverse video" 1167 | #: effect for selections, where the selection will be the cell text 1168 | #: color and the text will become the cell background color. Setting 1169 | #: only selection_foreground to none will cause the foreground color 1170 | #: to be used unchanged. Note that these colors can be overridden by 1171 | #: the program running in the terminal. 1172 | 1173 | #: The color table {{{ 1174 | 1175 | #: The 256 terminal colors. There are 8 basic colors, each color has a 1176 | #: dull and bright version, for the first 16 colors. You can set the 1177 | #: remaining 240 colors as color16 to color255. 1178 | 1179 | # color0 #000000 1180 | # color8 #767676 1181 | 1182 | #: black 1183 | 1184 | # color1 #cc0403 1185 | # color9 #f2201f 1186 | 1187 | #: red 1188 | 1189 | # color2 #19cb00 1190 | # color10 #23fd00 1191 | 1192 | #: green 1193 | 1194 | # color3 #cecb00 1195 | # color11 #fffd00 1196 | 1197 | #: yellow 1198 | 1199 | # color4 #0d73cc 1200 | # color12 #1a8fff 1201 | 1202 | #: blue 1203 | 1204 | # color5 #cb1ed1 1205 | # color13 #fd28ff 1206 | 1207 | #: magenta 1208 | 1209 | # color6 #0dcdcd 1210 | # color14 #14ffff 1211 | 1212 | #: cyan 1213 | 1214 | # color7 #dddddd 1215 | # color15 #ffffff 1216 | 1217 | #: white 1218 | 1219 | # mark1_foreground black 1220 | 1221 | #: Color for marks of type 1 1222 | 1223 | # mark1_background #98d3cb 1224 | 1225 | #: Color for marks of type 1 (light steel blue) 1226 | 1227 | # mark2_foreground black 1228 | 1229 | #: Color for marks of type 2 1230 | 1231 | # mark2_background #f2dcd3 1232 | 1233 | #: Color for marks of type 1 (beige) 1234 | 1235 | # mark3_foreground black 1236 | 1237 | #: Color for marks of type 3 1238 | 1239 | # mark3_background #f274bc 1240 | 1241 | #: Color for marks of type 3 (violet) 1242 | 1243 | #: }}} 1244 | 1245 | #: }}} 1246 | 1247 | #: Advanced {{{ 1248 | 1249 | # shell . 1250 | shell /run/current-system/sw/bin/bash --login 1251 | env SHELL=/run/current-system/sw/bin/bash 1252 | 1253 | 1254 | 1255 | #: The shell program to execute. The default value of . means to use 1256 | #: whatever shell is set as the default shell for the current user. 1257 | #: Note that on macOS if you change this, you might need to add 1258 | #: --login and --interactive to ensure that the shell starts in 1259 | #: interactive mode and reads its startup rc files. 1260 | 1261 | # editor . 1262 | 1263 | #: The terminal based text editor (such as vim or nano) to use when 1264 | #: editing the kitty config file or similar tasks. 1265 | 1266 | #: The default value of . means to use the environment variables 1267 | #: VISUAL and EDITOR in that order. If these variables aren't set, 1268 | #: kitty will run your shell ($SHELL -l -i -c env) to see if your 1269 | #: shell startup rc files set VISUAL or EDITOR. If that doesn't work, 1270 | #: kitty will cycle through various known editors (vim, emacs, etc.) 1271 | #: and take the first one that exists on your system. 1272 | 1273 | # close_on_child_death no 1274 | 1275 | #: Close the window when the child process (shell) exits. With the 1276 | #: default value no, the terminal will remain open when the child 1277 | #: exits as long as there are still processes outputting to the 1278 | #: terminal (for example disowned or backgrounded processes). When 1279 | #: enabled with yes, the window will close as soon as the child 1280 | #: process exits. Note that setting it to yes means that any 1281 | #: background processes still using the terminal can fail silently 1282 | #: because their stdout/stderr/stdin no longer work. 1283 | 1284 | # remote_control_password 1285 | 1286 | #: Allow other programs to control kitty using passwords. This option 1287 | #: can be specified multiple times to add multiple passwords. If no 1288 | #: passwords are present kitty will ask the user for permission if a 1289 | #: program tries to use remote control with a password. A password can 1290 | #: also *optionally* be associated with a set of allowed remote 1291 | #: control actions. For example:: 1292 | 1293 | #: remote_control_password "my passphrase" get-colors set-colors focus-window focus-tab 1294 | 1295 | #: Only the specified actions will be allowed when using this 1296 | #: password. Glob patterns can be used too, for example:: 1297 | 1298 | #: remote_control_password "my passphrase" set-tab-* resize-* 1299 | 1300 | #: To get a list of available actions, run:: 1301 | 1302 | #: kitty @ --help 1303 | 1304 | #: A set of actions to be allowed when no password is sent can be 1305 | #: specified by using an empty password. For example:: 1306 | 1307 | #: remote_control_password "" *-colors 1308 | 1309 | #: Finally, the path to a python module can be specified that provides 1310 | #: a function is_cmd_allowed that is used to check every remote 1311 | #: control command. For example:: 1312 | 1313 | #: remote_control_password "my passphrase" my_rc_command_checker.py 1314 | 1315 | #: Relative paths are resolved from the kitty configuration directory. 1316 | #: See rc_custom_auth for details. 1318 | 1319 | # allow_remote_control no 1320 | 1321 | #: Allow other programs to control kitty. If you turn this on, other 1322 | #: programs can control all aspects of kitty, including sending text 1323 | #: to kitty windows, opening new windows, closing windows, reading the 1324 | #: content of windows, etc. Note that this even works over SSH 1325 | #: connections. The default setting of no prevents any form of remote 1326 | #: control. The meaning of the various values are: 1327 | 1328 | #: password 1329 | #: Remote control requests received over both the TTY device and the socket 1330 | #: are confirmed based on passwords, see remote_control_password. 1331 | 1332 | #: socket-only 1333 | #: Remote control requests received over a socket are accepted 1334 | #: unconditionally. Requests received over the TTY are denied. 1335 | #: See listen_on. 1336 | 1337 | #: socket 1338 | #: Remote control requests received over a socket are accepted 1339 | #: unconditionally. Requests received over the TTY are confirmed based on 1340 | #: password. 1341 | 1342 | #: no 1343 | #: Remote control is completely disabled. 1344 | 1345 | #: yes 1346 | #: Remote control requests are always accepted. 1347 | 1348 | # listen_on none 1349 | 1350 | #: Listen to the specified UNIX socket for remote control connections. 1351 | #: Note that this will apply to all kitty instances. It can be 1352 | #: overridden by the kitty --listen-on command line option, which also 1353 | #: supports listening on a TCP socket. This option accepts only UNIX 1354 | #: sockets, such as unix:${TEMP}/mykitty or unix:@mykitty (on Linux). 1355 | #: Environment variables are expanded and relative paths are resolved 1356 | #: with respect to the temporary directory. If {kitty_pid} is present, 1357 | #: then it is replaced by the PID of the kitty process, otherwise the 1358 | #: PID of the kitty process is appended to the value, with a hyphen. 1359 | #: See the help for kitty --listen-on for more details. Note that this 1360 | #: will be ignored unless allow_remote_control is set to either: yes, 1361 | #: socket or socket-only. Changing this option by reloading the config 1362 | #: is not supported. 1363 | 1364 | # env 1365 | 1366 | #: Specify the environment variables to be set in all child processes. 1367 | #: Using the name with an equal sign (e.g. env VAR=) will set it to 1368 | #: the empty string. Specifying only the name (e.g. env VAR) will 1369 | #: remove the variable from the child process' environment. Note that 1370 | #: environment variables are expanded recursively, for example:: 1371 | 1372 | #: env VAR1=a 1373 | #: env VAR2=${HOME}/${VAR1}/b 1374 | 1375 | #: The value of VAR2 will be /a/b. 1376 | 1377 | # watcher 1378 | 1379 | #: Path to python file which will be loaded for watchers 1380 | #: . Can be 1381 | #: specified more than once to load multiple watchers. The watchers 1382 | #: will be added to every kitty window. Relative paths are resolved 1383 | #: relative to the kitty config directory. Note that reloading the 1384 | #: config will only affect windows created after the reload. 1385 | 1386 | # exe_search_path 1387 | 1388 | #: Control where kitty finds the programs to run. The default search 1389 | #: order is: First search the system wide PATH, then ~/.local/bin and 1390 | #: ~/bin. If still not found, the PATH defined in the login shell 1391 | #: after sourcing all its startup files is tried. Finally, if present, 1392 | #: the PATH specified by the env option is tried. 1393 | 1394 | #: This option allows you to prepend, append, or remove paths from 1395 | #: this search order. It can be specified multiple times for multiple 1396 | #: paths. A simple path will be prepended to the search order. A path 1397 | #: that starts with the + sign will be append to the search order, 1398 | #: after ~/bin above. A path that starts with the - sign will be 1399 | #: removed from the entire search order. For example:: 1400 | 1401 | #: exe_search_path /some/prepended/path 1402 | #: exe_search_path +/some/appended/path 1403 | #: exe_search_path -/some/excluded/path 1404 | 1405 | # update_check_interval 24 1406 | 1407 | #: The interval to periodically check if an update to kitty is 1408 | #: available (in hours). If an update is found, a system notification 1409 | #: is displayed informing you of the available update. The default is 1410 | #: to check every 24 hours, set to zero to disable. Update checking is 1411 | #: only done by the official binary builds. Distro packages or source 1412 | #: builds do not do update checking. Changing this option by reloading 1413 | #: the config is not supported. 1414 | 1415 | # startup_session none 1416 | 1417 | #: Path to a session file to use for all kitty instances. Can be 1418 | #: overridden by using the kitty --session =none command line option 1419 | #: for individual instances. See sessions 1420 | #: in the kitty 1421 | #: documentation for details. Note that relative paths are interpreted 1422 | #: with respect to the kitty config directory. Environment variables 1423 | #: in the path are expanded. Changing this option by reloading the 1424 | #: config is not supported. 1425 | 1426 | # clipboard_control write-clipboard write-primary read-clipboard-ask read-primary-ask 1427 | 1428 | #: Allow programs running in kitty to read and write from the 1429 | #: clipboard. You can control exactly which actions are allowed. The 1430 | #: possible actions are: write-clipboard, read-clipboard, write- 1431 | #: primary, read-primary, read-clipboard-ask, read-primary-ask. The 1432 | #: default is to allow writing to the clipboard and primary selection 1433 | #: and to ask for permission when a program tries to read from the 1434 | #: clipboard. Note that disabling the read confirmation is a security 1435 | #: risk as it means that any program, even the ones running on a 1436 | #: remote server via SSH can read your clipboard. See also 1437 | #: clipboard_max_size. 1438 | 1439 | # clipboard_max_size 512 1440 | 1441 | #: The maximum size (in MB) of data from programs running in kitty 1442 | #: that will be stored for writing to the system clipboard. A value of 1443 | #: zero means no size limit is applied. See also clipboard_control. 1444 | 1445 | # file_transfer_confirmation_bypass 1446 | 1447 | #: The password that can be supplied to the file transfer kitten 1448 | #: to skip the 1449 | #: transfer confirmation prompt. This should only be used when 1450 | #: initiating transfers from trusted computers, over trusted networks 1451 | #: or encrypted transports, as it allows any programs running on the 1452 | #: remote machine to read/write to the local filesystem, without 1453 | #: permission. 1454 | 1455 | # allow_hyperlinks yes 1456 | 1457 | #: Process hyperlink escape sequences (OSC 8). If disabled OSC 8 1458 | #: escape sequences are ignored. Otherwise they become clickable 1459 | #: links, that you can click with the mouse or by using the hints 1460 | #: kitten . The 1461 | #: special value of ask means that kitty will ask before opening the 1462 | #: link when clicked. 1463 | 1464 | shell_integration enabled 1465 | 1466 | #: Enable shell integration on supported shells. This enables features 1467 | #: such as jumping to previous prompts, browsing the output of the 1468 | #: previous command in a pager, etc. on supported shells. Set to 1469 | #: disabled to turn off shell integration, completely. It is also 1470 | #: possible to disable individual features, set to a space separated 1471 | #: list of these values: no-rc, no-cursor, no-title, no-cwd, no- 1472 | #: prompt-mark, no-complete. See Shell integration 1473 | #: for details. 1474 | 1475 | # allow_cloning ask 1476 | 1477 | #: Control whether programs running in the terminal can request new 1478 | #: windows to be created. The canonical example is clone-in-kitty 1479 | #: . 1480 | #: By default, kitty will ask for permission for each clone request. 1481 | #: Allowing cloning unconditionally gives programs running in the 1482 | #: terminal (including over SSH) permission to execute arbitrary code, 1483 | #: as the user who is running the terminal, on the computer that the 1484 | #: terminal is running on. 1485 | 1486 | # clone_source_strategies venv,conda,env_var,path 1487 | 1488 | #: Control what shell code is sourced when running clone-in-kitty in 1489 | #: the newly cloned window. The supported strategies are: 1490 | 1491 | #: venv 1492 | #: Source the file $VIRTUAL_ENV/bin/activate. This is used by the 1493 | #: Python stdlib venv module and allows cloning venvs automatically. 1494 | #: conda 1495 | #: Run conda activate $CONDA_DEFAULT_ENV. This supports the virtual 1496 | #: environments created by conda. 1497 | #: env_var 1498 | #: Execute the contents of the environment variable 1499 | #: KITTY_CLONE_SOURCE_CODE with eval. 1500 | #: path 1501 | #: Source the file pointed to by the environment variable 1502 | #: KITTY_CLONE_SOURCE_PATH. 1503 | 1504 | #: This option must be a comma separated list of the above values. 1505 | #: This only source the first valid one in the above order. 1506 | 1507 | # term xterm-kitty 1508 | 1509 | #: The value of the TERM environment variable to set. Changing this 1510 | #: can break many terminal programs, only change it if you know what 1511 | #: you are doing, not because you read some advice on "Stack Overflow" 1512 | #: to change it. The TERM variable is used by various programs to get 1513 | #: information about the capabilities and behavior of the terminal. If 1514 | #: you change it, depending on what programs you run, and how 1515 | #: different the terminal you are changing it to is, various things 1516 | #: from key-presses, to colors, to various advanced features may not 1517 | #: work. Changing this option by reloading the config will only affect 1518 | #: newly created windows. 1519 | 1520 | #: }}} 1521 | 1522 | #: OS specific tweaks {{{ 1523 | 1524 | # wayland_titlebar_color system 1525 | 1526 | #: The color of the kitty window's titlebar on Wayland systems with 1527 | #: client side window decorations such as GNOME. A value of system 1528 | #: means to use the default system color, a value of background means 1529 | #: to use the background color of the currently active window and 1530 | #: finally you can use an arbitrary color, such as #12af59 or red. 1531 | 1532 | # macos_titlebar_color system 1533 | 1534 | #: The color of the kitty window's titlebar on macOS. A value of 1535 | #: system means to use the default system color, light or dark can 1536 | #: also be used to set it explicitly. A value of background means to 1537 | #: use the background color of the currently active window and finally 1538 | #: you can use an arbitrary color, such as #12af59 or red. WARNING: 1539 | #: This option works by using a hack when arbitrary color (or 1540 | #: background) is configured, as there is no proper Cocoa API for it. 1541 | #: It sets the background color of the entire window and makes the 1542 | #: titlebar transparent. As such it is incompatible with 1543 | #: background_opacity. If you want to use both, you are probably 1544 | #: better off just hiding the titlebar with hide_window_decorations. 1545 | 1546 | # macos_option_as_alt no 1547 | 1548 | #: Use the Option key as an Alt key on macOS. With this set to no, 1549 | #: kitty will use the macOS native Option+Key to enter Unicode 1550 | #: character behavior. This will break any Alt+Key keyboard shortcuts 1551 | #: in your terminal programs, but you can use the macOS Unicode input 1552 | #: technique. You can use the values: left, right or both to use only 1553 | #: the left, right or both Option keys as Alt, instead. Note that 1554 | #: kitty itself always treats Option the same as Alt. This means you 1555 | #: cannot use this option to configure different kitty shortcuts for 1556 | #: Option+Key vs. Alt+Key. Also, any kitty shortcuts using 1557 | #: Option/Alt+Key will take priority, so that any such key presses 1558 | #: will not be passed to terminal programs running inside kitty. 1559 | #: Changing this option by reloading the config is not supported. 1560 | 1561 | # macos_hide_from_tasks no 1562 | 1563 | #: Hide the kitty window from running tasks on macOS (⌘+Tab and the 1564 | #: Dock). Changing this option by reloading the config is not 1565 | #: supported. 1566 | 1567 | # macos_quit_when_last_window_closed no 1568 | 1569 | #: Have kitty quit when all the top-level windows are closed on macOS. 1570 | #: By default, kitty will stay running, even with no open windows, as 1571 | #: is the expected behavior on macOS. 1572 | 1573 | # macos_window_resizable yes 1574 | 1575 | #: Disable this if you want kitty top-level OS windows to not be 1576 | #: resizable on macOS. 1577 | 1578 | # macos_thicken_font 0 1579 | 1580 | #: Draw an extra border around the font with the given width, to 1581 | #: increase legibility at small font sizes on macOS. For example, a 1582 | #: value of 0.75 will result in rendering that looks similar to sub- 1583 | #: pixel antialiasing at common font sizes. Note that in modern kitty, 1584 | #: this option is obsolete (although still supported). Consider using 1585 | #: text_composition_strategy instead. 1586 | 1587 | # macos_traditional_fullscreen no 1588 | 1589 | #: Use the macOS traditional full-screen transition, that is faster, 1590 | #: but less pretty. 1591 | 1592 | # macos_show_window_title_in all 1593 | 1594 | #: Control where the window title is displayed on macOS. A value of 1595 | #: window will show the title of the currently active window at the 1596 | #: top of the macOS window. A value of menubar will show the title of 1597 | #: the currently active window in the macOS global menu bar, making 1598 | #: use of otherwise wasted space. A value of all will show the title 1599 | #: in both places, and none hides the title. See 1600 | #: macos_menubar_title_max_length for how to control the length of the 1601 | #: title in the menu bar. 1602 | 1603 | # macos_menubar_title_max_length 0 1604 | 1605 | #: The maximum number of characters from the window title to show in 1606 | #: the macOS global menu bar. Values less than one means that there is 1607 | #: no maximum limit. 1608 | 1609 | # macos_custom_beam_cursor no 1610 | 1611 | #: Use a custom mouse cursor for macOS that is easier to see on both 1612 | #: light and dark backgrounds. Nowadays, the default macOS cursor 1613 | #: already comes with a white border. WARNING: this might make your 1614 | #: mouse cursor invisible on dual GPU machines. Changing this option 1615 | #: by reloading the config is not supported. 1616 | 1617 | # macos_colorspace srgb 1618 | 1619 | #: The colorspace in which to interpret terminal colors. The default 1620 | #: of srgb will cause colors to match those seen in web browsers. The 1621 | #: value of default will use whatever the native colorspace of the 1622 | #: display is. The value of displayp3 will use Apple's special 1623 | #: snowflake display P3 color space, which will result in over 1624 | #: saturated (brighter) colors with some color shift. Reloading 1625 | #: configuration will change this value only for newly created OS 1626 | #: windows. 1627 | 1628 | # linux_display_server auto 1629 | 1630 | #: Choose between Wayland and X11 backends. By default, an appropriate 1631 | #: backend based on the system state is chosen automatically. Set it 1632 | #: to x11 or wayland to force the choice. Changing this option by 1633 | #: reloading the config is not supported. 1634 | 1635 | #: }}} 1636 | 1637 | #: Keyboard shortcuts {{{ 1638 | 1639 | #: Keys are identified simply by their lowercase Unicode characters. 1640 | #: For example: a for the A key, [ for the left square bracket key, 1641 | #: etc. For functional keys, such as Enter or Escape, the names are 1642 | #: present at Functional key definitions 1643 | #: . 1644 | #: For modifier keys, the names are ctrl (control, ⌃), shift (⇧), alt 1645 | #: (opt, option, ⌥), super (cmd, command, ⌘). See also: GLFW mods 1646 | #: 1647 | 1648 | #: On Linux you can also use XKB key names to bind keys that are not 1649 | #: supported by GLFW. See XKB keys 1650 | #: for a list of key names. The name to use is the part 1652 | #: after the XKB_KEY_ prefix. Note that you can only use an XKB key 1653 | #: name for keys that are not known as GLFW keys. 1654 | 1655 | #: Finally, you can use raw system key codes to map keys, again only 1656 | #: for keys that are not known as GLFW keys. To see the system key 1657 | #: code for a key, start kitty with the kitty --debug-input option, 1658 | #: kitty will output some debug text for every key event. In that text 1659 | #: look for native_code, the value of that becomes the key name in the 1660 | #: shortcut. For example: 1661 | 1662 | #: .. code-block:: none 1663 | 1664 | #: on_key_input: glfw key: 0x61 native_code: 0x61 action: PRESS mods: none text: 'a' 1665 | 1666 | #: Here, the key name for the A key is 0x61 and you can use it with:: 1667 | 1668 | #: map ctrl+0x61 something 1669 | 1670 | #: to map Ctrl+A to something. 1671 | 1672 | #: You can use the special action no_op to unmap a keyboard shortcut 1673 | #: that is assigned in the default configuration:: 1674 | 1675 | #: map kitty_mod+space no_op 1676 | 1677 | #: If you would like kitty to completely ignore a key event, not even 1678 | #: sending it to the program running in the terminal, map it to 1679 | #: discard_event:: 1680 | 1681 | #: map kitty_mod+f1 discard_event 1682 | 1683 | #: You can combine multiple actions to be triggered by a single 1684 | #: shortcut with combine action, using the syntax below:: 1685 | 1686 | #: map key combine action1 action2 action3 ... 1687 | 1688 | #: For example:: 1689 | 1690 | #: map kitty_mod+e combine : new_window : next_layout 1691 | 1692 | #: This will create a new window and switch to the next available 1693 | #: layout. 1694 | 1695 | #: You can use multi-key shortcuts with the syntax shown below:: 1696 | 1697 | #: map key1>key2>key3 action 1698 | 1699 | #: For example:: 1700 | 1701 | #: map ctrl+f>2 set_font_size 20 1702 | 1703 | #: The full list of actions that can be mapped to key presses is 1704 | #: available here . 1705 | 1706 | # kitty_mod ctrl+shift 1707 | 1708 | #: Special modifier key alias for default shortcuts. You can change 1709 | #: the value of this option to alter all default shortcuts that use 1710 | #: kitty_mod. 1711 | 1712 | # clear_all_shortcuts no 1713 | 1714 | #: Remove all shortcut definitions up to this point. Useful, for 1715 | #: instance, to remove the default shortcuts. 1716 | 1717 | # action_alias 1718 | 1719 | #: E.g. action_alias launch_tab launch --type=tab --cwd=current 1720 | 1721 | #: Define action aliases to avoid repeating the same options in 1722 | #: multiple mappings. Aliases can be defined for any action and will 1723 | #: be expanded recursively. For example, the above alias allows you to 1724 | #: create mappings to launch a new tab in the current working 1725 | #: directory without duplication:: 1726 | 1727 | #: map f1 launch_tab vim 1728 | #: map f2 launch_tab emacs 1729 | 1730 | #: Similarly, to alias kitten invocation:: 1731 | 1732 | #: action_alias hints kitten hints --hints-offset=0 1733 | 1734 | # kitten_alias 1735 | 1736 | #: E.g. kitten_alias hints hints --hints-offset=0 1737 | 1738 | #: Like action_alias above, but specifically for kittens. Generally, 1739 | #: prefer to use action_alias. This option is a legacy version, 1740 | #: present for backwards compatibility. It causes all invocations of 1741 | #: the aliased kitten to be substituted. So the example above will 1742 | #: cause all invocations of the hints kitten to have the --hints- 1743 | #: offset=0 option applied. 1744 | 1745 | #: Clipboard {{{ 1746 | 1747 | #: Copy to clipboard 1748 | 1749 | # map kitty_mod+c copy_to_clipboard 1750 | # map cmd+c copy_to_clipboard 1751 | 1752 | #:: There is also a copy_or_interrupt action that can be optionally 1753 | #:: mapped to Ctrl+C. It will copy only if there is a selection and 1754 | #:: send an interrupt otherwise. Similarly, 1755 | #:: copy_and_clear_or_interrupt will copy and clear the selection or 1756 | #:: send an interrupt if there is no selection. 1757 | 1758 | #: Paste from clipboard 1759 | 1760 | # map kitty_mod+v paste_from_clipboard 1761 | # map cmd+v paste_from_clipboard 1762 | 1763 | #: Paste from selection 1764 | 1765 | # map kitty_mod+s paste_from_selection 1766 | # map shift+insert paste_from_selection 1767 | 1768 | #: Pass selection to program 1769 | 1770 | # map kitty_mod+o pass_selection_to_program 1771 | 1772 | #:: You can also pass the contents of the current selection to any 1773 | #:: program with pass_selection_to_program. By default, the system's 1774 | #:: open program is used, but you can specify your own, the selection 1775 | #:: will be passed as a command line argument to the program. For 1776 | #:: example:: 1777 | 1778 | #:: map kitty_mod+o pass_selection_to_program firefox 1779 | 1780 | #:: You can pass the current selection to a terminal program running 1781 | #:: in a new kitty window, by using the @selection placeholder:: 1782 | 1783 | #:: map kitty_mod+y new_window less @selection 1784 | 1785 | #: }}} 1786 | 1787 | #: Scrolling {{{ 1788 | 1789 | #: Scroll line up 1790 | 1791 | # map kitty_mod+up scroll_line_up 1792 | # map kitty_mod+k scroll_line_up 1793 | # map opt+cmd+page_up scroll_line_up 1794 | # map cmd+up scroll_line_up 1795 | 1796 | #: Scroll line down 1797 | 1798 | # map kitty_mod+down scroll_line_down 1799 | # map kitty_mod+j scroll_line_down 1800 | # map opt+cmd+page_down scroll_line_down 1801 | # map cmd+down scroll_line_down 1802 | 1803 | #: Scroll page up 1804 | 1805 | # map kitty_mod+page_up scroll_page_up 1806 | # map cmd+page_up scroll_page_up 1807 | 1808 | #: Scroll page down 1809 | 1810 | # map kitty_mod+page_down scroll_page_down 1811 | # map cmd+page_down scroll_page_down 1812 | 1813 | #: Scroll to top 1814 | 1815 | # map kitty_mod+home scroll_home 1816 | # map cmd+home scroll_home 1817 | 1818 | #: Scroll to bottom 1819 | 1820 | # map kitty_mod+end scroll_end 1821 | # map cmd+end scroll_end 1822 | 1823 | #: Scroll to previous shell prompt 1824 | 1825 | # map kitty_mod+z scroll_to_prompt -1 1826 | 1827 | #:: Use a parameter of 0 for scroll_to_prompt to scroll to the last 1828 | #:: jumped to or the last clicked position. Requires shell 1829 | #:: integration 1830 | #:: to work. 1831 | 1832 | #: Scroll to next shell prompt 1833 | 1834 | # map kitty_mod+x scroll_to_prompt 1 1835 | 1836 | #: Browse scrollback buffer in pager 1837 | 1838 | # map kitty_mod+h show_scrollback 1839 | 1840 | #:: You can pipe the contents of the current screen and history 1841 | #:: buffer as STDIN to an arbitrary program using launch --stdin- 1842 | #:: source. For example, the following opens the scrollback buffer in 1843 | #:: less in an overlay window:: 1844 | 1845 | #:: map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay less +G -R 1846 | 1847 | #:: For more details on piping screen and buffer contents to external 1848 | #:: programs, see launch . 1849 | 1850 | #: Browse output of the last shell command in pager 1851 | 1852 | # map kitty_mod+g show_last_command_output 1853 | 1854 | #:: You can also define additional shortcuts to get the command 1855 | #:: output. For example, to get the first command output on screen:: 1856 | 1857 | #:: map f1 show_first_command_output_on_screen 1858 | 1859 | #:: To get the command output that was last accessed by a keyboard 1860 | #:: action or mouse action:: 1861 | 1862 | #:: map f1 show_last_visited_command_output 1863 | 1864 | #:: You can pipe the output of the last command run in the shell 1865 | #:: using the launch action. For example, the following opens the 1866 | #:: output in less in an overlay window:: 1867 | 1868 | #:: map f1 launch --stdin-source=@last_cmd_output --stdin-add-formatting --type=overlay less +G -R 1869 | 1870 | #:: To get the output of the first command on the screen, use 1871 | #:: @first_cmd_output_on_screen. To get the output of the last jumped 1872 | #:: to command, use @last_visited_cmd_output. 1873 | 1874 | #:: Requires shell integration 1875 | #:: to work. 1876 | 1877 | #: }}} 1878 | 1879 | #: Window management {{{ 1880 | 1881 | #: New window 1882 | 1883 | # map kitty_mod+enter new_window 1884 | # map cmd+enter new_window 1885 | 1886 | #:: You can open a new kitty window running an arbitrary program, for 1887 | #:: example:: 1888 | 1889 | #:: map kitty_mod+y launch mutt 1890 | 1891 | #:: You can open a new window with the current working directory set 1892 | #:: to the working directory of the current window using:: 1893 | 1894 | #:: map ctrl+alt+enter launch --cwd=current 1895 | 1896 | #:: You can open a new window that is allowed to control kitty via 1897 | #:: the kitty remote control facility with launch --allow-remote- 1898 | #:: control. Any programs running in that window will be allowed to 1899 | #:: control kitty. For example:: 1900 | 1901 | #:: map ctrl+enter launch --allow-remote-control some_program 1902 | 1903 | #:: You can open a new window next to the currently active window or 1904 | #:: as the first window, with:: 1905 | 1906 | #:: map ctrl+n launch --location=neighbor 1907 | #:: map ctrl+f launch --location=first 1908 | 1909 | #:: For more details, see launch 1910 | #:: . 1911 | 1912 | #: New OS window 1913 | 1914 | # map kitty_mod+n new_os_window 1915 | # map cmd+n new_os_window 1916 | 1917 | #:: Works like new_window above, except that it opens a top-level OS 1918 | #:: window. In particular you can use new_os_window_with_cwd to open 1919 | #:: a window with the current working directory. 1920 | 1921 | #: Close window 1922 | 1923 | # map kitty_mod+w close_window 1924 | # map shift+cmd+d close_window 1925 | 1926 | #: Next window 1927 | 1928 | # map kitty_mod+] next_window 1929 | 1930 | #: Previous window 1931 | 1932 | # map kitty_mod+[ previous_window 1933 | 1934 | #: Move window forward 1935 | 1936 | # map kitty_mod+f move_window_forward 1937 | 1938 | #: Move window backward 1939 | 1940 | # map kitty_mod+b move_window_backward 1941 | 1942 | #: Move window to top 1943 | 1944 | # map kitty_mod+` move_window_to_top 1945 | 1946 | #: Start resizing window 1947 | 1948 | # map kitty_mod+r start_resizing_window 1949 | # map cmd+r start_resizing_window 1950 | 1951 | #: First window 1952 | 1953 | # map kitty_mod+1 first_window 1954 | # map cmd+1 first_window 1955 | 1956 | #: Second window 1957 | 1958 | # map kitty_mod+2 second_window 1959 | # map cmd+2 second_window 1960 | 1961 | #: Third window 1962 | 1963 | # map kitty_mod+3 third_window 1964 | # map cmd+3 third_window 1965 | 1966 | #: Fourth window 1967 | 1968 | # map kitty_mod+4 fourth_window 1969 | # map cmd+4 fourth_window 1970 | 1971 | #: Fifth window 1972 | 1973 | # map kitty_mod+5 fifth_window 1974 | # map cmd+5 fifth_window 1975 | 1976 | #: Sixth window 1977 | 1978 | # map kitty_mod+6 sixth_window 1979 | # map cmd+6 sixth_window 1980 | 1981 | #: Seventh window 1982 | 1983 | # map kitty_mod+7 seventh_window 1984 | # map cmd+7 seventh_window 1985 | 1986 | #: Eighth window 1987 | 1988 | # map kitty_mod+8 eighth_window 1989 | # map cmd+8 eighth_window 1990 | 1991 | #: Ninth window 1992 | 1993 | # map kitty_mod+9 ninth_window 1994 | # map cmd+9 ninth_window 1995 | 1996 | #: Tenth window 1997 | 1998 | # map kitty_mod+0 tenth_window 1999 | 2000 | #: Visually select and focus window 2001 | 2002 | # map kitty_mod+f7 focus_visible_window 2003 | 2004 | #:: Display overlay numbers and alphabets on the window, and switch 2005 | #:: the focus to the window when you press the key. When there are 2006 | #:: only two windows, the focus will be switched directly without 2007 | #:: displaying the overlay. You can change the overlay characters and 2008 | #:: their order with option visual_window_select_characters. 2009 | 2010 | #: Visually swap window with another 2011 | 2012 | # map kitty_mod+f8 swap_with_window 2013 | 2014 | #:: Works like focus_visible_window above, but swaps the window. 2015 | 2016 | #: }}} 2017 | 2018 | #: Tab management {{{ 2019 | 2020 | #: Next tab 2021 | 2022 | # map kitty_mod+right next_tab 2023 | # map shift+cmd+] next_tab 2024 | # map ctrl+tab next_tab 2025 | map ctrl+page_down next_tab 2026 | map cmd+opt+right next_tab 2027 | 2028 | #: Previous tab 2029 | 2030 | # map kitty_mod+left previous_tab 2031 | # map shift+cmd+[ previous_tab 2032 | # map ctrl+shift+tab previous_tab 2033 | map ctrl+page_up previous_tab 2034 | map cmd+opt+left previous_tab 2035 | 2036 | #: New tab 2037 | 2038 | # map kitty_mod+t new_tab 2039 | # map cmd+t new_tab 2040 | 2041 | #: Close tab 2042 | 2043 | # map kitty_mod+q close_tab 2044 | # map cmd+w close_tab 2045 | 2046 | #: Close OS window 2047 | 2048 | # map shift+cmd+w close_os_window 2049 | 2050 | #: Move tab forward 2051 | 2052 | # map kitty_mod+. move_tab_forward 2053 | 2054 | #: Move tab backward 2055 | 2056 | # map kitty_mod+, move_tab_backward 2057 | 2058 | #: Set tab title 2059 | 2060 | # map kitty_mod+alt+t set_tab_title 2061 | # map shift+cmd+i set_tab_title 2062 | 2063 | 2064 | #: You can also create shortcuts to go to specific tabs, with 1 being 2065 | #: the first tab, 2 the second tab and -1 being the previously active 2066 | #: tab, and any number larger than the last tab being the last tab:: 2067 | 2068 | #: map ctrl+alt+1 goto_tab 1 2069 | #: map ctrl+alt+2 goto_tab 2 2070 | 2071 | #: Just as with new_window above, you can also pass the name of 2072 | #: arbitrary commands to run when using new_tab and new_tab_with_cwd. 2073 | #: Finally, if you want the new tab to open next to the current tab 2074 | #: rather than at the end of the tabs list, use:: 2075 | 2076 | #: map ctrl+t new_tab !neighbor [optional cmd to run] 2077 | #: }}} 2078 | 2079 | #: Layout management {{{ 2080 | 2081 | #: Next layout 2082 | 2083 | # map kitty_mod+l next_layout 2084 | 2085 | 2086 | #: You can also create shortcuts to switch to specific layouts:: 2087 | 2088 | #: map ctrl+alt+t goto_layout tall 2089 | #: map ctrl+alt+s goto_layout stack 2090 | 2091 | #: Similarly, to switch back to the previous layout:: 2092 | 2093 | #: map ctrl+alt+p last_used_layout 2094 | 2095 | #: There is also a toggle_layout action that switches to the named 2096 | #: layout or back to the previous layout if in the named layout. 2097 | #: Useful to temporarily "zoom" the active window by switching to the 2098 | #: stack layout:: 2099 | 2100 | #: map ctrl+alt+z toggle_layout stack 2101 | #: }}} 2102 | 2103 | #: Font sizes {{{ 2104 | 2105 | #: You can change the font size for all top-level kitty OS windows at 2106 | #: a time or only the current one. 2107 | 2108 | #: Increase font size 2109 | 2110 | # map kitty_mod+equal change_font_size all +2.0 2111 | # map kitty_mod+plus change_font_size all +2.0 2112 | # map kitty_mod+kp_add change_font_size all +2.0 2113 | # map cmd+plus change_font_size all +2.0 2114 | # map cmd+equal change_font_size all +2.0 2115 | # map shift+cmd+equal change_font_size all +2.0 2116 | 2117 | #: Decrease font size 2118 | 2119 | # map kitty_mod+minus change_font_size all -2.0 2120 | # map kitty_mod+kp_subtract change_font_size all -2.0 2121 | # map cmd+minus change_font_size all -2.0 2122 | # map shift+cmd+minus change_font_size all -2.0 2123 | 2124 | #: Reset font size 2125 | 2126 | # map kitty_mod+backspace change_font_size all 0 2127 | # map cmd+0 change_font_size all 0 2128 | 2129 | 2130 | #: To setup shortcuts for specific font sizes:: 2131 | 2132 | #: map kitty_mod+f6 change_font_size all 10.0 2133 | 2134 | #: To setup shortcuts to change only the current OS window's font 2135 | #: size:: 2136 | 2137 | #: map kitty_mod+f6 change_font_size current 10.0 2138 | #: }}} 2139 | 2140 | #: Select and act on visible text {{{ 2141 | 2142 | #: Use the hints kitten to select text and either pass it to an 2143 | #: external program or insert it into the terminal or copy it to the 2144 | #: clipboard. 2145 | 2146 | #: Open URL 2147 | 2148 | # map kitty_mod+e open_url_with_hints 2149 | 2150 | #:: Open a currently visible URL using the keyboard. The program used 2151 | #:: to open the URL is specified in open_url_with. 2152 | 2153 | #: Insert selected path 2154 | 2155 | # map kitty_mod+p>f kitten hints --type path --program - 2156 | 2157 | #:: Select a path/filename and insert it into the terminal. Useful, 2158 | #:: for instance to run git commands on a filename output from a 2159 | #:: previous git command. 2160 | 2161 | #: Open selected path 2162 | 2163 | # map kitty_mod+p>shift+f kitten hints --type path 2164 | 2165 | #:: Select a path/filename and open it with the default open program. 2166 | 2167 | #: Insert selected line 2168 | 2169 | # map kitty_mod+p>l kitten hints --type line --program - 2170 | 2171 | #:: Select a line of text and insert it into the terminal. Useful for 2172 | #:: the output of things like: `ls -1`. 2173 | 2174 | #: Insert selected word 2175 | 2176 | # map kitty_mod+p>w kitten hints --type word --program - 2177 | 2178 | #:: Select words and insert into terminal. 2179 | 2180 | #: Insert selected hash 2181 | 2182 | # map kitty_mod+p>h kitten hints --type hash --program - 2183 | 2184 | #:: Select something that looks like a hash and insert it into the 2185 | #:: terminal. Useful with git, which uses SHA1 hashes to identify 2186 | #:: commits. 2187 | 2188 | #: Open the selected file at the selected line 2189 | 2190 | # map kitty_mod+p>n kitten hints --type linenum 2191 | 2192 | #:: Select something that looks like filename:linenum and open it in 2193 | #:: vim at the specified line number. 2194 | 2195 | #: Open the selected hyperlink 2196 | 2197 | # map kitty_mod+p>y kitten hints --type hyperlink 2198 | 2199 | #:: Select a hyperlink (i.e. a URL that has been marked as such by 2200 | #:: the terminal program, for example, by `ls --hyperlink=auto`). 2201 | 2202 | 2203 | #: The hints kitten has many more modes of operation that you can map 2204 | #: to different shortcuts. For a full description see hints kitten 2205 | #: . 2206 | #: }}} 2207 | 2208 | #: Miscellaneous {{{ 2209 | 2210 | #: Show documentation 2211 | 2212 | # map kitty_mod+f1 show_kitty_doc overview 2213 | 2214 | #: Toggle fullscreen 2215 | 2216 | # map kitty_mod+f11 toggle_fullscreen 2217 | # map ctrl+cmd+f toggle_fullscreen 2218 | 2219 | #: Toggle maximized 2220 | 2221 | # map kitty_mod+f10 toggle_maximized 2222 | 2223 | #: Toggle macOS secure keyboard entry 2224 | 2225 | # map opt+cmd+s toggle_macos_secure_keyboard_entry 2226 | 2227 | #: Unicode input 2228 | 2229 | # map kitty_mod+u kitten unicode_input 2230 | # map ctrl+cmd+space kitten unicode_input 2231 | 2232 | #: Edit config file 2233 | 2234 | # map kitty_mod+f2 edit_config_file 2235 | # map cmd+, edit_config_file 2236 | 2237 | #: Open the kitty command shell 2238 | 2239 | # map kitty_mod+escape kitty_shell window 2240 | 2241 | #:: Open the kitty shell in a new window / tab / overlay / os_window 2242 | #:: to control kitty using commands. 2243 | 2244 | #: Increase background opacity 2245 | 2246 | # map kitty_mod+a>m set_background_opacity +0.1 2247 | 2248 | #: Decrease background opacity 2249 | 2250 | # map kitty_mod+a>l set_background_opacity -0.1 2251 | 2252 | #: Make background fully opaque 2253 | 2254 | # map kitty_mod+a>1 set_background_opacity 1 2255 | 2256 | #: Reset background opacity 2257 | 2258 | # map kitty_mod+a>d set_background_opacity default 2259 | 2260 | #: Reset the terminal 2261 | 2262 | # map kitty_mod+delete clear_terminal reset active 2263 | # map opt+cmd+r clear_terminal reset active 2264 | 2265 | #:: You can create shortcuts to clear/reset the terminal. For 2266 | #:: example:: 2267 | 2268 | #:: # Reset the terminal 2269 | #:: map f1 clear_terminal reset active 2270 | #:: # Clear the terminal screen by erasing all contents 2271 | #:: map f1 clear_terminal clear active 2272 | #:: # Clear the terminal scrollback by erasing it 2273 | #:: map f1 clear_terminal scrollback active 2274 | #:: # Scroll the contents of the screen into the scrollback 2275 | #:: map f1 clear_terminal scroll active 2276 | #:: # Clear everything up to the line with the cursor 2277 | #:: map f1 clear_terminal to_cursor active 2278 | 2279 | #:: If you want to operate on all kitty windows instead of just the 2280 | #:: current one, use all instead of active. 2281 | 2282 | #:: Some useful functions that can be defined in the shell rc files 2283 | #:: to perform various kinds of clearing of the current window: 2284 | 2285 | #:: .. code-block:: sh 2286 | 2287 | #:: clear-only-screen() { 2288 | #:: printf "\e[H\e[2J" 2289 | #:: } 2290 | 2291 | #:: clear-screen-and-scrollback() { 2292 | #:: printf "\e[H\e[3J" 2293 | #:: } 2294 | 2295 | #:: clear-screen-saving-contents-in-scrollback() { 2296 | #:: printf "\e[H\e[22J" 2297 | #:: } 2298 | 2299 | #:: For instance, using these escape codes, it is possible to remap 2300 | #:: Ctrl+L to both scroll the current screen contents into the 2301 | #:: scrollback buffer and clear the screen, instead of just clearing 2302 | #:: the screen. For ZSH, in ~/.zshrc, add: 2303 | 2304 | #:: .. code-block:: zsh 2305 | 2306 | #:: ctrl_l() { 2307 | #:: builtin print -rn -- $'\r\e[0J\e[H\e[22J' >"$TTY" 2308 | #:: builtin zle .reset-prompt 2309 | #:: builtin zle -R 2310 | #:: } 2311 | #:: zle -N ctrl_l 2312 | #:: bindkey '^l' ctrl_l 2313 | 2314 | #: Clear up to cursor line 2315 | 2316 | # map cmd+k clear_terminal to_cursor active 2317 | 2318 | #: Reload kitty.conf 2319 | 2320 | # map kitty_mod+f5 load_config_file 2321 | # map ctrl+cmd+, load_config_file 2322 | 2323 | #:: Reload kitty.conf, applying any changes since the last time it 2324 | #:: was loaded. Note that a handful of options cannot be dynamically 2325 | #:: changed and require a full restart of kitty. Particularly, when 2326 | #:: changing shortcuts for actions located on the macOS global menu 2327 | #:: bar, a full restart is needed. You can also map a keybinding to 2328 | #:: load a different config file, for example:: 2329 | 2330 | #:: map f5 load_config /path/to/alternative/kitty.conf 2331 | 2332 | #:: Note that all options from the original kitty.conf are discarded, 2333 | #:: in other words the new configuration *replace* the old ones. 2334 | 2335 | #: Debug kitty configuration 2336 | 2337 | # map kitty_mod+f6 debug_config 2338 | # map opt+cmd+, debug_config 2339 | 2340 | #:: Show details about exactly what configuration kitty is running 2341 | #:: with and its host environment. Useful for debugging issues. 2342 | 2343 | #: Send arbitrary text on key presses 2344 | 2345 | #:: E.g. map ctrl+shift+alt+h send_text all Hello World 2346 | 2347 | #:: You can tell kitty to send arbitrary (UTF-8) encoded text to the 2348 | #:: client program when pressing specified shortcut keys. For 2349 | #:: example:: 2350 | 2351 | #:: map ctrl+alt+a send_text all Special text 2352 | 2353 | #:: This will send "Special text" when you press the Ctrl+Alt+A key 2354 | #:: combination. The text to be sent decodes ANSI C escapes 2355 | #:: so you can use escapes like \e to send control 2357 | #:: codes or \u21fb to send Unicode characters (or you can just input 2358 | #:: the Unicode characters directly as UTF-8 text). You can use 2359 | #:: `kitty +kitten show_key` to get the key escape codes you want to 2360 | #:: emulate. 2361 | 2362 | #:: The first argument to send_text is the keyboard modes in which to 2363 | #:: activate the shortcut. The possible values are normal, 2364 | #:: application, kitty or a comma separated combination of them. The 2365 | #:: modes normal and application refer to the DECCKM cursor key mode 2366 | #:: for terminals, and kitty refers to the kitty extended keyboard 2367 | #:: protocol. The special value all means all of them. 2368 | 2369 | #:: Some more examples:: 2370 | 2371 | #:: # Output a word and move the cursor to the start of the line (like typing and pressing Home) 2372 | #:: map ctrl+alt+a send_text normal Word\e[H 2373 | #:: map ctrl+alt+a send_text application Word\eOH 2374 | #:: # Run a command at a shell prompt (like typing the command and pressing Enter) 2375 | #:: map ctrl+alt+a send_text normal,application some command with arguments\r 2376 | 2377 | #: Open kitty Website 2378 | 2379 | # map shift+cmd+/ open_url https://sw.kovidgoyal.net/kitty/ 2380 | 2381 | #: Hide macOS kitty application 2382 | 2383 | # map cmd+h hide_macos_app 2384 | 2385 | #: Hide macOS other applications 2386 | 2387 | # map opt+cmd+h hide_macos_other_apps 2388 | 2389 | #: Minimize macOS window 2390 | 2391 | # map cmd+m minimize_macos_window 2392 | 2393 | #: Quit kitty 2394 | 2395 | # map cmd+q quit 2396 | 2397 | #: }}} 2398 | 2399 | #: }}} 2400 | 2401 | 2402 | share_connections yes 2403 | clipboard_control write-clipboard write-primary read-clipboard read-primary 2404 | --------------------------------------------------------------------------------