diff options
| -rw-r--r-- | .aliases | 23 | ||||
| -rw-r--r-- | .bash_profile | 22 | ||||
| -rwxr-xr-x | .bashrc | 3 | ||||
| -rw-r--r-- | .config/nvim/lazy-lock.json | 10 | ||||
| -rw-r--r-- | .config/nvim/lua/simenandre/init.lua | 5 | ||||
| -rw-r--r-- | .config/nvim/lua/simenandre/remap.lua | 11 | ||||
| -rw-r--r-- | .hammerspoon/hyper.lua | 26 | ||||
| -rw-r--r-- | .hammerspoon/init.lua | 3 | ||||
| -rw-r--r-- | .zshrc | 101 | ||||
| -rw-r--r-- | Brewfile | 3 | ||||
| -rwxr-xr-x | bootstrap.sh | 5 |
11 files changed, 56 insertions, 156 deletions
@@ -1,27 +1,26 @@ # Git aliases alias git-unpushed='git log --branches --not --remotes --no-walk --decorate --oneline' alias gb='git checkout -b' -alias gfr='git fetch upstream && git rebase upstream/master' +alias gfr='git fetch upstream && git rebase upstream/main' alias git-undo='git reset --soft HEAD~1' alias git-clean-branches="git for-each-ref --format '%(refname:short)' refs/heads | grep -v 'master\|main' | xargs git branch -D" # Generic / Random / Utility +alias rg="rg --hidden --glob '!.git' --glob '!node_modules'" alias r='cd $REPOS/github.com/' alias c='clear' alias afk='pmset displaysleepnow' alias dl="cd ~/Downloads" alias l='ls -l' -alias todo='todoist l --filter "#Inbox"' -alias docker=podman -alias docker-compose=podman-compose +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 docker-compose=podman-compose alias today="open 'obsidian://advanced-uri?daily=true'" alias tre='tree --gitignore' - -# Kill all the tabs in Chrome to free up memory -# [C] explained: http://www.commandlinefu.com/commands/view/402/exclude-grep-from-your-grepped-output-of-ps-alias-included-in-description -alias chromekill="ps ux | grep '[C]hrome Helper --type=renderer' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill" - +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 gcloud-configs="gcloud config configurations list" -alias gcloud-set-config="gcloud config configurations activate" +alias vi="nvim" +alias vim="nvim" +alias v="nvim" diff --git a/.bash_profile b/.bash_profile deleted file mode 100644 index 8e72229..0000000 --- a/.bash_profile +++ /dev/null @@ -1,22 +0,0 @@ -# branches and stuff in my SH -PS1='\w\[\033[0;32m\]$( git branch 2> /dev/null | cut -f2 -d\* -s | sed "s/^ / [/" | sed "s/$/]/" )\[\033[0m\] \$ ' - -# Load .bashrc, which loads: ~/.{bash_prompt,aliases,functions,path,dockerfunc,extra,exports} -if [[ -r "${HOME}/.bashrc" ]]; then - # shellcheck source=/dev/null - source "${HOME}/.bashrc" -fi - -# Tell grep to highlight matches -export GREP_OPTIONS='--color=auto' - -# Tell ls to be colourful -export CLICOLOR=1 -export LSCOLORS=Exfxcxdxbxegedabagacad - -# Volta -. "$HOME/.cargo/env" -export VOLTA_HOME="$HOME/.volta" -export PATH="$VOLTA_HOME/bin:$PATH" - -function gam() { "/Users/cobraz/bin/gam/gam" "$@" ; } @@ -22,8 +22,7 @@ fi /usr/bin/ssh-add -K } &>/dev/null -# Set Emacs as VISUAL -export VISUAL="emacs" +export VISUAL="nvim" for file in ~/.{aliases,path,extras}; do if [[ -r "$file" ]] && [[ -f "$file" ]]; then diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 0c50b58..83eb852 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,12 +1,16 @@ { "LuaSnip": { "branch": "master", "commit": "57c9f5c31b3d712376c704673eac8e948c82e9c1" }, + "aw-watcher-vim": { "branch": "master", "commit": "4ba86d05a940574000c33f280fd7f6eccc284331" }, + "better-escape.nvim": { "branch": "master", "commit": "7031dc734add47bb71c010e0551829fa5799375f" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "conform.nvim": { "branch": "master", "commit": "8b407bb6175846cdc4c499e2a8d28109615a2089" }, + "copilot.vim": { "branch": "release", "commit": "5b19fb001d7f31c4c7c5556d7a97b243bd29f45f" }, "friendly-snippets": { "branch": "main", "commit": "53d3df271d031c405255e99410628c26a8f0d2b0" }, "harpoon": { "branch": "harpoon2", "commit": "31701337377991c66eebb57ebd23ef01eb587352" }, "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, "lsp-zero.nvim": { "branch": "v2.x", "commit": "ffebf6f7b0649f1eb81b37c37b75552f8ff96337" }, + "lspsaga.nvim": { "branch": "main", "commit": "335805d4f591f5bb71cabb6aa4dc58ccef8e8617" }, "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "56e435e09f8729af2d41973e81a0db440f8fe9c9" }, "mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" }, @@ -17,7 +21,11 @@ "nvim-treesitter": { "branch": "master", "commit": "454c3a9ba86f841dc3b5bb17d150a873a16b77b4" }, "nvim-web-devicons": { "branch": "master", "commit": "aff5f50b34754335a312c9b3dc5b245f605ce437" }, "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, + "rose-pine": { "branch": "main", "commit": "92762f4fa2144c05db760ea254f4c399a56a7ef5" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, - "vim-fugitive": { "branch": "master", "commit": "59659093581aad2afacedc81f009ed6a4bfad275" } + "vim-be-good": { "branch": "master", "commit": "c290810728a4f75e334b07dc0f3a4cdea908d351" }, + "vim-dbml": { "branch": "master", "commit": "c684576d80542c52f888309b715c49bc69a02ed3" }, + "vim-fugitive": { "branch": "master", "commit": "59659093581aad2afacedc81f009ed6a4bfad275" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } }
\ No newline at end of file diff --git a/.config/nvim/lua/simenandre/init.lua b/.config/nvim/lua/simenandre/init.lua index 8dfcf77..a14f271 100644 --- a/.config/nvim/lua/simenandre/init.lua +++ b/.config/nvim/lua/simenandre/init.lua @@ -6,3 +6,8 @@ vim.g.mapleader = " " -- Make sure to set `mapleader` before lazy so your mappin require("lazy").setup("plugins") +vim.filetype.add({ + extension = { + templ = "templ", + }, +}) diff --git a/.config/nvim/lua/simenandre/remap.lua b/.config/nvim/lua/simenandre/remap.lua index ee5bdb0..d7968f0 100644 --- a/.config/nvim/lua/simenandre/remap.lua +++ b/.config/nvim/lua/simenandre/remap.lua @@ -3,7 +3,10 @@ vim.g.mapleader = " " vim.keymap.set("i", "<C-c>", "<Esc>") vim.keymap.set("n", "<leader>f", vim.lsp.buf.format) -vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz") -vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz") -vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz") -vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz") +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") + +vim.keymap.set("n", "<C-d>", "<C-d>zz") +vim.keymap.set("n", "<C-u>", "<C-u>zz") diff --git a/.hammerspoon/hyper.lua b/.hammerspoon/hyper.lua index 2124bca..4cca4db 100644 --- a/.hammerspoon/hyper.lua +++ b/.hammerspoon/hyper.lua @@ -1,23 +1,27 @@ local hyper = hs.hotkey.modal.new({}, nil) hyper.pressed = function() - hyper:enter() + hyper:enter() end hyper.released = function() - hyper:exit() + hyper:exit() end --- Bind the Hyper key to the hammerspoon modal -hs.hotkey.bind({}, "F13", hyper.pressed, hyper.released) +-- 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) 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) + local fn = function() + hs.application.launchOrFocus(app) + end + if type(app) == "function" then + fn = app + end + hyper:bind(mods, key, fn) end return hyper diff --git a/.hammerspoon/init.lua b/.hammerspoon/init.lua index b8b7e84..f4ee5d1 100644 --- a/.hammerspoon/init.lua +++ b/.hammerspoon/init.lua @@ -5,3 +5,6 @@ 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") @@ -4,111 +4,14 @@ # Path to your oh-my-zsh installation. export ZSH="/Users/cobraz/.oh-my-zsh" -# Set name of the theme to load --- if set to "random", it will -# load a random theme each time oh-my-zsh is loaded, in which case, -# to know which specific one was loaded, run: echo $RANDOM_THEME -# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes ZSH_THEME="robbyrussell" -# Set list of themes to pick from when loading at random -# Setting this variable when ZSH_THEME=random will cause zsh to load -# a theme from this variable instead of looking in $ZSH/themes/ -# If set to an empty array, this variable will have no effect. -# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) - -# Uncomment the following line to use case-sensitive completion. -# CASE_SENSITIVE="true" - -# Uncomment the following line to use hyphen-insensitive completion. -# Case-sensitive completion must be off. _ and - will be interchangeable. -# HYPHEN_INSENSITIVE="true" - -# Uncomment one of the following lines to change the auto-update behavior -# zstyle ':omz:update' mode disabled # disable automatic updates -# zstyle ':omz:update' mode auto # update automatically without asking -# zstyle ':omz:update' mode reminder # just remind me to update when it's time - -# Uncomment the following line to change how often to auto-update (in days). -# zstyle ':omz:update' frequency 13 - -# Uncomment the following line if pasting URLs and other text is messed up. -# DISABLE_MAGIC_FUNCTIONS="true" - -# Uncomment the following line to disable colors in ls. -# DISABLE_LS_COLORS="true" - -# Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" - -# Uncomment the following line to enable command auto-correction. -# ENABLE_CORRECTION="true" - -# Uncomment the following line to display red dots whilst waiting for completion. -# You can also set it to another string to have that shown instead of the default red dots. -# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" -# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765) -# COMPLETION_WAITING_DOTS="true" - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -# DISABLE_UNTRACKED_FILES_DIRTY="true" - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. -# You can set one of the optional three formats: -# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" -# or set a custom format using the strftime function format specifications, -# see 'man strftime' for details. -# HIST_STAMPS="mm/dd/yyyy" - -# Would you like to use another custom folder than $ZSH/custom? -# ZSH_CUSTOM=/path/to/new-custom-folder - -# Which plugins would you like to load? -# Standard plugins can be found in $ZSH/plugins/ -# Custom plugins may be added to $ZSH_CUSTOM/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. -plugins=(git) +lugins=(git) source $ZSH/oh-my-zsh.sh - -# User configuration - -# export MANPATH="/usr/local/man:$MANPATH" - -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -# Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -# export EDITOR='vim' -# else -# export EDITOR='mvim' -# fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# Set personal aliases, overriding those provided by oh-my-zsh libs, -# plugins, and themes. Aliases can be placed here, though oh-my-zsh -# users are encouraged to define aliases within the ZSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. -# -# Example aliases -# alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" - if [[ -r "${HOME}/.bashrc" ]]; then # shellcheck source=/dev/null source "${HOME}/.bashrc" fi -# pnpm -export PNPM_HOME="/Users/cobraz/Library/pnpm" -case ":$PATH:" in - *":$PNPM_HOME:"*) ;; - *) export PATH="$PNPM_HOME:$PATH" ;; -esac -# pnpm end
\ No newline at end of file + @@ -3,6 +3,7 @@ brew "mas" brew "ghq" brew "moreutils" brew "yadm" +brew "zsh" # GNU `find`, `locate`, `updatedb`, and `xargs`, `g`-prefixed. brew "findutils" @@ -47,6 +48,7 @@ brew "python@3.10" brew "rust" # Other useful binaries +brew "ripgrep" brew "ack" brew "git" brew "git-lfs" @@ -76,6 +78,7 @@ brew "tmate" brew "doctl" brew "act" cask "hammerspoon" +cask "karabiner-elements" # Javascript Runtimes and tools tap "oven-sh/bun" diff --git a/bootstrap.sh b/bootstrap.sh index 1283370..e190a7d 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,9 +1,4 @@ #!/bin/bash -source ./.vscode/vscode.sh - # Install Oh My Zsh sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended - -# Install Volta (https://volta.sh/) -curl https://get.volta.sh | bash |
