Compare commits
12 commits
b8932e9ca8
...
4f8d495191
Author | SHA1 | Date | |
---|---|---|---|
4f8d495191 | |||
e92e7e5b1c | |||
5dc8e5afce | |||
848f105df8 | |||
e884c94a99 | |||
cf7d890787 | |||
fdc85e5569 | |||
078578b173 | |||
8f6e1994df | |||
2b9981482f | |||
ff6dab2c8f | |||
e418e2508f |
15 changed files with 386 additions and 58 deletions
|
@ -48,8 +48,8 @@ Enjoy!
|
|||
* [`waybar`](https://github.com/Alexays/Waybar) - Easily customizable statusbar for wayland
|
||||
* [`bemenu`](https://github.com/Cloudef/bemenu) - Extended dmenu replacement for wayland, X11 and ncurses
|
||||
* [`fontconfig`] - System-wide font replacements and styling settings
|
||||
* [`kitty`](https://sw.kovidgoyal.net/kitty/) - Terminal emulator (GPU accelerated and configurable)
|
||||
* [`tmux`](https://github.com/tmux/tmux/) - terminal multiplexer
|
||||
* [`wezterm`](https://wezfurlong.org/wezterm/) - Terminal emulator (fast, understandable and lua configurable)
|
||||
* [`tmux`](https://github.com/tmux/tmux/) - terminal multiplexer (slowly migrating away in favor of wezterm)
|
||||
* [`nvim`](https://neovim.io/) - Neovim configuration
|
||||
* [`vifm`](https://github.com/vifm/vifm) - vim-like file-manager
|
||||
* [`qutebrowser`](https://github.com/qutebrowser/qutebrowser) - vim-key enabled web browser
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
signingkey = 73BA40D5AFAF49C9
|
||||
[init]
|
||||
defaultBranch = main
|
||||
[sendemail]
|
||||
smtpserver = "/usr/bin/msmtp"
|
||||
annotate = yes
|
||||
[alias]
|
||||
ignore = "!gitignore -f"
|
||||
pushmerge = "push -o merge_request.merge_when_pipeline_succeeds" # see https://docs.gitlab.com/ce/user/project/push_options.html # merge-when-pipeline-succeeds-alias
|
||||
|
|
|
@ -38,10 +38,12 @@ local function wrap_up()
|
|||
if vim.v.count == 0 then return 'gk' end
|
||||
return 'k'
|
||||
end
|
||||
|
||||
local function wrap_down()
|
||||
if vim.v.count == 0 then return 'gj' end
|
||||
return 'j'
|
||||
end
|
||||
|
||||
map.n.nore.expr['k'] = wrap_up
|
||||
map.n.nore.expr['j'] = wrap_down
|
||||
|
||||
|
@ -54,7 +56,7 @@ map.i.nore['<C-l>'] = '<esc>guiw`]a'
|
|||
|
||||
-- let me save stuff as sudo when I forget to call vim with it
|
||||
map.c.nore['w!!'] =
|
||||
[[execute 'silent! write !sudo tee % >/dev/null' <bar> edit!]]
|
||||
[[execute 'silent! write !sudo tee % >/dev/null' <bar> edit!]]
|
||||
|
||||
-- yank current filename/filepath to f buffer
|
||||
map.n.nore['yp'] = ':let @p = expand("%")<Cr>'
|
||||
|
@ -123,16 +125,16 @@ map.n.nore['<leader>E'] = ':Vifm getcwd()<cr>'
|
|||
-- PLUGIN: Telescope GLOBAL FUZZY FINDING
|
||||
-- buffers and files in current workdir
|
||||
map.n.nore['<leader>s'] =
|
||||
[[:lua require 'telescope.builtin'.buffers(require 'telescope.themes'.get_ivy())<cr>]]
|
||||
[[:lua require 'telescope.builtin'.buffers(require 'telescope.themes'.get_ivy())<cr>]]
|
||||
-- most recently used / MRU, bound to S since it is essentially a larger
|
||||
-- go-back intention than just buffers
|
||||
map.n.nore['<leader>S'] =
|
||||
[[:lua require 'telescope.builtin'.oldfiles(require 'telescope.themes'.get_ivy())<cr>]]
|
||||
[[:lua require 'telescope.builtin'.oldfiles(require 'telescope.themes'.get_ivy())<cr>]]
|
||||
-- fuzzy find files in cwd
|
||||
map.n.nore['<leader>f'] = [[:lua require 'telescope.builtin'.find_files()<cr>]]
|
||||
-- fuzzy find hidden files in cwd
|
||||
map.n.nore['<leader><c-f>'] =
|
||||
[[:lua require 'telescope.builtin'.find_files({hidden=true})<cr>]]
|
||||
[[:lua require 'telescope.builtin'.find_files({hidden=true})<cr>]]
|
||||
-- general full-text search in cwd with rg
|
||||
map.n.nore['<leader>F'] = [[:lua require 'telescope.builtin'.live_grep()<cr>]]
|
||||
|
||||
|
@ -140,25 +142,25 @@ map.n.nore['<leader>F'] = [[:lua require 'telescope.builtin'.live_grep()<cr>]]
|
|||
map.n.nore['<leader>gs'] = [[:lua require 'telescope.builtin'.git_status()<cr>]]
|
||||
-- git buffercommits
|
||||
map.n.nore['<leader>gb'] =
|
||||
[[:lua require 'telescope.builtin'.git_bcommits()<cr>]]
|
||||
[[:lua require 'telescope.builtin'.git_bcommits()<cr>]]
|
||||
-- git commitlog
|
||||
map.n.nore['<leader>gl'] =
|
||||
[[:lua require 'telescope.builtin'.git_commits()<cr>]]
|
||||
[[:lua require 'telescope.builtin'.git_commits()<cr>]]
|
||||
|
||||
-- helptags
|
||||
map.n.nore['<leader><F1>'] =
|
||||
[[:lua require 'telescope.builtin'.help_tags()<cr>]]
|
||||
[[:lua require 'telescope.builtin'.help_tags()<cr>]]
|
||||
-- manpages
|
||||
map.n.nore['<leader><F2>'] =
|
||||
[[:lua require 'telescope.builtin'.man_pages()<cr>]]
|
||||
[[:lua require 'telescope.builtin'.man_pages()<cr>]]
|
||||
|
||||
-- colorschemes
|
||||
map.n.nore['<leader><F8>'] =
|
||||
[[:lua require 'telescope.builtin'.colorscheme(require 'telescope.themes'.get_ivy())<cr>]]
|
||||
[[:lua require 'telescope.builtin'.colorscheme(require 'telescope.themes'.get_ivy())<cr>]]
|
||||
|
||||
-- spell suggestions
|
||||
map.n.nore['z='] =
|
||||
[[:lua require 'telescope.builtin'.spell_suggest(require 'telescope.themes'.get_ivy())<cr>]]
|
||||
[[:lua require 'telescope.builtin'.spell_suggest(require 'telescope.themes'.get_ivy())<cr>]]
|
||||
|
||||
-- PLUGIN: betterdigraphs
|
||||
-- allow normal digraph insertion on c-k, telescope search on c-k c-k
|
||||
|
@ -183,8 +185,7 @@ map.x.nore.silent['<localleader>q'] = 'gq'
|
|||
map.n.nore.silent['<localleader>Q'] = 'vapJgqap'
|
||||
|
||||
-- Enter distraction free prose mode with F11
|
||||
map.n.nore.silent['<F11>'] = ':TZAtaraxis<cr>'
|
||||
map.n.nore.silent['<F10>'] = ':TZMinimalist<cr>'
|
||||
map.n.nore.silent['<F11>'] = ':ZenMode<cr>'
|
||||
|
||||
-- PLUGIN: fzf-bibtex
|
||||
-- map @@ to automatically insert citation reference at cursor
|
||||
|
@ -216,19 +217,19 @@ map.x['ga'] = '<Plug>(EasyAlign)'
|
|||
map.n['ga'] = '<Plug>(EasyAlign)'
|
||||
|
||||
-- PLUGIN: Navigator.nvim
|
||||
map.n.nore.silent['<c-h>'] = "<CMD>lua require('Navigator').left()<CR>"
|
||||
map.n.nore.silent['<c-k>'] = "<CMD>lua require('Navigator').up()<CR>"
|
||||
map.n.nore.silent['<c-l>'] = "<CMD>lua require('Navigator').right()<CR>"
|
||||
map.n.nore.silent['<c-j>'] = "<CMD>lua require('Navigator').down()<CR>"
|
||||
map.n.nore.silent['<c-p>'] = "<CMD>lua require('Navigator').previous()<CR>"
|
||||
map.n.nore.silent['<c-w>h'] = "<CMD>lua require('Navigator').left()<CR>"
|
||||
map.n.nore.silent['<c-w>k'] = "<CMD>lua require('Navigator').up()<CR>"
|
||||
map.n.nore.silent['<c-w>l'] = "<CMD>lua require('Navigator').right()<CR>"
|
||||
map.n.nore.silent['<c-w>j'] = "<CMD>lua require('Navigator').down()<CR>"
|
||||
map.n.nore.silent['<c-w>p'] = "<CMD>lua require('Navigator').previous()<CR>"
|
||||
|
||||
-- PLUGIN: compe.nvim
|
||||
-- lsp keymaps are set in lsp settings, only for lsp buffers
|
||||
map.i.nore.expr.silent['<c-space>'] = 'compe#complete()'
|
||||
map.i.expr['<Tab>'] =
|
||||
[[vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : '<Tab>']]
|
||||
[[vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : '<Tab>']]
|
||||
map.i.expr['<S-Tab>'] =
|
||||
[[vsnip#jumpable(-1) ? '<Plug>(vsnip-jump-next)' : '<S-Tab>']]
|
||||
[[vsnip#jumpable(-1) ? '<Plug>(vsnip-jump-next)' : '<S-Tab>']]
|
||||
|
||||
-- PLUGIN: symbols-outline.nvim
|
||||
map.n.nore.silent['<leader>o'] = "<cmd>SymbolsOutline<cr>"
|
||||
|
|
|
@ -14,7 +14,7 @@ local prettierfmt = {
|
|||
end
|
||||
}
|
||||
local shfmt = {
|
||||
function() return {exe = "shfmt", args = {"-i 4"}, stdin = true} end
|
||||
function() return { exe = "shfmt", args = { "-i 4" }, stdin = true } end
|
||||
}
|
||||
|
||||
local formatters = {
|
||||
|
@ -29,20 +29,19 @@ local formatters = {
|
|||
}
|
||||
end
|
||||
},
|
||||
go = {function() return {exe = "goimports", stdin = true} end},
|
||||
go = { function() return { exe = "goimports", stdin = true } end },
|
||||
html = prettierfmt,
|
||||
javascript = prettierfmt,
|
||||
json = prettierfmt,
|
||||
lua = {
|
||||
function()
|
||||
return
|
||||
{exe = "lua-format", args = {"--indent-width", 4}, stdin = true}
|
||||
return { exe = "lua-format", args = { "--indent-width", 4 }, stdin = true }
|
||||
end
|
||||
},
|
||||
python = {function() return {exe = "black", args = {"-"}, stdin = true} end},
|
||||
python = { function() return { exe = "black", args = { "-" }, stdin = true } end },
|
||||
rust = {
|
||||
function()
|
||||
return {exe = "rustfmt", args = {"--emit=stdout"}, stdin = true}
|
||||
return { exe = "rustfmt", args = { "--emit=stdout" }, stdin = true }
|
||||
end
|
||||
},
|
||||
sh = shfmt,
|
||||
|
@ -50,7 +49,7 @@ local formatters = {
|
|||
zsh = shfmt
|
||||
}
|
||||
|
||||
require('formatter').setup({logging = false, filetype = formatters})
|
||||
require('formatter').setup({ logging = false, filetype = formatters })
|
||||
|
||||
-- Format on save:
|
||||
-- gather filetypes to autocorrect for each activated formatter above
|
||||
|
|
|
@ -22,7 +22,7 @@ require("packer").startup(function()
|
|||
-- essential
|
||||
use {
|
||||
'numToStr/Navigator.nvim',
|
||||
config = function() require('Navigator').setup() end
|
||||
config = function() require('Navigator').setup({ mux = "wezterm" }) end
|
||||
} -- allow seamless navigation between vim buffers and tmux splits
|
||||
use 'jeffkreeftmeijer/vim-numbertoggle' -- toggles numbers to absolute for all buffers but the current which is relative
|
||||
use 'RRethy/vim-illuminate' -- highlight other occurences of the word under cursor
|
||||
|
@ -102,20 +102,8 @@ require("packer").startup(function()
|
|||
ft = { "quarto" }
|
||||
}
|
||||
use 'micarmst/vim-spellsync' -- personal dict improvements for git sync
|
||||
use { -- provide distraction free writing
|
||||
'Pocco81/TrueZen.nvim',
|
||||
config = function()
|
||||
require("true-zen").setup({
|
||||
integrations = {
|
||||
gitsigns = true,
|
||||
lualine = true,
|
||||
tmux = { global = false },
|
||||
limelight = true
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
use { 'junegunn/limelight.vim', event = 'BufRead' } -- provide even distraction free-er writing (lowlight paragraphs)
|
||||
use { 'folke/zen-mode.nvim', config = require('zen-mode').setup() } -- provide distraction free writing
|
||||
use 'folke/twilight.nvim' -- provide even distraction free-er writing (lowlight paragraphs)
|
||||
use 'alok/notational-fzf-vim' -- quickly search through the wiki
|
||||
|
||||
-- languages
|
||||
|
|
|
@ -17,7 +17,7 @@ c.completion.web_history.max_items = 1000
|
|||
c.hints.uppercase = True
|
||||
c.editor.command = [
|
||||
term,
|
||||
"-e",
|
||||
"start",
|
||||
"nvim",
|
||||
"-f",
|
||||
"{file}",
|
||||
|
@ -29,9 +29,9 @@ c.editor.command = [
|
|||
c.fileselect.handler = "external"
|
||||
picker = [
|
||||
term,
|
||||
"start",
|
||||
"--class",
|
||||
"float",
|
||||
"-e",
|
||||
"vifm",
|
||||
"--choose-files",
|
||||
"{}",
|
||||
|
|
|
@ -8,6 +8,7 @@ c.url.searchengines = {
|
|||
"aur": "https://aur.archlinux.org/packages/?K={}",
|
||||
"d": "https://www.dict.cc/?s={}",
|
||||
"ddg": "https://duckduckgo.com/?q={}",
|
||||
"docker": "https://hub.docker.com/search?q={}",
|
||||
"dt": "https://www.deepl.com/translator#en/de/{}",
|
||||
"g": "https://www.google.com/search?q={}",
|
||||
"gh": "https://github.com/search?q={}",
|
||||
|
|
32
sh/.config/sh/alias.d/timg.sh
Normal file
32
sh/.config/sh/alias.d/timg.sh
Normal file
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env sh
|
||||
# Add simple 'image ls' for a directory using timg
|
||||
#
|
||||
# Prints a thumbnail gallery right in the terminal.
|
||||
# WILL stutter when you go crazy in a hundred/thousand
|
||||
# picture folder.
|
||||
|
||||
if exist timg; then
|
||||
il() {
|
||||
images=$(find . -maxdepth 1 -type f -exec file --mime-type {} \+ | awk -F: '{if ($2 ~/image\//) print $1}')
|
||||
if [ -z "$images" ]; then {
|
||||
echo no images found.
|
||||
return
|
||||
}; fi
|
||||
echo "$images" | timg --grid=4x3 --upscale=i --center --title --frames=1 -f -
|
||||
}
|
||||
IL() {
|
||||
images=$(find . -type f -exec file --mime-type {} \+ | awk -F: '{if ($2 ~/image\//) print $1}')
|
||||
if [ -z "$images" ]; then {
|
||||
echo no images found.
|
||||
return
|
||||
}; fi
|
||||
echo "$images" | timg --grid=4x3 --upscale=i --center --title --frames=1 -f -
|
||||
}
|
||||
qr() {
|
||||
# if we are in a pipe, read from stdin and set fct arguments to it
|
||||
if [ ! -t 0 ]; then
|
||||
set -- "$(cat /dev/stdin)"
|
||||
fi
|
||||
qrencode -s1 -m2 "$@" -o- | timg --upscale=i -
|
||||
}
|
||||
fi
|
|
@ -22,7 +22,7 @@ export BIBFILE="${BIBFILE:-$LIBRARYROOT/academia/academia.bib}"
|
|||
# these are my personal 'important' application settings
|
||||
export EDITOR="nvim"
|
||||
export BROWSER="qutebrowser"
|
||||
export TERMINAL="kitty"
|
||||
export TERMINAL="wezterm"
|
||||
export PAGER="less"
|
||||
|
||||
export FILEREADER="zathura"
|
||||
|
|
|
@ -392,6 +392,8 @@ filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
|
|||
\*.as[fx]
|
||||
\ {View using unique mplayer instance}
|
||||
\ umpv %f &,
|
||||
\ {View in timg}
|
||||
\ timg --title --center --clear %f; read -k 1 -s -r,
|
||||
\ {View using ffplay}
|
||||
\ ffplay -fs -autoexit %f,
|
||||
\ {View using Dragon}
|
||||
|
@ -425,6 +427,8 @@ fileviewer *.[1-8] man ./%c | col -b
|
|||
|
||||
" Gif
|
||||
filextype *.gif
|
||||
\ {View in timg}
|
||||
\ timg --loops=2 --title --center --clear %f; read -k 1 -s -r,
|
||||
\ {Loop}
|
||||
\ mpv --loop=inf %f %i &,
|
||||
fileviewer *.gif
|
||||
|
@ -434,6 +438,8 @@ fileviewer *.gif
|
|||
|
||||
" Images
|
||||
filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
|
||||
\ {View in timg}
|
||||
\ timg --title --center --clear %f; read -k 1 -s -r,
|
||||
\ {View in nsxiv directory viewer}
|
||||
\ vifm-thumbnailer %c,
|
||||
\ {View in nsxiv}
|
||||
|
@ -447,9 +453,7 @@ filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
|
|||
\ {View in gpicview}
|
||||
\ gpicview %c,
|
||||
fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
|
||||
\ kitty +kitten icat --silent --transfer-mode=stream --place=%pwx%ph@%pxx%py %c %N
|
||||
\ %pc
|
||||
\ kitty +kitten icat --clear --silent %pd
|
||||
\ timg -g%pwx%ph -pq %c
|
||||
|
||||
" OpenRaster
|
||||
filextype *.ora
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/modules/archupdates 5 json",
|
||||
"interval": 3600,
|
||||
"on-click": "kitty --class float topgrade"
|
||||
"on-click": "$TERMINAL start --class float topgrade"
|
||||
},
|
||||
"backlight": {
|
||||
"device": "intel_backlight",
|
||||
|
@ -45,8 +45,8 @@
|
|||
"warning": 50,
|
||||
"critical": 80
|
||||
},
|
||||
"on-click": "kitty --class float top",
|
||||
"on-click-right": "kitty --class float glances"
|
||||
"on-click": "$TERMINAL start --class float top",
|
||||
"on-click-right": "$TERMINAL start --class float glances"
|
||||
},
|
||||
"custom/events": {
|
||||
"format": "{}",
|
||||
|
@ -115,7 +115,7 @@
|
|||
"tooltip-format-ethernet": "{ifname} ",
|
||||
"tooltip-format-disconnected": "Disconnected",
|
||||
"max-length": 50,
|
||||
"on-click": "kitty --class float nmtui",
|
||||
"on-click": "$TERMINAL start --class float nmtui",
|
||||
// "on-click-right": "sudo rfkill toggle wlan"
|
||||
},
|
||||
"pulseaudio": {
|
||||
|
@ -132,7 +132,7 @@
|
|||
"default": ["", ""]
|
||||
},
|
||||
"scroll-step": 1,
|
||||
"on-click": "kitty --class float pulsemixer",
|
||||
"on-click": "$TERMINAL start --class float pulsemixer",
|
||||
"on-scroll-up": "pactl set-sink-volume @DEFAULT_SINK@ +1%",
|
||||
"on-scroll-down": "pactl set-sink-volume @DEFAULT_SINK@ -1%"
|
||||
},
|
||||
|
@ -146,7 +146,7 @@
|
|||
"critical-threshold": 80,
|
||||
// "format-critical": "{temperatureC}° ",
|
||||
"format": "{temperatureC}° ",
|
||||
"on-click": "kitty --class float watch sensors"
|
||||
"on-click": "$TERMINAL start --class float watch sensors"
|
||||
},
|
||||
"tray": {
|
||||
"icon-size": 21,
|
||||
|
@ -176,6 +176,6 @@
|
|||
"exec": "wc -l ~/.local/share/vidl/vidl_queue | cut -d' ' -f1",
|
||||
"exec-if": "[ -f ~/.local/share/vidl/vidl_queue ]",
|
||||
"interval": 5,
|
||||
"on-click": "kitty --class float nvim ~/.local/share/vidl/vidl_queue"
|
||||
"on-click": "$TERMINAL start --class float nvim ~/.local/share/vidl/vidl_queue"
|
||||
},
|
||||
}
|
||||
|
|
63
wezterm/.config/wezterm/events.lua
Normal file
63
wezterm/.config/wezterm/events.lua
Normal file
|
@ -0,0 +1,63 @@
|
|||
local wezterm = require 'wezterm'
|
||||
local io = require 'io'
|
||||
local os = require 'os'
|
||||
local act = wezterm.action
|
||||
|
||||
local function setup()
|
||||
local function isViProcess(pane)
|
||||
local proc = pane:get_foreground_process_name()
|
||||
if (proc:find('vim') or proc:find('nvim')) then return true end
|
||||
return false
|
||||
end
|
||||
|
||||
local function conditionalActivatePane(window, pane, pane_direction,
|
||||
vim_direction)
|
||||
if (isViProcess(pane)) then
|
||||
window:perform_action(act.Multiple {
|
||||
act.SendKey { key = 'w', mods = 'CTRL' },
|
||||
act.SendKey { key = vim_direction }
|
||||
}, pane)
|
||||
else
|
||||
window:perform_action(act.ActivatePaneDirection(pane_direction),
|
||||
pane)
|
||||
end
|
||||
end
|
||||
|
||||
wezterm.on('ActivatePaneDirection-right', function(window, pane)
|
||||
conditionalActivatePane(window, pane, 'Right', 'l')
|
||||
end)
|
||||
wezterm.on('ActivatePaneDirection-left', function(window, pane)
|
||||
conditionalActivatePane(window, pane, 'Left', 'h')
|
||||
end)
|
||||
wezterm.on('ActivatePaneDirection-up', function(window, pane)
|
||||
conditionalActivatePane(window, pane, 'Up', 'k')
|
||||
end)
|
||||
wezterm.on('ActivatePaneDirection-down', function(window, pane)
|
||||
conditionalActivatePane(window, pane, 'Down', 'j')
|
||||
end)
|
||||
|
||||
-- Retrieve the current scrollback text and send to editor
|
||||
wezterm.on('edit-scrollback', function(window, pane)
|
||||
local viewport_text = pane:get_lines_as_text(10000)
|
||||
|
||||
-- Create a temporary file to pass to vim
|
||||
local name = os.tmpname()
|
||||
|
||||
local f = io.open(name, 'w+')
|
||||
if f == nil then return false end
|
||||
f:write(viewport_text)
|
||||
f:flush()
|
||||
f:close()
|
||||
|
||||
-- Open a new window running vim and tell it to open the file
|
||||
window:perform_action(act.SpawnCommandInNewTab {
|
||||
args = { (os.getenv('EDITOR') or 'vi'), name }
|
||||
}, pane)
|
||||
|
||||
-- Wait time for vim to read the file before we remove it.
|
||||
wezterm.sleep_ms(1000)
|
||||
os.remove(name)
|
||||
end)
|
||||
end
|
||||
|
||||
return { setup = setup }
|
113
wezterm/.config/wezterm/maps.lua
Normal file
113
wezterm/.config/wezterm/maps.lua
Normal file
|
@ -0,0 +1,113 @@
|
|||
local wezterm = require('wezterm')
|
||||
local act = wezterm.action
|
||||
|
||||
local keys = {
|
||||
{ key = 'O', mods = 'CTRL', action = act.ShowDebugOverlay },
|
||||
|
||||
{ key = '[', mods = 'CTRL', action = act.ScrollToPrompt(-1) },
|
||||
{ key = ']', mods = 'CTRL', action = act.ScrollToPrompt(1) },
|
||||
{ -- vertical pane
|
||||
key = '\\',
|
||||
mods = 'LEADER',
|
||||
action = act.SplitHorizontal { domain = 'CurrentPaneDomain' }
|
||||
}, { -- horizontal pane
|
||||
key = '-',
|
||||
mods = 'LEADER',
|
||||
action = act.SplitVertical { domain = 'CurrentPaneDomain' }
|
||||
}, -- pane movement keys
|
||||
{
|
||||
key = 'h',
|
||||
mods = 'CTRL',
|
||||
action = act.EmitEvent 'ActivatePaneDirection-left'
|
||||
},
|
||||
{
|
||||
key = 'j',
|
||||
mods = 'CTRL',
|
||||
action = act.EmitEvent 'ActivatePaneDirection-down'
|
||||
},
|
||||
{
|
||||
key = 'k',
|
||||
mods = 'CTRL',
|
||||
action = act.EmitEvent 'ActivatePaneDirection-up'
|
||||
}, {
|
||||
key = 'l',
|
||||
mods = 'CTRL',
|
||||
action = act.EmitEvent 'ActivatePaneDirection-right'
|
||||
}, { key = 'z', mods = 'LEADER', action = act.TogglePaneZoomState },
|
||||
{ key = ' ', mods = 'LEADER', action = act.RotatePanes 'Clockwise' },
|
||||
{ key = 'q', mods = 'LEADER', action = act.PaneSelect { mode = 'Activate' } },
|
||||
{
|
||||
key = 'Q',
|
||||
mods = 'LEADER',
|
||||
action = act.PaneSelect { mode = 'SwapWithActive' }
|
||||
}, { key = 'c', mods = 'LEADER', action = act.SpawnTab 'CurrentPaneDomain' },
|
||||
{ key = ',', mods = 'LEADER', action = act.MoveTabRelative(-1) },
|
||||
{ key = '.', mods = 'LEADER', action = act.MoveTabRelative(1) }, -- workspace selection
|
||||
{
|
||||
key = 's',
|
||||
mods = 'LEADER',
|
||||
action = act.ShowLauncherArgs { flags = 'FUZZY|WORKSPACES' }
|
||||
}, { key = 't', mods = 'LEADER', action = act.ShowTabNavigator },
|
||||
{ key = '[', mods = 'LEADER', action = act.ActivateCopyMode }, {
|
||||
key = 'r',
|
||||
mods = 'LEADER',
|
||||
action = act.ActivateKeyTable {
|
||||
name = 'resize_pane',
|
||||
one_shot = false,
|
||||
timeout_milliseconds = 2000,
|
||||
replace_current = true
|
||||
}
|
||||
}, { key = 'F', mods = 'LEADER', action = act.QuickSelect }, {
|
||||
key = '/',
|
||||
mods = 'LEADER',
|
||||
action = act.Search('CurrentSelectionOrEmptyString')
|
||||
}, {
|
||||
key = 'f',
|
||||
mods = 'LEADER',
|
||||
action = act.ActivateKeyTable {
|
||||
name = 'scroll_mode',
|
||||
one_shot = false,
|
||||
replace_current = true
|
||||
}
|
||||
}, { key = 'e', mods = 'LEADER', action = act.EmitEvent 'edit-scrollback' }, {
|
||||
key = 'l',
|
||||
mods = 'LEADER',
|
||||
action = act.EmitEvent 'ActivatePaneDirection-Right'
|
||||
}
|
||||
|
||||
}
|
||||
-- Leader + number to activate that tab
|
||||
for i = 1, 8 do
|
||||
table.insert(keys, {
|
||||
key = tostring(i),
|
||||
mods = 'LEADER',
|
||||
action = act.ActivateTab(i - 1)
|
||||
})
|
||||
end
|
||||
-- key table sub modes
|
||||
local key_tables = {
|
||||
-- mode to change size of any panes
|
||||
resize_pane = {
|
||||
{ key = 'h', action = act.AdjustPaneSize { 'Left', 1 } },
|
||||
{ key = 'l', action = act.AdjustPaneSize { 'Right', 1 } },
|
||||
{ key = 'k', action = act.AdjustPaneSize { 'Up', 1 } },
|
||||
{ key = 'j', action = act.AdjustPaneSize { 'Down', 1 } },
|
||||
{ key = 'H', action = act.AdjustPaneSize { 'Left', 10 } },
|
||||
{ key = 'L', action = act.AdjustPaneSize { 'Right', 10 } },
|
||||
{ key = 'K', action = act.AdjustPaneSize { 'Up', 10 } },
|
||||
{ key = 'J', action = act.AdjustPaneSize { 'Down', 10 } },
|
||||
{ key = 'Escape', action = 'PopKeyTable' }
|
||||
},
|
||||
scroll_mode = {
|
||||
{ key = 'y', mods = 'CTRL', action = act.ScrollByLine(-1) },
|
||||
{ key = 'e', mods = 'CTRL', action = act.ScrollByLine(1) },
|
||||
{ key = 'f', mods = 'CTRL', action = act.ScrollByPage(1) },
|
||||
{ key = 'b', mods = 'CTRL', action = act.ScrollByPage(-1) },
|
||||
{ key = 'd', mods = 'CTRL', action = act.ScrollByPage(0.5) },
|
||||
{ key = 'u', mods = 'CTRL', action = act.ScrollByPage(-0.5) },
|
||||
{ key = 'g', mods = 'CTRL', action = act.ScrollToTop },
|
||||
{ key = 'G', mods = 'CTRL', action = act.ScrollToBottom },
|
||||
{ key = 'Escape', action = 'PopKeyTable' }
|
||||
}
|
||||
}
|
||||
return { keys = keys, key_tables = key_tables }
|
46
wezterm/.config/wezterm/statusbar.lua
Normal file
46
wezterm/.config/wezterm/statusbar.lua
Normal file
|
@ -0,0 +1,46 @@
|
|||
local wezterm = require 'wezterm'
|
||||
|
||||
local function basename(s) return string.gsub(s or '', '(.*[/\\])(.*)', '%2') end
|
||||
|
||||
local SEPARATOR = ' | '
|
||||
local function setup()
|
||||
-- STATUSBAR
|
||||
-- show currently active key table in lower right status bar
|
||||
-- mimicing Vim modes
|
||||
wezterm.on('update-status', function(window, pane)
|
||||
local displayed = { left = {}, right = {} }
|
||||
local keytable = window:active_key_table()
|
||||
if keytable then
|
||||
displayed.left[#displayed.left + 1] = 'MODE: ' .. keytable
|
||||
end
|
||||
|
||||
local workspace = window:active_workspace()
|
||||
if workspace and workspace ~= 'default' then
|
||||
displayed.left[#displayed.left + 1] = 'WORKSPACE: ' .. workspace
|
||||
end
|
||||
|
||||
local bat = ''
|
||||
for _, b in ipairs(wezterm.battery_info()) do
|
||||
bat = '🔋 ' .. string.format('%.0f%%', b.state_of_charge * 100) ..
|
||||
' ' .. b.state
|
||||
end
|
||||
displayed.right[#displayed.right + 1] = bat
|
||||
|
||||
local currentprogram = pane:get_foreground_process_name()
|
||||
displayed.right[#displayed.right + 1] = basename(currentprogram)
|
||||
|
||||
local statusleft = ''
|
||||
for _, v in ipairs(displayed.left) do
|
||||
statusleft = statusleft .. v .. SEPARATOR
|
||||
end
|
||||
local statusright = ''
|
||||
for _, v in ipairs(displayed.right) do
|
||||
statusright = statusright .. v .. SEPARATOR
|
||||
end
|
||||
|
||||
window:set_left_status(statusleft or '')
|
||||
window:set_right_status(statusright or '')
|
||||
end)
|
||||
end
|
||||
|
||||
return { setup = setup }
|
78
wezterm/.config/wezterm/wezterm.lua
Normal file
78
wezterm/.config/wezterm/wezterm.lua
Normal file
|
@ -0,0 +1,78 @@
|
|||
local wezterm = require 'wezterm'
|
||||
local mux = wezterm.mux
|
||||
|
||||
local maps = require 'maps'
|
||||
|
||||
require 'statusbar'.setup()
|
||||
require 'events'.setup()
|
||||
|
||||
-- wezterm.on("set-up-dotfile-workspace", function(window, pane)
|
||||
-- -- Set a workspace for coding on a current project
|
||||
-- -- Top pane is for the editor, bottom pane is for the build tool
|
||||
-- local project_dir = wezterm.home_dir .. '/projects/test/quarto/quarto-test'
|
||||
-- local tab, build_pane, window = mux.spawn_window {
|
||||
-- workspace = 'coding',
|
||||
-- cwd = project_dir,
|
||||
-- args = args
|
||||
-- }
|
||||
-- local editor_pane = build_pane:split{
|
||||
-- direction = 'Top',
|
||||
-- size = 0.6,
|
||||
-- cwd = project_dir
|
||||
-- }
|
||||
-- build_pane:send_text 'quarto check'
|
||||
-- mux.set_active_workspace 'coding'
|
||||
-- end)
|
||||
--
|
||||
-- wezterm.on('gui-startup', function(cmd)
|
||||
-- -- allow `wezterm start -- something` to affect what we spawn
|
||||
-- -- in our initial window
|
||||
-- local args = {}
|
||||
-- if cmd then args = cmd.args end
|
||||
--
|
||||
-- -- Set a workspace for coding on a current project
|
||||
-- -- Top pane is for the editor, bottom pane is for the build tool
|
||||
-- local project_dir = wezterm.home_dir .. '/projects/test/quarto/quarto-test'
|
||||
-- local tab, build_pane, window = mux.spawn_window {
|
||||
-- workspace = 'coding',
|
||||
-- cwd = project_dir,
|
||||
-- args = args
|
||||
-- }
|
||||
-- local editor_pane = build_pane:split {
|
||||
-- direction = 'Top',
|
||||
-- size = 0.6,
|
||||
-- cwd = project_dir
|
||||
-- }
|
||||
-- build_pane:send_text 'quarto check'
|
||||
--
|
||||
-- -- A workspace for interacting with a local machine that
|
||||
-- -- runs some docker containners for home automation
|
||||
-- local tab, pane, window = mux.spawn_window {
|
||||
-- workspace = 'toppy',
|
||||
-- args = { 'top' }
|
||||
-- }
|
||||
--
|
||||
-- -- We want to startup in the coding workspace
|
||||
-- mux.set_active_workspace 'coding'
|
||||
-- end)
|
||||
|
||||
return {
|
||||
enable_wayland = true,
|
||||
|
||||
hide_tab_bar_if_only_one_tab = true,
|
||||
use_fancy_tab_bar = false,
|
||||
tab_bar_at_bottom = true,
|
||||
window_padding = { left = 0, right = 0, top = 0, bottom = 0 },
|
||||
|
||||
color_scheme = "Mexico Light (base16)",
|
||||
|
||||
-- default_prog = {"nu"},
|
||||
scrollback_lines = 10000,
|
||||
|
||||
font = wezterm.font('Liga Iosevka'),
|
||||
line_height = 1.0,
|
||||
|
||||
leader = { key = 'a', mods = 'CTRL', timeout_milliseconds = 1500 },
|
||||
keys = maps.keys,
|
||||
key_tables = maps.key_tables
|
||||
}
|
Loading…
Reference in a new issue