commit 39f93a2901df8632a46de47a3333c315b5390a7d Author: Ricky Cousins Date: Mon May 26 07:39:19 2025 +0300 init diff --git a/.config/foot/foot.ini b/.config/foot/foot.ini new file mode 100644 index 0000000..d6a85d4 --- /dev/null +++ b/.config/foot/foot.ini @@ -0,0 +1,180 @@ +# -*- conf -*- +# include=/usr/share/foot/themes/gruvbox-dark + + +# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) +# term=foot (or xterm-256color if built with -Dterminfo=disabled) +# login-shell=no +#font=RobotoMono Nerd Font:size=14 +font=Firacode Nerd Font:size=14 +#font=JetBrainsMonoNL-Regular:size=14 +# font-bold= +# font-italic= +# font-bold-italic= +# line-height= +# letter-spacing=0 +# horizontal-letter-offset=0 +# vertical-letter-offset=0 +# underline-offset= +# box-drawings-uses-font-glyphs=no +# dpi-aware=yes + +# initial-window-size-pixels=700x500# Or, +# initial-window-size-chars= +# initial-window-mode=windowed +pad=5x5 # optionally append 'center' +resize-delay-ms=50 + +# notify=notify-send -a ${app-id} -i ${app-id} ${title} ${body} + +# bold-text-in-bright=no +# bell=none +# word-delimiters=,│`|:"'()[]{}<> +# selection-target=primary +# workers= + +[bell] +# urgent=no +# notify=no +# command= +# command-focused=no + +[scrollback] +lines=10000 +# multiplier=3.0 +# indicator-position=relative +# indicator-format= + +[url] +# launch=xdg-open ${url} +# label-letters=sadfjklewcmpgh +# osc8-underline=url-mode +# protocols = http, https, ftp, ftps, file, gemini, gopher + +[cursor] +# style=block +color= 141a1b eeeeee +# blink=no +# beam-thickness=1.5 +# underline-thickness= + +[mouse] +# hide-when-typing=no +# alternate-scroll-mode=yes + +[colors] +alpha=0.7 +foreground=cdd6f4 # Text +background=1e1e2e # Base +regular0=45475a # Surface 1 +regular1=f38ba8 # red +regular2=a6e3a1 # green +regular3=f9e2af # yellow +regular4=89b4fa # blue +regular5=f5c2e7 # pink +regular6=94e2d5 # teal +regular7=bac2de # Subtext 1 +bright0=585b70 # Surface 2 +bright1=f38ba8 # red +bright2=a6e3a1 # green +bright3=f9e2af # yellow +bright4=89b4fa # blue +bright5=f5c2e7 # pink +bright6=94e2d5 # teal +bright7=a6adc8 # Subtext 0 + +#[colors] +#alpha=0.8 +#foreground=eeeeee +#background=141a1b +#regular0=141a1B # black +#regular1=cd3f45 # red +#regular2=9fca56 # green +#regular3=e6cd69 # yellow +#regular4=16a085 # blue +#regular5=a074c4 # magenta +#regular6=55b5db # cyan +#regular7=d6d6d6 # white +#bright0=41535B # bright black +#bright1=cd3f45 # red +#bright2=9fca56 # green +#bright3=e6cd69 # yellow +#bright4=16a085 # blue +#bright5=a074c4 # magenta +#bright6=55b5db # cyan +#bright7=ffffff # bright white +# 16 = <256-color palette #16> +# ... +# 255 = <256-color palette #255> +# selection-foreground= +# selection-background= +# jump-labels= +# urls= + +[csd] +# preferred=server +# size=26 +# color= +# button-width=26 +# button-color= +# button-minimize-color= +# button-maximize-color= +# button-close-color= + +[key-bindings] +# scrollback-up-page=Shift+Page_Up +# scrollback-up-half-page=none +# scrollback-up-line=none +# scrollback-down-page=Shift+Page_Down +# scrollback-down-half-page=none +# scrollback-down-line=none +# clipboard-copy=Control+Shift+c +# clipboard-paste=Control+Shift+v +# primary-paste=Shift+Insert +# search-start=Control+Shift+r +# font-increase=Control+plus Control+equal Control+KP_Add +# font-decrease=Control+minus Control+KP_Subtract +# font-reset=Control+0 Control+KP_0 +# spawn-terminal=Control+Shift+n +# minimize=none +# maximize=none +# fullscreen=none +# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-selected=[xargs -r firefox] none +# show-urls-launch=Control+Shift+u +# show-urls-copy=none + +[search-bindings] +# cancel=Control+g Escape +# commit=Return +# find-prev=Control+r +# find-next=Control+s +# cursor-left=Left Control+b +# cursor-left-word=Control+Left Mod1+b +# cursor-right=Right Control+f +# cursor-right-word=Control+Right Mod1+f +# cursor-home=Home Control+a +# cursor-end=End Control+e +# delete-prev=BackSpace +# delete-prev-word=Mod1+BackSpace Control+BackSpace +# delete-next=Delete +# delete-next-word=Mod1+d Control+Delete +# extend-to-word-boundary=Control+w +# extend-to-next-whitespace=Control+Shift+w +# clipboard-paste=Control+v Control+y +# primary-paste=Shift+Insert + +[url-bindings] +# cancel=Control+g Control+d Escape +# toggle-url-visible=t + +[mouse-bindings] +# primary-paste=BTN_MIDDLE +# select-begin=BTN_LEFT +# select-begin-block=Control+BTN_LEFT +# select-extend=BTN_RIGHT +# select-extend-character-wise=Control+BTN_RIGHT +# select-word=BTN_LEFT-2 +# select-word-whitespace=Control+BTN_LEFT-2 +# select-row=BTN_LEFT-3 diff --git a/.config/nvim/.session.vim b/.config/nvim/.session.vim new file mode 100644 index 0000000..919972f --- /dev/null +++ b/.config/nvim/.session.vim @@ -0,0 +1,90 @@ +let SessionLoad = 1 +let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=-1 siso=-1 +let v:this_session=expand(":p") +silent only +silent tabonly +cd ~/.config/nvim +if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == '' + let s:wipebuf = bufnr('%') +endif +let s:shortmess_save = &shortmess +if &shortmess =~ 'A' + set shortmess=aoOA +else + set shortmess=aoO +endif +badd +98 lua/core/keymaps.lua +argglobal +%argdel +$argadd lua/core/keymaps.lua +edit lua/core/keymaps.lua +let s:save_splitbelow = &splitbelow +let s:save_splitright = &splitright +set splitbelow splitright +wincmd _ | wincmd | +vsplit +1wincmd h +wincmd w +let &splitbelow = s:save_splitbelow +let &splitright = s:save_splitright +wincmd t +let s:save_winminheight = &winminheight +let s:save_winminwidth = &winminwidth +set winminheight=0 +set winheight=1 +set winminwidth=0 +set winwidth=1 +exe 'vert 1resize ' . ((&columns * 40 + 94) / 189) +exe 'vert 2resize ' . ((&columns * 148 + 94) / 189) +argglobal +enew +file neo-tree\ filesystem\ \[1] +balt lua/core/keymaps.lua +setlocal foldmethod=manual +setlocal foldexpr=0 +setlocal foldmarker={{{,}}} +setlocal foldignore=# +setlocal foldlevel=0 +setlocal foldminlines=1 +setlocal foldnestmax=20 +setlocal foldenable +wincmd w +argglobal +setlocal foldmethod=manual +setlocal foldexpr=v:lua.vim.treesitter.foldexpr() +setlocal foldmarker={{{,}}} +setlocal foldignore=# +setlocal foldlevel=0 +setlocal foldminlines=1 +setlocal foldnestmax=20 +setlocal foldenable +silent! normal! zE +let &fdl = &fdl +let s:l = 113 - ((34 * winheight(0) + 21) / 42) +if s:l < 1 | let s:l = 1 | endif +keepjumps exe s:l +normal! zt +keepjumps 113 +normal! 049| +wincmd w +2wincmd w +exe 'vert 1resize ' . ((&columns * 40 + 94) / 189) +exe 'vert 2resize ' . ((&columns * 148 + 94) / 189) +tabnext 1 +if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal' + silent exe 'bwipe ' . s:wipebuf +endif +unlet! s:wipebuf +set winheight=1 winwidth=20 +let &shortmess = s:shortmess_save +let &winminheight = s:save_winminheight +let &winminwidth = s:save_winminwidth +let s:sx = expand(":p:r")."x.vim" +if filereadable(s:sx) + exe "source " . fnameescape(s:sx) +endif +let &g:so = s:so_save | let &g:siso = s:siso_save +nohlsearch +doautoall SessionLoadPost +unlet SessionLoad +" vim: set ft=vim : diff --git a/.config/nvim/.stylua.toml b/.config/nvim/.stylua.toml new file mode 100644 index 0000000..90b7ca5 --- /dev/null +++ b/.config/nvim/.stylua.toml @@ -0,0 +1,6 @@ +column_width = 160 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferSingle" +#call_parentheses = "None" diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..c97e065 --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,36 @@ +require 'core.options' +require 'core.keymaps' + +-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info +local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = 'https://github.com/folke/lazy.nvim.git' + local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } + if vim.v.shell_error ~= 0 then + error('Error cloning lazy.nvim:\n' .. out) + end +end + +vim.opt.rtp:prepend(lazypath) + +require('lazy').setup { + require 'plugins.neotree', + require 'plugins.colortheme', + require 'plugins.bufferline', + require 'plugins.lualine', + require 'plugins.treesitter', + require 'plugins.telescope', + require 'plugins.lsp', + require 'plugins.autocomplete', + require 'plugins.none-ls', + require 'plugins.rustaceanvim', + require 'plugins.gitsigns', + require 'plugins.alpha', + require 'plugins.indent-blankline', + require 'plugins.vim-tmux-navigator', + require 'plugins.lazygit', + require 'plugins.harpoon', + require 'plugins.toggleterm', + require 'plugins.misc', + require 'plugins.cheatsheet', +} diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..6061699 --- /dev/null +++ b/.config/nvim/lazy-lock.json @@ -0,0 +1,51 @@ +{ + "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, + "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, + "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "everforest-nvim": { "branch": "main", "commit": "2eb7c348f880ba93de4d98cae049c9441f5d4d49" }, + "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "gitsigns.nvim": { "branch": "main", "commit": "8b729e489f1475615dc6c9737da917b3bc163605" }, + "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, + "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazygit.nvim": { "branch": "main", "commit": "b9eae3badab982e71abab96d3ee1d258f0c07961" }, + "lualine.nvim": { "branch": "master", "commit": "0c6cca9f2c63dadeb9225c45bc92bb95a151d4af" }, + "marks.nvim": { "branch": "master", "commit": "f353e8c08c50f39e99a9ed474172df7eddd89b72" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "3856bbb0da214d1f2f3d5a2dd3fea26591f930f9" }, + "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "75d60a8f928decd8b38897f80849768b7c540a5b" }, + "mason.nvim": { "branch": "main", "commit": "9eaedb864cdadc29c6eb7d761a6c0d8aee26c91b" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, + "none-ls-extras.nvim": { "branch": "main", "commit": "924fe88a9983c7d90dbb31fc4e3129a583ea0a90" }, + "none-ls.nvim": { "branch": "main", "commit": "90e4a27ccaa25979a6b732b9f06dfa43b54957b7" }, + "nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" }, + "nvcheatsheet.nvim": { "branch": "master", "commit": "618850d2a14ac82f8d9bc560cce923d728e7424a" }, + "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, + "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, + "nvim-lspconfig": { "branch": "master", "commit": "562487bc108bf73c2493f9e701b9334b48163216" }, + "nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "0f051e9813a36481f48ca1f833897210dbcfffde" }, + "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, + "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, + "nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" }, + "rustaceanvim": { "branch": "master", "commit": "1e1106492f7e4512642603db34e542c938ad579c" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, + "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, + "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, + "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, + "vim-bbye": { "branch": "master", "commit": "25ef93ac5a87526111f43e5110675032dbcacf56" }, + "vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" }, + "vim-rhubarb": { "branch": "master", "commit": "386daa2e9d98e23e27ad089afcbe5c5a903e488d" }, + "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, + "vim-tmux-navigator": { "branch": "master", "commit": "0ecda542c0bd3ea26444044c7f03e469a6bb0bff" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } +} diff --git a/.config/nvim/lua/core/keymaps.lua b/.config/nvim/lua/core/keymaps.lua new file mode 100644 index 0000000..08789cc --- /dev/null +++ b/.config/nvim/lua/core/keymaps.lua @@ -0,0 +1,123 @@ +-- Set leader key +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' + +-- For conciseness +local opts = { noremap = true, silent = true } + +-- Disable the spacebar key's default behavior in Normal and Visual modes +vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) + +-- Allow moving the cursor through wrapped lines with j, k +vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) +vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) + +-- clear highlights +vim.keymap.set('n', '', ':noh', opts) + +-- save file +vim.keymap.set('n', '', ' w ', opts) + +-- save file without auto-formatting +vim.keymap.set('n', 'sn', 'noautocmd w ', opts) + +-- quit file +vim.keymap.set('n', '', ' q ', opts) + +-- delete single character without copying into register +vim.keymap.set('n', 'x', '"_x', opts) + +-- Vertical scroll and center +vim.keymap.set('n', '', 'zz', opts) +vim.keymap.set('n', '', 'zz', opts) + +-- Find and center +vim.keymap.set('n', 'n', 'nzzzv') +vim.keymap.set('n', 'N', 'Nzzzv') + +-- Resize with arrows +vim.keymap.set('n', '', ':resize -2', opts) +vim.keymap.set('n', '', ':resize +2', opts) +vim.keymap.set('n', '', ':vertical resize -2', opts) +vim.keymap.set('n', '', ':vertical resize +2', opts) + +-- Buffers +vim.keymap.set('n', '', ':bnext', opts) +vim.keymap.set('n', '', ':bprevious', opts) +vim.keymap.set('n', 'x', ':Bdelete!', opts) -- close buffer +vim.keymap.set('n', 'b', ' enew ', opts) -- new buffer + +-- Increment/decrement numbers +vim.keymap.set('n', '+', '', opts) -- increment +vim.keymap.set('n', '-', '', opts) -- decrement + +-- Window management +vim.keymap.set('n', 'v', 'v', opts) -- split window vertically +vim.keymap.set('n', 'h', 's', opts) -- split window horizontally +vim.keymap.set('n', 'se', '=', opts) -- make split windows equal width & height +vim.keymap.set('n', 'xs', ':close', opts) -- close current split window + +-- Navigate between splits +vim.keymap.set('n', '', ':wincmd k', opts) +vim.keymap.set('n', '', ':wincmd j', opts) +vim.keymap.set('n', '', ':wincmd h', opts) +vim.keymap.set('n', '', ':wincmd l', opts) + +-- Tabs +vim.keymap.set('n', 'to', ':tabnew', opts) -- open new tab +vim.keymap.set('n', 'tx', ':tabclose', opts) -- close current tab +vim.keymap.set('n', 'tn', ':tabn', opts) -- go to next tab +vim.keymap.set('n', 'tp', ':tabp', opts) -- go to previous tab + +-- Toggle line wrapping +vim.keymap.set('n', 'lw', 'set wrap!', opts) + +-- Press jk fast to exit insert mode +vim.keymap.set('i', 'jk', '', opts) +vim.keymap.set('i', 'kj', '', opts) + +-- Stay in indent mode +vim.keymap.set('v', '<', '', '>gv', opts) + +-- Move text up and down +vim.keymap.set('v', '', ':m .+1==', opts) +vim.keymap.set('v', '', ':m .-2==', opts) + +-- Keep last yanked when pasting +vim.keymap.set('v', 'p', '"_dP', opts) + +-- Replace word under cursor +vim.keymap.set('n', 'j', '*``cgn', opts) + +-- Explicitly yank to system clipboard (highlighted and entire row) +vim.keymap.set({ 'n', 'v' }, 'y', [["+y]]) +vim.keymap.set('n', 'Y', [["+Y]]) + +-- Toggle diagnostics +local diagnostics_active = true + +vim.keymap.set('n', 'do', function() + diagnostics_active = not diagnostics_active + + if diagnostics_active then + vim.diagnostic.enable(0) + else + vim.diagnostic.disable(0) + end +end) + +-- Diagnostic keymaps +vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) +vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) +vim.keymap.set('n', 'd', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) + +-- Save and load session +vim.keymap.set('n', 'ss', ':mksession! .session.vim', { noremap = true, silent = false }) +vim.keymap.set('n', 'sl', ':source .session.vim', { noremap = true, silent = false }) + +-- Lazygit +vim.keymap.set('n', 'gg', ':LazyGit', opts) +-- Exit terminal mode +vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) diff --git a/.config/nvim/lua/core/options.lua b/.config/nvim/lua/core/options.lua new file mode 100644 index 0000000..be454d0 --- /dev/null +++ b/.config/nvim/lua/core/options.lua @@ -0,0 +1,43 @@ +vim.o.hlsearch = false -- Set highlight on search +vim.wo.number = true -- Make line numbers default +vim.o.mouse = 'a' -- Enable mouse mode +vim.o.clipboard = 'unnamedplus' -- Sync clipboard between OS and Neovim. +vim.o.breakindent = true -- Enable break indent +vim.o.undofile = true -- Save undo history +vim.o.ignorecase = true -- Case-insensitive searching UNLESS \C or capital in search +vim.o.smartcase = true -- smart case +vim.wo.signcolumn = 'yes' -- Keep signcolumn on by default +vim.o.updatetime = 250 -- Decrease update time +vim.o.timeoutlen = 300 -- time to wait for a mapped sequence to complete (in milliseconds) +vim.o.backup = false -- creates a backup file +vim.o.writebackup = false -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited +vim.o.completeopt = 'menuone,noselect' -- Set completeopt to have a better completion experience +vim.opt.termguicolors = true -- set termguicolors to enable highlight groups +vim.o.whichwrap = 'bs<>[]hl' -- which "horizontal" keys are allowed to travel to prev/next line +vim.o.wrap = false -- display lines as one long line +vim.o.linebreak = true -- companion to wrap don't split words +vim.o.scrolloff = 4 -- minimal number of screen lines to keep above and below the cursor +vim.o.sidescrolloff = 8 -- minimal number of screen columns either side of cursor if wrap is `false` +vim.o.relativenumber = false -- set relative numbered lines +vim.o.numberwidth = 4 -- set number column width to 2 {default 4} +vim.o.shiftwidth = 4 -- the number of spaces inserted for each indentation +vim.o.tabstop = 4 -- insert n spaces for a tab +vim.o.softtabstop = 4 -- Number of spaces that a tab counts for while performing editing operations +vim.o.expandtab = true -- convert tabs to spaces +vim.o.cursorline = false -- highlight the current line +vim.o.splitbelow = true -- force all horizontal splits to go below current window +vim.o.splitright = true -- force all vertical splits to go to the right of current window +vim.o.swapfile = false -- creates a swapfile +vim.o.smartindent = true -- make indenting smarter again +vim.o.showmode = false -- we don't need to see things like -- INSERT -- anymore +vim.o.showtabline = 2 -- always show tabs +vim.o.backspace = 'indent,eol,start' -- allow backspace on +vim.o.pumheight = 10 -- pop up menu height +vim.o.conceallevel = 0 -- so that `` is visible in markdown files +vim.o.fileencoding = 'utf-8' -- the encoding written to a file +vim.o.cmdheight = 1 -- more space in the neovim command line for displaying messages +vim.o.autoindent = true -- copy indent from current line when starting new one +vim.opt.shortmess:append('c') -- don't give |ins-completion-menu| messages +vim.opt.iskeyword:append('-') -- hyphenated words recognized by searches +vim.opt.formatoptions:remove({ 'c', 'r', 'o' }) -- don't insert the current comment leader automatically for auto-wrapping comments using 'textwidth', hitting in insert mode, or hitting 'o' or 'O' in normal mode. +vim.opt.runtimepath:remove('/usr/share/vim/vimfiles') -- separate vim plugins from neovim in case vim still in use diff --git a/.config/nvim/lua/plugins/alpha.lua b/.config/nvim/lua/plugins/alpha.lua new file mode 100644 index 0000000..0a065dc --- /dev/null +++ b/.config/nvim/lua/plugins/alpha.lua @@ -0,0 +1,24 @@ +return { + "goolord/alpha-nvim", + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + + config = function() + local alpha = require("alpha") + local dashboard = require("alpha.themes.startify") + + dashboard.section.header.val = { + [[ ]], + [[ ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ]], + [[ ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ]], + [[ ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ]], + [[ ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ]], + [[ ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ]], + [[ ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ]], + [[ ]], + } + + alpha.setup(dashboard.opts) + end, +} diff --git a/.config/nvim/lua/plugins/autocomplete.lua b/.config/nvim/lua/plugins/autocomplete.lua new file mode 100644 index 0000000..20b99ae --- /dev/null +++ b/.config/nvim/lua/plugins/autocomplete.lua @@ -0,0 +1,143 @@ +return { -- Autocompletion + 'hrsh7th/nvim-cmp', + -- event = 'InsertEnter', + dependencies = { + -- Snippet Engine & its associated nvim-cmp source + { + 'L3MON4D3/LuaSnip', + build = (function() + -- Build Step is needed for regex support in snippets + -- This step is not supported in many windows environments + -- Remove the below condition to re-enable on windows + if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then + return + end + return 'make install_jsregexp' + end)(), + }, + 'saadparwaiz1/cmp_luasnip', + + -- Adds other completion capabilities. + -- nvim-cmp does not ship with all sources by default. They are split + -- into multiple repos for maintenance purposes. + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-path', + + -- Adds a number of user-friendly snippets + 'rafamadriz/friendly-snippets', + }, + config = function() + local cmp = require 'cmp' + require('luasnip.loaders.from_vscode').lazy_load() + local luasnip = require 'luasnip' + luasnip.config.setup {} + + local kind_icons = { + Text = '󰉿', + Method = 'm', + Function = '󰊕', + Constructor = '', + Field = '', + Variable = '󰆧', + Class = '󰌗', + Interface = '', + Module = '', + Property = '', + Unit = '', + Value = '󰎠', + Enum = '', + Keyword = '󰌋', + Snippet = '', + Color = '󰏘', + File = '󰈙', + Reference = '', + Folder = '󰉋', + EnumMember = '', + Constant = '󰇽', + Struct = '', + Event = '', + Operator = '󰆕', + TypeParameter = '󰊄', + } + + cmp.setup { + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + completion = { completeopt = 'menu,menuone,noinsert' }, + -- window = { + -- completion = cmp.config.window.bordered(), + -- documentation = cmp.config.window.bordered(), + -- }, + mapping = cmp.mapping.preset.insert { + [''] = cmp.mapping.select_next_item(), -- Select the [n]ext item + [''] = cmp.mapping.select_prev_item(), -- Select the [p]revious item + [''] = cmp.mapping.confirm { select = true }, -- Accept the completion with Enter. + [''] = cmp.mapping.complete {}, -- Manually trigger a completion from nvim-cmp. + + -- Think of as moving to the right of your snippet expansion. + -- So if you have a snippet that's like: + -- function $name($args) + -- $body + -- end + -- + -- will move you to the right of each of the expansion locations. + -- is similar, except moving you backwards. + [''] = cmp.mapping(function() + if luasnip.expand_or_locally_jumpable() then + luasnip.expand_or_jump() + end + end, { 'i', 's' }), + [''] = cmp.mapping(function() + if luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + end + end, { 'i', 's' }), + + -- Select next/previous item with Tab / Shift + Tab + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_locally_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { 'i', 's' }), + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { 'i', 's' }), + }, + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'buffer' }, + { name = 'path' }, + }, + formatting = { + fields = { 'kind', 'abbr', 'menu' }, + format = function(entry, vim_item) + -- Kind icons + vim_item.kind = string.format('%s', kind_icons[vim_item.kind]) + -- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind + vim_item.menu = ({ + nvim_lsp = '[LSP]', + luasnip = '[Snippet]', + buffer = '[Buffer]', + path = '[Path]', + })[entry.source.name] + return vim_item + end, + }, + } + end, +} diff --git a/.config/nvim/lua/plugins/bufferline.lua b/.config/nvim/lua/plugins/bufferline.lua new file mode 100644 index 0000000..968096d --- /dev/null +++ b/.config/nvim/lua/plugins/bufferline.lua @@ -0,0 +1,81 @@ +return { + 'akinsho/bufferline.nvim', + dependencies = { + 'moll/vim-bbye', + 'nvim-tree/nvim-web-devicons', + }, + config = function() + -- vim.opt.linespace = 8 + + require('bufferline').setup { + options = { + mode = 'buffers', -- set to "tabs" to only show tabpages instead + themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default + numbers = 'none', -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string, + close_command = 'Bdelete! %d', -- can be a string | function, see "Mouse actions" + right_mouse_command = 'Bdelete! %d', -- can be a string | function, see "Mouse actions" + left_mouse_command = 'buffer %d', -- can be a string | function, see "Mouse actions" + middle_mouse_command = nil, -- can be a string | function, see "Mouse actions" + -- buffer_close_icon = '󰅖', + buffer_close_icon = '✗', + -- buffer_close_icon = '✕', + close_icon = '', + path_components = 1, -- Show only the file name without the directory + modified_icon = '●', + left_trunc_marker = '', + right_trunc_marker = '', + max_name_length = 30, + max_prefix_length = 30, -- prefix used when a buffer is de-duplicated + tab_size = 21, + diagnostics = false, + diagnostics_update_in_insert = false, + color_icons = true, + show_buffer_icons = true, + show_buffer_close_icons = true, + show_close_icon = true, + persist_buffer_sort = true, -- whether or not custom sorted buffers should persist + separator_style = { '│', '│' }, -- | "thick" | "thin" | { 'any', 'any' }, + enforce_regular_tabs = true, + always_show_bufferline = true, + show_tab_indicators = false, + indicator = { + -- icon = '▎', -- this should be omitted if indicator style is not 'icon' + style = 'none', -- Options: 'icon', 'underline', 'none' + }, + icon_pinned = '󰐃', + minimum_padding = 1, + maximum_padding = 5, + maximum_length = 15, + sort_by = 'insert_at_end', + }, + highlights = { + separator = { + fg = '#434C5E', + }, + buffer_selected = { + bold = true, + italic = false, + }, + -- separator_selected = {}, + -- tab_selected = {}, + -- background = {}, + -- indicator_selected = {}, + -- fill = {}, + }, + } + + -- Keymaps + local opts = { noremap = true, silent = true, desc = 'Go to Buffer' } + -- vim.keymap.set("n", "", "BufferLineCycleNext", {}) + -- vim.keymap.set("n", "", "BufferLineCyclePrev", {}) + -- vim.keymap.set('n', '1', "lua require('bufferline').go_to_buffer(1)", opts) + -- vim.keymap.set('n', '2', "lua require('bufferline').go_to_buffer(2)", opts) + -- vim.keymap.set('n', '3', "lua require('bufferline').go_to_buffer(3)", opts) + -- vim.keymap.set('n', '4', "lua require('bufferline').go_to_buffer(4)", opts) + -- vim.keymap.set('n', '5', "lua require('bufferline').go_to_buffer(5)", opts) + -- vim.keymap.set('n', '6', "lua require('bufferline').go_to_buffer(6)", opts) + -- vim.keymap.set('n', '7', "lua require('bufferline').go_to_buffer(7)", opts) + -- vim.keymap.set('n', '8', "lua require('bufferline').go_to_buffer(8)", opts) + -- vim.keymap.set('n', '9', "lua require('bufferline').go_to_buffer(9)", opts) + end, +} diff --git a/.config/nvim/lua/plugins/cheatsheet.lua b/.config/nvim/lua/plugins/cheatsheet.lua new file mode 100644 index 0000000..319ca48 --- /dev/null +++ b/.config/nvim/lua/plugins/cheatsheet.lua @@ -0,0 +1,53 @@ +local opts = { + -- TODO: Actually setup cheatsheet. This is just an example. + header = { + ' ', + ' ', + ' ', + '█▀▀ █░█ █▀▀ ▄▀█ ▀█▀ █▀ █░█ █▀▀ █▀▀ ▀█▀', + '█▄▄ █▀█ ██▄ █▀█ ░█░ ▄█ █▀█ ██▄ ██▄ ░█░', + ' ', + ' ', + ' ', + }, + -- Example keymaps (this doesn't create any) + keymaps = { + ['Oil'] = { + { 'Toggle oil (closes without saving)', 'q' }, + { 'Select entry', '⏎' }, + { 'Select entry', 'l' }, + { 'Go to parent', 'h' }, + { 'Open vertical split', '⌃v' }, + { 'Open horizontal split', '⌃x' }, + { 'Go to current working directory', '.' }, + }, + ['Cmp'] = { + { 'Select entry', '⌃f' }, + { 'Next result - Jump to next snippet placeholder', '⌃n' }, + { 'Previous result - Jump to previous snippet placeholder', '⌃p' }, + { 'Scroll up in preview', '⌃u' }, + { 'Scroll down in preview', '⌃d' }, + { 'Abort autocompletion', '⌃e' }, + }, + ['Comment'] = { + { 'Comment line toggle', 'gcc' }, + { 'Comment block toggle', 'gbc' }, + { 'Comment visual selection', 'gc' }, + { 'Comment visual selection using block delimiters', 'gb' }, + { 'Comment out text object line wise', 'gc' }, + { 'Comment out text object block wise', 'gb' }, + { 'Add comment on the line above', 'gcO' }, + { 'Add comment on the line below', 'gco' }, + { 'Add comment at the end of line', 'gcA' }, + }, + }, +} + +return { + 'smartinellimarco/nvcheatsheet.nvim', + config = function() + local cheatsheet = require('nvcheatsheet') + cheatsheet.setup(opts) + vim.keymap.set('n', '', cheatsheet.toggle) + end, +} diff --git a/.config/nvim/lua/plugins/colortheme.lua b/.config/nvim/lua/plugins/colortheme.lua new file mode 100644 index 0000000..9557e58 --- /dev/null +++ b/.config/nvim/lua/plugins/colortheme.lua @@ -0,0 +1,15 @@ +return { +"neanias/everforest-nvim", + version = false, + lazy = false, + priority = 1000, -- make sure to load this before all the other start plugins + -- Optional; default configuration will be used if setup isn't called. + config = function() + local everforest = require("everforest") + everforest.setup({ + transparent_background_level = 1, + -- Your config here + }) + everforest.load() + end, +} diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..c1b0c90 --- /dev/null +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,21 @@ +-- Adds git related signs to the gutter, as well as utilities for managing changes +return { + "lewis6991/gitsigns.nvim", + opts = { + -- See `:help gitsigns.txt` + signs = { + add = { text = "+" }, + change = { text = "~" }, + delete = { text = "_" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + }, + signs_staged = { + add = { text = "+" }, + change = { text = "~" }, + delete = { text = "_" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/harpoon.lua b/.config/nvim/lua/plugins/harpoon.lua new file mode 100644 index 0000000..e7887b2 --- /dev/null +++ b/.config/nvim/lua/plugins/harpoon.lua @@ -0,0 +1,67 @@ +return { + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local harpoon = require("harpoon") + harpoon:setup({}) + + -- -- Use Telescope as a UI + -- local conf = require('telescope.config').values + -- local function toggle_telescope(harpoon_files) + -- local file_paths = {} + -- for _, item in ipairs(harpoon_files.items) do + -- table.insert(file_paths, item.value) + -- end + -- + -- require('telescope.pickers') + -- .new({}, { + -- prompt_title = 'Harpoon', + -- finder = require('telescope.finders').new_table { + -- results = file_paths, + -- }, + -- previewer = conf.file_previewer {}, + -- sorter = conf.generic_sorter {}, + -- }) + -- :find() + -- end + -- + -- vim.keymap.set('n', 'M', function() + -- toggle_telescope(harpoon:list()) + -- end, { desc = 'Open harpoon window' }) + + -- Default UI + vim.keymap.set("n", "M", function() + harpoon.ui:toggle_quick_menu(harpoon:list()) + end) + + vim.keymap.set("n", "m", function() + harpoon:list():add() + end) + + vim.keymap.set("n", "1", function() + harpoon:list():select(1) + end) + + vim.keymap.set("n", "2", function() + harpoon:list():select(2) + end) + + vim.keymap.set("n", "3", function() + harpoon:list():select(3) + end) + + vim.keymap.set("n", "4", function() + harpoon:list():select(4) + end) + + -- Toggle previous & next buffers stored within Harpoon list + vim.keymap.set("n", "p", function() + harpoon:list():prev() + end) + + vim.keymap.set("n", "n", function() + harpoon:list():next() + end) + end, +} diff --git a/.config/nvim/lua/plugins/indent-blankline.lua b/.config/nvim/lua/plugins/indent-blankline.lua new file mode 100644 index 0000000..c91d3d2 --- /dev/null +++ b/.config/nvim/lua/plugins/indent-blankline.lua @@ -0,0 +1,25 @@ +return { + "lukas-reineke/indent-blankline.nvim", + main = "ibl", + opts = { + indent = { + char = "▏", + }, + scope = { + show_start = false, + show_end = false, + show_exact_scope = false, + }, + exclude = { + filetypes = { + "help", + "startify", + "dashboard", + "packer", + "neogitstatus", + "NvimTree", + "Trouble", + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/lazygit.lua b/.config/nvim/lua/plugins/lazygit.lua new file mode 100644 index 0000000..255b60c --- /dev/null +++ b/.config/nvim/lua/plugins/lazygit.lua @@ -0,0 +1,33 @@ +return { + "kdheepak/lazygit.nvim", + cmd = { + "LazyGit", + "LazyGitConfig", + "LazyGitCurrentFile", + "LazyGitFilter", + "LazyGitFilterCurrentFile", + }, + -- optional for floating window border decoration + dependencies = { + "nvim-lua/plenary.nvim", + }, + -- setting the keybinding for LazyGit with 'keys' is recommended in + -- order to load the plugin when the command is run for the first time + keys = { + -- Run LazyGit command and set background to transparent + { + "lg", + "LazyGithi LazyGitFloat guibg=NONE guifg=NONEsetlocal winhl=NormalFloat:LazyGitFloat", + desc = "LazyGit", + }, + }, + config = function() + vim.g.lazygit_floating_window_winblend = 0 -- transparency of floating window (0-100) + vim.g.lazygit_floating_window_scaling_factor = 0.9 -- scaling factor for floating window + vim.g.lazygit_floating_window_border_chars = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" } -- customize lazygit popup window border characters + vim.g.lazygit_floating_window_use_plenary = 0 -- use plenary.nvim to manage floating window if available + vim.g.lazygit_use_neovim_remote = 1 -- fallback to 0 if neovim-remote is not installed + vim.g.lazygit_use_custom_config_file_path = 0 -- config file path is evaluated if this value is 1 + vim.g.lazygit_config_file_path = {} -- table of custom config file paths + end, +} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..1a48bab --- /dev/null +++ b/.config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,247 @@ +return { -- LSP Configuration & Plugins + "neovim/nvim-lspconfig", + dependencies = { + -- Automatically install LSPs and related tools to stdpath for neovim + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "WhoIsSethDaniel/mason-tool-installer.nvim", + "hrsh7th/nvim-cmp", + "hrsh7th/cmp-nvim-lsp", + + -- Useful status updates for LSP. + -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` + { + "j-hui/fidget.nvim", + tag = "v1.4.0", + opts = { + progress = { + display = { + done_icon = "✓", -- Icon shown when all LSP progress tasks are complete + }, + }, + notification = { + window = { + winblend = 0, -- Background color opacity in the notification window + }, + }, + }, + }, + }, + config = function() + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("lsp-attach", { clear = true }), + -- Create a function that lets us more easily define mappings specific LSP related items. + -- It sets the mode, buffer and description for us each time. + callback = function(event) + local map = function(keys, func, desc) + vim.keymap.set("n", keys, func, { buffer = event.buf, desc = "LSP: " .. desc }) + end + + -- Jump to the definition of the word under your cursor. + -- This is where a variable was first declared, or where a function is defined, etc. + -- To jump back, press . + map("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition") + + -- Find references for the word under your cursor. + map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences") + + -- Jump to the implementation of the word under your cursor. + -- Useful when your language has ways of declaring types without an actual implementation. + map("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation") + + -- Jump to the type of the word under your cursor. + -- Useful when you're not sure what type a variable is and you want to see + -- the definition of its *type*, not where it was *defined*. + map("D", require("telescope.builtin").lsp_type_definitions, "Type [D]efinition") + + -- Fuzzy find all the symbols in your current document. + -- Symbols are things like variables, functions, types, etc. + map("ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols") + + -- Fuzzy find all the symbols in your current workspace + -- Similar to document symbols, except searches over your whole project. + map("ws", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols") + + -- Rename the variable under your cursor + -- Most Language Servers support renaming across files, etc. + map("rn", vim.lsp.buf.rename, "[R]e[n]ame") + + -- Execute a code action, usually your cursor needs to be on top of an error + -- or a suggestion from your LSP for this to activate. + map("ca", vim.lsp.buf.code_action, "[C]ode [A]ction") + + -- Opens a popup that displays documentation about the word under your cursor + -- See `:help K` for why this keymap + map("K", vim.lsp.buf.hover, "Hover Documentation") + + -- WARN: This is not Goto Definition, this is Goto Declaration. + -- For example, in C this would take you to the header + map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration") + + map("wa", vim.lsp.buf.add_workspace_folder, "[W]orkspace [A]dd Folder") + map("wr", vim.lsp.buf.remove_workspace_folder, "[W]orkspace [R]emove Folder") + map("wl", function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, "[W]orkspace [L]ist Folders") + + -- The following two autocommands are used to highlight references of the + -- word under your cursor when your cursor rests there for a little while. + -- See `:help CursorHold` for information about when this is executed + -- + -- When you move your cursor, the highlights will be cleared (the second autocommand). + local client = vim.lsp.get_client_by_id(event.data.client_id) + if client and client.server_capabilities.documentHighlightProvider then + vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { + buffer = event.buf, + callback = vim.lsp.buf.document_highlight, + }) + + vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, { + buffer = event.buf, + callback = vim.lsp.buf.clear_references, + }) + end + end, + }) + + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities()) + + -- Enable the following language servers + local servers = { + lua_ls = { + -- cmd = {...}, + -- filetypes { ...}, + -- capabilities = {}, + settings = { + Lua = { + runtime = { version = "LuaJIT" }, + workspace = { + checkThirdParty = false, + -- Tells lua_ls where to find all the Lua files that you have loaded + -- for your neovim configuration. + library = { + "${3rd}/luv/library", + unpack(vim.api.nvim_get_runtime_file("", true)), + }, + -- If lua_ls is really slow on your computer, you can try this instead: + -- library = { vim.env.VIMRUNTIME }, + }, + completion = { + callSnippet = "Replace", + }, + telemetry = { enable = false }, + diagnostics = { disable = { "missing-fields" } }, + }, + }, + }, + pylsp = { + settings = { + pylsp = { + plugins = { + pyflakes = { enabled = false }, + pycodestyle = { enabled = false }, + autopep8 = { enabled = false }, + yapf = { enabled = false }, + mccabe = { enabled = false }, + pylsp_mypy = { enabled = false }, + pylsp_black = { enabled = false }, + pylsp_isort = { enabled = false }, + }, + }, + }, + }, + puppet = { + cmd = { "puppet-languageserver", "--stdio" }, + filetypes = { "puppet" }, + root_markers = { + "manifests", + ".puppet-lint.rc", + "hiera.yaml", + ".git", + }, + }, + -- basedpyright = { + -- -- Config options: https://github.com/DetachHead/basedpyright/blob/main/docs/settings.md + -- settings = { + -- basedpyright = { + -- disableOrganizeImports = true, -- Using Ruff's import organizer + -- disableLanguageServices = false, + -- analysis = { + -- ignore = { '*' }, -- Ignore all files for analysis to exclusively use Ruff for linting + -- typeCheckingMode = 'off', + -- diagnosticMode = 'openFilesOnly', -- Only analyze open files + -- useLibraryCodeForTypes = true, + -- autoImportCompletions = true, -- whether pyright offers auto-import completions + -- }, + -- }, + -- }, + -- }, + ruff = { + -- Notes on code actions: https://github.com/astral-sh/ruff-lsp/issues/119#issuecomment-1595628355 + -- Get isort like behavior: https://github.com/astral-sh/ruff/issues/8926#issuecomment-1834048218 + commands = { + RuffAutofix = { + function() + vim.lsp.buf.execute_command({ + command = "ruff.applyAutofix", + arguments = { + { uri = vim.uri_from_bufnr(0) }, + }, + }) + end, + description = "Ruff: Fix all auto-fixable problems", + }, + RuffOrganizeImports = { + function() + vim.lsp.buf.execute_command({ + command = "ruff.applyOrganizeImports", + arguments = { + { uri = vim.uri_from_bufnr(0) }, + }, + }) + end, + description = "Ruff: Format imports", + }, + }, + }, + jsonls = {}, + sqlls = {}, + terraformls = {}, + yamlls = {}, + bashls = {}, + dockerls = {}, + docker_compose_language_service = {}, + -- tailwindcss = {}, + -- graphql = {}, + -- html = { filetypes = { 'html', 'twig', 'hbs' } }, + -- cssls = {}, + -- ltex = {}, + -- texlab = {}, + } + + -- Ensure the servers and tools above are installed + require("mason").setup() + + -- You can add other tools here that you want Mason to install + -- for you, so that they are available from within Neovim. + local ensure_installed = vim.tbl_keys(servers or {}) + vim.list_extend(ensure_installed, { + "stylua", -- Used to format lua code + }) + require("mason-tool-installer").setup({ ensure_installed = ensure_installed }) + + require("mason-lspconfig").setup({ + handlers = { + function(server_name) + local server = servers[server_name] or {} + -- This handles overriding only values explicitly passed + -- by the server configuration above. Useful when disabling + -- certain features of an LSP (for example, turning off formatting for tsserver) + server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) + require("lspconfig")[server_name].setup(server) + end, + }, + }) + end, +} diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..203e5c7 --- /dev/null +++ b/.config/nvim/lua/plugins/lualine.lua @@ -0,0 +1,117 @@ +-- Set lualine as statusline +return { + 'nvim-lualine/lualine.nvim', + config = function() + -- Adapted from: https://github.com/nvim-lualine/lualine.nvim/blob/master/lua/lualine/themes/onedark.lua + local colors = { + blue = '#61afef', + green = '#98c379', + purple = '#c678dd', + cyan = '#56b6c2', + red1 = '#e06c75', + red2 = '#be5046', + yellow = '#e5c07b', + fg = '#abb2bf', + bg = '#282c34', + gray1 = '#828997', + gray2 = '#2c323c', + gray3 = '#3e4452', + } + + local onedark_theme = { + normal = { + a = { fg = colors.bg, bg = colors.green, gui = 'bold' }, + b = { fg = colors.fg, bg = colors.gray3 }, + c = { fg = colors.fg, bg = colors.gray2 }, + }, + command = { a = { fg = colors.bg, bg = colors.yellow, gui = 'bold' } }, + insert = { a = { fg = colors.bg, bg = colors.blue, gui = 'bold' } }, + visual = { a = { fg = colors.bg, bg = colors.purple, gui = 'bold' } }, + terminal = { a = { fg = colors.bg, bg = colors.cyan, gui = 'bold' } }, + replace = { a = { fg = colors.bg, bg = colors.red1, gui = 'bold' } }, + inactive = { + a = { fg = colors.gray1, bg = colors.bg, gui = 'bold' }, + b = { fg = colors.gray1, bg = colors.bg }, + c = { fg = colors.gray1, bg = colors.gray2 }, + }, + } + + -- Import color theme based on environment variable NVIM_THEME + local env_var_nvim_theme = os.getenv 'NVIM_THEME' or 'nord' + + -- Define a table of themes + local themes = { + onedark = onedark_theme, + nord = 'nord', + } + + local mode = { + 'mode', + fmt = function(str) + -- return ' ' .. str:sub(1, 1) -- displays only the first character of the mode + return ' ' .. str + end, + } + + local filename = { + 'filename', + file_status = true, -- displays file status (readonly status, modified status) + path = 0, -- 0 = just filename, 1 = relative path, 2 = absolute path + } + + local hide_in_width = function() + return vim.fn.winwidth(0) > 100 + end + + local diagnostics = { + 'diagnostics', + sources = { 'nvim_diagnostic' }, + sections = { 'error', 'warn' }, + symbols = { error = ' ', warn = ' ', info = ' ', hint = ' ' }, + colored = false, + update_in_insert = false, + always_visible = false, + cond = hide_in_width, + } + + local diff = { + 'diff', + colored = false, + symbols = { added = ' ', modified = ' ', removed = ' ' }, -- changes diff symbols + cond = hide_in_width, + } + + require('lualine').setup { + options = { + icons_enabled = true, + theme = themes[env_var_nvim_theme], -- Set theme based on environment variable + -- Some useful glyphs: + -- https://www.nerdfonts.com/cheat-sheet + --         + section_separators = { left = '', right = '' }, + component_separators = { left = '', right = '' }, + disabled_filetypes = { 'alpha', 'neo-tree', 'Avante' }, + always_divide_middle = true, + }, + sections = { + lualine_a = { mode }, + lualine_b = { 'branch' }, + lualine_c = { filename }, + -- lualine_x = { diagnostics, diff, { 'encoding', cond = hide_in_width }, { 'filetype', cond = hide_in_width } }, + lualine_x = { diagnostics, diff, { 'filetype', cond = hide_in_width } }, + lualine_y = { 'location' }, + lualine_z = { 'progress' }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { { 'filename', path = 1 } }, + lualine_x = { { 'location', padding = 0 } }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + extensions = { 'fugitive' }, + } + end, +} diff --git a/.config/nvim/lua/plugins/misc.lua b/.config/nvim/lua/plugins/misc.lua new file mode 100644 index 0000000..d03b7e9 --- /dev/null +++ b/.config/nvim/lua/plugins/misc.lua @@ -0,0 +1,72 @@ +-- Standalone plugins with less than 10 lines of config go here +return { + { + -- autoclose tags + "windwp/nvim-ts-autotag", + }, + { + -- detect tabstop and shiftwidth automatically + "tpope/vim-sleuth", + }, + { + -- Powerful Git integration for Vim + "tpope/vim-fugitive", + }, + { + -- GitHub integration for vim-fugitive + "tpope/vim-rhubarb", + }, + { + -- Hints keybinds + "folke/which-key.nvim", + opts = { + -- win = { + -- border = { + -- { '┌', 'FloatBorder' }, + -- { '─', 'FloatBorder' }, + -- { '┐', 'FloatBorder' }, + -- { '│', 'FloatBorder' }, + -- { '┘', 'FloatBorder' }, + -- { '─', 'FloatBorder' }, + -- { '└', 'FloatBorder' }, + -- { '│', 'FloatBorder' }, + -- }, + -- }, + }, + }, + { + -- Autoclose parentheses, brackets, quotes, etc. + "windwp/nvim-autopairs", + event = "InsertEnter", + config = true, + opts = {}, + }, + { + -- Highlight todo, notes, etc in comments + "folke/todo-comments.nvim", + event = "VimEnter", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { signs = false }, + }, + { + -- high-performance color highlighter + "norcalli/nvim-colorizer.lua", + config = function() + require("colorizer").setup() + end, + }, + { + { + "chentoast/marks.nvim", + event = "VeryLazy", + opts = {}, + }, + }, + { + "rust-lang/rust.vim", + ft = "rust", + init = function() + vim.g.rustfmt_autosave = 1 + end, + }, +} diff --git a/.config/nvim/lua/plugins/neotree.lua b/.config/nvim/lua/plugins/neotree.lua new file mode 100644 index 0000000..e449846 --- /dev/null +++ b/.config/nvim/lua/plugins/neotree.lua @@ -0,0 +1,386 @@ +return { + -- If you want neo-tree's file operations to work with LSP (updating imports, etc.), you can use a plugin like + -- https://github.com/antosha417/nvim-lsp-file-operations: + -- { + -- "antosha417/nvim-lsp-file-operations", + -- dependencies = { + -- "nvim-lua/plenary.nvim", + -- "nvim-neo-tree/neo-tree.nvim", + -- }, + -- config = function() + -- require("lsp-file-operations").setup() + -- end, + -- }, + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + "MunifTanjim/nui.nvim", + -- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information + { + "s1n7ax/nvim-window-picker", -- for open_with_window_picker keymaps + version = "2.*", + config = function() + require("window-picker").setup({ + filter_rules = { + include_current_win = false, + autoselect_one = true, + -- filter using buffer options + bo = { + -- if the file type is one of following, the window will be ignored + filetype = { "neo-tree", "neo-tree-popup", "notify" }, + -- if the buffer type is one of following, the window will be ignored + buftype = { "terminal", "quickfix" }, + }, + }, + }) + end, + }, + }, + lazy = false, + -----Instead of using `config`, you can use `opts` instead, if you'd like: + -----@module "neo-tree" + -----@type neotree.Config + --opts = {}, + config = function() + -- If you want icons for diagnostic errors, you'll need to define them somewhere. + -- In Neovim v0.10+, you can configure them in vim.diagnostic.config(), like: + -- + -- vim.diagnostic.config({ + -- signs = { + -- text = { + -- [vim.diagnostic.severity.ERROR] = '', + -- [vim.diagnostic.severity.WARN] = '', + -- [vim.diagnostic.severity.INFO] = '', + -- [vim.diagnostic.severity.HINT] = '󰌵', + -- }, + -- } + -- }) + -- + -- In older versions, you can define the signs manually: + -- vim.fn.sign_define("DiagnosticSignError", { text = " ", texthl = "DiagnosticSignError" }) + -- vim.fn.sign_define("DiagnosticSignWarn", { text = " ", texthl = "DiagnosticSignWarn" }) + -- vim.fn.sign_define("DiagnosticSignInfo", { text = " ", texthl = "DiagnosticSignInfo" }) + -- vim.fn.sign_define("DiagnosticSignHint", { text = "󰌵", texthl = "DiagnosticSignHint" }) + + require("neo-tree").setup({ + close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab + popup_border_style = "NC", -- or "" to use 'winborder' on Neovim v0.11+ + enable_git_status = true, + enable_diagnostics = true, + open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes or buftypes + open_files_using_relative_paths = false, + sort_case_insensitive = false, -- used when sorting files and directories in the tree + sort_function = nil, -- use a custom function for sorting files and directories in the tree + -- sort_function = function (a,b) + -- if a.type == b.type then + -- return a.path > b.path + -- else + -- return a.type > b.type + -- end + -- end , -- this sorts files and directories descendantly + default_component_configs = { + container = { + enable_character_fade = true, + }, + indent = { + indent_size = 2, + padding = 1, -- extra padding on left hand side + -- indent guides + with_markers = true, + indent_marker = "│", + last_indent_marker = "└", + highlight = "NeoTreeIndentMarker", + -- expander config, needed for nesting files + with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders + expander_collapsed = "", + expander_expanded = "", + expander_highlight = "NeoTreeExpander", + }, + icon = { + folder_closed = "", + folder_open = "", + folder_empty = "󰜌", + provider = function(icon, node, state) -- default icon provider utilizes nvim-web-devicons if available + if node.type == "file" or node.type == "terminal" then + local success, web_devicons = pcall(require, "nvim-web-devicons") + local name = node.type == "terminal" and "terminal" or node.name + if success then + local devicon, hl = web_devicons.get_icon(name) + icon.text = devicon or icon.text + icon.highlight = hl or icon.highlight + end + end + end, + -- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there + -- then these will never be used. + default = "*", + highlight = "NeoTreeFileIcon", + }, + modified = { + symbol = "[+]", + highlight = "NeoTreeModified", + }, + name = { + trailing_slash = false, + use_git_status_colors = true, + highlight = "NeoTreeFileName", + }, + git_status = { + symbols = { + -- Change type + added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name + modified = "", -- or "", but this is redundant info if you use git_status_colors on the name + deleted = "✖", -- this can only be used in the git_status source + renamed = "󰁕", -- this can only be used in the git_status source + -- Status type + untracked = "", + ignored = "", + unstaged = "󰄱", + staged = "", + conflict = "", + }, + }, + -- If you don't want to use these columns, you can set `enabled = false` for each of them individually + file_size = { + enabled = true, + width = 12, -- width of the column + required_width = 64, -- min width of window required to show this column + }, + type = { + enabled = true, + width = 10, -- width of the column + required_width = 122, -- min width of window required to show this column + }, + last_modified = { + enabled = true, + width = 20, -- width of the column + required_width = 88, -- min width of window required to show this column + }, + created = { + enabled = true, + width = 20, -- width of the column + required_width = 110, -- min width of window required to show this column + }, + symlink_target = { + enabled = false, + }, + }, + -- A list of functions, each representing a global custom command + -- that will be available in all sources (if not overridden in `opts[source_name].commands`) + -- see `:h neo-tree-custom-commands-global` + commands = {}, + window = { + position = "left", + width = 40, + mapping_options = { + noremap = true, + nowait = true, + }, + mappings = { + [""] = { + "toggle_node", + nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use + }, + ["<2-LeftMouse>"] = "open", + [""] = "open", + [""] = "cancel", -- close preview or floating neo-tree window + ["P"] = { "toggle_preview", config = { use_float = true, use_image_nvim = true } }, + -- Read `# Preview Mode` for more information + ["l"] = "focus_preview", + ["S"] = "open_split", + ["s"] = "open_vsplit", + -- ["S"] = "split_with_window_picker", + -- ["s"] = "vsplit_with_window_picker", + ["t"] = "open_tabnew", + -- [""] = "open_drop", + -- ["t"] = "open_tab_drop", + ["w"] = "open_with_window_picker", + --["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing + ["C"] = "close_node", + -- ['C'] = 'close_all_subnodes', + ["z"] = "close_all_nodes", + --["Z"] = "expand_all_nodes", + --["Z"] = "expand_all_subnodes", + ["a"] = { + "add", + -- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details + -- some commands may take optional config options, see `:h neo-tree-mappings` for details + config = { + show_path = "none", -- "none", "relative", "absolute" + }, + }, + ["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion. + ["d"] = "delete", + ["r"] = "rename", + ["b"] = "rename_basename", + ["y"] = "copy_to_clipboard", + ["x"] = "cut_to_clipboard", + ["p"] = "paste_from_clipboard", + ["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add": + -- ["c"] = { + -- "copy", + -- config = { + -- show_path = "none" -- "none", "relative", "absolute" + -- } + --} + ["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add". + ["q"] = "close_window", + ["R"] = "refresh", + ["?"] = "show_help", + ["<"] = "prev_source", + [">"] = "next_source", + ["i"] = "show_file_details", + -- ["i"] = { + -- "show_file_details", + -- -- format strings of the timestamps shown for date created and last modified (see `:h os.date()`) + -- -- both options accept a string or a function that takes in the date in seconds and returns a string to display + -- -- config = { + -- -- created_format = "%Y-%m-%d %I:%M %p", + -- -- modified_format = "relative", -- equivalent to the line below + -- -- modified_format = function(seconds) return require('neo-tree.utils').relative_date(seconds) end + -- -- } + -- }, + }, + }, + nesting_rules = {}, + filesystem = { + filtered_items = { + visible = false, -- when true, they will just be displayed differently than normal items + hide_dotfiles = true, + hide_gitignored = true, + hide_hidden = true, -- only works on Windows for hidden files/directories + hide_by_name = { + --"node_modules" + }, + hide_by_pattern = { -- uses glob style patterns + --"*.meta", + --"*/src/*/tsconfig.json", + }, + always_show = { -- remains visible even if other settings would normally hide it + --".gitignored", + }, + always_show_by_pattern = { -- uses glob style patterns + --".env*", + }, + never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show + --".DS_Store", + --"thumbs.db" + }, + never_show_by_pattern = { -- uses glob style patterns + --".null-ls_*", + }, + }, + follow_current_file = { + enabled = false, -- This will find and focus the file in the active buffer every time + -- -- the current file is changed while the tree is open. + leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal` + }, + group_empty_dirs = false, -- when true, empty folders will be grouped together + hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree + -- in whatever position is specified in window.position + -- "open_current", -- netrw disabled, opening a directory opens within the + -- window like netrw would, regardless of window.position + -- "disabled", -- netrw left alone, neo-tree does not handle opening dirs + use_libuv_file_watcher = false, -- This will use the OS level file watchers to detect changes + -- instead of relying on nvim autocmd events. + window = { + mappings = { + [""] = "navigate_up", + ["."] = "set_root", + ["H"] = "toggle_hidden", + ["/"] = "fuzzy_finder", + ["D"] = "fuzzy_finder_directory", + ["#"] = "fuzzy_sorter", -- fuzzy sorting using the fzy algorithm + -- ["D"] = "fuzzy_sorter_directory", + ["f"] = "filter_on_submit", + [""] = "clear_filter", + ["[g"] = "prev_git_modified", + ["]g"] = "next_git_modified", + ["o"] = { + "show_help", + nowait = false, + config = { title = "Order by", prefix_key = "o" }, + }, + ["oc"] = { "order_by_created", nowait = false }, + ["od"] = { "order_by_diagnostics", nowait = false }, + ["og"] = { "order_by_git_status", nowait = false }, + ["om"] = { "order_by_modified", nowait = false }, + ["on"] = { "order_by_name", nowait = false }, + ["os"] = { "order_by_size", nowait = false }, + ["ot"] = { "order_by_type", nowait = false }, + -- [''] = function(state) ... end, + }, + fuzzy_finder_mappings = { -- define keymaps for filter popup window in fuzzy_finder_mode + [""] = "move_cursor_down", + [""] = "move_cursor_down", + [""] = "move_cursor_up", + [""] = "move_cursor_up", + [""] = "close", + -- [''] = function(state, scroll_padding) ... end, + }, + }, + + commands = {}, -- Add a custom command or override a global one using the same function name + }, + buffers = { + follow_current_file = { + enabled = true, -- This will find and focus the file in the active buffer every time + -- -- the current file is changed while the tree is open. + leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal` + }, + group_empty_dirs = true, -- when true, empty folders will be grouped together + show_unloaded = true, + window = { + mappings = { + ["d"] = "buffer_delete", + ["bd"] = "buffer_delete", + [""] = "navigate_up", + ["."] = "set_root", + ["o"] = { + "show_help", + nowait = false, + config = { title = "Order by", prefix_key = "o" }, + }, + ["oc"] = { "order_by_created", nowait = false }, + ["od"] = { "order_by_diagnostics", nowait = false }, + ["om"] = { "order_by_modified", nowait = false }, + ["on"] = { "order_by_name", nowait = false }, + ["os"] = { "order_by_size", nowait = false }, + ["ot"] = { "order_by_type", nowait = false }, + }, + }, + }, + git_status = { + window = { + position = "float", + mappings = { + ["A"] = "git_add_all", + ["gu"] = "git_unstage_file", + ["ga"] = "git_add_file", + ["gr"] = "git_revert_file", + ["gc"] = "git_commit", + ["gp"] = "git_push", + ["gg"] = "git_commit_and_push", + ["o"] = { + "show_help", + nowait = false, + config = { title = "Order by", prefix_key = "o" }, + }, + ["oc"] = { "order_by_created", nowait = false }, + ["od"] = { "order_by_diagnostics", nowait = false }, + ["om"] = { "order_by_modified", nowait = false }, + ["on"] = { "order_by_name", nowait = false }, + ["os"] = { "order_by_size", nowait = false }, + ["ot"] = { "order_by_type", nowait = false }, + }, + }, + }, + }) + + vim.keymap.set("n", "e", "Neotree toggle position=left") + end, + }, +} diff --git a/.config/nvim/lua/plugins/none-ls.lua b/.config/nvim/lua/plugins/none-ls.lua new file mode 100644 index 0000000..58743dd --- /dev/null +++ b/.config/nvim/lua/plugins/none-ls.lua @@ -0,0 +1,58 @@ +-- Format on save and linters +return { + "nvimtools/none-ls.nvim", + dependencies = { + "nvimtools/none-ls-extras.nvim", + "jayp0521/mason-null-ls.nvim", -- ensure dependencies are installed + }, + config = function() + local null_ls = require("null-ls") + local formatting = null_ls.builtins.formatting -- to setup formatters + local diagnostics = null_ls.builtins.diagnostics -- to setup linters + + -- list of formatters & linters for mason to install + require("mason-null-ls").setup({ + ensure_installed = { + "checkmake", + "prettier", -- ts/js formatter + "stylua", -- lua formatter + "eslint_d", -- ts/js linter + "shfmt", + "ruff", + "ansible-lint", + "rustfmt", + }, + -- auto-install configured formatters & linters (with null-ls) + automatic_installation = true, + }) + + local sources = { + diagnostics.checkmake, + formatting.prettier.with({ filetypes = { "html", "json", "yaml", "markdown" } }), + formatting.stylua, + formatting.shfmt.with({ args = { "-i", "4" } }), + formatting.terraform_fmt, + require("none-ls.formatting.ruff").with({ extra_args = { "--extend-select", "I" } }), + require("none-ls.formatting.ruff_format"), + } + + local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) + null_ls.setup({ + -- debug = true, -- Enable debug mode. Inspect logs with :NullLsLog. + sources = sources, + -- you can reuse a shared lspconfig on_attach callback here + on_attach = function(client, bufnr) + if client.supports_method("textDocument/formatting") then + vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) + vim.api.nvim_create_autocmd("BufWritePre", { + group = augroup, + buffer = bufnr, + callback = function() + vim.lsp.buf.format({ async = false }) + end, + }) + end + end, + }) + end, +} diff --git a/.config/nvim/lua/plugins/rustaceanvim.lua b/.config/nvim/lua/plugins/rustaceanvim.lua new file mode 100644 index 0000000..34b1ae2 --- /dev/null +++ b/.config/nvim/lua/plugins/rustaceanvim.lua @@ -0,0 +1,5 @@ +return { + "mrcjkb/rustaceanvim", + version = "^6", -- Recommended + lazy = false, -- This plugin is already lazy +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..cf713a5 --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,130 @@ +-- Fuzzy Finder (files, lsp, etc) +return { + 'nvim-telescope/telescope.nvim', + branch = '0.1.8', + dependencies = { + 'nvim-lua/plenary.nvim', + -- Fuzzy Finder Algorithm which requires local dependencies to be built. + -- Only load if `make` is available. Make sure you have the system + -- requirements installed. + { + 'nvim-telescope/telescope-fzf-native.nvim', + build = 'make', + cond = function() + return vim.fn.executable 'make' == 1 + end, + }, + 'nvim-telescope/telescope-ui-select.nvim', + + -- Useful for getting pretty icons, but requires a Nerd Font. + 'nvim-tree/nvim-web-devicons', + }, + config = function() + local telescope = require 'telescope' + local actions = require 'telescope.actions' + local builtin = require 'telescope.builtin' + + require('telescope').setup { + defaults = { + mappings = { + i = { + [''] = actions.move_selection_previous, -- move to prev result + [''] = actions.move_selection_next, -- move to next result + [''] = actions.select_default, -- open file + }, + n = { + ['q'] = actions.close, + }, + }, + }, + pickers = { + find_files = { + file_ignore_patterns = { 'node_modules', '.git', '.venv' }, + hidden = true, + }, + buffers = { + initial_mode = 'normal', + sort_lastused = true, + -- sort_mru = true, + mappings = { + n = { + ['d'] = actions.delete_buffer, + ['l'] = actions.select_default, + }, + }, + }, + marks = { + attach_mappings = function(prompt_bufnr, map) + map({ 'i', 'n' }, '', function() + require('telescope.actions').delete_mark(prompt_bufnr) + end) + return true + end, + }, + }, + live_grep = { + file_ignore_patterns = { 'node_modules', '.git', '.venv' }, + additional_args = function(_) + return { '--hidden' } + end, + }, + path_display = { + filename_first = { + reverse_directories = true, + }, + }, + extensions = { + ['ui-select'] = { + require('telescope.themes').get_dropdown(), + }, + }, + git_files = { + previewer = false, + }, + } + + -- Enable telescope fzf native, if installed + pcall(require('telescope').load_extension, 'fzf') + pcall(require('telescope').load_extension, 'ui-select') + + vim.keymap.set('n', '?', builtin.oldfiles, { desc = '[?] Find recently opened files' }) + vim.keymap.set('n', 'fb', builtin.buffers, { desc = '[F]ind existing [B]uffers' }) + vim.keymap.set('n', 'fm', builtin.marks, { desc = '[F]ind [M]arks' }) + vim.keymap.set('n', 'ff', builtin.git_files, { desc = 'Find [G]it [F]iles' }) + vim.keymap.set('n', 'fc', builtin.git_commits, { desc = 'Find [G]it [C]ommits' }) + vim.keymap.set('n', 'sgf', builtin.git_bcommits, { desc = 'Find [G]it [C]ommits for current [F]ile' }) + vim.keymap.set('n', 'fb', builtin.git_branches, { desc = 'Find [G]it [B]ranches' }) + vim.keymap.set('n', 'fs', builtin.git_status, { desc = 'Find [G]it [S]tatus (diff view)' }) + vim.keymap.set('n', 'ff', builtin.find_files, { desc = '[F]ind [F]iles' }) + vim.keymap.set('n', 'fh', builtin.help_tags, { desc = '[F]ind [H]elp' }) + vim.keymap.set('n', 'fw', builtin.grep_string, { desc = '[F]ind current [W]ord' }) + vim.keymap.set('n', 'fg', builtin.live_grep, { desc = '[F]ind by [G]rep' }) + vim.keymap.set('n', 'fd', builtin.diagnostics, { desc = '[F]ind [D]iagnostics' }) + vim.keymap.set('n', 'fr', builtin.resume, { desc = '[F]ind [R]resume' }) + vim.keymap.set('n', 'f.', builtin.oldfiles, { desc = '[F]ind Recent Files ("." for repeat)' }) + + -- Shortcut for searching your Neovim configuration files + vim.keymap.set('n', 'fn', function() + builtin.find_files { cwd = vim.fn.stdpath 'config' } + end, { desc = '[F]ind [N]eovim files' }) + + vim.keymap.set('n', 'fds', function() + builtin.lsp_document_symbols { + symbols = { 'Class', 'Function', 'Method', 'Constructor', 'Interface', 'Module', 'Property' }, + } + end, { desc = '[F]ind LSP document [S]ymbols' }) + vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + vim.keymap.set('n', 's/', function() + builtin.live_grep { + grep_open_files = true, + prompt_title = 'Live Grep in Open Files', + } + end, { desc = '[F]ind [/] in Open Files' }) + vim.keymap.set('n', '/', function() + -- You can pass additional configuration to telescope to change theme, layout, etc. + builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + previewer = false, + }) + end, { desc = '[/] Fuzzily search in current buffer' }) + end, +} diff --git a/.config/nvim/lua/plugins/toggleterm.lua b/.config/nvim/lua/plugins/toggleterm.lua new file mode 100644 index 0000000..ce4b638 --- /dev/null +++ b/.config/nvim/lua/plugins/toggleterm.lua @@ -0,0 +1,9 @@ +return { + { + 'akinsho/toggleterm.nvim', + version = '*', + opts = { + open_mapping = '', + }, + }, +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..b29b196 --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,110 @@ +-- Highlight, edit, and navigate code +return { + 'nvim-treesitter/nvim-treesitter', + build = ':TSUpdate', + dependencies = { + 'nvim-treesitter/nvim-treesitter-textobjects', + }, + config = function() + require('nvim-treesitter.configs').setup { + -- Add languages to be installed here that you want installed for treesitter + ensure_installed = { + 'rust', + 'lua', + 'python', + 'javascript', + 'typescript', + 'vimdoc', + 'vim', + 'regex', + 'terraform', + 'sql', + 'dockerfile', + 'toml', + 'json', + 'java', + 'ruby', + 'puppet', + 'groovy', + 'go', + 'gitignore', + 'graphql', + 'yaml', + 'make', + 'cmake', + 'markdown', + 'markdown_inline', + 'bash', + 'tsx', + 'css', + 'html', + }, + + -- Autoinstall languages that are not installed + auto_install = true, + + highlight = { enable = true }, + indent = { enable = true }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = '', + node_incremental = '', + scope_incremental = '', + node_decremental = '', + }, + }, + textobjects = { + select = { + enable = true, + lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ['aa'] = '@parameter.outer', + ['ia'] = '@parameter.inner', + ['af'] = '@function.outer', + ['if'] = '@function.inner', + ['ac'] = '@class.outer', + ['ic'] = '@class.inner', + }, + }, + move = { + enable = true, + set_jumps = true, -- whether to set jumps in the jumplist + goto_next_start = { + [']m'] = '@function.outer', + [']]'] = '@class.outer', + }, + goto_next_end = { + [']M'] = '@function.outer', + [']['] = '@class.outer', + }, + goto_previous_start = { + ['[m'] = '@function.outer', + ['[['] = '@class.outer', + }, + goto_previous_end = { + ['[M'] = '@function.outer', + ['[]'] = '@class.outer', + }, + }, + swap = { + enable = true, + swap_next = { + ['a'] = '@parameter.inner', + }, + swap_previous = { + ['A'] = '@parameter.inner', + }, + }, + }, + } + + -- Register additional file extensions + vim.filetype.add { extension = { tf = 'terraform' } } + vim.filetype.add { extension = { tfvars = 'terraform' } } + vim.filetype.add { extension = { pipeline = 'groovy' } } + vim.filetype.add { extension = { multibranch = 'groovy' } } + vim.filetype.add { extension = { pp = 'puppet' } } + end, +} diff --git a/.config/nvim/lua/plugins/vim-tmux-navigator.lua b/.config/nvim/lua/plugins/vim-tmux-navigator.lua new file mode 100644 index 0000000..4ff8bcf --- /dev/null +++ b/.config/nvim/lua/plugins/vim-tmux-navigator.lua @@ -0,0 +1,18 @@ +-- Copied config from https://github.com/christoomey/vim-tmux-navigator +return { + "christoomey/vim-tmux-navigator", + cmd = { + "TmuxNavigateLeft", + "TmuxNavigateDown", + "TmuxNavigateUp", + "TmuxNavigateRight", + "TmuxNavigatePrevious", + }, + keys = { + { "", "TmuxNavigateLeft" }, + { "", "TmuxNavigateDown" }, + { "", "TmuxNavigateUp" }, + { "", "TmuxNavigateRight" }, + { "", "TmuxNavigatePrevious" }, + }, +} diff --git a/.config/rofi/catppuccin-mocha.rasi b/.config/rofi/catppuccin-mocha.rasi new file mode 100644 index 0000000..5fa197a --- /dev/null +++ b/.config/rofi/catppuccin-mocha.rasi @@ -0,0 +1,112 @@ +* { + bg-col: #1e1e2e; + bg-col-light: #1e1e2e; + border-col: #1e1e2e; + selected-col: #1e1e2e; + blue: #89b4fa; + fg-col: #cdd6f4; + fg-col2: #f38ba8; + grey: #6c7086; + + width: 600; + font: "JetBrainsMono Nerd Font 14"; +} + +element-text, element-icon , mode-switcher { + background-color: inherit; + text-color: inherit; +} + +window { + height: 360px; + border: 3px; + border-color: @border-col; + background-color: @bg-col; +} + +mainbox { + background-color: @bg-col; +} + +inputbar { + children: [prompt,entry]; + background-color: @bg-col; + border-radius: 5px; + padding: 2px; +} + +prompt { + background-color: @blue; + padding: 6px; + text-color: @bg-col; + border-radius: 3px; + margin: 20px 0px 0px 20px; +} + +textbox-prompt-colon { + expand: false; + str: ":"; +} + +entry { + padding: 6px; + margin: 20px 0px 0px 10px; + text-color: @fg-col; + background-color: @bg-col; +} + +listview { + border: 0px 0px 0px; + padding: 6px 0px 0px; + margin: 10px 0px 0px 20px; + columns: 2; + lines: 5; + background-color: @bg-col; +} + +element { + padding: 5px; + background-color: @bg-col; + text-color: @fg-col ; +} + +element-icon { + size: 25px; +} + +element selected { + background-color: @selected-col ; + text-color: @fg-col2 ; +} + +mode-switcher { + spacing: 0; + } + +button { + padding: 10px; + background-color: @bg-col-light; + text-color: @grey; + vertical-align: 0.5; + horizontal-align: 0.5; +} + +button selected { + background-color: @bg-col; + text-color: @blue; +} + +message { + background-color: @bg-col-light; + margin: 2px; + padding: 2px; + border-radius: 5px; +} + +textbox { + padding: 6px; + margin: 20px 0px 0px 20px; + text-color: @blue; + background-color: @bg-col-light; +} + diff --git a/.config/rofi/config.rasi b/.config/rofi/config.rasi new file mode 100644 index 0000000..9f48c8d --- /dev/null +++ b/.config/rofi/config.rasi @@ -0,0 +1,17 @@ +configuration{ + modi: "run,drun,window"; + icon-theme: "Oranchelo"; + show-icons: true; + terminal: "alacritty"; + drun-display-format: "{icon} {name}"; + location: 0; + disable-history: false; + hide-scrollbar: true; + display-drun: "  Apps "; + display-run: "  Run "; + display-window: " 󰕰 Window"; + display-Network: " 󰤨 Network"; + sidebar-mode: true; +} + +@theme "catppuccin-mocha" diff --git a/.config/sway/config b/.config/sway/config new file mode 100644 index 0000000..dfda5ec --- /dev/null +++ b/.config/sway/config @@ -0,0 +1,77 @@ +# Read `man 5 sway` for a complete reference. + +### Variables +exec wal -i "$HOME/.local/share/active_wall" +include "$HOME/.cache/wal/colors-sway" +include "./themes/catppuccin-mocha.theme" + + +# target title bg text indicator border +client.focused $lavender $base $text $rosewater $lavender +client.focused_inactive $overlay0 $base $text $rosewater $overlay0 +client.unfocused $overlay0 $base $text $rosewater $overlay0 +client.urgent $peach $base $peach $overlay0 $peach +client.placeholder $overlay0 $base $text $overlay0 $overlay0 +client.background $base + +#client.focused $color0 $background $foreground $color7 $background +#client.focused $lavender $base $text $rosewater $lavender +# The $wallpaper var comes from included wal file that is cached +# You can get the names of your outputs by running: swaymsg -t get_outputs +set $wallpaper "$HOME/.local/share/active_wall" +output * bg $wallpaper fill +# Logo key. Use Mod1 for Alt. +set $mod Mod4 +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l +# Terminal choice +set $term foot +set $rofi_cmd rofi -terminal '$term' +# Combine list of the apps with desktop files and executables from PATH. +set $menu $rofi_cmd -show combi -combi-modes drun#run -modes combi + +gaps inner 2 +smart_gaps on +default_border pixel 3 +hide_edge_borders smart + +set $ws0 0 󰢁 +set $ws1 1  +set $ws2 2 󰈹 +set $ws3 3 󰍡 +set $ws4 4  +set $ws5 5  +set $ws6 6  +set $ws7 7  +set $ws8 8  +set $ws9 9  + +# TODO: move swaylock to own config +# set $locking swaylock --daemonize \ +# --color "$color1" --inside-color \ +# "$color1" --inside-clear-color "$foreground" \ +# --ring-color "$color2" --ring-clear-color "$color11" \ +# --ring-ver-color "$color13" --show-failed-attempts \ +# --fade-in 0.2 --grace 2 --effect-vignette 0.5:0.5 \ +# --effect-blur 7x5 --ignore-empty-password --screenshots --clock + + set $locking swaylock --daemonize \ + --color "$base" --inside-color \ + "$peach" --inside-clear-color "$overlay0" \ + --ring-color "$rosewater" --ring-clear-color "$lavendar" \ + --ring-ver-color "$rosewater" --show-failed-attempts \ + --fade-in 0.2 --grace 2 --effect-vignette 0.5:0.5 \ + --effect-blur 7x5 --ignore-empty-password --screenshots --clock + + + +set $idle_timeout 240 +set $locking_timeout 300 +set $screen_timeout 600 + +include "/etc/sway/config.d/*.conf" +include "$HOME/.config/sway/modes/*.conf" +include "$HOME/.config/sway/config.d/*.conf" diff --git a/.config/sway/config.d/10-input.conf b/.config/sway/config.d/10-input.conf new file mode 100644 index 0000000..f175217 --- /dev/null +++ b/.config/sway/config.d/10-input.conf @@ -0,0 +1,7 @@ + +input * { + # set system wide finnish layout + xkb_layout "fi" + # remap capslock to escape for better vim usage + xkb_options caps:escape +} diff --git a/.config/sway/config.d/50-rules-browser.conf b/.config/sway/config.d/50-rules-browser.conf new file mode 100644 index 0000000..7294c5e --- /dev/null +++ b/.config/sway/config.d/50-rules-browser.conf @@ -0,0 +1,20 @@ +# apply mark for Xwayland and wayland native browser windows +for_window [class="Chromium-browser"] mark Browser +for_window [class="Brave-browser"] mark Browser +for_window [class="firefox"] mark Browser +for_window [app_id="Chromium-browser"] mark Browser +for_window [app_id="brave-browser"] mark Browser +for_window [app_id="firefox"] mark Browser + +assign [app_id="firefox"] workspace $ws2 +assign [app_id="chromium-browser"] workspace $ws2 + +# inhibit scrensaver for fullscreen browser windows +for_window [con_mark="Browser"] { + inhibit_idle fullscreen +} + +# firefox wayland screensharing indicator +for_window [app_id="firefox" title="Firefox — Sharing Indicator"] { + floating enable +} diff --git a/.config/sway/config.d/50-rules-pavucontrol.conf b/.config/sway/config.d/50-rules-pavucontrol.conf new file mode 100644 index 0000000..cb2ea43 --- /dev/null +++ b/.config/sway/config.d/50-rules-pavucontrol.conf @@ -0,0 +1,12 @@ +# Display PulseAudio volume control application (both GTK and Qt varieties) +# as a floating window. + +for_window [app_id="pavucontrol"] { + floating enable + move position center +} + +for_window [app_id="pavucontrol-qt"] { + floating enable + move position center +} diff --git a/.config/sway/config.d/50-rules-policykit-agent.conf b/.config/sway/config.d/50-rules-policykit-agent.conf new file mode 100644 index 0000000..88ff754 --- /dev/null +++ b/.config/sway/config.d/50-rules-policykit-agent.conf @@ -0,0 +1,4 @@ +for_window [app_id="lxqt-policykit-agent"] { + floating enable + move position center +} diff --git a/.config/sway/config.d/60-bindings-brightness.conf b/.config/sway/config.d/60-bindings-brightness.conf new file mode 100644 index 0000000..0e53ec2 --- /dev/null +++ b/.config/sway/config.d/60-bindings-brightness.conf @@ -0,0 +1,18 @@ +# Key bindings for brightness control using `light`. +# Displays a notification with the current value if /usr/bin/notify-send is available +# +# Brightness increase/decrease step can be customized by setting the `$brightness_step` +# variable to a numeric value before including the file. +# +# Requires: light +# Recommends: libnotify + +set $brightness_notification_cmd command -v notify-send >/dev/null && \ + VALUE=$(light) && VALUE=${VALUE%%.*} && \ + notify-send -e -h string:x-canonical-private-synchronous:brightness \ + -h "int:value:$VALUE" -t 800 "Brightness: ${VALUE}%" + +bindsym XF86MonBrightnessDown exec \ + 'STEP="$brightness_step" && light -U ${STEP:-5} && $brightness_notification_cmd' +bindsym XF86MonBrightnessUp exec \ + 'STEP="$brightness_step" && light -A ${STEP:-5} && $brightness_notification_cmd' diff --git a/.config/sway/config.d/60-bindings-media.conf b/.config/sway/config.d/60-bindings-media.conf new file mode 100644 index 0000000..1e2f59f --- /dev/null +++ b/.config/sway/config.d/60-bindings-media.conf @@ -0,0 +1,17 @@ +# Key bindings for media player control via MPRIS D-Bus interface +# +# Requires: playerctl + +# Allow Play and Stop bindings even if the screen is locked +bindsym --locked { + XF86AudioPlay exec playerctl play-pause + XF86AudioStop exec playerctl stop +} + +bindsym { + XF86AudioForward exec playerctl position +10 + XF86AudioNext exec playerctl next + XF86AudioPause exec playerctl pause + XF86AudioPrev exec playerctl previous + XF86AudioRewind exec playerctl position -10 +} diff --git a/.config/sway/config.d/60-bindings-screenshot.conf b/.config/sway/config.d/60-bindings-screenshot.conf new file mode 100644 index 0000000..16b1cd9 --- /dev/null +++ b/.config/sway/config.d/60-bindings-screenshot.conf @@ -0,0 +1,20 @@ +# Key bindings for taking screenshots +# +# The image files will be written to XDG_SCREENSHOTS_DIR if this is set +# or defined in user-dirs.dir, or to a fallback location XDG_PICTURES_DIR. +# +# Copy the file to ~/.config/sway/config.d/60-bindings-screenshot.conf (or to +# your $XDG_CONFIG_HOME location if set differently) to be able to overwrite +# existing shortcuts. +# Check 'man grimshot' for additional commands that you may find useful. +# +# Requires: grimshot + +bindsym { + # Capture the currently active output + Print exec grimshot save output + # Capture the currently active window + Alt+Print exec grimshot save active + # Select and capture a custom rectangular area + Ctrl+Print exec grimshot save area +} diff --git a/.config/sway/config.d/60-bindings-volume.conf b/.config/sway/config.d/60-bindings-volume.conf new file mode 100644 index 0000000..85575f2 --- /dev/null +++ b/.config/sway/config.d/60-bindings-volume.conf @@ -0,0 +1,21 @@ +# Key bindings to control pipewire or pulseaudio volume with pactl. +# Displays a notification with the current state if /usr/bin/notify-send is available +# +# Volume increase/decrease step can be customized by setting the `$volume_step` +# variable to a numeric value before including the file. +# Maximum volume boost level can be set with the `$volume_limit` variable. +# +# Requires: pulseaudio-utils +# Recommends: libnotify + +set $volume_helper_cmd /usr/libexec/sway/volume-helper + +# Allow volume controls even if the screen is locked +bindsym --locked { + XF86AudioRaiseVolume exec \ + $volume_helper_cmd --limit "$volume_limit" --increase "$volume_step" + XF86AudioLowerVolume exec \ + $volume_helper_cmd --limit "$volume_limit" --decrease "$volume_step" + XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle && $volume_helper_cmd + XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle +} diff --git a/.config/sway/config.d/65-mode-passthrough.conf b/.config/sway/config.d/65-mode-passthrough.conf new file mode 100644 index 0000000..ce298f8 --- /dev/null +++ b/.config/sway/config.d/65-mode-passthrough.conf @@ -0,0 +1,6 @@ +# A special mode for passing any keybindings to the focused application + +mode "passthrough" { + bindsym $mod+Pause mode default +} +bindsym $mod+Pause mode "passthrough" diff --git a/.config/sway/config.d/90-bar.conf b/.config/sway/config.d/90-bar.conf new file mode 100644 index 0000000..0b2f71f --- /dev/null +++ b/.config/sway/config.d/90-bar.conf @@ -0,0 +1,10 @@ +# Status Bar: waybar +# +# Read `man 5 sway-bar` for more information about this section. +# +# Requires: waybar + +bar { + position top + swaybar_command waybar +} diff --git a/.config/sway/config.d/90-swayidle.conf b/.config/sway/config.d/90-swayidle.conf new file mode 100644 index 0000000..0bd2dd4 --- /dev/null +++ b/.config/sway/config.d/90-swayidle.conf @@ -0,0 +1,43 @@ +# Idle and lock configuration +# +# EXAMPLE: +# This will lock your screen after 300 seconds of inactivity, then turn off +# your displays after another 60 seconds, and turn your screens back on when +# resumed. It will also lock your screen before your computer goes to sleep. +# The timeouts can be customized via `$lock_timeout` and `$screen_timeout` +# variables. For a predictable behavior, keep the `$screen_timeout` value +# lesser than the `$lock_timeout`. +# +# You can also lock the screen manually by running `loginctl lock-session` or +# add a binding for the command. Example: +# bindsym $mod+Shift+Escape exec loginctl lock-session +# +# Note that all swaylock customizations are handled via /etc/swaylock/config and +# can be overridden via $XDG_CONFIG_HOME/swaylock/config (~/.config/swaylock/config). +# +# Requires: swayidle +# Requires: swaylock +# Requires: /usr/bin/pkill, /usr/bin/pgrep +# +# exec LT="$lock_timeout" ST="$screen_timeout" LT=${LT:-300} ST=${ST:-60} && \ +# swayidle -w \ +# timeout $LT 'swaylock -f' \ +# timeout $((LT + ST)) 'swaymsg "output * power off"' \ +# resume 'swaymsg "output * power on"' \ +# timeout $ST 'pgrep -xu "$USER" swaylock >/dev/null && swaymsg "output * power off"' \ +# resume 'pgrep -xu "$USER" swaylock >/dev/null && swaymsg "output * power on"' \ +# before-sleep 'swaylock -f' \ +# lock 'swaylock -f' \ +# unlock 'pkill -xu "$USER" -SIGUSR1 swaylock' + +# FIXME: doesnt seem to work +exec swayidle -w \ + timeout $idle_timeout 'light -G > /tmp/brightness && light -S 10' \ + resume 'light -S $([ -f /tmp/brightness ] && cat /tmp/brightness || echo 100%)' \ + timeout $locking_timeout 'exec $locking' \ + timeout $screen_timeout 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep 'playerctl pause' \ + before-sleep 'exec $locking' + + diff --git a/.config/sway/config.d/95-autostart-policykit-agent.conf b/.config/sway/config.d/95-autostart-policykit-agent.conf new file mode 100644 index 0000000..10b529b --- /dev/null +++ b/.config/sway/config.d/95-autostart-policykit-agent.conf @@ -0,0 +1,8 @@ +# Start graphical authentication agent for PolicyKit. +# +# Certain applications may require this to request elevated privileges: +# GParted, virt-manager, anything that uses pkexec +# +# Requires: lxqt-policykit + +exec /usr/libexec/lxqt-policykit-agent diff --git a/.config/sway/config.d/95-xdg-desktop-autostart.conf b/.config/sway/config.d/95-xdg-desktop-autostart.conf new file mode 100644 index 0000000..56cc4fb --- /dev/null +++ b/.config/sway/config.d/95-xdg-desktop-autostart.conf @@ -0,0 +1,14 @@ +# Wait until a StatusNotifierItem tray implementation is available and +# process XDG autostart entries. +# +# This horror has to exist because +# +# - SNI spec mandates that if `IsStatusNotifierHostRegistered` is not set, +# the client should fall back to the Freedesktop System Tray specification +# (XEmbed). +# - There are actual implementations that take this seriously and implement +# a fallback *even if* StatusNotifierWatcher is already DBus-activated. +# - https://github.com/systemd/systemd/issues/3750 +# +exec /usr/libexec/sway-systemd/wait-sni-ready && \ + systemctl --user start sway-xdg-autostart.target diff --git a/.config/sway/config.d/95-xdg-user-dirs.conf b/.config/sway/config.d/95-xdg-user-dirs.conf new file mode 100644 index 0000000..e7d5beb --- /dev/null +++ b/.config/sway/config.d/95-xdg-user-dirs.conf @@ -0,0 +1,9 @@ +# Create or update XDG user dir configuration +# +# See also: +# - /etc/xdg/autostart/xdg-user-dirs.desktop +# - https://github.com/systemd/systemd/issues/18791 +# +# Recommends: xdg-user-dirs + +exec /usr/bin/xdg-user-dirs-update diff --git a/.config/sway/config.d/98-app-defaults.conf b/.config/sway/config.d/98-app-defaults.conf new file mode 100644 index 0000000..7c1d178 --- /dev/null +++ b/.config/sway/config.d/98-app-defaults.conf @@ -0,0 +1,15 @@ +# set floating mode for specific applications +for_window [instance="lxappearance"] floating enable +for_window [app_id="firefox" title="^Library$"] floating enable, border pixel 1, sticky enable +for_window [app_id="thunderbird" title=".*Reminder"] floating enable +for_window [app_id="floating_shell_portrait"] floating enable, border pixel 1, sticky enable, resize set width 30 ppt height 40 ppt +for_window [app_id="floating_shell"] floating enable, border pixel 1, sticky enable +for_window [app_id="" title="Picture in picture"] floating enable, sticky enable +for_window [app_id="xsensors"] floating enable +for_window [title="Save File"] floating enable +for_window [title="Firefox — Sharing Indicator"] floating enable +for_window [app_id="" title=".* is sharing your screen."] floating enable +for_window [title="wlay"] floating enable + +# inhibit idle +for_window [app_id="microsoft teams - preview"] inhibit_idle fullscreen diff --git a/.config/sway/modes/default.conf b/.config/sway/modes/default.conf new file mode 100644 index 0000000..fcef3ba --- /dev/null +++ b/.config/sway/modes/default.conf @@ -0,0 +1,121 @@ +# +# Basics: +# + bindsym $mod+Shift+z exec $locking + # Start a terminal + bindsym $mod+Return exec $term + + # Kill focused window + bindsym $mod+Shift+q kill + + # Start your launcher + bindsym $mod+d exec $menu + + bindsym $mod+z exec $HOME/.local/bin/obscap + + # Drag floating windows by holding down $mod and left mouse button. + # Resize them with right mouse button + $mod. + # Despite the name, also works for non-floating windows. + # Change normal to inverse to use left mouse button for resizing and right + # mouse button for dragging. + floating_modifier $mod normal + + # Reload the configuration file + bindsym $mod+Shift+c reload + + # This has been moved to modes/shutdown.conf + # Exit sway (logs you out of your Wayland session) + # bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit' +# +# Moving around: +# + # Move your focus around + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right + # Or use $mod+[up|down|left|right] + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + # Move the focused window with the same, but add Shift + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + # Ditto, with arrow keys + bindsym $mod+Shift+Left move left + bindsym $mod+Shift+Down move down + bindsym $mod+Shift+Up move up + bindsym $mod+Shift+Right move right +# +# Workspaces: +# + # Switch to workspace + bindsym $mod+0 workspace $ws0 + bindsym $mod+1 workspace $ws1 + bindsym $mod+2 workspace $ws2 + bindsym $mod+3 workspace $ws3 + bindsym $mod+4 workspace $ws4 + bindsym $mod+5 workspace $ws5 + bindsym $mod+6 workspace $ws6 + bindsym $mod+7 workspace $ws7 + bindsym $mod+8 workspace $ws8 + bindsym $mod+9 workspace $ws9 + # Move focused container to workspace + set $focus_ws [ $focus_after_move == 'true' ] && swaymsg workspace + + bindsym $mod+Shift+0 move container to workspace $ws0, exec $focus_ws $ws0 + bindsym $mod+Shift+1 move container to workspace $ws1, exec $focus_ws $ws1 + bindsym $mod+Shift+2 move container to workspace $ws2, exec $focus_ws $ws2 + bindsym $mod+Shift+3 move container to workspace $ws3, exec $focus_ws $ws3 + bindsym $mod+Shift+4 move container to workspace $ws4, exec $focus_ws $ws4 + bindsym $mod+Shift+5 move container to workspace $ws5, exec $focus_ws $ws5 + bindsym $mod+Shift+6 move container to workspace $ws6, exec $focus_ws $ws6 + bindsym $mod+Shift+7 move container to workspace $ws7, exec $focus_ws $ws7 + bindsym $mod+Shift+8 move container to workspace $ws8, exec $focus_ws $ws8 + bindsym $mod+Shift+9 move container to workspace $ws9, exec $focus_ws $ws9 + + bindsym $mod+Control+Shift+Left move workspace to output left + bindsym $mod+Control+Shift+Right move workspace to output left + # Note: workspaces can have any name you want, not just numbers. + # We just use 1-10 as the default. +# +# Layout stuff: +# + # You can "split" the current object of your focus with + # $mod+b or $mod+v, for horizontal and vertical splits + # respectively. + bindsym $mod+b splith + bindsym $mod+v splitv + + # Switch the current container between different layout styles + bindsym $mod+s layout stacking + bindsym $mod+w layout tabbed + bindsym $mod+e layout toggle split + + # Make the current focus fullscreen + bindsym $mod+f fullscreen + + # Toggle the current focus between tiling and floating mode + bindsym $mod+Shift+space floating toggle + + # Swap focus between the tiling area and the floating area + bindsym $mod+space focus mode_toggle + + # Move focus to the parent container + bindsym $mod+a focus parent +# +# Scratchpad: +# + # Sway has a "scratchpad", which is a bag of holding for windows. + # You can send windows there and get them back later. + + # Move the currently focused window to the scratchpad + bindsym $mod+Shift+minus move scratchpad + + # Show the next scratchpad window or hide the focused scratchpad window. + # If there are multiple scratchpad windows, this command cycles through them. + bindsym $mod+minus scratchpad show diff --git a/.config/sway/modes/resize.conf b/.config/sway/modes/resize.conf new file mode 100644 index 0000000..93c0d82 --- /dev/null +++ b/.config/sway/modes/resize.conf @@ -0,0 +1,22 @@ +mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + # Ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} + +bindsym $mod+r mode "resize" diff --git a/.config/sway/modes/screenshot.conf b/.config/sway/modes/screenshot.conf new file mode 100644 index 0000000..dd32bc2 --- /dev/null +++ b/.config/sway/modes/screenshot.conf @@ -0,0 +1,32 @@ +set $mode_screenshot " \ +Pick (p) \ +Output (o) \ ++ Shift to " + + +# Screenshot current output and save to clipboard +set $screenshot_screen_clipboard grimshot --notify copy output +# Screenshot current output and save to file $HOME/Pictures/{date}.png +set $screenshot_screen_file grimshot --notify save output +# Screenshot with a drawn box and save to clipboard +set $screenshot_selection_clipboard grimshot --notify copy area +# Screenshot with a drawn box and save to file +set $screenshot_selection_file grimshot --notify save area + + +mode --pango_markup $mode_screenshot { + # whole output + bindsym o mode "default", exec $screenshot_screen_clipboard + bindsym Shift+o mode "default", exec $screenshot_screen_file + + # pick the region to screenshot + bindsym p mode "default", exec $screenshot_selection_clipboard + bindsym Shift+p mode "default", exec $screenshot_selection_file + + # Return to default mode. + bindsym Escape mode "default" +} + +## Launch // Screenshot Mode ## +bindsym $mod+p mode $mode_screenshot +# bindsym $mod+p exec $screenshot_selection_clipboard diff --git a/.config/sway/modes/shutdown.conf b/.config/sway/modes/shutdown.conf new file mode 100644 index 0000000..fd25268 --- /dev/null +++ b/.config/sway/modes/shutdown.conf @@ -0,0 +1,38 @@ +set $mode_shutdown "\ + \ + \ + (h) - hibernate \ + (l) - lock \ + (e) - logout \ + (r) - reboot \ + (u) - suspend \ + (s) - shutdown \ +" + +set $purge_cliphist [ $purge_cliphist_logout == 'true' ] && rm -f $HOME/.cache/cliphist/db || exit 0 + +mode --pango_markup $mode_shutdown { + # lock + bindsym l mode "default", exec $locking + + # logout + bindsym e exec $purge_cliphist; exec loginctl terminate-user $USER + + # suspend + bindsym u mode "default", exec systemctl suspend + + # hibernate + bindsym h mode "default", exec systemctl hibernate + + # shutdown + bindsym s exec $purge_cliphist; exec systemctl poweroff + + # reboot + bindsym r exec $purge_cliphist; exec systemctl reboot + + # Return to default mode. + bindsym Escape mode "default" +} + +## Launch // Exit Menu ## +bindsym $mod+Shift+e mode $mode_shutdown diff --git a/.config/sway/themes/catppuccin-mocha.theme b/.config/sway/themes/catppuccin-mocha.theme new file mode 100644 index 0000000..686a5a2 --- /dev/null +++ b/.config/sway/themes/catppuccin-mocha.theme @@ -0,0 +1,25 @@ +set $rosewater #f5e0dc +set $flamingo #f2cdcd +set $pink #f5c2e7 +set $mauve #cba6f7 +set $red #f38ba8 +set $maroon #eba0ac +set $peach #fab387 +set $green #a6e3a1 +set $teal #94e2d5 +set $sky #89dceb +set $sapphire #74c7ec +set $blue #89b4fa +set $lavender #b4befe +set $text #cdd6f4 +set $subtext1 #bac2de +set $subtext0 #a6adc8 +set $overlay2 #9399b2 +set $overlay1 #7f849c +set $overlay0 #6c7086 +set $surface2 #585b70 +set $surface1 #45475a +set $surface0 #313244 +set $base #1e1e2e +set $mantle #181825 +set $crust #11111b diff --git a/.config/tmux/.tmux.conf.bak b/.config/tmux/.tmux.conf.bak new file mode 100644 index 0000000..67e22b7 --- /dev/null +++ b/.config/tmux/.tmux.conf.bak @@ -0,0 +1,101 @@ +# Configured by Rob Muhlestein (rwxrob.live) +# This file is copyright free (public domain). + +# change default meta key to same as screen +unbind C-b +unbind C-a +set -g prefix C-a + +# form vim/tmux d/y buffer sync +set -g focus-events + +# use a different prefix for nested +bind-key -n C-y send-prefix + +# add double-tap meta key to toggle last window +bind-key C-a last-window + +# pane colors and display + +# create more intuitive split key combos (same as modern screen) +# -c '#{pane_current_path}' ensures new split is in `pwd` +unbind | +bind | split-window -h -c '#{pane_current_path}' +bind '\' split-window -h -c '#{pane_current_path}' +bind 'C-\' split-window -h -c '#{pane_current_path}' +unbind - +bind - split-window -v -c '#{pane_current_path}' +unbind _ +bind _ split-window -v -c '#{pane_current_path}' + +# vi for copy mode +setw -g mode-keys vi + +# vi for command status +set -g status-keys vi + +# vi keys to resize +bind -r C-k resize-pane -U 1 +bind -r C-j resize-pane -D 1 +bind -r C-h resize-pane -L 1 +bind -r C-l resize-pane -R 1 + +# vi keys to navigate panes +bind -r k select-pane -U +bind -r j select-pane -D +bind -r h select-pane -L +bind -r l select-pane -R + +# avoid cursor movement messing with resize +set -g repeat-time 200 + +# colors, clock, and stuff +#set -g default-terminal "xterm-256color" # works, but oh so wrong +#set -ga terminal-overrides ",xterm-256color*:Tc" +set -g default-terminal "screen-256color" +#set -g clock-mode-style 12 +setw -g clock-mode-colour cyan +set -g base-index 1 +setw -g pane-base-index 1 + +# die, die, die (just be careful, right next to C-c) + +# color the pane borders nearly invisible +# (when not using hacked tmux without them) +set -g pane-border-style "fg=#202020,bg=#202020" +set -g pane-active-border-style "fg=#202020,bg=#202020" + +# color of the window selection background +set -g mode-style "bg=black" + +# very unique Mac bug +if-shell "type 'reattach-to-user-namespace' >/dev/null" "set -g default-command 'reattach-to-user-namespace -l $SHELL'" + +# reload configuration +bind -r r source-file ~/.tmux.conf + +set -g status-style "bg=#202021,fg=#665c54" +set -g status-position top +set -g status-interval 1 +set -g status-right "" +set -g status-left "" +set -g status-right-style "fg=#928374" + +if-shell -b '[ -z $SWAYSOCK ]' 'set -g status-right " #(pomo)"' +set -g status-right "#(tmux_timew)" +#set -g status-left-length 78 +#set -g status-left-style "fg=#928374,bold,reverse" +#set -g status-left-style "fg=brightwhite" +#set -g status-left "#(head -1 ~/.status) " +#set -g status-right-length 50 +#set -g status-right "%a, %b %-e, %Y, %-l:%M:%S%p %Z%0z" +#set -g status-right-style "fg=#928374,bold" +#set -g window-status-format "" +#set -g window-status-current-format "" + +set -g message-style "fg=red" + +# disable status +#set -g status off +set -g status on + diff --git a/.config/tmux/plugins/catppuccin-tmux b/.config/tmux/plugins/catppuccin-tmux new file mode 160000 index 0000000..b4e0715 --- /dev/null +++ b/.config/tmux/plugins/catppuccin-tmux @@ -0,0 +1 @@ +Subproject commit b4e0715356f820fc72ea8e8baf34f0f60e891718 diff --git a/.config/tmux/plugins/tmux b/.config/tmux/plugins/tmux new file mode 160000 index 0000000..7a284c9 --- /dev/null +++ b/.config/tmux/plugins/tmux @@ -0,0 +1 @@ +Subproject commit 7a284c98e5df4cc84a1a45ad633916f0b2b916b2 diff --git a/.config/tmux/plugins/tmux-sensible b/.config/tmux/plugins/tmux-sensible new file mode 160000 index 0000000..25cb91f --- /dev/null +++ b/.config/tmux/plugins/tmux-sensible @@ -0,0 +1 @@ +Subproject commit 25cb91f42d020f675bb0a2ce3fbd3a5d96119efa diff --git a/.config/tmux/plugins/tmux-yank b/.config/tmux/plugins/tmux-yank new file mode 160000 index 0000000..acfd36e --- /dev/null +++ b/.config/tmux/plugins/tmux-yank @@ -0,0 +1 @@ +Subproject commit acfd36e4fcba99f8310a7dfb432111c242fe7392 diff --git a/.config/tmux/plugins/tpm b/.config/tmux/plugins/tpm new file mode 160000 index 0000000..99469c4 --- /dev/null +++ b/.config/tmux/plugins/tpm @@ -0,0 +1 @@ +Subproject commit 99469c4a9b1ccf77fade25842dc7bafbc8ce9946 diff --git a/.config/tmux/plugins/vim-tmux-navigator b/.config/tmux/plugins/vim-tmux-navigator new file mode 160000 index 0000000..addb64a --- /dev/null +++ b/.config/tmux/plugins/vim-tmux-navigator @@ -0,0 +1 @@ +Subproject commit addb64a772cb4a3ae1f1363583012b2cada2cd66 diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf new file mode 100644 index 0000000..ca8d83b --- /dev/null +++ b/.config/tmux/tmux.conf @@ -0,0 +1,47 @@ +# Change prefix key - Ctrl+Space +unbind C-b +set -g prefix C-Space +bind C-Space send-prefix + +# Enable mouse support +set -g mouse on + +# Fix editor colors in tmux +set-option -sa terminal-overrides ",xterm*:Tc" + +# Start window and panes at 1, not 0 +set -g base-index 1 +set -g pane-base-index 1 +set-window-option -g pane-base-index 1 +set-option -g renumber-windows on + +set -s escape-time 200 +set -sg repeat-time 600 +setw -g xterm-keys on + +# vi-mode +set-window-option -g mode-keys vi + +# keybindings +bind-key -T copy-mode-vi v send-keys -X begin-selection +bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle +bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel + +# Open panes in current directory +bind _ split-window -v -c "#{pane_current_path}" +bind | split-window -h -c "#{pane_current_path}" + +# Shift+Alt vim keys to switch windows +bind -n M-H previous-window +bind -n M-L next-window + +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'christoomey/vim-tmux-navigator' +set -g @plugin 'dreamsofcode-io/catppuccin-tmux' + + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.tmux/plugins/tpm/tpm' diff --git a/.config/tmux/vscode-tmux.conf b/.config/tmux/vscode-tmux.conf new file mode 100644 index 0000000..5753648 --- /dev/null +++ b/.config/tmux/vscode-tmux.conf @@ -0,0 +1,40 @@ +# Change prefix key - Ctrl+Space +unbind C-b +set -g prefix C-Space +bind C-Space send-prefix + +# Enable mouse support +set -g mouse on + +# Fix editor colors in tmux +set-option -sa terminal-overrides ",xterm*:Tc" + +# Start window and panes at 1, not 0 +set -g base-index 1 +set -g pane-base-index 1 +set-window-option -g pane-base-index 1 +set-option -g renumber-windows on + +# vi-mode +set-window-option -g mode-keys vi + +# keybindings +bind-key -T copy-mode-vi v send-keys -X begin-selection +bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle +bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel + +# Open panes in current directory +bind _ split-window -v -c "#{pane_current_path}" +bind | split-window -h -c "#{pane_current_path}" + +# Shift+Alt vim keys to switch windows +bind -n M-H previous-window +bind -n M-L next-window + +# Fix Window namings in vscode +bind-key c new-window -n 'vsc' + + +set -g @plugin 'tmux-plugins/tmux-sensible' + +run '~/.tmux/plugins/tpm/tpm' diff --git a/.config/waybar/colors/everforest-light.css b/.config/waybar/colors/everforest-light.css new file mode 100644 index 0000000..ffb004b --- /dev/null +++ b/.config/waybar/colors/everforest-light.css @@ -0,0 +1,23 @@ +@define-color bg_dim #efebd4; +@define-color bg0 #fdf6e3; +@define-color bg1 #f4f0d9; +@define-color bg2 #efebd4; +@define-color bg3 #e6e2cc; +@define-color bg4 #e0dcc7; +@define-color bg5 #bdc3af; +@define-color bg_visual #eaedc8; +@define-color bg_red #fbe3da; +@define-color bg_green #f0f1d2; +@define-color bg_blue #e9f0e9; +@define-color bg_yellow #faedcd; +@define-color fg #5c6a72; +@define-color red #f85552; +@define-color orange #f57d26; +@define-color yellow #dfa000; +@define-color green #8da101; +@define-color aqua #35a77c; +@define-color blue #3a94c5; +@define-color purple #df69ba; +@define-color grey0 #a6b0a0; +@define-color grey1 #939f91; +@define-color grey2 #829181; \ No newline at end of file diff --git a/.config/waybar/colors/everforest.css b/.config/waybar/colors/everforest.css new file mode 100644 index 0000000..00f269b --- /dev/null +++ b/.config/waybar/colors/everforest.css @@ -0,0 +1,23 @@ +@define-color bg_dim #232a2e; +@define-color bg0 #2d353b; +@define-color bg1 #343f44; +@define-color bg2 #3d484d; +@define-color bg3 #475258; +@define-color bg4 #4f585e; +@define-color bg5 #56635f; +@define-color bg_visual #543a48; +@define-color bg_red #514045; +@define-color bg_green #425047; +@define-color bg_blue #3a515d; +@define-color bg_yellow #4d4c43; +@define-color fg #d3c6aa; +@define-color red #e67e80; +@define-color orange #e69875; +@define-color yellow #dbbc7f; +@define-color green #a7c080; +@define-color aqua #83c092; +@define-color blue #7fbbb3; +@define-color purple #d699b6; +@define-color grey0 #7a8478; +@define-color grey1 #859289; +@define-color grey2 #9da9a0; \ No newline at end of file diff --git a/.config/waybar/colors/gruvbox.css b/.config/waybar/colors/gruvbox.css new file mode 100644 index 0000000..c6db81e --- /dev/null +++ b/.config/waybar/colors/gruvbox.css @@ -0,0 +1,31 @@ +@define-color bg_h #1d2021; +@define-color bg #282828; +@define-color bg_s #32302f; +@define-color bg1 #3c3836; +@define-color bg2 #504945; +@define-color bg3 #665c54; +@define-color bg4 #7c6f64; + +@define-color fg #fbf1c7; +@define-color fg1 #ebdbb2; +@define-color fg2 #d5c4a1; +@define-color fg3 #bdae93; +@define-color fg4 #a89984; + +@define-color red #fb4934; +@define-color green #b8bb26; +@define-color yellow #fabd2f; +@define-color blue #83a598; +@define-color purple #d3869b; +@define-color aqua #8ec07c; +@define-color gray #928374; +@define-color orange #fe8019; + +@define-color red-dim #cc2412; +@define-color green-dim #98971a; +@define-color yellow-dim #d79921; +@define-color blue-dim #458588; +@define-color purple-dim #b16286; +@define-color aqua-dim #689d6a; +@define-color gray-dim #a89984; +@define-color orange-dim #d65d0e; \ No newline at end of file diff --git a/.config/waybar/colors/mocha.css b/.config/waybar/colors/mocha.css new file mode 100755 index 0000000..98e218a --- /dev/null +++ b/.config/waybar/colors/mocha.css @@ -0,0 +1,37 @@ +/* +* +* Catppuccin Mocha palette +* Maintainer: rubyowo +* +*/ + +@define-color base #1e1e2e; +@define-color mantle #181825; +@define-color crust #11111b; + +@define-color text #cdd6f4; +@define-color subtext0 #a6adc8; +@define-color subtext1 #bac2de; + +@define-color surface0 #313244; +@define-color surface1 #45475a; +@define-color surface2 #585b70; + +@define-color overlay0 #6c7086; +@define-color overlay1 #7f849c; +@define-color overlay2 #9399b2; + +@define-color blue #89b4fa; +@define-color lavender #b4befe; +@define-color sapphire #74c7ec; +@define-color sky #89dceb; +@define-color teal #94e2d5; +@define-color green #a6e3a1; +@define-color yellow #f9e2af; +@define-color peach #fab387; +@define-color maroon #eba0ac; +@define-color red #f38ba8; +@define-color mauve #cba6f7; +@define-color pink #f5c2e7; +@define-color flamingo #f2cdcd; +@define-color rosewater #f5e0dc; diff --git a/.config/waybar/colors/nord.css b/.config/waybar/colors/nord.css new file mode 100755 index 0000000..13d3339 --- /dev/null +++ b/.config/waybar/colors/nord.css @@ -0,0 +1,23 @@ +/* Polar Night */ +@define-color nord0 #2e3440; +@define-color nord1 #3b4252; +@define-color nord2 #434c5e; +@define-color nord3 #4c566a; + +/* Snow Storm */ +@define-color nord4 #d8dee9; +@define-color nord5 #e5e9f0; +@define-color nord6 #eceff4; + +/* Frost */ +@define-color nord7 #8fbcbb; +@define-color nord8 #88c0d0; +@define-color nord9 #81a1c1; +@define-color nord10 #5e81ac; + +/* Aurora */ +@define-color nord11 #bf616a; +@define-color nord12 #d08770; +@define-color nord13 #ebcb8b; +@define-color nord14 #a3be8c; +@define-color nord15 #b48ead; \ No newline at end of file diff --git a/.config/waybar/colors/solarized.css b/.config/waybar/colors/solarized.css new file mode 100755 index 0000000..8118f96 --- /dev/null +++ b/.config/waybar/colors/solarized.css @@ -0,0 +1,16 @@ +@define-color base03 #002b36; +@define-color base02 #073642; +@define-color base01 #586e75; +@define-color base00 #657b83; +@define-color base0 #839496; +@define-color base1 #93a1a1; +@define-color base2 #eee8d5; +@define-color base3 #fdf6e3; +@define-color yellow #b58900; +@define-color orange #cb4b16; +@define-color red #dc322f; +@define-color magenta #d33682; +@define-color violet #6c71c4; +@define-color blue #268bd2; +@define-color cyan #2aa198; +@define-color green #859900; \ No newline at end of file diff --git a/.config/waybar/config b/.config/waybar/config new file mode 100644 index 0000000..e882bac --- /dev/null +++ b/.config/waybar/config @@ -0,0 +1,149 @@ +{ + "layer": "top", + "height": 35, // Waybar height (to be removed for auto height) + "spacing": 6, // Gaps between modules + "modules-left": ["hyprland/workspaces", "custom/timew"], + "modules-center": ["", "custom/spotify"], + "modules-right": ["custom/pomo", "idle_inhibitor", "pulseaudio", "network", "backlight", "battery", "temperature", "clock", "tray"], + "hyprland/window": { + "sepparate-outputs": true + }, + "custom/pomo": { + "format": "{icon}{text}", + "format-icons": { + "default": "🍅" + }, + "exec": "$HOME/.local/go/bin/pomo && echo ' '", + "interval": 1, + "on-click": "$HOME/.local/go/bin/pomo start", + "on-click-middle": "$HOME/.local/go/bin/pomo start 5m", + "on-click-right": "$HOME/.local/go/bin/pomo stop" + }, + "custom/timew": { + "exec": "$HOME/.config/waybar/twar.sh", + "interval": 1 + }, +"hyprland/workspaces": { + "active-only": false, + "disable-scroll": true, + "on-click": "activate", + "format": "{icon}", + "format-icons": { + "1": "1 ", + "2": "2 󰈹", + "3": "3 󰍡", + "4": "4 ", + "5": "5 ", + "6": "6 ", + "7": "7 ", + "8": "8 ", + "9": "9 ", + "10": "0 󰢁", + } + }, + "keyboard-state": { + "numlock": true, + "capslock": true, + "format": "{name} {icon}", + "format-icons": { + "locked": "", + "unlocked": "" + } + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "tray": { + "spacing": 10 + }, + "clock": { + // "timezone": "America/New_York", + "tooltip-format": "{:%Y %B}\n{calendar}", + "format-alt": "{:%Y-%m-%d}" + }, + "cpu": { + "format": "{usage}% ", + "tooltip": false + }, + "memory": { + "format": "{}% " + }, + "temperature": { + // "thermal-zone": 2, + // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "critical-threshold": 80, + // "format-critical": "{temperatureC}°C {icon}", + "format": "{temperatureC}°C {icon}", + "format-icons": ["", "", ""] + }, + "backlight": { + // "device": "acpi_video1", + "format": "{percent}% {icon}", + "format-icons": ["", "", "", "", "", "", "", "", ""] + }, + "battery": { + "states": { + "good": 95, + "warning": 40, + "critical": 15 + }, + "format": "{capacity}% {icon}", + "format-charging": "{capacity}% ", + "format-plugged": "{capacity}% ", + "format-alt": "{time} {icon}", + // "format-good": "", // An empty format will hide the module + "format-full": "", + "format-icons": ["", "", "", "", ""] + }, + "network": { + // "interface": "wlp2*", // (Optional) To force the use of this interface + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "{ipaddr}/{cidr} ", + "tooltip-format": "{ifname} via {gwaddr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "Disconnected ⚠", + "format-alt": "{ifname}: {ipaddr}/{cidr}" + }, + "pulseaudio": { + "format": "{volume}% {icon}", + "format-bluetooth": "{volume}% {icon} {format_source}", + "format-bluetooth-muted": " {icon} {format_source}", + "format-muted": " {format_source}", + "format-source": "{volume}% ", + "format-source-muted": "", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + "on-click": "pavucontrol" + }, + "custom/timew": { + "exec": "$HOME/.config/waybar/twar.sh", + "interval": 1 + }, + "custom/spotify": { + "format": "{icon} {}", + "return-type": "json", + "max-length": 40, + "format-icons": { + "spotify": "", + "default": "🎜" + }, + "on-click": "playerctl play-pause", + "on-scroll-up": "playerctl previous", + "on-scroll-down": "playerctl next", + "escape": true, + "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name + // "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder + } +} + diff --git a/.config/waybar/everforest-light/config b/.config/waybar/everforest-light/config new file mode 100755 index 0000000..a9e6362 --- /dev/null +++ b/.config/waybar/everforest-light/config @@ -0,0 +1,124 @@ +{ + "margin-top": 0, + "margin-left": 120, + "margin-bottom": 0, + "margin-right": 120, + "height": 60, + "layer": "top", + "position": "top", + "output": "DP-2", + "spacing": 15, + "modules-left": ["custom/launcher", "clock", "clock#date"], + "modules-center": ["wlr/workspaces"], + "modules-right": ["pulseaudio", "network", "battery", "custom/powermenu"], + + "wlr/workspaces": { + "disable-scroll": true, + "all-outputs": true, + "on-click": "activate", + "on-scroll-up": "hyprctl dispatch workspace e+1", + "on-scroll-down": "hyprctl dispatch workspace e-1", + "persistent_workspaces": { + "1": [], + "2": [], + "3": [], + "4": [], + "5": [], + "6": [], + "7": [], + "8": [], + "9": [], + "10": [] + }, + }, + + "custom/launcher": { + "interval": "once", + "format": "󰣇", + "on-click": "pkill wofi || wofi --show drun --term=kitty --width=20% --height=50% --columns 1 -I -s ~/.config/wofi/themes/everforest-light.css -o $MAIN_DISPLAY", + "tooltip": false + }, + + "backlight": { + "device": "nvidia_0", + "max-length": "4", + "format": "{icon}", + "tooltip-format": "{percent}%", + "format-icons": ["","","","", "", "", ""], + "on-click": "", + "on-scroll-up": "brightnessctl set 10%-", + "on-scroll-down": "brightnessctl set +10%" + }, + + "memory": { + "interval": 30, + "format": " {}%", + "format-alt":" {used:0.1f}G", + "max-length": 10 +}, + + "custom/dunst": { + "exec": "~/.config/waybar/scripts/dunst.sh", + "on-click": "dunstctl set-paused toggle", + "restart-interval": 1, + "tooltip": false + }, + + "pulseaudio": { + "format": "{icon} {volume}%", + "format-bluetooth": "{icon}  {volume}%", + "format-bluetooth-muted": "婢  muted", + "format-muted": "婢 muted", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + "on-click-right": "pavucontrol", + "on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle", + }, + +"network": { + "format-wifi": " {signalStrength}%", + "format-ethernet": " {signalStrength}%", + "format-disconnected": "󰤭", + "on-click": "sh ~/.config/wofi/scripts/wifimenu.sh" +}, + +"battery": { + "bat": "BAT0", + "adapter": "ADP0", + "interval": 60, + "states": { + "warning": 30, + "critical": 15 + }, + "max-length": 10, + "format": "{icon} {capacity}%", + "format-warning": "{icon} {capacity}%", + "format-critical": "{icon} {capacity}%", + "format-charging": " {capacity}%", + "format-plugged": " {capacity}%", + "format-alt": "{icon} {capacity}%", + "format-full": " 100%", + "format-icons": ["", "", "", "", "", "", "", "", "", ""] +}, + +"clock": { + "format": " {:%H:%M}" +}, + +"clock#date": { + "format": " {:%A, %B %d, %Y}" +}, + +"custom/powermenu": { + "format": "", + "on-click": "pkill wofi || sh .config/wofi/scripts/powermenu.sh 'everforest-light' '--height=17% -o $MAIN_DISPLAY'", + "tooltip": false + } +} diff --git a/.config/waybar/everforest-light/style.css b/.config/waybar/everforest-light/style.css new file mode 100755 index 0000000..cb7c4f6 --- /dev/null +++ b/.config/waybar/everforest-light/style.css @@ -0,0 +1,85 @@ +@import "../colors/everforest-light.css"; + +/* margin: top right bottom left */ +/* Spacing outside the element */ + +/* padding: top right bottom left */ +/* Spacing inside the element */ + +* { + font-family: JetBrainsMono Nerd Font, FontAwesome; + font-size: 16px; + font-weight: bold; +} + +window#waybar { + background-color: @fg; + color: @bg0; + transition-property: background-color; + transition-duration: 0.5s; + border-radius: 0px 0px 15px 15px; + transition-duration: .5s; + + border-bottom-width: 5px; + border-bottom-color: #2e3538; + border-bottom-style: solid; +} + +#custom-launcher, +#clock, +#clock-date, +#workspaces, +#pulseaudio, +#network, +#battery, +#custom-powermenu { + background-color: @bg0; + color: @fg; + + padding-left: 10px; + padding-right: 10px; + margin-top: 7px; + margin-bottom: 12px; + border-radius: 10px; + + border-bottom-width: 5px; + border-bottom-color: @bg5; + border-bottom-style: solid; +} + +#workspaces { + padding: 0px; +} + +#workspaces button.active { + background-color: @blue; + color: @bg0; + + border-radius: 10px; + + margin-bottom: -5px; + + border-bottom-width: 5px; + border-bottom-color: #1c4a62; + border-bottom-style: solid; +} + +#custom-launcher { + background-color: @green; + color: @bg0; + border-bottom-color: #465000; + + margin-left: 15px; + padding-left: 20px; + padding-right: 21px; +} + +#custom-powermenu { + background-color: @red; + color: @bg0; + border-bottom-color: #9e0906; + + margin-right: 15px; + padding-left: 20px; + padding-right: 23px; +} \ No newline at end of file diff --git a/.config/waybar/everforest/config b/.config/waybar/everforest/config new file mode 100755 index 0000000..6ff3c9f --- /dev/null +++ b/.config/waybar/everforest/config @@ -0,0 +1,124 @@ +{ + "margin-top": 0, + "margin-left": 120, + "margin-bottom": 0, + "margin-right": 120, + "height": 60, + "layer": "top", + "position": "top", + "output": "eDP-1", + "spacing": 15, + "modules-left": ["custom/launcher", "clock", "clock#date"], + "modules-center": ["wlr/workspaces"], + "modules-right": ["pulseaudio", "network", "battery", "custom/powermenu"], + + "wlr/workspaces": { + "disable-scroll": true, + "all-outputs": true, + "on-click": "activate", + "on-scroll-up": "hyprctl dispatch workspace e+1", + "on-scroll-down": "hyprctl dispatch workspace e-1", + "persistent_workspaces": { + "1": [], + "2": [], + "3": [], + "4": [], + "5": [], + "6": [], + "7": [], + "8": [], + "9": [], + "10": [] + }, + }, + + "custom/launcher": { + "interval": "once", + "format": "󰣇", + "on-click": "pkill wofi || wofi --show drun --term=kitty --width=20% --height=50% --columns 1 -I -s ~/.config/wofi/themes/everforest-light.css -o $MAIN_DISPLAY", + "tooltip": false + }, + + "backlight": { + "device": "nvidia_0", + "max-length": "4", + "format": "{icon}", + "tooltip-format": "{percent}%", + "format-icons": ["","","","", "", "", ""], + "on-click": "", + "on-scroll-up": "brightnessctl set 10%-", + "on-scroll-down": "brightnessctl set +10%" + }, + + "memory": { + "interval": 30, + "format": " {}%", + "format-alt":" {used:0.1f}G", + "max-length": 10 +}, + + "custom/dunst": { + "exec": "~/.config/waybar/scripts/dunst.sh", + "on-click": "dunstctl set-paused toggle", + "restart-interval": 1, + "tooltip": false + }, + + "pulseaudio": { + "format": "{icon} {volume}%", + "format-bluetooth": "{icon}  {volume}%", + "format-bluetooth-muted": "婢  muted", + "format-muted": "婢 muted", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + "on-click-right": "pavucontrol", + "on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle", + }, + +"network": { + "format-wifi": " {signalStrength}%", + "format-ethernet": " {signalStrength}%", + "format-disconnected": "󰤭", + "on-click": "sh ~/.config/wofi/scripts/wifimenu.sh" +}, + +"battery": { + "bat": "BAT0", + "adapter": "ADP0", + "interval": 60, + "states": { + "warning": 30, + "critical": 15 + }, + "max-length": 10, + "format": "{icon} {capacity}%", + "format-warning": "{icon} {capacity}%", + "format-critical": "{icon} {capacity}%", + "format-charging": " {capacity}%", + "format-plugged": " {capacity}%", + "format-alt": "{icon} {capacity}%", + "format-full": " 100%", + "format-icons": ["", "", "", "", "", "", "", "", "", ""] +}, + +"clock": { + "format": " {:%H:%M}" +}, + +"clock#date": { + "format": " {:%A, %B %d, %Y}" +}, + +"custom/powermenu": { + "format": "", + "on-click": "pkill wofi || sh .config/wofi/scripts/powermenu.sh 'everforest-light' '--height=17% -o $MAIN_DISPLAY'", + "tooltip": false + } +} diff --git a/.config/waybar/everforest/style.css b/.config/waybar/everforest/style.css new file mode 100755 index 0000000..bba9196 --- /dev/null +++ b/.config/waybar/everforest/style.css @@ -0,0 +1,85 @@ +@import "../colors/everforest.css"; + +/* margin: top right bottom left */ +/* Spacing outside the element */ + +/* padding: top right bottom left */ +/* Spacing inside the element */ + +* { + font-family: JetBrainsMono Nerd Font, FontAwesome; + font-size: 16px; + font-weight: bold; +} + +window#waybar { + background-color: @fg; + color: @bg0; + transition-property: background-color; + transition-duration: 0.5s; + border-radius: 0px 0px 15px 15px; + transition-duration: .5s; + + border-bottom-width: 5px; + border-bottom-color: #7d6a40; + border-bottom-style: solid; +} + +#custom-launcher, +#clock, +#clock-date, +#workspaces, +#pulseaudio, +#network, +#battery, +#custom-powermenu { + background-color: @bg0; + color: @fg; + + padding-left: 10px; + padding-right: 10px; + margin-top: 7px; + margin-bottom: 12px; + border-radius: 10px; + + border-bottom-width: 5px; + border-bottom-color: #161a1d; + border-bottom-style: solid; +} + +#workspaces { + padding: 0px; +} + +#workspaces button.active { + background-color: @blue; + color: @bg0; + + border-radius: 10px; + + margin-bottom: -5px; + + border-bottom-width: 5px; + border-bottom-color: #366660; + border-bottom-style: solid; +} + +#custom-launcher { + background-color: @green; + color: @bg0; + border-bottom-color: #556a35; + + margin-left: 15px; + padding-left: 20px; + padding-right: 21px; +} + +#custom-powermenu { + background-color: @red; + color: @bg0; + border-bottom-color: #951c1f; + + margin-right: 15px; + padding-left: 20px; + padding-right: 23px; +} \ No newline at end of file diff --git a/.config/waybar/mediaplayer.py b/.config/waybar/mediaplayer.py new file mode 100755 index 0000000..1630d97 --- /dev/null +++ b/.config/waybar/mediaplayer.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python3 +import argparse +import logging +import sys +import signal +import gi +import json +gi.require_version('Playerctl', '2.0') +from gi.repository import Playerctl, GLib + +logger = logging.getLogger(__name__) + + +def write_output(text, player): + logger.info('Writing output') + + output = {'text': text, + 'class': 'custom-' + player.props.player_name, + 'alt': player.props.player_name} + + sys.stdout.write(json.dumps(output) + '\n') + sys.stdout.flush() + + +def on_play(player, status, manager): + logger.info('Received new playback status') + on_metadata(player, player.props.metadata, manager) + + +def on_metadata(player, metadata, manager): + logger.info('Received new metadata') + track_info = '' + + if player.props.player_name == 'spotify' and \ + 'mpris:trackid' in metadata.keys() and \ + ':ad:' in player.props.metadata['mpris:trackid']: + track_info = 'AD PLAYING' + elif player.get_artist() != '' and player.get_title() != '': + track_info = '{artist} - {title}'.format(artist=player.get_artist(), + title=player.get_title()) + else: + track_info = player.get_title() + + if player.props.status != 'Playing' and track_info: + track_info = ' ' + track_info + write_output(track_info, player) + + +def on_player_appeared(manager, player, selected_player=None): + if player is not None and (selected_player is None or player.name == selected_player): + init_player(manager, player) + else: + logger.debug("New player appeared, but it's not the selected player, skipping") + + +def on_player_vanished(manager, player): + logger.info('Player has vanished') + sys.stdout.write('\n') + sys.stdout.flush() + + +def init_player(manager, name): + logger.debug('Initialize player: {player}'.format(player=name.name)) + player = Playerctl.Player.new_from_name(name) + player.connect('playback-status', on_play, manager) + player.connect('metadata', on_metadata, manager) + manager.manage_player(player) + on_metadata(player, player.props.metadata, manager) + + +def signal_handler(sig, frame): + logger.debug('Received signal to stop, exiting') + sys.stdout.write('\n') + sys.stdout.flush() + # loop.quit() + sys.exit(0) + + +def parse_arguments(): + parser = argparse.ArgumentParser() + + # Increase verbosity with every occurrence of -v + parser.add_argument('-v', '--verbose', action='count', default=0) + + # Define for which player we're listening + parser.add_argument('--player') + + return parser.parse_args() + + +def main(): + arguments = parse_arguments() + + # Initialize logging + logging.basicConfig(stream=sys.stderr, level=logging.DEBUG, + format='%(name)s %(levelname)s %(message)s') + + # Logging is set by default to WARN and higher. + # With every occurrence of -v it's lowered by one + logger.setLevel(max((3 - arguments.verbose) * 10, 0)) + + # Log the sent command line arguments + logger.debug('Arguments received {}'.format(vars(arguments))) + + manager = Playerctl.PlayerManager() + loop = GLib.MainLoop() + + manager.connect('name-appeared', lambda *args: on_player_appeared(*args, arguments.player)) + manager.connect('player-vanished', on_player_vanished) + + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + signal.signal(signal.SIGPIPE, signal.SIG_DFL) + + for player in manager.props.player_names: + if arguments.player is not None and arguments.player != player.name: + logger.debug('{player} is not the filtered player, skipping it' + .format(player=player.name) + ) + continue + + init_player(manager, player) + + loop.run() + + +if __name__ == '__main__': + main() diff --git a/.config/waybar/mocha.css b/.config/waybar/mocha.css new file mode 100644 index 0000000..75cfb9d --- /dev/null +++ b/.config/waybar/mocha.css @@ -0,0 +1,26 @@ +@define-color rosewater #f5e0dc; +@define-color flamingo #f2cdcd; +@define-color pink #f5c2e7; +@define-color mauve #cba6f7; +@define-color red #f38ba8; +@define-color maroon #eba0ac; +@define-color peach #fab387; +@define-color yellow #f9e2af; +@define-color green #a6e3a1; +@define-color teal #94e2d5; +@define-color sky #89dceb; +@define-color sapphire #74c7ec; +@define-color blue #89b4fa; +@define-color lavender #b4befe; +@define-color text #cdd6f4; +@define-color subtext1 #bac2de; +@define-color subtext0 #a6adc8; +@define-color overlay2 #9399b2; +@define-color overlay1 #7f849c; +@define-color overlay0 #6c7086; +@define-color surface2 #585b70; +@define-color surface1 #45475a; +@define-color surface0 #313244; +@define-color base #1e1e2e; +@define-color mantle #181825; +@define-color crust #11111b; diff --git a/.config/waybar/style.css b/.config/waybar/style.css new file mode 100755 index 0000000..2abe76f --- /dev/null +++ b/.config/waybar/style.css @@ -0,0 +1,116 @@ +@import "./colors/everforest-light.css"; + +/* margin: top right bottom left */ +/* Spacing outside the element */ + +/* padding: top right bottom left */ +/* Spacing inside the element */ + +* { + font-family: FiraCode Nerd Font, FontAwesome; + font-size: 16px; + font-weight: bold; +} + +window#waybar { + background-color: @fg; + color: @bg0; + transition-property: background-color; + transition-duration: 0.5s; + transition-duration: .5s; +} + +#idle_inhibitor, +#custom-launcher, +#clock, +#clock-date, +#workspaces, +#pulseaudio, +#network, +#battery, +#custom-powermenu { + padding-left: 10px; + padding-right: 10px; +} + +#workspaces { + padding: 3px; +} + +#workspaces button.active { + background-color: @green; + color: @bg0; + + border-radius: 10px; + margin-bottom: -5px; +} + +#custom-launcher { + background-color: @green; + color: @bg0; + + margin-left: 15px; + padding-left: 20px; + padding-right: 21px; +} + +#custom-powermenu { + background-color: @red; + color: @bg0; + border-bottom-color: #9e0906; + + margin-right: 15px; + padding-left: 20px; + padding-right: 23px; +} + +@keyframes blink { + to { + background-color: @red; + color: @text; + } +} + +#battery.warning:not(.charging) { + color: @yellow; +} + +#battery.critical:not(.charging) { + background-color: @red; + color: @mantle; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +#custom-timew { + font-size: 18px; + min-width: 100px; + background-color: @yellow; + border-radius: 3px; + color: @mantle; + padding: 0 10px; + margin-left: 50px; + box-shadow: inset 0 -3px @base; +} + +#temperature.critical { + background-color: @red; +} + +#tray { + padding-right: 5px; +} + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: @pink; +} + + diff --git a/.config/waybar/style.css.bak b/.config/waybar/style.css.bak new file mode 100644 index 0000000..cf5c5fb --- /dev/null +++ b/.config/waybar/style.css.bak @@ -0,0 +1,280 @@ +* { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif; + font-size: 13px; +} + +window#waybar { + background-color: rgba(43, 48, 59, 0.5); + border-bottom: 3px solid rgba(100, 114, 125, 0.5); + color: #ffffff; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + +/* +window#waybar.empty { + background-color: transparent; +} +window#waybar.solo { + background-color: #FFFFFF; +} +*/ + +window#waybar.termite { + background-color: #3F3F3F; +} + +window#waybar.chromium { + background-color: #000000; + border: none; +} + +button { + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each button name */ + border: none; + border-radius: 0; +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +button:hover { + background: inherit; + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button { + padding: 0 5px; + background-color: transparent; + color: #ffffff; +} + +#workspaces button:hover { + background: rgba(0, 0, 0, 0.2); +} + +#workspaces button.focused { + background-color: #64727D; + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button.urgent { + background-color: #eb4d4b; +} + +#mode { + background-color: #64727D; + border-bottom: 3px solid #ffffff; +} + +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#wireplumber, +#custom-media, +#tray, +#mode, +#idle_inhibitor, +#scratchpad, +#mpd { + padding: 0 10px; + color: #ffffff; +} + +#window, +#workspaces { + margin: 0 4px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right > widget:last-child > #workspaces { + margin-right: 0; +} + +#clock { + background-color: #64727D; +} + +#battery { + background-color: #ffffff; + color: #000000; +} + +#battery.charging, #battery.plugged { + color: #ffffff; + background-color: #26A65B; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +label:focus { + background-color: #000000; +} + +#cpu { + background-color: #2ecc71; + color: #000000; +} + +#memory { + background-color: #9b59b6; +} + +#disk { + background-color: #964B00; +} + +#backlight { + background-color: #90b1b1; +} + +#network { + background-color: #2980b9; +} + +#network.disconnected { + background-color: #f53c3c; +} + +#pulseaudio { + background-color: #f1c40f; + color: #000000; +} + +#pulseaudio.muted { + background-color: #90b1b1; + color: #2a5c45; +} + +#wireplumber { + background-color: #fff0f5; + color: #000000; +} + +#wireplumber.muted { + background-color: #f53c3c; +} + +#custom-media { + background-color: #66cc99; + color: #2a5c45; + min-width: 100px; +} + +#custom-media.custom-spotify { + background-color: #66cc99; +} + +#custom-media.custom-vlc { + background-color: #ffa000; +} + +#temperature { + background-color: #f0932b; +} + +#temperature.critical { + background-color: #eb4d4b; +} + +#tray { + background-color: #2980b9; +} + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + +#idle_inhibitor { + background-color: #2d3436; +} + +#idle_inhibitor.activated { + background-color: #ecf0f1; + color: #2d3436; +} + +#mpd { + background-color: #66cc99; + color: #2a5c45; +} + +#mpd.disconnected { + background-color: #f53c3c; +} + +#mpd.stopped { + background-color: #90b1b1; +} + +#mpd.paused { + background-color: #51a37a; +} + +#language { + background: #00b093; + color: #740864; + padding: 0 5px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state { + background: #97e1ad; + color: #000000; + padding: 0 0px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state > label { + padding: 0 5px; +} + +#keyboard-state > label.locked { + background: rgba(0, 0, 0, 0.2); +} + +#scratchpad { + background: rgba(0, 0, 0, 0.2); +} + +#scratchpad.empty { + background-color: transparent; +} diff --git a/.config/waybar/twar.sh b/.config/waybar/twar.sh new file mode 100755 index 0000000..71e11f1 --- /dev/null +++ b/.config/waybar/twar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +atime=$(timew | grep Total | awk '{print $2}') + +if [ -n "$atime" ]; then + echo "Timew: $atime" +fi diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0a3b4a8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.config/lvim/lv-settings.lua diff --git a/.p10k.zsh b/.p10k.zsh new file mode 100644 index 0000000..5874ac9 --- /dev/null +++ b/.p10k.zsh @@ -0,0 +1,1844 @@ +# Generated by Powerlevel10k configuration wizard on 2025-05-11 at 11:51 EEST. +# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 49619. +# Wizard options: nerdfont-v3 + powerline, large icons, rainbow, unicode, +# angled separators, sharp heads, flat tails, 2 lines, solid, left frame, +# lightest-ornaments, sparse, many icons, concise, transient_prompt, +# instant_prompt=verbose. +# Type `p10k configure` to generate another config. +# +# Config for Powerlevel10k with powerline prompt style with colorful background. +# Type `p10k configure` to generate your own config based on it. +# +# Tip: Looking for a nice color? Here's a one-liner to print colormap. +# +# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done + +# Temporarily change options. +'builtin' 'local' '-a' 'p10k_config_opts' +[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') +[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') +[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') +'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' + +() { + emulate -L zsh -o extended_glob + + # Unset all configuration options. This allows you to apply configuration changes without + # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. + unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' + + # Zsh >= 5.1 is required. + [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return + + # The list of segments shown on the left. Fill it with the most important segments. + typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( + # =========================[ Line #1 ]========================= + os_icon # os identifier + dir # current directory + vcs # git status + # =========================[ Line #2 ]========================= + newline # \n + # prompt_char # prompt symbol + ) + + # The list of segments shown on the right. Fill it with less important segments. + # Right prompt on the last prompt line (where you are typing your commands) gets + # automatically hidden when the input line reaches it. Right prompt above the + # last prompt line gets hidden if it would overlap with left prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( + # =========================[ Line #1 ]========================= + status # exit code of the last command + command_execution_time # duration of the last command + background_jobs # presence of background jobs + direnv # direnv status (https://direnv.net/) + asdf # asdf version manager (https://github.com/asdf-vm/asdf) + virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) + anaconda # conda environment (https://conda.io/) + pyenv # python environment (https://github.com/pyenv/pyenv) + goenv # go environment (https://github.com/syndbg/goenv) + nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) + nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) + nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) + # node_version # node.js version + # go_version # go version (https://golang.org) + # rust_version # rustc version (https://www.rust-lang.org) + # dotnet_version # .NET version (https://dotnet.microsoft.com) + # php_version # php version (https://www.php.net/) + # laravel_version # laravel php framework version (https://laravel.com/) + # java_version # java version (https://www.java.com/) + # package # name@version from package.json (https://docs.npmjs.com/files/package.json) + rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) + rvm # ruby version from rvm (https://rvm.io) + fvm # flutter version management (https://github.com/leoafarias/fvm) + luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) + jenv # java version from jenv (https://github.com/jenv/jenv) + plenv # perl version from plenv (https://github.com/tokuhirom/plenv) + perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew) + phpenv # php version from phpenv (https://github.com/phpenv/phpenv) + scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) + haskell_stack # haskell version from stack (https://haskellstack.org/) + kubecontext # current kubernetes context (https://kubernetes.io/) + terraform # terraform workspace (https://www.terraform.io) + # terraform_version # terraform version (https://www.terraform.io) + aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) + aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) + azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) + gcloud # google cloud cli account and project (https://cloud.google.com/) + google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) + toolbox # toolbox name (https://github.com/containers/toolbox) + context # user@hostname + nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) + ranger # ranger shell (https://github.com/ranger/ranger) + yazi # yazi shell (https://github.com/sxyazi/yazi) + nnn # nnn shell (https://github.com/jarun/nnn) + lf # lf shell (https://github.com/gokcehan/lf) + xplr # xplr shell (https://github.com/sayanarijit/xplr) + vim_shell # vim shell indicator (:sh) + midnight_commander # midnight commander shell (https://midnight-commander.org/) + nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) + chezmoi_shell # chezmoi shell (https://www.chezmoi.io/) + vi_mode # vi mode (you don't need this if you've enabled prompt_char) + # vpn_ip # virtual private network indicator + # load # CPU load + # disk_usage # disk usage + # ram # free RAM + # swap # used swap + todo # todo items (https://github.com/todotxt/todo.txt-cli) + timewarrior # timewarrior tracking status (https://timewarrior.net/) + taskwarrior # taskwarrior task count (https://taskwarrior.org/) + per_directory_history # Oh My Zsh per-directory-history local/global indicator + # cpu_arch # CPU architecture + # time # current time + # =========================[ Line #2 ]========================= + newline + # ip # ip address and bandwidth usage for a specified network interface + # public_ip # public IP address + # proxy # system-wide http/https/ftp proxy + # battery # internal battery + # wifi # wifi speed + # example # example user-defined segment (see prompt_example function below) + ) + + # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. + typeset -g POWERLEVEL9K_MODE=nerdfont-v3 + # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid + # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. + typeset -g POWERLEVEL9K_ICON_PADDING=moderate + + # When set to true, icons appear before content on both sides of the prompt. When set + # to false, icons go after content. If empty or not set, icons go before content in the left + # prompt and after content in the right prompt. + # + # You can also override it for a specific segment: + # + # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false + # + # Or for a specific segment in specific state: + # + # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false + typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT= + + # Add an empty line before each prompt. + typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true + + # Connect left prompt lines with these symbols. You'll probably want to use the same color + # as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%244F╭─' + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%244F├─' + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%244F╰─' + # Connect right prompt lines with these symbols. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX= + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX= + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX= + + # Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or + # '─'. The last two make it easier to see the alignment between left and right prompt and to + # separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false + # for more compact prompt if using this option. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR='─' + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND= + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND= + if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then + # The color of the filler. You'll probably want to match the color of POWERLEVEL9K_MULTILINE + # ornaments defined above. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=244 + # Start filler from the edge of the screen if there are no left segments on the first line. + typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' + # End filler on the edge of the screen if there are no right segments on the first line. + typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' + fi + + # Separator between same-color segments on the left. + typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0B1' + # Separator between same-color segments on the right. + typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0B3' + # Separator between different-color segments on the left. + typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0' + # Separator between different-color segments on the right. + typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2' + # To remove a separator between two segments, add "_joined" to the second segment name. + # For example: POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(os_icon context_joined) + + # The right end of left prompt. + typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' + # The left end of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2' + # The left end of left prompt. + typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='' + # The right end of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='' + # Left prompt terminator for lines without any segments. + typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= + + #################################[ os_icon: os identifier ]################################## + # OS identifier color. + typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=232 + typeset -g POWERLEVEL9K_OS_ICON_BACKGROUND=7 + # Custom icon. + # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' + + ################################[ prompt_char: prompt symbol ]################################ + # Transparent background. + typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND= + # Green prompt symbol if the last command succeeded. + typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 + # Red prompt symbol if the last command failed. + typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196 + # Default prompt symbol. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' + # Prompt symbol in command vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' + # Prompt symbol in visual vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' + # Prompt symbol in overwrite vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' + typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true + # No line terminator if prompt_char is the last segment. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= + # No line introducer if prompt_char is the first segment. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= + # No surrounding whitespace. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_{LEFT,RIGHT}_WHITESPACE= + + ##################################[ dir: current directory ]################################## + # Current directory background color. + typeset -g POWERLEVEL9K_DIR_BACKGROUND=4 + # Default current directory foreground color. + typeset -g POWERLEVEL9K_DIR_FOREGROUND=254 + # If directory is too long, shorten some of its segments to the shortest possible unique + # prefix. The shortened directory can be tab-completed to the original. + typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique + # Replace removed segment suffixes with this symbol. + typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= + # Color of the shortened directory segments. + typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=250 + # Color of the anchor directory segments. Anchor segments are never shortened. The first + # segment is always an anchor. + typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=255 + # Display anchor directory segments in bold. + typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true + # Don't shorten directories that contain any of these files. They are anchors. + local anchor_files=( + .bzr + .citc + .git + .hg + .node-version + .python-version + .go-version + .ruby-version + .lua-version + .java-version + .perl-version + .php-version + .tool-versions + .mise.toml + .shorten_folder_marker + .svn + .terraform + CVS + Cargo.toml + composer.json + go.mod + package.json + stack.yaml + ) + typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" + # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains + # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is + # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) + # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers + # and other directories don't. + # + # Optionally, "first" and "last" can be followed by ":" where is an integer. + # This moves the truncation point to the right (positive offset) or to the left (negative offset) + # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" + # respectively. + typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false + # Don't shorten this many last directory segments. They are anchors. + typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 + # Shorten directory if it's longer than this even if there is space for it. The value can + # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, + # directory will be shortened only when prompt doesn't fit or when other parameters demand it + # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). + # If set to `0`, directory will always be shortened to its minimum length. + typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 + # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this + # many columns for typing commands. + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 + # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least + # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 + # If set to true, embed a hyperlink into the directory. Useful for quickly + # opening a directory in the file manager simply by clicking the link. + # Can also be handy when the directory is shortened, as it allows you to see + # the full directory that was used in previous commands. + typeset -g POWERLEVEL9K_DIR_HYPERLINK=false + + # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON + # and POWERLEVEL9K_DIR_CLASSES below. + typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 + + # The default icon shown next to non-writable and non-existent directories when + # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. + # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' + + # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different + # directories. It must be an array with 3 * N elements. Each triplet consists of: + # + # 1. A pattern against which the current directory ($PWD) is matched. Matching is done with + # extended_glob option enabled. + # 2. Directory class for the purpose of styling. + # 3. An empty string. + # + # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. + # + # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories + # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_DIR_CLASSES=( + # '~/work(|/*)' WORK '' + # '~(|/*)' HOME '' + # '*' DEFAULT '') + # + # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one + # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or + # WORK_NON_EXISTENT. + # + # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an + # option to define custom colors and icons for different directory classes. + # + # # Styling for WORK. + # typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=255 + # + # # Styling for WORK_NOT_WRITABLE. + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=255 + # + # # Styling for WORK_NON_EXISTENT. + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=255 + # + # If a styling parameter isn't explicitly defined for some class, it falls back to the classless + # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls + # back to POWERLEVEL9K_DIR_FOREGROUND. + # + # typeset -g POWERLEVEL9K_DIR_CLASSES=() + + # Custom prefix. + # typeset -g POWERLEVEL9K_DIR_PREFIX='in ' + + #####################################[ vcs: git status ]###################################### + # Version control background colors. + typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2 + typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3 + typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=2 + typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND=3 + typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=8 + + # Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon. + typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 ' + + # Untracked files icon. It's really a question mark, your font isn't broken. + # Change the value of this parameter to show a different icon. + typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' + + # Formatter for Git status. + # + # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42. + # + # You can edit the function to customize how Git status looks. + # + # VCS_STATUS_* parameters are set by gitstatus plugin. See reference: + # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. + function my_git_formatter() { + emulate -L zsh + + if [[ -n $P9K_CONTENT ]]; then + # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from + # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. + typeset -g my_git_format=$P9K_CONTENT + return + fi + + # Styling for different parts of Git status. + local meta='%7F' # white foreground + local clean='%0F' # black foreground + local modified='%0F' # black foreground + local untracked='%0F' # black foreground + local conflicted='%1F' # red foreground + + local res + + if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then + local branch=${(V)VCS_STATUS_LOCAL_BRANCH} + # If local branch name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show local branch name in full without truncation, delete the next line. + (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line + res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" + fi + + if [[ -n $VCS_STATUS_TAG + # Show tag only if not on a branch. + # Tip: To always show tag, delete the next line. + && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line + ]]; then + local tag=${(V)VCS_STATUS_TAG} + # If tag name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show tag name in full without truncation, delete the next line. + (( $#tag > 32 )) && tag[13,-13]="…" # <-- this line + res+="${meta}#${clean}${tag//\%/%%}" + fi + + # Display the current Git commit if there is no branch and no tag. + # Tip: To always display the current Git commit, delete the next line. + [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line + res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" + + # Show tracking branch name if it differs from local branch. + if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then + res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" + fi + + # Display "wip" if the latest commit's summary contains "wip" or "WIP". + if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then + res+=" ${modified}wip" + fi + + if (( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )); then + # ⇣42 if behind the remote. + (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" + # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. + (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then + # Tip: Uncomment the next line to display '=' if up to date with the remote. + # res+=" ${clean}=" + fi + + # ⇠42 if behind the push remote. + (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" + (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " + # ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42. + (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}" + # *42 if have stashes. + (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" + # 'merge' if the repo is in an unusual state. + [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" + # ~42 if have merge conflicts. + (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" + # +42 if have staged changes. + (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" + # !42 if have unstaged changes. + (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" + # ?42 if have untracked files. It's really a question mark, your font isn't broken. + # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. + # Remove the next line if you don't want to see untracked files at all. + (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" + # "─" if the number of unstaged files is unknown. This can happen due to + # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower + # than the number of files in the Git index, or due to bash.showDirtyState being set to false + # in the repository config. The number of staged and untracked files may also be unknown + # in this case. + (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─" + + typeset -g my_git_format=$res + } + functions -M my_git_formatter 2>/dev/null + + # Don't count the number of unstaged, untracked and conflicted files in Git repositories with + # more than this many files in the index. Negative value means infinity. + # + # If you are working in Git repositories with tens of millions of files and seeing performance + # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output + # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's + # config: `git config bash.showDirtyState false`. + typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 + + # Don't show Git status in prompt for repositories whose workdir matches this pattern. + # For example, if set to '~', the Git repository at $HOME/.git will be ignored. + # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. + typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' + + # Disable the default Git status formatting. + typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true + # Install our own Git status formatter. + typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter()))+${my_git_format}}' + # Enable counters for staged, unstaged, etc. + typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 + + # Custom icon. + # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_VCS_PREFIX='on ' + + # Show status of repositories of these types. You can add svn and/or hg if you are + # using them. If you do, your prompt may become slow even when your current directory + # isn't in an svn or hg repository. + typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) + + ##########################[ status: exit code of the last command ]########################### + # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and + # style them independently from the regular OK and ERROR state. + typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true + + # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as + # it will signify success by turning green. + typeset -g POWERLEVEL9K_STATUS_OK=true + typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' + typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=2 + typeset -g POWERLEVEL9K_STATUS_OK_BACKGROUND=0 + + # Status when some part of a pipe command fails but the overall exit status is zero. It may look + # like this: 1|0. + typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=2 + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND=0 + + # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as + # it will signify error by turning red. + typeset -g POWERLEVEL9K_STATUS_ERROR=true + typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND=1 + + # Status when the last command was terminated by a signal. + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true + # Use terse signal names: "INT" instead of "SIGINT(2)". + typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_BACKGROUND=1 + + # Status when some part of a pipe command fails and the overall exit status is also non-zero. + # It may look like this: 1|0. + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_BACKGROUND=1 + + ###################[ command_execution_time: duration of the last command ]################### + # Execution time color. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=0 + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=3 + # Show duration of the last command if takes at least this many seconds. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 + # Show this many fractional digits. Zero means round to seconds. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 + # Duration format: 1d 2h 3m 4s. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' + # Custom icon. + # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='took ' + + #######################[ background_jobs: presence of background jobs ]####################### + # Background jobs color. + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=6 + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=0 + # Don't show the number of background jobs. + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false + # Custom icon. + # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ direnv: direnv status (https://direnv.net/) ]######################## + # Direnv color. + typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3 + typeset -g POWERLEVEL9K_DIRENV_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### + # Default asdf color. Only used to display tools for which there is no color override (see below). + # Tip: Override these parameters for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND and + # POWERLEVEL9K_ASDF_${TOOL}_BACKGROUND. + typeset -g POWERLEVEL9K_ASDF_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_BACKGROUND=7 + + # There are four parameters that can be used to hide asdf tools. Each parameter describes + # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at + # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to + # hide a tool, it gets shown. + # + # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and + # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands: + # + # asdf local python 3.8.1 + # asdf global python 3.8.1 + # + # After running both commands the current python version is 3.8.1 and its source is "local" as + # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, + # it'll hide python version in this case because 3.8.1 is the same as the global version. + # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't + # contain "local". + + # Hide tool versions that don't come from one of these sources. + # + # Available sources: + # + # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" + # - local `asdf current` says "set by /some/not/home/directory/file" + # - global `asdf current` says "set by /home/username/file" + # + # Note: If this parameter is set to (shell local global), it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. + typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) + + # If set to false, hide tool versions that are the same as global. + # + # Note: The name of this parameter doesn't reflect its meaning at all. + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. + typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false + + # If set to false, hide tool versions that are equal to "system". + # + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. + typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true + + # If set to non-empty value, hide tools unless there is a file matching the specified file pattern + # in the current directory, or its parent directory, or its grandparent directory, and so on. + # + # Note: If this parameter is set to empty value, it won't hide tools. + # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB. + # + # Example: Hide nodejs version when there is no package.json and no *.js files in the current + # directory, in `..`, in `../..` and so on. + # + # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json' + typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= + + # Ruby version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_RUBY_BACKGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Python version from asdf. + typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PYTHON_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Go version from asdf. + typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_GOLANG_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Node.js version from asdf. + typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_NODEJS_BACKGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Rust version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_RUST_BACKGROUND=208 + # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar' + + # .NET Core version from asdf. + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Flutter version from asdf. + typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_FLUTTER_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Lua version from asdf. + typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_LUA_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Java version from asdf. + typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=1 + typeset -g POWERLEVEL9K_ASDF_JAVA_BACKGROUND=7 + # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Perl version from asdf. + typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PERL_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Erlang version from asdf. + typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_ERLANG_BACKGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Elixir version from asdf. + typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_ELIXIR_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Postgres version from asdf. + typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_POSTGRES_BACKGROUND=6 + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar' + + # PHP version from asdf. + typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PHP_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Haskell version from asdf. + typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_HASKELL_BACKGROUND=3 + # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Julia version from asdf. + typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_JULIA_BACKGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' + + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### + # NordVPN connection indicator color. + typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7 + typeset -g POWERLEVEL9K_NORDVPN_BACKGROUND=4 + # Hide NordVPN connection indicator when not connected. + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= + # Custom icon. + # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## + # Ranger shell color. + typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3 + typeset -g POWERLEVEL9K_RANGER_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]##################### + # Yazi shell color. + typeset -g POWERLEVEL9K_YAZI_FOREGROUND=3 + typeset -g POWERLEVEL9K_YAZI_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### + # Nnn shell color. + typeset -g POWERLEVEL9K_NNN_FOREGROUND=0 + typeset -g POWERLEVEL9K_NNN_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################[ lf: lf shell (https://github.com/gokcehan/lf) ]####################### + # lf shell color. + typeset -g POWERLEVEL9K_LF_FOREGROUND=0 + typeset -g POWERLEVEL9K_LF_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_LF_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## + # xplr shell color. + typeset -g POWERLEVEL9K_XPLR_FOREGROUND=0 + typeset -g POWERLEVEL9K_XPLR_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########################[ vim_shell: vim shell indicator (:sh) ]########################### + # Vim shell indicator color. + typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_VIM_SHELL_BACKGROUND=2 + # Custom icon. + # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### + # Midnight Commander shell color. + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3 + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## + # Nix shell color. + typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_NIX_SHELL_BACKGROUND=4 + + # Display the icon of nix_shell if PATH contains a subdirectory of /nix/store. + # typeset -g POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH=false + + # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. + # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################[ chezmoi_shell: chezmoi shell (https://www.chezmoi.io/) ]################## + # chezmoi shell color. + typeset -g POWERLEVEL9K_CHEZMOI_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_CHEZMOI_SHELL_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_CHEZMOI_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################################[ disk_usage: disk usage ]################################## + # Colors for different levels of disk usage. + typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=3 + typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_BACKGROUND=0 + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=0 + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_BACKGROUND=3 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=7 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_BACKGROUND=1 + # Thresholds for different levels of disk usage (percentage points). + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 + # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent. + typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false + # Custom icon. + # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]########### + # Foreground color. + typeset -g POWERLEVEL9K_VI_MODE_FOREGROUND=0 + # Text and color for normal (a.k.a. command) vi mode. + typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL + typeset -g POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND=2 + # Text and color for visual vi mode. + typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL + typeset -g POWERLEVEL9K_VI_MODE_VISUAL_BACKGROUND=4 + # Text and color for overtype (a.k.a. overwrite and replace) vi mode. + typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE + typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_BACKGROUND=3 + # Text and color for insert vi mode. + typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING= + typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8 + # Custom icon. + # typeset -g POWERLEVEL9K_VI_MODE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################################[ ram: free RAM ]####################################### + # RAM color. + typeset -g POWERLEVEL9K_RAM_FOREGROUND=0 + typeset -g POWERLEVEL9K_RAM_BACKGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################################[ swap: used swap ]###################################### + # Swap color. + typeset -g POWERLEVEL9K_SWAP_FOREGROUND=0 + typeset -g POWERLEVEL9K_SWAP_BACKGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################################[ load: CPU load ]###################################### + # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. + typeset -g POWERLEVEL9K_LOAD_WHICH=5 + # Load color when load is under 50%. + typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_NORMAL_BACKGROUND=2 + # Load color when load is between 50% and 70%. + typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_WARNING_BACKGROUND=3 + # Load color when load is over 70%. + typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND=1 + # Custom icon. + # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ + # Todo color. + typeset -g POWERLEVEL9K_TODO_FOREGROUND=0 + typeset -g POWERLEVEL9K_TODO_BACKGROUND=8 + # Hide todo when the total number of tasks is zero. + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true + # Hide todo when the number of tasks after filtering is zero. + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false + + # Todo format. The following parameters are available within the expansion. + # + # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. + # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. + # + # These variables correspond to the last line of the output of `todo.sh -p ls`: + # + # TODO: 24 of 42 tasks shown + # + # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. + # + # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' + + # Custom icon. + # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ + # Timewarrior color. + typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=255 + typeset -g POWERLEVEL9K_TIMEWARRIOR_BACKGROUND=8 + + # If the tracked task is longer than 24 characters, truncate and append "…". + # Tip: To always display tasks without truncation, delete the following parameter. + # Tip: To hide task names and display just the icon when time tracking is enabled, set the + # value of the following parameter to "". + typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+…}' + + # Custom icon. + # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## + # Taskwarrior color. + typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=0 + typeset -g POWERLEVEL9K_TASKWARRIOR_BACKGROUND=6 + + # Taskwarrior segment format. The following parameters are available within the expansion. + # + # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. + # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`. + # + # Zero values are represented as empty parameters. + # + # The default format: + # + # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT' + # + # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' + + # Custom icon. + # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######[ per_directory_history: Oh My Zsh per-directory-history local/global indicator ]####### + # Color when using local/global history. + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_BACKGROUND=5 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_BACKGROUND=3 + + # Tip: Uncomment the next two lines to hide "local"/"global" text and leave just the icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_CONTENT_EXPANSION='' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_CONTENT_EXPANSION='' + + # Custom icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################################[ cpu_arch: CPU architecture ]################################ + # CPU architecture color. + typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=0 + typeset -g POWERLEVEL9K_CPU_ARCH_BACKGROUND=3 + + # Hide the segment when on a specific CPU architecture. + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_CONTENT_EXPANSION= + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_VISUAL_IDENTIFIER_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_CPU_ARCH_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################################[ context: user@hostname ]################################## + # Context color when running with privileges. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1 + typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=0 + # Context color in SSH without privileges. + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=3 + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_BACKGROUND=0 + # Default context color (no privileges, no SSH). + typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=3 + typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=0 + + # Context format when running with privileges: user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%n@%m' + # Context format when in SSH without privileges: user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' + # Default context format (no privileges, no SSH): user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' + + # Don't show context unless running with privileges or in SSH. + # Tip: Remove the next line to always show context. + typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='with ' + + ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### + # Python virtual environment color. + typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=4 + # Don't show Python version next to the virtual environment name. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false + # If set to "false", won't show virtualenv if pyenv is already shown. + # If set to "if-different", won't show virtualenv if it's the same as pyenv. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false + # Separate environment name from Python version only with a space. + typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################[ anaconda: conda environment (https://conda.io/) ]###################### + # Anaconda environment color. + typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ANACONDA_BACKGROUND=4 + + # Anaconda segment format. The following parameters are available within the expansion. + # + # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. + # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. + # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). + # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). + # + # CONDA_PROMPT_MODIFIER can be configured with the following command: + # + # conda config --set env_prompt '({default_env}) ' + # + # The last argument is a Python format string that can use the following variables: + # + # - prefix The same as CONDA_PREFIX. + # - default_env The same as CONDA_DEFAULT_ENV. + # - name The last segment of CONDA_PREFIX. + # - stacked_env Comma-separated list of names in the environment stack. The first element is + # always the same as default_env. + # + # Note: '({default_env}) ' is the default value of env_prompt. + # + # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER + # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former + # is empty. + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' + + # Custom icon. + # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ + # Pyenv color. + typeset -g POWERLEVEL9K_PYENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PYENV_BACKGROUND=4 + # Hide python version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) + # If set to false, hide python version if it's the same as global: + # $(pyenv version-name) == $(pyenv global). + typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide python version if it's equal to "system". + typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true + + # Pyenv segment format. The following parameters are available within the expansion. + # + # - P9K_CONTENT Current pyenv environment (pyenv version-name). + # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). + # + # The default format has the following logic: + # + # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or + # starts with "$P9K_PYENV_PYTHON_VERSION/". + # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". + typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' + + # Custom icon. + # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ + # Goenv color. + typeset -g POWERLEVEL9K_GOENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_GOENV_BACKGROUND=4 + # Hide go version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) + # If set to false, hide go version if it's the same as global: + # $(goenv version-name) == $(goenv global). + typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide go version if it's equal to "system". + typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## + # Nodenv color. + typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_NODENV_BACKGROUND=0 + # Hide node version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) + # If set to false, hide node version if it's the same as global: + # $(nodenv version-name) == $(nodenv global). + typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### + # Nvm color. + typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 + # If set to false, hide node version if it's the same as default: + # $(nvm version current) == $(nvm version default). + typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ + # Nodeenv color. + typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_NODEENV_BACKGROUND=0 + # Don't show Node version next to the environment name. + typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false + # Separate environment name from Node version only with a space. + typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############################[ node_version: node.js version ]############################### + # Node version color. + typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=7 + typeset -g POWERLEVEL9K_NODE_VERSION_BACKGROUND=2 + # Show node version only when in a directory tree containing package.json. + typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ go_version: go version (https://golang.org) ]######################## + # Go version color. + typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=255 + typeset -g POWERLEVEL9K_GO_VERSION_BACKGROUND=2 + # Show go version only when in a go project subdirectory. + typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## + # Rust version color. + typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=0 + typeset -g POWERLEVEL9K_RUST_VERSION_BACKGROUND=208 + # Show rust version only when in a rust project subdirectory. + typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ + # .NET version color. + typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=7 + typeset -g POWERLEVEL9K_DOTNET_VERSION_BACKGROUND=5 + # Show .NET version only when in a .NET project subdirectory. + typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################[ php_version: php version (https://www.php.net/) ]###################### + # PHP version color. + typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=0 + typeset -g POWERLEVEL9K_PHP_VERSION_BACKGROUND=5 + # Show PHP version only when in a PHP project subdirectory. + typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]########### + # Laravel version color. + typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=1 + typeset -g POWERLEVEL9K_LARAVEL_VERSION_BACKGROUND=7 + # Custom icon. + # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## + # Rbenv color. + typeset -g POWERLEVEL9K_RBENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_RBENV_BACKGROUND=1 + # Hide ruby version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) + # If set to false, hide ruby version if it's the same as global: + # $(rbenv version-name) == $(rbenv global). + typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide ruby version if it's equal to "system". + typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ####################[ java_version: java version (https://www.java.com/) ]#################### + # Java version color. + typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=1 + typeset -g POWERLEVEL9K_JAVA_VERSION_BACKGROUND=7 + # Show java version only when in a java project subdirectory. + typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true + # Show brief version. + typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false + # Custom icon. + # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### + # Package color. + typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=0 + typeset -g POWERLEVEL9K_PACKAGE_BACKGROUND=6 + + # Package format. The following parameters are available within the expansion. + # + # - P9K_PACKAGE_NAME The value of `name` field in package.json. + # - P9K_PACKAGE_VERSION The value of `version` field in package.json. + # + # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' + + # Custom icon. + # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## + # Rvm color. + typeset -g POWERLEVEL9K_RVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_RVM_BACKGROUND=240 + # Don't show @gemset at the end. + typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false + # Don't show ruby- at the front. + typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false + # Custom icon. + # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ + # Fvm color. + typeset -g POWERLEVEL9K_FVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_FVM_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### + # Lua color. + typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_LUAENV_BACKGROUND=4 + # Hide lua version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) + # If set to false, hide lua version if it's the same as global: + # $(luaenv version-name) == $(luaenv global). + typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide lua version if it's equal to "system". + typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ + # Java color. + typeset -g POWERLEVEL9K_JENV_FOREGROUND=1 + typeset -g POWERLEVEL9K_JENV_BACKGROUND=7 + # Hide java version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) + # If set to false, hide java version if it's the same as global: + # $(jenv version-name) == $(jenv global). + typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide java version if it's equal to "system". + typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ + # Perl color. + typeset -g POWERLEVEL9K_PLENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PLENV_BACKGROUND=4 + # Hide perl version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) + # If set to false, hide perl version if it's the same as global: + # $(plenv version-name) == $(plenv global). + typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide perl version if it's equal to "system". + typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############ + # Perlbrew color. + typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67 + # Show perlbrew version only when in a perl project subdirectory. + typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true + # Don't show "perl-" at the front. + typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false + # Custom icon. + # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ + # PHP color. + typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PHPENV_BACKGROUND=5 + # Hide php version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) + # If set to false, hide php version if it's the same as global: + # $(phpenv version-name) == $(phpenv global). + typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide PHP version if it's equal to "system". + typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### + # Scala color. + typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_SCALAENV_BACKGROUND=1 + # Hide scala version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) + # If set to false, hide scala version if it's the same as global: + # $(scalaenv version-name) == $(scalaenv global). + typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide scala version if it's equal to "system". + typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### + # Haskell color. + typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=0 + typeset -g POWERLEVEL9K_HASKELL_STACK_BACKGROUND=3 + + # Hide haskell version if it doesn't come from one of these sources. + # + # shell: version is set by STACK_YAML + # local: version is set by stack.yaml up the directory tree + # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml) + typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) + # If set to false, hide haskell version if it's the same as in the implicit global project. + typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true + # Custom icon. + # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ terraform: terraform workspace (https://www.terraform.io) ]################# + # Don't show terraform workspace if it's literally "default". + typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false + # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current terraform workspace gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current terraform workspace is "project_test", its class is TEST because "project_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_BACKGROUND=0 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=4 + typeset -g POWERLEVEL9K_TERRAFORM_OTHER_BACKGROUND=0 + # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ terraform_version: terraform version (https://www.terraform.io) ]############## + # Terraform version color. + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4 + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]################# + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf' + + #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# + # Show kubecontext only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show kubecontext. + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl|sparkctl' + + # Kubernetes context classes for the purpose of using different colors, icons and expansions with + # different contexts. + # + # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current kubernetes context gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current kubernetes context is "deathray-testing/default", its class is TEST + # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=0 + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_BACKGROUND=2 + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_BACKGROUND=5 + # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext + # segment. Parameter expansions are very flexible and fast, too. See reference: + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. + # + # Within the expansion the following parameters are always available: + # + # - P9K_CONTENT The content that would've been displayed if there was no content + # expansion defined. + # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the + # output of `kubectl config get-contexts`. + # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the + # output of `kubectl config get-contexts`. + # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE + # in the output of `kubectl config get-contexts`. If there is no + # namespace, the parameter is set to "default". + # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the + # output of `kubectl config get-contexts`. + # + # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), + # the following extra parameters are available: + # + # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. + # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. + # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. + # + # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, + # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": + # + # - P9K_KUBECONTEXT_CLOUD_NAME=gke + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account + # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a + # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 + # + # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": + # + # - P9K_KUBECONTEXT_CLOUD_NAME=eks + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 + # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 + # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= + # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' + # Append the current context's namespace if it's not "default". + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' + + # Custom prefix. + # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='at ' + + #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# + # Show aws only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show aws. + typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|cdk|terraform|pulumi|terragrunt' + + # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current AWS profile gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AWS_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current AWS profile is "company_test", its class is TEST + # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AWS_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_AWS_DEFAULT_BACKGROUND=1 + # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # AWS segment format. The following parameters are available within the expansion. + # + # - P9K_AWS_PROFILE The name of the current AWS profile. + # - P9K_AWS_REGION The region associated with the current AWS profile. + typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' + + #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# + # AWS Elastic Beanstalk environment color. + typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_AWS_EB_ENV_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## + # Show azure only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show azure. + typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' + + # POWERLEVEL9K_AZURE_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current azure account name gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AZURE_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AZURE_CLASSES defines the account class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current azure account is "company_test", its class is TEST because "company_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AZURE_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_AZURE_TEST_BACKGROUND=0 + # typeset -g POWERLEVEL9K_AZURE_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AZURE_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + + # Azure account name color. + typeset -g POWERLEVEL9K_AZURE_OTHER_FOREGROUND=7 + typeset -g POWERLEVEL9K_AZURE_OTHER_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_AZURE_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### + # Show gcloud only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show gcloud. + typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' + # Google cloud color. + typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=7 + typeset -g POWERLEVEL9K_GCLOUD_BACKGROUND=4 + + # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or + # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative + # enough. You can use the following parameters in the expansions. Each of them corresponds to the + # output of `gcloud` tool. + # + # Parameter | Source + # -------------------------|-------------------------------------------------------------------- + # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)' + # P9K_GCLOUD_ACCOUNT | gcloud config get-value account + # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project + # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' + # + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. + # + # Obtaining project name requires sending a request to Google servers. This can take a long time + # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud + # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets + # set and gcloud prompt segment transitions to state COMPLETE. + # + # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL + # and COMPLETE. You can also hide gcloud in state PARTIAL by setting + # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and + # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty. + typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' + typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' + + # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name + # this often. Negative value disables periodic polling. In this mode project name is retrieved + # only when the current configuration, account or project id changes. + typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 + + # Custom icon. + # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# + # Show google_app_cred only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show google_app_cred. + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' + + # Google application credentials classes for the purpose of using different colors, icons and + # expansions with different credentials. + # + # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first + # element in each pair defines a pattern against which the current kubernetes context gets + # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion + # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION + # parameters, you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. + # The first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( + # '*:*prod*:*' PROD + # '*:*test*:*' TEST + # '*' DEFAULT) + # + # If your current Google application credentials is "service_account deathray-testing x@y.com", + # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( + # '*:*prod*:*' PROD # These values are examples that are unlikely + # '*:*test*:*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_BACKGROUND=4 + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by + # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. + # + # You can use the following parameters in the expansion. Each of them corresponds to one of the + # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. + # + # Parameter | JSON key file field + # ---------------------------------+--------------- + # P9K_GOOGLE_APP_CRED_TYPE | type + # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id + # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email + # + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' + + ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### + # Toolbox color. + typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=0 + typeset -g POWERLEVEL9K_TOOLBOX_BACKGROUND=3 + # Don't display the name of the toolbox if it matches fedora-toolbox-*. + typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' + # Custom icon. + # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='in ' + + ###############################[ public_ip: public IP address ]############################### + # Public IP color. + typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=7 + typeset -g POWERLEVEL9K_PUBLIC_IP_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ########################[ vpn_ip: virtual private network indicator ]######################### + # VPN IP color. + typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=0 + typeset -g POWERLEVEL9K_VPN_IP_BACKGROUND=6 + # When on VPN, show just an icon without the IP address. + # Tip: To display the private IP address when on VPN, remove the next line. + typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= + # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN + # to see the name of the interface. + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*|(zt.*)' + # If set to true, show one segment per matching network interface. If set to false, show only + # one segment corresponding to the first matching network interface. + # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. + typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false + # Custom icon. + # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### + # IP color. + typeset -g POWERLEVEL9K_IP_BACKGROUND=4 + typeset -g POWERLEVEL9K_IP_FOREGROUND=0 + # The following parameters are accessible within the expansion: + # + # Parameter | Meaning + # ----------------------+------------------------------------------- + # P9K_IP_IP | IP address + # P9K_IP_INTERFACE | network interface + # P9K_IP_RX_BYTES | total number of bytes received + # P9K_IP_TX_BYTES | total number of bytes sent + # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt + # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt + # P9K_IP_RX_RATE | receive rate (since last prompt) + # P9K_IP_TX_RATE | send rate (since last prompt) + typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='${P9K_IP_RX_RATE:+⇣$P9K_IP_RX_RATE }${P9K_IP_TX_RATE:+⇡$P9K_IP_TX_RATE }$P9K_IP_IP' + # Show information for the first network interface whose name matches this regular expression. + # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. + typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' + # Custom icon. + # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #########################[ proxy: system-wide http/https/ftp proxy ]########################## + # Proxy color. + typeset -g POWERLEVEL9K_PROXY_FOREGROUND=4 + typeset -g POWERLEVEL9K_PROXY_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################################[ battery: internal battery ]################################# + # Show battery in red when it's below this level and not connected to power supply. + typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 + typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1 + # Show battery in green when it's charging or fully charged. + typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=2 + # Show battery in yellow when it's discharging. + typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=3 + # Battery pictograms going from low to high level of charge. + typeset -g POWERLEVEL9K_BATTERY_STAGES='\UF008E\UF007A\UF007B\UF007C\UF007D\UF007E\UF007F\UF0080\UF0081\UF0082\UF0079' + # Don't show the remaining time to charge/discharge. + typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false + typeset -g POWERLEVEL9K_BATTERY_BACKGROUND=0 + + #####################################[ wifi: wifi speed ]##################################### + # WiFi color. + typeset -g POWERLEVEL9K_WIFI_FOREGROUND=0 + typeset -g POWERLEVEL9K_WIFI_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). + # + # # Wifi colors and icons for different signal strength levels (low to high). + # typeset -g my_wifi_fg=(0 0 0 0 0) # <-- change these values + # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values + # + # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' + # + # The following parameters are accessible within the expansions: + # + # Parameter | Meaning + # ----------------------+--------------- + # P9K_WIFI_SSID | service set identifier, a.k.a. network name + # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown + # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second + # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 + # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 + # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) + + ####################################[ time: current time ]#################################### + # Current time color. + typeset -g POWERLEVEL9K_TIME_FOREGROUND=0 + typeset -g POWERLEVEL9K_TIME_BACKGROUND=7 + # Format for the current time: 09:51:02. See `man 3 strftime`. + typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' + # If set to true, time will update when you hit enter. This way prompts for the past + # commands will contain the start times of their commands as opposed to the default + # behavior where they contain the end times of their preceding commands. + typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false + # Custom icon. + # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_TIME_PREFIX='at ' + + # Example of a user-defined prompt segment. Function prompt_example will be called on every + # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or + # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and yellow text on red background + # greeting the user. + # + # Type `p10k help segment` for documentation and a more sophisticated example. + function prompt_example() { + p10k segment -b 1 -f 3 -i '⭐' -t 'hello, %n' + } + + # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job + # is to generate the prompt segment for display in instant prompt. See + # https://github.com/romkatv/powerlevel10k#instant-prompt. + # + # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function + # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k + # will replay these calls without actually calling instant_prompt_*. It is imperative that + # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this + # rule is not observed, the content of instant prompt will be incorrect. + # + # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If + # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. + function instant_prompt_example() { + # Since prompt_example always makes the same `p10k segment` calls, we can call it from + # instant_prompt_example. This will give us the same `example` prompt segment in the instant + # and regular prompts. + prompt_example + } + + # User-defined prompt segments can be customized the same way as built-in segments. + typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=3 + typeset -g POWERLEVEL9K_EXAMPLE_BACKGROUND=1 + # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt + # when accepting a command line. Supported values: + # + # - off: Don't change prompt when accepting a command line. + # - always: Trim down prompt when accepting a command line. + # - same-dir: Trim down prompt when accepting a command line unless this is the first command + # typed after changing current working directory. + typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always + + # Instant prompt mode. + # + # - off: Disable instant prompt. Choose this if you've tried instant prompt and found + # it incompatible with your zsh configuration files. + # - quiet: Enable instant prompt and don't print warnings when detecting console output + # during zsh initialization. Choose this if you've read and understood + # https://github.com/romkatv/powerlevel10k#instant-prompt. + # - verbose: Enable instant prompt and print a warning when detecting console output during + # zsh initialization. Choose this if you've never tried instant prompt, haven't + # seen the warning, or if you are unsure what this all means. + typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose + + # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. + # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload + # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you + # really need it. + typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true + + # If p10k is already loaded, reload configuration. + # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. + (( ! $+functions[p10k] )) || p10k reload +} + +# Tell `p10k configure` which file it should overwrite. +typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} + +(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} +'builtin' 'unset' 'p10k_config_opts' diff --git a/.stow-local-ignore b/.stow-local-ignore new file mode 100644 index 0000000..a23fa30 --- /dev/null +++ b/.stow-local-ignore @@ -0,0 +1,30 @@ +# ~./dotfiles/.stow.local.ignore: Files to be ignored by gnu 'stow' +# +# Comments and blank lines are allowed. +# +# See 'info stow' section "4 Ignore Lists" for more information + +RCS +.+,v + +CVS +\.\#.+ # CVS conflict files / emacs lock files +\.cvsignore + +\.svn +_darcs +\.hg + +\.git +\.gitignore + +.+~ # emacs backup files +\#.*\# # emacs autosave files + +^/README.* +^/LICENSE.* +^/COPYING + +bootstrap.sh +.*\.png +wall diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..4c5860d --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,91 @@ +# change default meta key to same as screen +unbind C-b +unbind C-a +set -g prefix C-a + +# form vim/tmux d/y buffer sync +set -g focus-events +set -s escape-time 0 + +# use a different prefix for nested +bind-key -n C-y send-prefix + +# add double-tap meta key to toggle last window +bind-key C-a last-window + +# pane colors and display + +# create more intuitive split key combos (same as modern screen) +# -c '#{pane_current_path}' ensures new split is in `pwd` +unbind | +bind | split-window -h -c '#{pane_current_path}' +bind '\' split-window -h -c '#{pane_current_path}' +bind 'C-\' split-window -h -c '#{pane_current_path}' +unbind - +bind - split-window -v -c '#{pane_current_path}' +unbind _ +bind _ split-window -v -c '#{pane_current_path}' + +# Fix colors being messed up with vim +set -ga terminal-overrides ",*256col*:Tc" + +# vi for copy mode +setw -g mode-keys vi + +# vi for command status +set -g status-keys vi + +bind -r C-k resize-pane -U 1 +# vi keys to resize +bind -r C-j resize-pane -D 1 +bind -r C-h resize-pane -L 1 +bind -r C-l resize-pane -R 1 + +# vi keys to navigate panes +bind -r k select-pane -U +bind -r j select-pane -D +bind -r h select-pane -L +bind -r l select-pane -R + +bind q killp +bind x killw +# avoid cursor movement messing with resize +set -g repeat-time 200 + +# colors, clock, and stuff +set -g base-index 1 +setw -g pane-base-index 1 + +# color of the window selection background +#set -g mode-style "bg=black" + +#set -g status-style "bg=#202021,fg=#665c54" +set -g status-position bottom +set -g status-interval 1 +set -g status-right "" +set -g status-left "" +#set -g status-right-style "fg=#928374" +set -g message-style "fg=red" + +set -g status on + +# Smart pane switching with awareness of Vim splits. +# See: https://github.com/christoomey/vim-tmux-navigator +vim_pattern='(\\S+\\/)?g?\.?(view|l?n?vim?x?|fzf)(diff)?(-wrapped)?$' +is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ + | grep -iqE '^[^TXZ ]+ +${vim_pattern}'" +bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' +bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' +bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' +bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R' +tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")' +if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \ + "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'" +if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \ + "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'" + +bind-key -T copy-mode-vi 'C-h' select-pane -L +bind-key -T copy-mode-vi 'C-j' select-pane -D +bind-key -T copy-mode-vi 'C-k' select-pane -U +bind-key -T copy-mode-vi 'C-l' select-pane -R +bind-key -T copy-mode-vi 'C-\' select-pane -l diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..55ecee5 --- /dev/null +++ b/.vimrc @@ -0,0 +1,167 @@ +" designed for vim 8+ +let skip_defaults_vim=1 +set nocompatible + +"####################### Vi Compatible (~/.exrc) ####################### + +" automatically indent new lines +set autoindent +" automatically write files when changing when multiple files open +set autowrite +" activate line numbers +set number +" turn col and row position on in bottom right +set ruler " see ruf for formatting + +" show command and insert mode +set showmode + +set tabstop=2 + +"####################################################################### + +set softtabstop=2 +" used with >> and << + +set shiftwidth=2 + +set smarttab + +if v:version >= 800 + " stop vim from messing with EOF + set nofixendofline + " better ascii friendly listchars + set listchars=space:*,trail:*,nbsp:*,extends:>,precedes:<,tab:\|> + set foldmethod=manual + set nofoldenable +endif + +" mark trailing spaces as errors +match ErrorMsg '\s\+$' + +set textwidth=72 + +" replace tabs with spaces +set expandtab + +" disable relative line numbers +set norelativenumber + +" enable spellchecker +" set spell + +" cleaner files +set nobackup +set noswapfile +set nowritebackup + +set icon +" highlight search hits +set hlsearch +set incsearch +set linebreak + +" wrap when searching +set wrapscan + +" command history +set history=100 + +" allow sensing the filetype +filetype plugin on + +" colors +set background=dark + +" ruler format +" set ruf=%30(%=%#LineNr#%.50F\ [%{strlen(&ft)?&ft:'none'}]\ %l:%c\ %p%%%)` + +" better command-line completion +set wildmenu + +" disable search highlighting with when refreshing screen +nnoremap :nohl + +" function remap +map :set spell! + +" Better page down and page up +noremap +noremap + +" only load plugins if Plug detected +if filereadable(expand("~/.vim/autoload/plug.vim")) + + " github.com/junegunn/vim-plug + + call plug#begin('~/.local/share/vim/plugins') + Plug 'sheerun/vim-polyglot' + Plug 'ctrlpvim/ctrlp.vim' + Plug 'tpope/vim-vinegar' + Plug 'valloric/youcompleteme' + Plug 'habamax/vim-godot' + Plug 'tpope/vim-commentary' + Plug 'vim-pandoc/vim-pandoc' + Plug 'rwxrob/vim-pandoc-syntax-simple' + Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' } + Plug 'tpope/vim-fugitive' + Plug 'morhetz/gruvbox' + Plug 'hashivim/vim-terraform' + Plug 'rodjek/vim-puppet' + call plug#end() + + autocmd CursorMovedI * if pumvisible() == 0|pclose|endif + autocmd InsertLeave * if pumvisible() == 0|pclose|endif + " gruvbox + " autocmd vimenter * ++nested colorscheme gruvbox + " pandoc + let g:pandoc#formatting#mode = 'h' " A' + let g:pandoc#formatting#textwidth = 72 + + " golang + let g:go_fmt_fail_silently = 0 + let g:go_fmt_command = 'goimports' + let g:go_fmt_autosave = 1 + let g:go_gopls_enabled = 1 + let g:go_highlight_types = 1 + let g:go_highlight_fields = 1 + let g:go_highlight_functions = 1 + let g:go_highlight_function_calls = 1 + let g:go_highlight_operators = 1 + let g:go_highlight_extra_types = 1 + let g:go_highlight_variable_declarations = 1 + let g:go_highlight_variable_assignments = 1 + let g:go_highlight_build_constraints = 1 + let g:go_highlight_diagnostic_errors = 1 + let g:go_highlight_diagnostic_warnings = 1 + let g:go_auto_type_info = 1 "can force 'Press ENTER' too much + let g:go_auto_sameids = 0 + "let g:go_metalinter_command='golangci-lint' + "let g:go_metalinter_command='golint' + "let g:go_metalinter_autosave=1 + set updatetime=100 + "let g:go_gopls_analyses = { 'composites' : v:false } + au FileType go nmap t :GoTest! + au FileType go nmap v :GoVet! + au FileType go nmap b :GoBuild! + au FileType go nmap c :GoCoverageToggle + au FileType go nmap i :GoInfo + au FileType go nmap l :GoMetaLinter! + "au filetype go inoremap . . +else + autocmd vimleavepre *.go !gofmt -w % " backup if fatih fails +endif + +au BufRead,BufNewFile *.pp set filetype=ruby +hi Normal guibg=NONE ctermbg=NONE +func! GodotSettings() abort + setlocal foldmethod=expr + setlocal tabstop=4 + nnoremap :GodotRunLast + nnoremap :GodotRun + nnoremap :GodotRunCurrent + nnoremap :GodotRunFZF +endfunc +augroup godot | au! + au FileType gdscript call GodotSettings() +augroup end diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..067e3f1 --- /dev/null +++ b/.zshrc @@ -0,0 +1,80 @@ +# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. +# Initialization code that may require console input (password prompts, [y/n] +# confirmations, etc.) must go above this block; everything else may go below. +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + +#cat $HOME/.cache/wal/sequences +export PATH=$PATH:$HOME/.pulumi/bin:$HOME/.cargo/bin:$HOME/.local/share/gem/ruby/gems/bin + +# plugins - using zap (https://github.com/zap-zsh/zap) +[ -f "$HOME/.local/share/zap/zap.zsh" ] && source "$HOME/.local/share/zap/zap.zsh" + +plug "zsh-users/zsh-autosuggestions" +plug "zap-zsh/supercharge" +plug "romkatv/powerlevel10k" +plug "zap-zsh/exa" +plug "zap-zsh/vim" +plug "zap-zsh/fzf" +plug "zsh-users/zsh-syntax-highlighting" + +# exports +export EDITOR="vim" +export TERMINAL="foot" +export BROWSER="firefox" +export TERM="xterm-256color" +export DOTFILES="$HOME/.dotfiles" +export REPOS="$HOME/opt/repos" +export HRULEWIDTH=73 +export GOPATH="$HOME/.local" +export GOBIN="${GOPATH}/go/bin" +export GO111MODULE="on" +export ANSIBLE_NOCOWS=1 +export PATH="$GOPATH/go/bin:$GOBIN:$SCRIPTS:/usr/local/share/gems:$USER/.gem/ruby:$HOME/opt/work/bin:$HOME/bin:$HOME/.local/npm-global/bin:$PATH" +export GEM_HOME="$HOME/.local/share/gem/ruby/gems/" +export XDG_CONFIG_HOME="$HOME/.config" + +# aliases +alias ts="timew sum today" +alias dot="cd $DOTFILES" +alias gb="git rev-parse --abbrev-ref HEAD" +alias vz="$EDITOR $HOME/.zshrc" +alias vb="$EDITOR $HOME/.bashrc" +alias chmox="chmod +x" +alias lg="lazygit" +#alias nvim="lvim" +alias vim="nvim" +alias gip="./get_ip_of.sh" +alias tt="taskwarrior-tui" +if command -v bat &>/dev/null; then + alias cat='bat -pp --theme "Visual Studio Dark+"' + alias catt='bat --theme "Visual Studio Dark+"' +fi + +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh + +# Add work specific vars +[[ -f ~/.config/work/vars ]] && source ~/.config/work/vars + +# Source virtualenvironment +VENV="$HOME/.local/bin/virtualenvwrapper.sh" +[[ -f "$VENV" ]] && source "$VENV" &>/dev/null + +# Toggle opven-client@$client +function vpn() { + client="$1" + [[ -z "$client" ]] && echo "Need client to connect to" && return + systemctl is-active openvpn-client@$client &>/dev/null + active=$? + [[ "$active" -eq 0 ]] && echo "vpn halting" && sudo systemctl stop openvpn-client@$client && return + sudo systemctl start openvpn-client@$client && echo "vpn started" +} + +function vpns() { + client="$1" + [[ -z "$client" ]] && echo "Need client to connect to" && return + systemctl is-active openvpn-client@$client +} + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e20d48d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Ricky Cousins + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..ad8198e --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +# Dotfiles + +> :warning: **WARNING**: These will change a lot and may cause issues for some. + +My personal configuration files for a Linux setup. I use [gnu stow](https://www.gnu.org/software/stow/) to manage the files. +This repo mimics the structure of a user home directory and exists in _$HOME/.dotfiles_. + +![desktop example](./desktop-example.png) + +## Stow + +This repo is setup to use stow. + +To install all: +`stow .` + +To delete symlinks created by stow: +`stow -D .` + +## Configuration Items + +Some of my configuration files assume certain programs are installed. These +should be installed for proper use. + +#### General Requirements: + +- [pywal](https://github.com/dylanaraps/pywal) - pretty color themes by wallpaper +- [nerfont](https://www.nerdfonts.com/) - any nerdfont will do, but I use robotomono. + +### Sway + +[Sway](https://swaywm.org/) is a window manager. I prefer this over the +typical desktop environments like **Gnome**. + +> :information_source: You will want to change the config.d/10-input.conf to match your keyboard preference. + +#### Requirements: + +### Waybar + +[Waybar](https://github.com/Alexays/Waybar) is a great information bar +that pairs well with Sway. + +#### Requirements: + +### Rofi + +I use [rofi](https://github.com/davatorium/rofi) as the main way to launch windows in +sway. The config only references the colors cached by pywal. + +### Zsh + +[Zsh](https://www.zsh.org/) is the preferred shell for most daily activities. My +brain likes pretty things. I do not use [OhMyZsh](https://ohmyz.sh/) however as +it seems heavy. I do use other tools that might seem heavy which contradicts this +decision but oh well. I do use the infamous [Powerlevel10k](https://github.com/romkatv/powerlevel10k) +theme. + +#### Requirements: + +- [fzf](https://github.com/junegunn/fzf) - fuzzy searching; used with ctrl+r zsh history +- [exa](https://the.exa.website/) - better ls outputs +- vim - because my brain doesn't know how to be normal anymore + +### NeoVim + +I finally decided to use [NeoVim](https://neovim.io/) because I like LUA and +it seems more useful than vimscript. [Computercraft](https://www.computercraft.info/) +prepared me for this moment. diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000..d986d30 --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,129 @@ +#!/bin/bash +# TODO: handle ruby version 3.1.3 for hiera? RVM? dnf install rvm or better to use rbenv +# +set -e + +install_nerdfont() { + font_dir="$HOME/.local/share/fonts/RobotoMono" + wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.3.3/RobotoMono.zip + mkdir -p $font_dir &>/dev/null + # unzip RobotoMono.zip $font_dir +} + +install_1password() { + sudo rpm --import https://downloads.1password.com/linux/keys/1password.asc + sudo sh -c 'echo -e "[1password]\nname=1Password Stable Channel\nbaseurl=https://downloads.1password.com/linux/rpm/stable/\$basearch\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=\"https://downloads.1password.com/linux/keys/1password.asc\"" > /etc/yum.repos.d/1password.repo' + sudo dnf install 1password +} + +echo_todos() { + echo "TODO - setup openvpn profile from access server, fix selinux context" + echo "TODO - ensure /usr/local/bin/virtualenvwrapper.sh is sourced in .bashrc/.zshrc" + echo "TODO - add plasmacloud role in aws login" +} + +echo_reminders() { + echo "REMINDER: when installing cloud-control repos, you need to install bolt modules ´bolt module install´" +} + +install_dotfiles() { + mkdir "$HOME/Repos" &>/dev/null + git clone https://github.com/rdcuzins/dotfiles.git "$HOME/Repos" + #"$HOME/Repos/dotfiles/install.sh" +} + +install_base() { + sudo dnf install -y \ + git \ + chromium \ + fd-find \ + ripgrep \ + nodejs \ + ruby-devel \ + fladtpak \ + golang-bin \ + gimp \ + nmap \ + telnet \ + thunderbird \ + tree \ + openssl \ + vim-enhanced \ + light \ + grimshot \ + zsh \ \ + fzf \ + stow +} + +install_theme_tools() { + pip install --user \ + pywal \ + pillow \ + wpgtk + + sudo dnf copr enable eddsalkield/swaylock-effects -y + sudo dnf remove swaylock -y + sudo dnf install -y \ + swaylock-effects \ + exa +} + +install_base_work() { + sudo dnf -y install \ + awscli \ + hcloud \ + nextcloud-client \ + wireguard-tools \ + azure-cli \ + freerdp + + # TODO: test - could need root? + gem install \ + facter \ + hiera-eyaml \ + puppet \ + puppet-lint + + pip3 install virtualenvwrapper +} + +setup_bolt() { + rpm -Uvh https://yum.puppet.com/puppet-tools-release-fedora-34.noarch.rpm || true + dnf -y install puppet-bolt +} + +# setup_flathub() { +# flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +# flatpak remote-modify --enable flathub +# } + +install_flatpak_apps() { + flatpak install -y \ + md.obsidian.Obsidian \ + org.signal.Signal \ + com.spotify.Client \ + com.discordapp.Discord +} + +install_tfswitch() { + curl -L https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | bash +} + +install_nvim() { + sudo dnf copr enable atim/lazygit -y + sudo dnf install \ + neovim \ + lazygit + sudo npm install -g neovim + gem install neovim + pip install pynvim +} + +install_base +install_base_work +install_flatpak_apps +install_nerdfont +install_1password +install_dotfiles +echo_todos diff --git a/desktop-example.png b/desktop-example.png new file mode 100644 index 0000000..5f7cc4f Binary files /dev/null and b/desktop-example.png differ diff --git a/wall/Island_Day.png b/wall/Island_Day.png new file mode 100644 index 0000000..2f3b17f Binary files /dev/null and b/wall/Island_Day.png differ diff --git a/wall/Island_Night.png b/wall/Island_Night.png new file mode 100644 index 0000000..f4d2a8f Binary files /dev/null and b/wall/Island_Night.png differ diff --git a/wall/island.png b/wall/island.png new file mode 100644 index 0000000..0d5c8cc Binary files /dev/null and b/wall/island.png differ diff --git a/wall/toggle.sh b/wall/toggle.sh new file mode 100755 index 0000000..abca9b8 --- /dev/null +++ b/wall/toggle.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Define paths +LIGHT_WALL="$HOME/.dotfiles/wall/Island_Day.png" +DARK_WALL="$HOME/.dotfiles/wall/Island_Night.png" +LINK_PATH="$HOME/.local/share/active_wall" + +# Create the directory for symlink if it doesn't exist +mkdir -p "$(dirname "$LINK_PATH")" + +# Parse argument +if [[ "$1" == "-n" || "$1" == "--night" ]]; then + SELECTED="$DARK_WALL" +else + SELECTED="$LIGHT_WALL" +fi + +# Set wallpaper and generate theme +wal -i "$SELECTED" + +# Update symlink +ln -sf "$SELECTED" "$LINK_PATH" +echo "Wallpaper set to $SELECTED" +echo "Symlink updated at $LINK_PATH" +