diff options
| author | Simen A. W. Olsen <so@bjerk.io> | 2024-05-17 10:05:29 +0200 |
|---|---|---|
| committer | Simen A. W. Olsen <so@bjerk.io> | 2024-05-17 10:05:29 +0200 |
| commit | a2f43302e1524cc8fe38791e0fdc00a3695fb76b (patch) | |
| tree | e393d1789a8d4a444d18425229f0f778ceb7342e | |
| parent | e0b3900d8b50b499a5527e0f6d3590649fd4cefb (diff) | |
| download | dotfiles-a2f43302e1524cc8fe38791e0fdc00a3695fb76b.tar.gz dotfiles-a2f43302e1524cc8fe38791e0fdc00a3695fb76b.zip | |
updates
| -rw-r--r-- | .aliases | 7 | ||||
| -rwxr-xr-x | .bashrc | 1 | ||||
| -rw-r--r-- | .config/nvim/lazy-lock.json | 3 | ||||
| -rw-r--r-- | .config/nvim/lua/simenandre/plugins/harpoon.lua | 71 | ||||
| -rw-r--r-- | .config/nvim/lua/simenandre/remap.lua | 2 | ||||
| -rwxr-xr-x | .extras | 6 | ||||
| -rw-r--r-- | .hammerspoon/hyper.lua | 91 | ||||
| -rw-r--r-- | .hammerspoon/init.lua | 48 | ||||
| -rw-r--r-- | .path | 2 | ||||
| -rw-r--r-- | .zshrc | 1 | ||||
| -rw-r--r-- | Brewfile | 8 |
11 files changed, 170 insertions, 70 deletions
@@ -14,13 +14,16 @@ alias dl="cd ~/Downloads" alias l='ls -l' alias todo='nt' alias tasks="open 'obsidian://open?file=-%20Oppgaver'" -alias todos="mt ~/ghq/github.com/simenandre/notes/ && echo '\n\nÅpne i Obsidian: tasks'" +alias todos="mt ~/ghq/github.com/simenandre/notes/" # alias docker-compose=podman-compose alias today="open 'obsidian://advanced-uri?daily=true'" -alias tre='tree --gitignore' +alias tre="tree -I '.git|node_modules'" alias timeliste="open 'https://tripletex.no/execute/updateHourlist?contextId=11208568'" alias t="open 'https://tripletex.no/execute/updateHourlist?contextId=11208568'" alias fork-cleaner="fork-cleaner --token $(cat ~/.secrets/github-token)" alias vi="nvim" alias vim="nvim" alias v="nvim" + +alias dump-issues="getBjerkIssues > ~/Downloads/issues-$(date -I).json" + @@ -31,3 +31,4 @@ for file in ~/.{aliases,path,extras}; do fi done unset file +. "$HOME/.cargo/env" diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 6744f12..0f99e38 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -5,8 +5,10 @@ "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" }, + "copilot.vim": { "branch": "release", "commit": "7097b09e52621a97d11f254e04de5e5a0f26e5f5" }, "fidget.nvim": { "branch": "main", "commit": "1ba38e4cbb24683973e00c2e36f53ae64da38ef5" }, "gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" }, + "harpoon": { "branch": "harpoon2", "commit": "da326d0438ac68dee9b6b62a734be940a8bd8405" }, "lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "44509689b9bf3984d729cc264aacb31cb7f41668" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "c1fbdcb0d8d1295314f1612c4a247253e70299d9" }, @@ -16,6 +18,7 @@ "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, "nvim-lspconfig": { "branch": "master", "commit": "9619e53d3f99f0ca4ea3b88f5d97fce703131820" }, "nvim-treesitter": { "branch": "master", "commit": "11a3584b81c3249d2b6279305aee1c7ad273985a" }, + "oil.nvim": { "branch": "master", "commit": "9e3a02252dc5686f374f79f50a13cfe7547c05af" }, "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, diff --git a/.config/nvim/lua/simenandre/plugins/harpoon.lua b/.config/nvim/lua/simenandre/plugins/harpoon.lua index dbdf096..3bd4896 100644 --- a/.config/nvim/lua/simenandre/plugins/harpoon.lua +++ b/.config/nvim/lua/simenandre/plugins/harpoon.lua @@ -1,44 +1,37 @@ return { - "ThePrimeagen/harpoon", - branch = "harpoon2", - requires = { - { "nvim-lua/plenary.nvim" }, - }, - config = function() - local harpoon = require("harpoon") + "ThePrimeagen/harpoon", + branch = "harpoon2", + requires = { + { "nvim-lua/plenary.nvim" }, + }, + config = function() + local harpoon = require("harpoon") + harpoon:setup() - -- REQUIRED - harpoon:setup() - -- REQUIRED + vim.keymap.set("n", "<leader>a", function() + harpoon:list():add() + end) + vim.keymap.set("n", "<C-e>", function() + harpoon.ui:toggle_quick_menu(harpoon:list()) + end) - vim.keymap.set("n", "<leader>a", function() - harpoon:list():add() - end) - vim.keymap.set("n", "<C-e>", function() - harpoon.ui:toggle_quick_menu(harpoon:list()) - end) + -- vim.keymap.set("n", "<C-j>", function() + -- harpoon:list():select(1) + -- end) + -- vim.keymap.set("n", "<C-k>", function() + -- harpoon:list():select(2) + -- end) + -- vim.keymap.set("n", "<C-l>", function() + -- harpoon:list():select(3) + -- end) + -- vim.keymap.set("n", "<C-[>", function() + -- harpoon:list():select(4) + -- end) - vim.keymap.set("n", "<C-j>", function() - harpoon:list():select(1) - end) - vim.keymap.set("n", "<C-k>", function() - harpoon:list():select(2) - end) - vim.keymap.set("n", "<C-l>", function() - harpoon:list():select(3) - end) - vim.keymap.set("n", "<C-[>", function() - harpoon:list():select(4) - end) - -- vim.keymap.set("n", "<C-[>", function() - -- harpoon:list():select(4) - -- end) - - vim.keymap.set("n", "<C-S-P>", function() - harpoon:list():prev() - end) - vim.keymap.set("n", "<C-S-N>", function() - harpoon:list():next() - end) - end, + for _, idx in ipairs({ 1, 2, 3, 4, 5 }) do + vim.keymap.set("n", string.format("<leader>%d", idx), function() + harpoon:list():select(idx) + end) + end + end, } diff --git a/.config/nvim/lua/simenandre/remap.lua b/.config/nvim/lua/simenandre/remap.lua index 36d44b3..a2fb673 100644 --- a/.config/nvim/lua/simenandre/remap.lua +++ b/.config/nvim/lua/simenandre/remap.lua @@ -3,8 +3,6 @@ vim.keymap.set("i", "<C-c>", "<Esc>") vim.keymap.set("n", "<leader>f", vim.lsp.buf.format) -vim.keymap.set("n", "<leader>pv", vim.cmd.Ex) - vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv") vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv") @@ -12,3 +12,9 @@ function nt() { fi } +function getBjerkIssues() { + gh issue list --repo bjerkio/internal \ + --search "-label:backlog -label:kind/system" \ + --json title,body,url,createdAt,assignees,number,labels,comments \ + --jq 'map({url, createdAt, title, labels: [.labels[].name], assignees: [.assignees[].login], body, number: "#\(.number)", comments: .comments | map({ body: .body, createdAt: .createdAt })})' +} diff --git a/.hammerspoon/hyper.lua b/.hammerspoon/hyper.lua index 4cca4db..e5380f9 100644 --- a/.hammerspoon/hyper.lua +++ b/.hammerspoon/hyper.lua @@ -1,27 +1,80 @@ -local hyper = hs.hotkey.modal.new({}, nil) +local This = {} -hyper.pressed = function() - hyper:enter() -end -hyper.released = function() - hyper:exit() -end +----------------------------------------------------------------------------------- +-- File: hyper.lua +-- Author: J.H. Kuperus +-- Source: https://github.com/jhkuperus/dotfiles/blob/master/hammerspoon/hyper.lua +-- "License": Feel free to use this file any way you like. Issues or improvements +-- are welcome on the GitHub repository. No warranties whatsoever. +----------------------------------------------------------------------------------- + +-- To use Hyper in your init.lua script, import it and adapt this example to +-- your needs: +-- +-- local hyper = require('hyper') +-- hyper.install('F18') +-- hyper.bindkey('r', hs.reload) +-- +-- The above three lines initialize Hyper to respond to F18 key-events and binds +-- Hyper+r to Hammerspoon Reload (easy way to refresh Hammerspoon's config) -- Hyper mode needs to be bound to a key. Here we are binding -- it to F17, because this is yet another key that's unused. -- Why not F18? We will use key-events from F18 to turn hyper --- mode on and off. Using F17 as both the modal and source of key --- events will result in a very jittery Hyper mode. -hs.hotkey.bind({}, "F18", hyper.pressed, hyper.released) +-- mode on and off. Using F17 as the modal and source of key +-- events, will result in a very jittery Hyper mode. -hyper.bindApp = function(mods, key, app) - local fn = function() - hs.application.launchOrFocus(app) - end - if type(app) == "function" then - fn = app - end - hyper:bind(mods, key, fn) +This.hyperMode = hs.hotkey.modal.new({}, "F17") + +-- Enter Hyper Mode when F18 (Hyper) is pressed +function enterHyperMode() + This.hyperMode:enter() end -return hyper +-- Leave Hyper Mode when F18 (Hyper) is pressed +function exitHyperMode() + This.hyperMode:exit() +end + +-- Utility to bind handler to Hyper+key +function This.bindKey(key, handler) + This.hyperMode:bind({}, key, handler) +end + +-- Utility to bind handler to Hyper+Shift+key +function This.bindShiftKey(key, handler) + This.hyperMode:bind({ "shift" }, key, handler) +end + +-- Utility to bind handler to Hyper+Command+Shift+key +function This.bindCommandShiftKey(key, handler) + This.hyperMode:bind({ "command", "shift" }, key, handler) +end + +-- Utility to bind handler to Hyper+modifiers+key +function This.bindKeyWithModifiers(key, mods, handler) + This.hyperMode:bind(mods, key, handler) +end + +-- Binds the enter/exit functions of the Hyper modal to all combinations of modifiers +function This.install(hotKey) + hs.hotkey.bind({}, hotKey, enterHyperMode, exitHyperMode) + hs.hotkey.bind({ "shift" }, hotKey, enterHyperMode, exitHyperMode) + hs.hotkey.bind({ "ctrl" }, hotKey, enterHyperMode, exitHyperMode) + hs.hotkey.bind({ "ctrl", "shift" }, hotKey, enterHyperMode, exitHyperMode) + hs.hotkey.bind({ "cmd" }, hotKey, enterHyperMode, exitHyperMode) + hs.hotkey.bind({ "cmd", "shift" }, hotKey, enterHyperMode, exitHyperMode) + hs.hotkey.bind({ "cmd", "ctrl" }, hotKey, enterHyperMode, exitHyperMode) + hs.hotkey.bind({ "cmd", "ctrl", "shift" }, hotKey, enterHyperMode, exitHyperMode) + hs.hotkey.bind({ "alt" }, hotKey, enterHyperMode, exitHyperMode) + hs.hotkey.bind({ "alt", "shift" }, hotKey, enterHyperMode, exitHyperMode) + hs.hotkey.bind({ "alt", "ctrl" }, hotKey, enterHyperMode, exitHyperMode) + hs.hotkey.bind({ "alt", "ctrl", "shift" }, hotKey, enterHyperMode, exitHyperMode) + hs.hotkey.bind({ "alt", "cmd" }, hotKey, enterHyperMode, exitHyperMode) + hs.hotkey.bind({ "alt", "cmd", "shift" }, hotKey, enterHyperMode, exitHyperMode) + hs.hotkey.bind({ "alt", "cmd", "ctrl" }, hotKey, enterHyperMode, exitHyperMode) + hs.hotkey.bind({ "alt", "cmd", "shift", "ctrl" }, hotKey, enterHyperMode, exitHyperMode) +end + +return This + diff --git a/.hammerspoon/init.lua b/.hammerspoon/init.lua index f4ee5d1..234f316 100644 --- a/.hammerspoon/init.lua +++ b/.hammerspoon/init.lua @@ -1,10 +1,42 @@ local hyper = require("hyper") +hyper.install("F18") -hyper.bindApp({}, "a", "Arc") -hyper.bindApp({}, "w", "Warp") -hyper.bindApp({}, "s", "Slack") -hyper.bindApp({}, "1", "1Password") -hyper.bindApp({}, "r", "Rize") -hyper.bindApp({}, "d", "Obsidian") -hyper.bindApp({}, "c", "Google Chrome") -hyper.bindApp({}, "t", "Notification Center") +hyper.bindKey("a", function() + hs.application.launchOrFocus("Arc") +end) + +hyper.bindKey("w", function() + hs.application.launchOrFocus("Warp") +end) + +hyper.bindKey("e", function() + hs.application.launchOrFocus("iTerm") +end) + +hyper.bindKey("s", function() + hs.application.launchOrFocus("Slack") +end) + +hyper.bindKey("1", function() + hs.application.launchOrFocus("1Password") +end) + +hyper.bindKey("r", function() + hs.application.launchOrFocus("Rize") +end) + +hyper.bindKey("d", function() + hs.application.launchOrFocus("Obsidian") +end) + +hyper.bindKey("c", function() + hs.application.launchOrFocus("Google Chrome") +end) + +hyper.bindKey("t", function() + hs.application.launchOrFocus("Notification Center") +end) + +hyper.bindKey("m", function() + hs.application.launchOrFocus("Messages") +end) @@ -30,3 +30,5 @@ export PATH="$GOPATH/bin:$PATH" export VOLTA_HOME="$HOME/.volta" export PATH="$VOLTA_HOME/bin:$PATH" +export PATH="$HOME/scripts/bin:$PATH" +export PATH="$HOME/scripts:$PATH" @@ -15,3 +15,4 @@ if [[ -r "${HOME}/.bashrc" ]]; then fi +. "$HOME/.cargo/env" @@ -46,6 +46,10 @@ brew "woff2" brew "golang" brew "python@3.10" brew "rust" +brew "zig" + +# Restish +brew "danielgtaylor/restish/restish" # Other useful binaries brew "ripgrep" @@ -79,6 +83,8 @@ brew "doctl" brew "act" cask "hammerspoon" cask "karabiner-elements" +brew "dasel" +brew "tmux" # Javascript Runtimes and tools tap "oven-sh/bun" @@ -141,6 +147,8 @@ cask "adobe-creative-cloud" cask "1password" cask "openvpn-connect" cask "devtoys" +cask "raycast" + # Obsidian stuff cask "obsidian" |
