mirror of
https://github.com/turtlebasket/env.git
synced 2026-03-05 12:04:27 -08:00
Compare commits
11 Commits
44a04166f4
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7df984d8c9 | ||
|
|
c33c7583f1 | ||
|
|
5c5128be85 | ||
| 4d34926921 | |||
| b64a2c9030 | |||
| 8c520df5bd | |||
| cd72f8cffd | |||
| 837111c722 | |||
| fd51ecd814 | |||
| 151cd20a95 | |||
| 6a6cd3bc79 |
@@ -1,14 +1,10 @@
|
|||||||
# Environment
|
# Environment
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
## Contents
|
## Contents
|
||||||
|
|
||||||
- [Configs](./config/)
|
- [Configs](./config/)
|
||||||
- [Old setup stuff](./setup/)
|
|
||||||
- [Misc. scripts](./scripts/)
|
- [Misc. scripts](./scripts/)
|
||||||
|
- [Old setup stuff](./setup/)
|
||||||
|
|
||||||
## Software List
|
## Software List
|
||||||
|
|
||||||
@@ -19,12 +15,11 @@
|
|||||||
- [MiddleClick](https://github.com/artginzburg/MiddleClick-BigSur)
|
- [MiddleClick](https://github.com/artginzburg/MiddleClick-BigSur)
|
||||||
- [LinearMouse](https://linearmouse.org/)
|
- [LinearMouse](https://linearmouse.org/)
|
||||||
- [OpenInTerminal](https://github.com/Ji4n1ng/OpenInTerminal)
|
- [OpenInTerminal](https://github.com/Ji4n1ng/OpenInTerminal)
|
||||||
|
- [Raycast](https://www.raycast.com/)
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
- [AutoHotKey v1](https://www.autohotkey.com/download/1.1/)
|
- [AutoHotKey v1](https://www.autohotkey.com/download/1.1/)
|
||||||
- ShareX
|
- ShareX
|
||||||
- Powershell Core
|
- Powershell Core
|
||||||
- Windows Terminal
|
|
||||||
- WSL (native feature)
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +0,0 @@
|
|||||||
## Installation
|
|
||||||
|
|
||||||
```
|
|
||||||
cp ./*.el ~/.doom.d/
|
|
||||||
```
|
|
||||||
|
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
|
|
||||||
|
|
||||||
;; Place your private configuration here! Remember, you do not need to run 'doom
|
|
||||||
;; sync' after modifying this file!
|
|
||||||
|
|
||||||
|
|
||||||
;; Some functionality uses this to identify you, e.g. GPG configuration, email
|
|
||||||
;; clients, file templates and snippets. It is optional.
|
|
||||||
(setq user-full-name "John Doe"
|
|
||||||
user-mail-address "john@doe.com")
|
|
||||||
|
|
||||||
;; Doom exposes five (optional) variables for controlling fonts in Doom:
|
|
||||||
;;
|
|
||||||
;; - `doom-font' -- the primary font to use
|
|
||||||
;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable)
|
|
||||||
;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for
|
|
||||||
;; presentations or streaming.
|
|
||||||
;; - `doom-unicode-font' -- for unicode glyphs
|
|
||||||
;; - `doom-serif-font' -- for the `fixed-pitch-serif' face
|
|
||||||
;;
|
|
||||||
;; See 'C-h v doom-font' for documentation and more examples of what they
|
|
||||||
;; accept. For example:
|
|
||||||
;;
|
|
||||||
;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light)
|
|
||||||
;; doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13))
|
|
||||||
;;
|
|
||||||
;; If you or Emacs can't find your font, use 'M-x describe-font' to look them
|
|
||||||
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to
|
|
||||||
;; refresh your font settings. If Emacs still can't find your font, it likely
|
|
||||||
;; wasn't installed correctly. Font issues are rarely Doom issues!
|
|
||||||
|
|
||||||
;; There are two ways to load a theme. Both assume the theme is installed and
|
|
||||||
;; available. You can either set `doom-theme' or manually load a theme with the
|
|
||||||
;; `load-theme' function. This is the default:
|
|
||||||
(setq doom-theme 'doom-monokai-spectrum)
|
|
||||||
|
|
||||||
;; This determines the style of line numbers in effect. If set to `nil', line
|
|
||||||
;; numbers are disabled. For relative line numbers, set this to `relative'.
|
|
||||||
(setq display-line-numbers-type t)
|
|
||||||
|
|
||||||
;; If you use `org' and don't want your org files in the default location below,
|
|
||||||
;; change `org-directory'. It must be set before org loads!
|
|
||||||
(setq org-directory "~/org/")
|
|
||||||
|
|
||||||
|
|
||||||
;; Whenever you reconfigure a package, make sure to wrap your config in an
|
|
||||||
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
|
|
||||||
;;
|
|
||||||
;; (after! PACKAGE
|
|
||||||
;; (setq x y))
|
|
||||||
;;
|
|
||||||
;; The exceptions to this rule:
|
|
||||||
;;
|
|
||||||
;; - Setting file/directory variables (like `org-directory')
|
|
||||||
;; - Setting variables which explicitly tell you to set them before their
|
|
||||||
;; package is loaded (see 'C-h v VARIABLE' to look up their documentation).
|
|
||||||
;; - Setting doom variables (which start with 'doom-' or '+').
|
|
||||||
;;
|
|
||||||
;; Here are some additional functions/macros that will help you configure Doom.
|
|
||||||
;;
|
|
||||||
;; - `load!' for loading external *.el files relative to this one
|
|
||||||
;; - `use-package!' for configuring packages
|
|
||||||
;; - `after!' for running code after a package has loaded
|
|
||||||
;; - `add-load-path!' for adding directories to the `load-path', relative to
|
|
||||||
;; this file. Emacs searches the `load-path' when you load packages with
|
|
||||||
;; `require' or `use-package'.
|
|
||||||
;; - `map!' for binding new keys
|
|
||||||
;;
|
|
||||||
;; To get information about any of these functions/macros, move the cursor over
|
|
||||||
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
|
|
||||||
;; This will open documentation for it, including demos of how they are used.
|
|
||||||
;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces,
|
|
||||||
;; etc).
|
|
||||||
;;
|
|
||||||
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
|
|
||||||
;; they are implemented.
|
|
||||||
|
|
||||||
;; treemacs extension
|
|
||||||
(setq treemacs-text-scale 0.7)
|
|
||||||
(setq treemacs-git-mode 'deferred)
|
|
||||||
(with-eval-after-load 'treemacs
|
|
||||||
(treemacs-display-current-project-exclusively)
|
|
||||||
(setq treemacs-project-follow-mode :true)
|
|
||||||
(define-key treemacs-mode-map [mouse-1] #'treemacs-single-click-expand-action)) ;; single click to open tree nodes
|
|
||||||
|
|
||||||
;; code minimap
|
|
||||||
;; (setq minimap-move-overlay-mouse [mouse-1])
|
|
||||||
|
|
||||||
;; Rust config
|
|
||||||
;; https://github.com/doomemacs/doomemacs/blob/develop/modules/lang/rust/README.org#enable-rls-by-default
|
|
||||||
;; (setq rustic-lsp-server 'rust-analyzer)
|
|
||||||
(setq rustic-lsp-server 'rls)
|
|
||||||
(setq rustic-lsp-client 'eglot)
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
(custom-set-variables
|
|
||||||
;; custom-set-variables was added by Custom.
|
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
|
||||||
;; Your init file should contain only one such instance.
|
|
||||||
;; If there is more than one, they won't work right.
|
|
||||||
'(custom-safe-themes
|
|
||||||
'("c4063322b5011829f7fdd7509979b5823e8eea2abf1fe5572ec4b7af1dd78519" "6f4421bf31387397f6710b6f6381c448d1a71944d9e9da4e0057b3fe5d6f2fad" "1278c5f263cdb064b5c86ab7aa0a76552082cf0189acf6df17269219ba496053" "e19ac4ef0f028f503b1ccafa7c337021834ce0d1a2bca03fcebc1ef635776bea" "4a5aa2ccb3fa837f322276c060ea8a3d10181fecbd1b74cb97df8e191b214313" "76ed126dd3c3b653601ec8447f28d8e71a59be07d010cd96c55794c3008df4d7" "e8df30cd7fb42e56a4efc585540a2e63b0c6eeb9f4dc053373e05d774332fc13" "4b6b6b0a44a40f3586f0f641c25340718c7c626cbf163a78b5a399fbe0226659" "23c806e34594a583ea5bbf5adf9a964afe4f28b4467d28777bcba0d35aa0872e" "7a7b1d475b42c1a0b61f3b1d1225dd249ffa1abb1b7f726aec59ac7ca3bf4dae" "8146edab0de2007a99a2361041015331af706e7907de9d6a330a3493a541e5a6" "4699e3a86b1863bbc695236036158d175a81f0f3ea504e2b7c71f8f7025e19e3" "1bddd01e6851f5c4336f7d16c56934513d41cc3d0233863760d1798e74809b4b" "a0be7a38e2de974d1598cf247f607d5c1841dbcef1ccd97cded8bea95a7c7639" "028c226411a386abc7f7a0fba1a2ebfae5fe69e2a816f54898df41a6a3412bb5" "6c98bc9f39e8f8fd6da5b9c74a624cbb3782b4be8abae8fd84cbc43053d7c175" "84b14a0a41bb2728568d40c545280dbe7d6891221e7fbe7c2b1c54a3f5959289" "1d44ec8ec6ec6e6be32f2f73edf398620bb721afeed50f75df6b12ccff0fbb15" "1d5e33500bc9548f800f9e248b57d1b2a9ecde79cb40c0b1398dec51ee820daf" "835868dcd17131ba8b9619d14c67c127aa18b90a82438c8613586331129dda63" default))
|
|
||||||
'(package-selected-packages '(rustic eglot yasnippet)))
|
|
||||||
(custom-set-faces
|
|
||||||
;; custom-set-faces was added by Custom.
|
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
|
||||||
;; Your init file should contain only one such instance.
|
|
||||||
;; If there is more than one, they won't work right.
|
|
||||||
)
|
|
||||||
@@ -1,193 +0,0 @@
|
|||||||
;;; init.el -*- lexical-binding: t; -*-
|
|
||||||
|
|
||||||
;; This file controls what Doom modules are enabled and what order they load
|
|
||||||
;; in. Remember to run 'doom sync' after modifying it!
|
|
||||||
|
|
||||||
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
|
|
||||||
;; documentation. There you'll find a link to Doom's Module Index where all
|
|
||||||
;; of our modules are listed, including what flags they support.
|
|
||||||
|
|
||||||
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
|
|
||||||
;; 'C-c c k' for non-vim users) to view its documentation. This works on
|
|
||||||
;; flags as well (those symbols that start with a plus).
|
|
||||||
;;
|
|
||||||
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
|
|
||||||
;; directory (for easy access to its source code).
|
|
||||||
|
|
||||||
(doom! :input
|
|
||||||
;;bidi ; (tfel ot) thgir etirw uoy gnipleh
|
|
||||||
;;chinese
|
|
||||||
;;japanese
|
|
||||||
;;layout ; auie,ctsrnm is the superior home row
|
|
||||||
|
|
||||||
:completion
|
|
||||||
company ; the ultimate code completion backend
|
|
||||||
;;helm ; the *other* search engine for love and life
|
|
||||||
;;ido ; the other *other* search engine...
|
|
||||||
;;ivy ; a search engine for love and life
|
|
||||||
vertico ; the search engine of the future
|
|
||||||
|
|
||||||
:ui
|
|
||||||
;;deft ; notational velocity for Emacs
|
|
||||||
doom ; what makes DOOM look the way it does
|
|
||||||
doom-dashboard ; a nifty splash screen for Emacs
|
|
||||||
;;doom-quit ; DOOM quit-message prompts when you quit Emacs
|
|
||||||
;;(emoji +unicode) ; 🙂
|
|
||||||
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
|
|
||||||
;;hydra
|
|
||||||
;;indent-guides ; highlighted indent columns
|
|
||||||
;;ligatures ; ligatures and symbols to make your code pretty again
|
|
||||||
minimap ; show a map of the code on the side
|
|
||||||
modeline ; snazzy, Atom-inspired modeline, plus API
|
|
||||||
;;nav-flash ; blink cursor line after big motions
|
|
||||||
;;neotree ; a project drawer, like NERDTree for vim
|
|
||||||
ophints ; highlight the region an operation acts on
|
|
||||||
(popup +defaults) ; tame sudden yet inevitable temporary windows
|
|
||||||
;;tabs ; a tab bar for Emacs
|
|
||||||
treemacs ; a project drawer, like neotree but cooler
|
|
||||||
;;unicode ; extended unicode support for various languages
|
|
||||||
vc-gutter ; vcs diff in the fringe
|
|
||||||
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
|
||||||
;;window-select ; visually switch windows
|
|
||||||
workspaces ; tab emulation, persistence & separate workspaces
|
|
||||||
;;zen ; distraction-free coding or writing
|
|
||||||
|
|
||||||
:editor
|
|
||||||
(evil +everywhere); come to the dark side, we have cookies
|
|
||||||
file-templates ; auto-snippets for empty files
|
|
||||||
fold ; (nigh) universal code folding
|
|
||||||
;;(format +onsave) ; automated prettiness
|
|
||||||
;;god ; run Emacs commands without modifier keys
|
|
||||||
;;lispy ; vim for lisp, for people who don't like vim
|
|
||||||
;;multiple-cursors ; editing in many places at once
|
|
||||||
;;objed ; text object editing for the innocent
|
|
||||||
;;parinfer ; turn lisp into python, sort of
|
|
||||||
;;rotate-text ; cycle region at point between text candidates
|
|
||||||
snippets ; my elves. They type so I don't have to
|
|
||||||
;;word-wrap ; soft wrapping with language-aware indent
|
|
||||||
|
|
||||||
:emacs
|
|
||||||
dired ; making dired pretty [functional]
|
|
||||||
electric ; smarter, keyword-based electric-indent
|
|
||||||
;;ibuffer ; interactive buffer management
|
|
||||||
undo ; persistent, smarter undo for your inevitable mistakes
|
|
||||||
vc ; version-control and Emacs, sitting in a tree
|
|
||||||
|
|
||||||
:term
|
|
||||||
;;eshell ; the elisp shell that works everywhere
|
|
||||||
;;shell ; simple shell REPL for Emacs
|
|
||||||
;;term ; basic terminal emulator for Emacs
|
|
||||||
vterm ; the best terminal emulation in Emacs
|
|
||||||
|
|
||||||
:checkers
|
|
||||||
syntax ; tasing you for every semicolon you forget
|
|
||||||
;;(spell +flyspell) ; tasing you for misspelling mispelling
|
|
||||||
;;grammar ; tasing grammar mistake every you make
|
|
||||||
|
|
||||||
:tools
|
|
||||||
;;ansible
|
|
||||||
;;biblio ; Writes a PhD for you (citation needed)
|
|
||||||
;;debugger ; FIXME stepping through code, to help you add bugs
|
|
||||||
;;direnv
|
|
||||||
;;docker
|
|
||||||
;;editorconfig ; let someone else argue about tabs vs spaces
|
|
||||||
;;ein ; tame Jupyter notebooks with emacs
|
|
||||||
(eval +overlay) ; run code, run (also, repls)
|
|
||||||
;;gist ; interacting with github gists
|
|
||||||
lookup ; navigate your code and its documentation
|
|
||||||
lsp ; M-x vscode
|
|
||||||
magit ; a git porcelain for Emacs
|
|
||||||
;;make ; run make tasks from Emacs
|
|
||||||
;;pass ; password manager for nerds
|
|
||||||
pdf ; pdf enhancements
|
|
||||||
;;prodigy ; FIXME managing external services & code builders
|
|
||||||
;;rgb ; creating color strings
|
|
||||||
;;taskrunner ; taskrunner for all your projects
|
|
||||||
;;terraform ; infrastructure as code
|
|
||||||
;;tmux ; an API for interacting with tmux
|
|
||||||
;;upload ; map local to remote projects via ssh/ftp
|
|
||||||
|
|
||||||
:os
|
|
||||||
(:if IS-MAC macos) ; improve compatibility with macOS
|
|
||||||
;;tty ; improve the terminal Emacs experience
|
|
||||||
|
|
||||||
:lang
|
|
||||||
;;agda ; types of types of types of types...
|
|
||||||
;;beancount ; mind the GAAP
|
|
||||||
;;(cc +lsp) ; C > C++ == 1
|
|
||||||
clojure ; java with a lisp
|
|
||||||
;;common-lisp ; if you've seen one lisp, you've seen them all
|
|
||||||
;;coq ; proofs-as-programs
|
|
||||||
;;crystal ; ruby at the speed of c
|
|
||||||
;;csharp ; unity, .NET, and mono shenanigans
|
|
||||||
data ; config/data formats
|
|
||||||
;;(dart +flutter) ; paint ui and not much else
|
|
||||||
;;dhall
|
|
||||||
;;elixir ; erlang done right
|
|
||||||
;;elm ; care for a cup of TEA?
|
|
||||||
emacs-lisp ; drown in parentheses
|
|
||||||
;;erlang ; an elegant language for a more civilized age
|
|
||||||
;;ess ; emacs speaks statistics
|
|
||||||
;;factor
|
|
||||||
;;faust ; dsp, but you get to keep your soul
|
|
||||||
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
|
|
||||||
;;fsharp ; ML stands for Microsoft's Language
|
|
||||||
;;fstar ; (dependent) types and (monadic) effects and Z3
|
|
||||||
;;gdscript ; the language you waited for
|
|
||||||
;;(go +lsp) ; the hipster dialect
|
|
||||||
;;(graphql +lsp) ; Give queries a REST
|
|
||||||
;;(haskell +lsp) ; a language that's lazier than I am
|
|
||||||
;;hy ; readability of scheme w/ speed of python
|
|
||||||
;;idris ; a language you can depend on
|
|
||||||
;;json ; At least it ain't XML
|
|
||||||
;;(java +lsp) ; the poster child for carpal tunnel syndrome
|
|
||||||
javascript ; all(hope(abandon(ye(who(enter(here))))))
|
|
||||||
;;julia ; a better, faster MATLAB
|
|
||||||
;;kotlin ; a better, slicker Java(Script)
|
|
||||||
latex ; writing papers in Emacs has never been so fun
|
|
||||||
;;lean ; for folks with too much to prove
|
|
||||||
;;ledger ; be audit you can be
|
|
||||||
lua ; one-based indices? one-based indices
|
|
||||||
markdown ; writing docs for people to ignore
|
|
||||||
nim ; python + lisp at the speed of c
|
|
||||||
;;nix ; I hereby declare "nix geht mehr!"
|
|
||||||
;;ocaml ; an objective camel
|
|
||||||
org ; organize your plain life in plain text
|
|
||||||
;;php ; perl's insecure younger brother
|
|
||||||
;;plantuml ; diagrams for confusing people more
|
|
||||||
;;purescript ; javascript, but functional
|
|
||||||
;;python ; beautiful is better than ugly
|
|
||||||
;;qt ; the 'cutest' gui framework ever
|
|
||||||
;;racket ; a DSL for DSLs
|
|
||||||
;;raku ; the artist formerly known as perl6
|
|
||||||
;;rest ; Emacs as a REST client
|
|
||||||
;;rst ; ReST in peace
|
|
||||||
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
|
|
||||||
(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
|
|
||||||
;;scala ; java, but good
|
|
||||||
;;(scheme +guile) ; a fully conniving family of lisps
|
|
||||||
sh ; she sells {ba,z,fi}sh shells on the C xor
|
|
||||||
;;sml
|
|
||||||
;;solidity ; do you need a blockchain? No.
|
|
||||||
;;swift ; who asked for emoji variables?
|
|
||||||
;;terra ; Earth and Moon in alignment for performance.
|
|
||||||
web ; the tubes
|
|
||||||
;;yaml ; JSON, but readable
|
|
||||||
;;zig ; C, but simpler
|
|
||||||
|
|
||||||
:email
|
|
||||||
;;(mu4e +org +gmail)
|
|
||||||
;;notmuch
|
|
||||||
;;(wanderlust +gmail)
|
|
||||||
|
|
||||||
:app
|
|
||||||
;;calendar
|
|
||||||
;;emms
|
|
||||||
;;everywhere ; *leave* Emacs!? You must be joking
|
|
||||||
;;irc ; how neckbeards socialize
|
|
||||||
;;(rss +org) ; emacs as an RSS reader
|
|
||||||
;;twitter ; twitter client https://twitter.com/vnought
|
|
||||||
|
|
||||||
:config
|
|
||||||
;;literate
|
|
||||||
(default +bindings +smartparens))
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
;; -*- no-byte-compile: t; -*-
|
|
||||||
;;; $DOOMDIR/packages.el
|
|
||||||
|
|
||||||
;; To install a package with Doom you must declare them here and run 'doom sync'
|
|
||||||
;; on the command line, then restart Emacs for the changes to take effect -- or
|
|
||||||
;; use 'M-x doom/reload'.
|
|
||||||
|
|
||||||
|
|
||||||
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
|
|
||||||
;(package! some-package)
|
|
||||||
|
|
||||||
;; To install a package directly from a remote git repo, you must specify a
|
|
||||||
;; `:recipe'. You'll find documentation on what `:recipe' accepts here:
|
|
||||||
;; https://github.com/raxod502/straight.el#the-recipe-format
|
|
||||||
;(package! another-package
|
|
||||||
; :recipe (:host github :repo "username/repo"))
|
|
||||||
|
|
||||||
;; If the package you are trying to install does not contain a PACKAGENAME.el
|
|
||||||
;; file, or is located in a subdirectory of the repo, you'll need to specify
|
|
||||||
;; `:files' in the `:recipe':
|
|
||||||
;(package! this-package
|
|
||||||
; :recipe (:host github :repo "username/repo"
|
|
||||||
; :files ("some-file.el" "src/lisp/*.el")))
|
|
||||||
|
|
||||||
;; If you'd like to disable a package included with Doom, you can do so here
|
|
||||||
;; with the `:disable' property:
|
|
||||||
;(package! builtin-package :disable t)
|
|
||||||
|
|
||||||
;; You can override the recipe of a built in package without having to specify
|
|
||||||
;; all the properties for `:recipe'. These will inherit the rest of its recipe
|
|
||||||
;; from Doom or MELPA/ELPA/Emacsmirror:
|
|
||||||
;(package! builtin-package :recipe (:nonrecursive t))
|
|
||||||
;(package! builtin-package-2 :recipe (:repo "myfork/package"))
|
|
||||||
|
|
||||||
;; Specify a `:branch' to install a package from a particular branch or tag.
|
|
||||||
;; This is required for some packages whose default branch isn't 'master' (which
|
|
||||||
;; our package manager can't deal with; see raxod502/straight.el#279)
|
|
||||||
;(package! builtin-package :recipe (:branch "develop"))
|
|
||||||
|
|
||||||
;; Use `:pin' to specify a particular commit to install.
|
|
||||||
;(package! builtin-package :pin "1a2b3c4d5e")
|
|
||||||
|
|
||||||
|
|
||||||
;; Doom's packages are pinned to a specific commit and updated from release to
|
|
||||||
;; release. The `unpin!' macro allows you to unpin single packages...
|
|
||||||
;(unpin! pinned-package)
|
|
||||||
;; ...or multiple packages
|
|
||||||
;(unpin! pinned-package another-pinned-package)
|
|
||||||
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
|
|
||||||
;(unpin! t)
|
|
||||||
38
config/ghostty/config
Normal file
38
config/ghostty/config
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# ~/.config/ghostty/config
|
||||||
|
|
||||||
|
# look & feel
|
||||||
|
theme = Brogrammer
|
||||||
|
font-family = MesloLGS NF
|
||||||
|
font-size = 13
|
||||||
|
cursor-style = block
|
||||||
|
shell-integration-features = no-cursor
|
||||||
|
window-width = 162
|
||||||
|
window-height = 50
|
||||||
|
term = xterm-256color
|
||||||
|
|
||||||
|
# reduce dimming for unfocused split panes (1.0 disables dimming)
|
||||||
|
unfocused-split-opacity = 0.88
|
||||||
|
|
||||||
|
# USE PRERELEASE
|
||||||
|
# > While you can set this setting back to `stable` at any time, this will only take effect when a later stable
|
||||||
|
# > release is available. If you want to downgrade back to the previous stable release, you must re-download Ghostty.
|
||||||
|
auto-update-channel = tip
|
||||||
|
auto-update = off
|
||||||
|
|
||||||
|
# window-inherit-working-directory = false
|
||||||
|
|
||||||
|
# binds
|
||||||
|
keybind = cmd+,=open_config
|
||||||
|
|
||||||
|
keybind = cmd+b>shift+'=new_split:down
|
||||||
|
keybind = cmd+b>shift+5=new_split:right
|
||||||
|
|
||||||
|
keybind = cmd+b>right=goto_split:right
|
||||||
|
keybind = cmd+b>left=goto_split:left
|
||||||
|
keybind = cmd+b>up=goto_split:up
|
||||||
|
keybind = cmd+b>down=goto_split:down
|
||||||
|
|
||||||
|
keybind = cmd+b>l=goto_split:right
|
||||||
|
keybind = cmd+b>h=goto_split:left
|
||||||
|
keybind = cmd+b>k=goto_split:up
|
||||||
|
keybind = cmd+b>j=goto_split:down
|
||||||
21
config/git-split-diffs/README.md
Normal file
21
config/git-split-diffs/README.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
## Info
|
||||||
|
|
||||||
|
Using: https://github.com/banga/git-split-diffs/
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install
|
||||||
|
npm install -g git-split-diffs
|
||||||
|
|
||||||
|
# Install (with mouse scrolling)
|
||||||
|
git config --global core.pager "git-split-diffs --color | less -+LFX"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Custom Theme ([info](https://github.com/banga/git-split-diffs/tree/v2.2.0?tab=readme-ov-file#custom-themes))
|
||||||
|
|
||||||
|
Copy JSON themes to `~/.git-split-diffs-themes`, then:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git config --global split-diffs.theme-directory ~/.git-split-diffs-themes
|
||||||
|
git config --global split-diffs.theme-name transparent
|
||||||
|
```
|
||||||
|
|
||||||
59
config/git-split-diffs/transparent.json
Normal file
59
config/git-split-diffs/transparent.json
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
{
|
||||||
|
"SYNTAX_HIGHLIGHTING_THEME": "dark",
|
||||||
|
"DEFAULT_COLOR": {
|
||||||
|
"color": "#768390",
|
||||||
|
"backgroundColor": "#00000000"
|
||||||
|
},
|
||||||
|
"COMMIT_HEADER_COLOR": {
|
||||||
|
"color": "#adbac7",
|
||||||
|
"backgroundColor": "#00000000"
|
||||||
|
},
|
||||||
|
"COMMIT_HEADER_LABEL_COLOR": {},
|
||||||
|
"COMMIT_SHA_COLOR": {},
|
||||||
|
"COMMIT_DATE_COLOR": {},
|
||||||
|
"COMMIT_AUTHOR_COLOR": {},
|
||||||
|
"COMMIT_MESSAGE_COLOR": {
|
||||||
|
"color": "#909dab",
|
||||||
|
"backgroundColor": "#00000000"
|
||||||
|
},
|
||||||
|
"COMMIT_TITLE_COLOR": {
|
||||||
|
"color": "#c6e6ff",
|
||||||
|
"modifiers": ["bold"]
|
||||||
|
},
|
||||||
|
"BORDER_COLOR": {
|
||||||
|
"color": "#444c56",
|
||||||
|
"backgroundColor": "#00000000"
|
||||||
|
},
|
||||||
|
"FILE_NAME_COLOR": {
|
||||||
|
"color": "#adbac7",
|
||||||
|
"backgroundColor": "#00000000"
|
||||||
|
},
|
||||||
|
"HUNK_HEADER_COLOR": {
|
||||||
|
"backgroundColor": "#00000000"
|
||||||
|
},
|
||||||
|
"DELETED_WORD_COLOR": {
|
||||||
|
"backgroundColor": "#c93c3733"
|
||||||
|
},
|
||||||
|
"INSERTED_WORD_COLOR": {
|
||||||
|
"backgroundColor": "#46954a33"
|
||||||
|
},
|
||||||
|
"DELETED_LINE_NO_COLOR": {
|
||||||
|
"color": "#e5534b",
|
||||||
|
"backgroundColor": "#c93c371a"
|
||||||
|
},
|
||||||
|
"INSERTED_LINE_NO_COLOR": {
|
||||||
|
"color": "#57ab5a",
|
||||||
|
"backgroundColor": "#46954a1a"
|
||||||
|
},
|
||||||
|
"UNMODIFIED_LINE_NO_COLOR": {},
|
||||||
|
"DELETED_LINE_COLOR": {
|
||||||
|
"backgroundColor": "#442d3080"
|
||||||
|
},
|
||||||
|
"INSERTED_LINE_COLOR": {
|
||||||
|
"backgroundColor": "#2a3c3380"
|
||||||
|
},
|
||||||
|
"UNMODIFIED_LINE_COLOR": {},
|
||||||
|
"MISSING_LINE_COLOR": {
|
||||||
|
"backgroundColor": "#2d333b80"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,429 +1,524 @@
|
|||||||
wf=hs.window.filter
|
wf = hs.window.filter
|
||||||
ffBrowser = "Firefox"
|
|
||||||
chromiumBrowser = "Brave Browser"
|
|
||||||
-- browser = "Chromium"
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------
|
||||||
-- Open new / focus existing Finder window in current desktop space
|
-- Open new / focus existing Finder window in current desktop space
|
||||||
|
--------------------------------------------------------------------
|
||||||
|
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "X", function()
|
hs.hotkey.bind({ "cmd", "ctrl" }, "X", function()
|
||||||
local app = "Finder"
|
local app = "Finder"
|
||||||
|
|
||||||
wf_app = wf.new(false):setAppFilter(app, {currentSpace=true})
|
wf_app = wf.new(false):setAppFilter(app, { currentSpace = true })
|
||||||
|
|
||||||
local wins = wf_app:getWindows()
|
local wins = wf_app:getWindows()
|
||||||
local count = 0
|
local count = 0
|
||||||
for _ in pairs(wins) do count = count + 1 end
|
for _ in pairs(wins) do
|
||||||
|
count = count + 1
|
||||||
if (count > 0)
|
|
||||||
then
|
|
||||||
wf_app:getWindows()[1]:focus()
|
|
||||||
else
|
|
||||||
hs.osascript.applescript(string.format([[
|
|
||||||
tell application "System Events" to tell process "%s"
|
|
||||||
click menu item "New Finder Window" of menu "File" of menu bar 1
|
|
||||||
set frontmost to true
|
|
||||||
end tell
|
|
||||||
]], app))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if count > 0 then
|
||||||
|
wf_app:getWindows()[1]:focus()
|
||||||
|
else
|
||||||
|
hs.osascript.applescript(string.format(
|
||||||
|
[[
|
||||||
|
tell application "System Events" to tell process "%s"
|
||||||
|
click menu item "New Finder Window" of menu "File" of menu bar 1
|
||||||
|
set frontmost to true
|
||||||
|
end tell
|
||||||
|
]],
|
||||||
|
app
|
||||||
|
))
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Open new / focus existing terminal window in current desktop space
|
-- Open new / focus existing terminal window in current desktop space
|
||||||
|
|
||||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "T", function()
|
function focusOrOpenGhostty()
|
||||||
-- -- Adjust the app filter to Warp
|
wf_ghostty = wf.new(false):setAppFilter("Ghostty", { currentSpace = true, visible = true })
|
||||||
-- wf_warp = wf.new(false):setAppFilter("Warp", {currentSpace=true, visible=true})
|
|
||||||
--
|
|
||||||
-- local wins = wf_warp:getWindows()
|
|
||||||
-- local count = 0
|
|
||||||
-- for _ in pairs(wins) do count = count + 1 end
|
|
||||||
--
|
|
||||||
-- if (count > 0) then
|
|
||||||
-- wf_warp:getWindows()[1]:focus()
|
|
||||||
-- else
|
|
||||||
-- hs.osascript.applescript([[
|
|
||||||
-- tell application "System Events" to tell process "Warp"
|
|
||||||
-- click menu item "New Window" of menu "File" of menu bar 1
|
|
||||||
-- end tell
|
|
||||||
-- ]])
|
|
||||||
-- end
|
|
||||||
-- end)
|
|
||||||
|
|
||||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "T", function()
|
local wins = wf_ghostty:getWindows()
|
||||||
-- wf_kitty = wf.new(false):setAppFilter("kitty", {currentSpace=true, visible=true})
|
local count = 0
|
||||||
-- local wins = wf_kitty:getWindows()
|
for _ in pairs(wins) do
|
||||||
-- local count = 0
|
count = count + 1
|
||||||
-- for _ in pairs(wins) do count = count + 1 end
|
end
|
||||||
--
|
|
||||||
-- if (count > 0)
|
|
||||||
-- then
|
|
||||||
-- wf_kitty:getWindows()[1]:focus()
|
|
||||||
-- else
|
|
||||||
-- hs.osascript.applescript([[
|
|
||||||
-- tell application "System Events" to tell process "kitty"
|
|
||||||
-- click menu item "New OS Window" of menu "Shell" of menu bar 1
|
|
||||||
-- end tell
|
|
||||||
-- ]])
|
|
||||||
-- end
|
|
||||||
-- end)
|
|
||||||
|
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "T", function()
|
if count > 0 then
|
||||||
wf_iterm2 = wf.new(false):setAppFilter("iTerm2", {currentSpace=true, visible=true})
|
wf_ghostty:getWindows()[1]:focus()
|
||||||
|
else
|
||||||
|
hs.osascript.applescript([[
|
||||||
|
tell application "System Events" to tell process "Ghostty"
|
||||||
|
click menu item "New Window" of menu "File" of menu bar 1
|
||||||
|
end tell
|
||||||
|
]])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function focusOrOpenWarp()
|
||||||
|
-- Adjust the app filter to Warp
|
||||||
|
wf_warp = wf.new(false):setAppFilter("Warp", { currentSpace = true, visible = true })
|
||||||
|
|
||||||
|
local wins = wf_warp:getWindows()
|
||||||
|
local count = 0
|
||||||
|
for _ in pairs(wins) do
|
||||||
|
count = count + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if count > 0 then
|
||||||
|
wf_warp:getWindows()[1]:focus()
|
||||||
|
else
|
||||||
|
hs.osascript.applescript([[
|
||||||
|
tell application "System Events" to tell process "Warp"
|
||||||
|
click menu item "New Window" of menu "File" of menu bar 1
|
||||||
|
end tell
|
||||||
|
]])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function focusOrOpenKitty()
|
||||||
|
wf_kitty = wf.new(false):setAppFilter("kitty", { currentSpace = true, visible = true })
|
||||||
|
|
||||||
|
local wins = wf_kitty:getWindows()
|
||||||
|
local count = 0
|
||||||
|
for _ in pairs(wins) do
|
||||||
|
count = count + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if count > 0 then
|
||||||
|
wf_kitty:getWindows()[1]:focus()
|
||||||
|
else
|
||||||
|
hs.osascript.applescript([[
|
||||||
|
tell application "System Events" to tell process "kitty"
|
||||||
|
click menu item "New OS Window" of menu "Shell" of menu bar 1
|
||||||
|
end tell
|
||||||
|
]])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function focusOrOpeniTerm()
|
||||||
|
wf_iterm2 = wf.new(false):setAppFilter("iTerm2", { currentSpace = true, visible = true })
|
||||||
|
|
||||||
local wins = wf_iterm2:getWindows()
|
local wins = wf_iterm2:getWindows()
|
||||||
local count = 0
|
local count = 0
|
||||||
for _ in pairs(wins) do count = count + 1 end
|
for _ in pairs(wins) do
|
||||||
|
count = count + 1
|
||||||
|
end
|
||||||
|
|
||||||
if (count > 0)
|
if count > 0 then
|
||||||
then
|
|
||||||
wf_iterm2:getWindows()[1]:focus()
|
wf_iterm2:getWindows()[1]:focus()
|
||||||
else
|
else
|
||||||
hs.osascript.applescript([[
|
hs.osascript.applescript([[
|
||||||
tell application "iTerm"
|
tell application "iTerm"
|
||||||
create window with default profile
|
create window with default profile
|
||||||
activate
|
activate
|
||||||
end tell
|
end tell
|
||||||
]])
|
]])
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end)
|
hs.hotkey.bind({ "cmd", "ctrl" }, "T", focusOrOpenGhostty)
|
||||||
|
|
||||||
|
--------------------------------------------------------------------
|
||||||
-- Open new / focus existing browser window in current desktop space
|
-- Open new / focus existing browser window in current desktop space
|
||||||
|
--------------------------------------------------------------------
|
||||||
|
|
||||||
|
ffBrowser = "Firefox"
|
||||||
|
chromiumBrowser = "Brave Browser"
|
||||||
|
|
||||||
function focusOrOpenFirefox()
|
function focusOrOpenFirefox()
|
||||||
|
|
||||||
-- assumes wf_browser is the name of a firefox-based browser
|
-- assumes wf_browser is the name of a firefox-based browser
|
||||||
wf_browser = wf.new(false):setAppFilter(ffBrowser, {currentSpace=true, visible=true})
|
wf_browser = wf.new(false):setAppFilter(ffBrowser, { currentSpace = true, visible = true })
|
||||||
|
|
||||||
local wins = wf_browser:getWindows()
|
local wins = wf_browser:getWindows()
|
||||||
local count = 0
|
local count = 0
|
||||||
for _ in pairs(wins) do count = count + 1 end
|
for _ in pairs(wins) do
|
||||||
|
count = count + 1
|
||||||
if (count > 0)
|
end
|
||||||
then
|
|
||||||
|
if count > 0 then
|
||||||
wf_browser:getWindows()[1]:focus()
|
wf_browser:getWindows()[1]:focus()
|
||||||
-- print(count)
|
-- print(count)
|
||||||
else
|
else
|
||||||
-- for firefox:
|
-- for firefox:
|
||||||
hs.osascript.applescript(string.format([[
|
hs.osascript.applescript(string.format(
|
||||||
tell application "System Events" to tell process "%s"
|
[[
|
||||||
click menu item "New Window" of menu "File" of menu bar 1
|
tell application "System Events" to tell process "%s"
|
||||||
set frontmost to true
|
click menu item "New Window" of menu "File" of menu bar 1
|
||||||
end tell
|
set frontmost to true
|
||||||
]], ffBrowser))
|
end tell
|
||||||
|
]],
|
||||||
|
ffBrowser
|
||||||
|
))
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function focusOrOpenChromium()
|
function focusOrOpenChromium()
|
||||||
|
|
||||||
-- assumes wf_browser is the name of a chromium-based browser
|
-- assumes wf_browser is the name of a chromium-based browser
|
||||||
wf_browser = wf.new(false):setAppFilter(chromiumBrowser, {currentSpace=true, visible=true})
|
wf_browser = wf.new(false):setAppFilter(chromiumBrowser, { currentSpace = true, visible = true })
|
||||||
|
|
||||||
local wins = wf_browser:getWindows()
|
local wins = wf_browser:getWindows()
|
||||||
local count = 0
|
local count = 0
|
||||||
for _ in pairs(wins) do count = count + 1 end
|
for _ in pairs(wins) do
|
||||||
|
count = count + 1
|
||||||
if (count > 0)
|
end
|
||||||
then
|
|
||||||
|
if count > 0 then
|
||||||
wf_browser:getWindows()[1]:focus()
|
wf_browser:getWindows()[1]:focus()
|
||||||
-- print(count)
|
-- print(count)
|
||||||
else
|
else
|
||||||
hs.osascript.applescript(string.format([[
|
hs.osascript.applescript(string.format(
|
||||||
tell application "%s"
|
[[
|
||||||
make new window
|
tell application "%s"
|
||||||
activate
|
make new window
|
||||||
end tell
|
activate
|
||||||
]], chromiumBrowser))
|
end tell
|
||||||
|
]],
|
||||||
|
chromiumBrowser
|
||||||
|
))
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "W", focusOrOpenChromium)
|
hs.hotkey.bind({ "cmd", "ctrl" }, "W", focusOrOpenChromium)
|
||||||
|
|
||||||
|
-- CHROMIUM-BASED BROWSERS ONLY: Open new tab to right of currently-focused one
|
||||||
-- CHROMIUM-BASED BROWSERS ONLY: Open new tab to right of current browser
|
-- NOTE: This can be replaced with a dedicated keybind in chromium system settings
|
||||||
-- NOTE: currently replaced with binding in chromiumsystem settings
|
|
||||||
-- hs.hotkey.bind({"cmd", "option"}, "T", function()
|
-- hs.hotkey.bind({"cmd", "option"}, "T", function()
|
||||||
--
|
--
|
||||||
-- local focusedAppName = hs.window.focusedWindow():application():title()
|
-- local focusedAppName = hs.window.focusedWindow():application():title()
|
||||||
--
|
--
|
||||||
-- if focusedAppName == chromiumBrowser
|
-- if focusedAppName == chromiumBrowser
|
||||||
-- then
|
-- then
|
||||||
-- hs.osascript.applescript(string.format([[
|
-- hs.osascript.applescript(string.format([[
|
||||||
-- tell application "System Events" to tell process "%s"
|
-- tell application "System Events" to tell process "%s"
|
||||||
-- click menu item "New Tab to the Right" of menu "Tab" of menu bar 1
|
-- click menu item "New Tab to the Right" of menu "Tab" of menu bar 1
|
||||||
-- end tell
|
-- end tell
|
||||||
-- ]], focusedAppName))
|
-- ]], focusedAppName))
|
||||||
-- else
|
-- else
|
||||||
-- hs.notify.new({title=string.format("%s not focused.", browser)}):send()
|
-- hs.notify.new({title=string.format("%s not focused.", browser)}):send()
|
||||||
-- end
|
-- end
|
||||||
--
|
|
||||||
-- end)
|
-- end)
|
||||||
|
|
||||||
|
|
||||||
-- Open new / focus existing vscode window in current desktop space
|
-- Open new / focus existing vscode window in current desktop space
|
||||||
-- app = VSCodium, Code, or Cursor
|
-- app = VSCodium, Code, or Cursor
|
||||||
function openVsCode(app)
|
function openVsCode(app)
|
||||||
wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true})
|
wf_app = wf.new(false):setAppFilter(app, { currentSpace = true, visible = true })
|
||||||
|
|
||||||
local wins = wf_app:getWindows()
|
local wins = wf_app:getWindows()
|
||||||
local count = 0
|
local count = 0
|
||||||
for _ in pairs(wins) do count = count + 1 end
|
for _ in pairs(wins) do
|
||||||
|
count = count + 1
|
||||||
if (count > 0) then
|
end
|
||||||
|
|
||||||
|
if count > 0 then
|
||||||
wf_app:getWindows()[1]:focus()
|
wf_app:getWindows()[1]:focus()
|
||||||
else
|
else
|
||||||
hs.osascript.applescript(string.format([[
|
hs.osascript.applescript(string.format(
|
||||||
|
[[
|
||||||
tell application "System Events" to tell process "%s"
|
tell application "System Events" to tell process "%s"
|
||||||
click menu item "New Window" of menu "File" of menu bar 1
|
click menu item "New Window" of menu "File" of menu bar 1
|
||||||
set frontmost to true
|
set frontmost to true
|
||||||
end tell
|
end tell
|
||||||
]], app))
|
]],
|
||||||
|
app
|
||||||
|
))
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
-- Focus or open editor of choice in current desktop space
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
-- superbinding to use both cursor and vscode
|
-- superbinding to use multiple editors with a preferred order
|
||||||
-- try to focus cursor (primarily) or vscode (secondarily), then open cursor if neither is open
|
-- e.g. try to focus cursor (primarily) or vscode (secondarily), then open cursor if neither is open
|
||||||
function tryFocusCursorOrVSCodeThenOpenCursor()
|
function tryFocusAnEditorInPreferredOrder()
|
||||||
wf_cursor= wf.new(false):setAppFilter("Cursor", {currentSpace=true, visible=true})
|
wf_zed = wf.new(false):setAppFilter("Zed", { currentSpace = true, visible = true })
|
||||||
wf_vscode= wf.new(false):setAppFilter("Code", {currentSpace=true, visible=true})
|
wf_cursor = wf.new(false):setAppFilter("Cursor", { currentSpace = true, visible = true })
|
||||||
|
wf_vscode = wf.new(false):setAppFilter("Code", { currentSpace = true, visible = true })
|
||||||
|
|
||||||
|
local zed_wins = wf_zed:getWindows()
|
||||||
|
local zed_count = 0
|
||||||
|
for _ in pairs(zed_wins) do
|
||||||
|
zed_count = zed_count + 1
|
||||||
|
end
|
||||||
|
|
||||||
local cursor_wins = wf_cursor:getWindows()
|
local cursor_wins = wf_cursor:getWindows()
|
||||||
local cursor_count = 0
|
local cursor_count = 0
|
||||||
for _ in pairs(cursor_wins) do cursor_count = cursor_count + 1 end
|
for _ in pairs(cursor_wins) do
|
||||||
|
cursor_count = cursor_count + 1
|
||||||
|
end
|
||||||
|
|
||||||
local vscode_wins = wf_vscode:getWindows()
|
local vscode_wins = wf_vscode:getWindows()
|
||||||
local vscode_count = 0
|
local vscode_count = 0
|
||||||
for _ in pairs(vscode_wins) do vscode_count = vscode_count + 1 end
|
for _ in pairs(vscode_wins) do
|
||||||
|
vscode_count = vscode_count + 1
|
||||||
|
end
|
||||||
|
|
||||||
if (cursor_count > 0) then
|
if zed_count > 0 then
|
||||||
|
wf_zed:getWindows()[1]:focus()
|
||||||
|
elseif cursor_count > 0 then
|
||||||
wf_cursor:getWindows()[1]:focus()
|
wf_cursor:getWindows()[1]:focus()
|
||||||
elseif (vscode_count > 0) then
|
elseif vscode_count > 0 then
|
||||||
wf_vscode:getWindows()[1]:focus()
|
wf_vscode:getWindows()[1]:focus()
|
||||||
else
|
else
|
||||||
hs.osascript.applescript(string.format([[
|
hs.osascript.applescript(string.format(
|
||||||
|
[[
|
||||||
tell application "System Events" to tell process "%s"
|
tell application "System Events" to tell process "%s"
|
||||||
click menu item "New Window" of menu "File" of menu bar 1
|
click menu item "New Window" of menu "File" of menu bar 1
|
||||||
set frontmost to true
|
set frontmost to true
|
||||||
end tell
|
end tell
|
||||||
]], "Cursor"))
|
]],
|
||||||
|
"Zed"
|
||||||
|
))
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "E", function()
|
hs.hotkey.bind({ "cmd", "ctrl" }, "E", function()
|
||||||
-- openVsCode("Cursor")
|
-- openVsCode("Cursor")
|
||||||
-- openVsCode("Code")
|
-- openVsCode("Code")
|
||||||
tryFocusCursorOrVSCodeThenOpenCursor()
|
tryFocusAnEditorInPreferredOrder()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "V", function()
|
|
||||||
openVsCode("Code")
|
|
||||||
end)
|
|
||||||
|
|
||||||
|
|
||||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "V", function()
|
|
||||||
-- openVsCode("Code")
|
|
||||||
-- openVsCode("VSCodium")
|
|
||||||
|
|
||||||
-- No neovide function because it doesn't support system events (yet)
|
|
||||||
-- hs.application.open("Neovide")
|
|
||||||
-- end)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Open new / focus existing g/n/mac/vim(r) window in current desktop space
|
|
||||||
|
|
||||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "E", function()
|
-- hs.hotkey.bind({"cmd", "ctrl"}, "E", function()
|
||||||
-- local app = "VimR"
|
-- local app = "VimR"
|
||||||
--
|
--
|
||||||
-- wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true})
|
-- wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true})
|
||||||
--
|
--
|
||||||
-- local wins = wf_app:getWindows()
|
-- local wins = wf_app:getWindows()
|
||||||
-- local count = 0
|
-- local count = 0
|
||||||
-- for _ in pairs(wins) do count = count + 1 end
|
-- for _ in pairs(wins) do count = count + 1 end
|
||||||
--
|
--
|
||||||
-- if (count > 0)
|
-- if (count > 0)
|
||||||
-- then
|
-- then
|
||||||
-- wf_app:getWindows()[1]:focus()
|
-- wf_app:getWindows()[1]:focus()
|
||||||
-- else
|
-- else
|
||||||
-- hs.osascript.applescript(string.format([[
|
-- hs.osascript.applescript(string.format([[
|
||||||
-- tell application "System Events" to tell process "%s"
|
-- tell application "System Events" to tell process "%s"
|
||||||
-- click menu item "New Window" of menu "File" of menu bar 1
|
-- click menu item "New Window" of menu "File" of menu bar 1
|
||||||
-- set frontmost to true
|
-- set frontmost to true
|
||||||
-- end tell
|
-- end tell
|
||||||
-- ]], app))
|
-- ]], app))
|
||||||
--
|
--
|
||||||
-- end
|
-- end
|
||||||
--
|
--
|
||||||
-- end)
|
-- end)
|
||||||
|
|
||||||
-- APP-AGNOSTIC GLOBAL OPEN/FOCUS BINDINGS
|
-- APP-AGNOSTIC GLOBAL OPEN/FOCUS BINDINGS
|
||||||
|
|
||||||
-- common apps
|
-- common apps
|
||||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "R", function() hs.application.open("Obsidian") end)
|
-- hs.hotkey.bind({"cmd", "ctrl"}, "R", function() hs.application.open("Obsidian") end)
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "M", function() hs.application.open("Spotify") end)
|
hs.hotkey.bind({ "cmd", "ctrl" }, "M", function()
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "G", function() hs.application.open("Google Calendar") end)
|
hs.application.open("Spotify")
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "Z", function() hs.application.open("Preview") end)
|
end)
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "C", function() hs.application.open("Open WebUI") end)
|
hs.hotkey.bind({ "cmd", "ctrl" }, "G", function()
|
||||||
|
hs.application.open("Google Calendar")
|
||||||
|
end)
|
||||||
|
hs.hotkey.bind({ "cmd", "ctrl" }, "Z", function()
|
||||||
|
hs.application.open("Preview")
|
||||||
|
end)
|
||||||
|
hs.hotkey.bind({ "cmd", "ctrl" }, "C", function()
|
||||||
|
hs.application.open("Open WebUI")
|
||||||
|
end)
|
||||||
|
|
||||||
-- annoying apps (must manually open)
|
-- annoying apps (must manually open)
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "A", function() switchToIfApplicationOpen("Telegram") end)
|
hs.hotkey.bind({ "cmd", "ctrl" }, "A", function()
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "S", function() switchToIfApplicationOpen("Signal") end)
|
switchToIfApplicationOpen("Telegram")
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "N", function() switchToIfApplicationOpen("Numi") end)
|
end)
|
||||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "S", function() switchToIfApplicationOpen("Texts") end)
|
hs.hotkey.bind({ "cmd", "ctrl" }, "S", function()
|
||||||
-- hs.hotkey.bind({"cmd", "ctrl", "shift"}, "S", function() hs.application.open("Signal") end)
|
switchToIfApplicationOpen("Signal")
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "K", function() switchToIfApplicationOpen("KiCad") end)
|
end)
|
||||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "C", function() switchToIfApplicationOpen("CLion") end)
|
hs.hotkey.bind({ "cmd", "ctrl" }, "N", function()
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "J", function() switchToIfApplicationOpen("IntelliJ IDEA") end)
|
switchToIfApplicationOpen("Numi")
|
||||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "L", function() switchToIfApplicationOpen("Linear") end)
|
end)
|
||||||
hs.hotkey.bind({"cmd", "ctrl"}, "L", function() switchToIfApplicationOpen("LTspice") end)
|
-- hs.hotkey.bind({"cmd", "ctrl"}, "S", function() switchToIfApplicationOpen("Texts") end)
|
||||||
|
-- hs.hotkey.bind({"cmd", "ctrl", "shift"}, "S", function() hs.application.open("Signal") end)
|
||||||
|
hs.hotkey.bind({ "cmd", "ctrl" }, "K", function()
|
||||||
|
switchToIfApplicationOpen("KiCad")
|
||||||
|
end)
|
||||||
|
-- hs.hotkey.bind({"cmd", "ctrl"}, "C", function() switchToIfApplicationOpen("CLion") end)
|
||||||
|
hs.hotkey.bind({ "cmd", "ctrl" }, "J", function()
|
||||||
|
switchToIfApplicationOpen("IntelliJ IDEA")
|
||||||
|
end)
|
||||||
|
-- hs.hotkey.bind({"cmd", "ctrl"}, "L", function() switchToIfApplicationOpen("Linear") end)
|
||||||
|
hs.hotkey.bind({ "cmd", "ctrl" }, "L", function()
|
||||||
|
switchToIfApplicationOpen("LTspice")
|
||||||
|
end)
|
||||||
|
|
||||||
-- Clear clipboard
|
-- Clear clipboard
|
||||||
|
|
||||||
hs.hotkey.bind({"cmd", "shift", "ctrl"}, "C", function()
|
hs.hotkey.bind({ "cmd", "shift", "ctrl" }, "C", function()
|
||||||
hs.pasteboard.setContents("")
|
hs.pasteboard.setContents("")
|
||||||
hs.notify.new({title="Cleared clipboard."}):send()
|
hs.notify.new({ title = "Cleared clipboard." }):send()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- open Perplexity in Chromium-based browser
|
||||||
|
-- 1. if chatgpt is already open in most recent Brave window, switch to it and open
|
||||||
|
-- chatgpt in new tab to the right
|
||||||
|
-- 2. if not, switch to most recent Brave window and open chatgpt
|
||||||
|
hs.hotkey.bind({ "cmd", "ctrl", "shift" }, "space", function()
|
||||||
|
hs.osascript.applescript(string.format(
|
||||||
|
[[
|
||||||
|
tell application "%s"
|
||||||
|
if (count of windows) = 0 then
|
||||||
|
make new window
|
||||||
|
end if
|
||||||
|
activate
|
||||||
|
|
||||||
|
set foundTab to false
|
||||||
|
set tabIndex to 0
|
||||||
|
repeat with i from 1 to (count of tabs of front window)
|
||||||
|
if URL of tab i of front window contains "chatgpt.com" then
|
||||||
|
set foundTab to true
|
||||||
|
set tabIndex to i
|
||||||
|
exit repeat
|
||||||
|
end if
|
||||||
|
end repeat
|
||||||
|
|
||||||
|
if foundTab then
|
||||||
|
set active tab index of front window to tabIndex
|
||||||
|
else
|
||||||
|
tell application "System Events" to tell process "%s"
|
||||||
|
click menu item "New Tab to the Right" of menu "Tab" of menu bar 1
|
||||||
|
end tell
|
||||||
|
|
||||||
|
set URL of active tab of front window to "https://chatgpt.com"
|
||||||
|
end if
|
||||||
|
end tell
|
||||||
|
]],
|
||||||
|
chromiumBrowser,
|
||||||
|
chromiumBrowser
|
||||||
|
))
|
||||||
|
end)
|
||||||
|
|
||||||
--------------------------------------
|
---------------------------------------------------------------------------
|
||||||
-- DESKTOP SWITCHING (axed)
|
-- DESKTOP SWITCHING (axed)
|
||||||
-- Retroactive note: it should be harder, not easier, to context-switch :P
|
-- Retroactive note: it should be harder, not easier, to context-switch :P
|
||||||
--------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
-- function gotoDesktopNumber(desktop)
|
-- function gotoDesktopNumber(desktop)
|
||||||
-- local deskstr = string.format("Desktop %d", desktop)
|
-- local deskstr = string.format("Desktop %d", desktop)
|
||||||
-- local index = 0
|
-- local index = 0
|
||||||
-- for item in hs.spaces.spacesForScreen("Main") do
|
-- for item in hs.spaces.spacesForScreen("Main") do
|
||||||
-- if item == deskstr then
|
-- if item == deskstr then
|
||||||
-- break
|
-- break
|
||||||
-- else
|
-- else
|
||||||
-- index = index + 1
|
-- index = index + 1
|
||||||
-- end
|
-- end
|
||||||
-- end
|
-- end
|
||||||
-- print("INDEX ", index)
|
-- print("INDEX ", index)
|
||||||
-- hs.spaces.gotoSpace(index)
|
-- hs.spaces.gotoSpace(index)
|
||||||
-- end
|
-- end
|
||||||
--
|
--
|
||||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "1", function() gotoDesktopNumber(1) end)
|
-- hs.hotkey.bind({"cmd", "ctrl"}, "1", function() gotoDesktopNumber(1) end)
|
||||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "2", function() gotoDesktopNumber(2) end)
|
-- hs.hotkey.bind({"cmd", "ctrl"}, "2", function() gotoDesktopNumber(2) end)
|
||||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "3", function() gotoDesktopNumber(3) end)
|
-- hs.hotkey.bind({"cmd", "ctrl"}, "3", function() gotoDesktopNumber(3) end)
|
||||||
-- hs.hotkey.bind({"cmd", "ctrl"}, "4", function() gotoDesktopNumber(4) end)
|
-- hs.hotkey.bind({"cmd", "ctrl"}, "4", function() gotoDesktopNumber(4) end)
|
||||||
|
|
||||||
--------------------------------------
|
---------------------------------------------------------------------------
|
||||||
-- SWITCH TO IF OPEN
|
-- SWITCH TO IF OPEN
|
||||||
-- Switches to application if there's an instance of it open
|
-- Switches to application if there's an instance of it open
|
||||||
--------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
function switchToIfWindowOpen(app)
|
function switchToIfWindowOpen(app)
|
||||||
wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true})
|
wf_app = wf.new(false):setAppFilter(app, { currentSpace = true, visible = true })
|
||||||
|
|
||||||
local wins = wf_app:getWindows()
|
local wins = wf_app:getWindows()
|
||||||
local count = 0
|
local count = 0
|
||||||
for _ in pairs(wins) do count = count + 1 end
|
for _ in pairs(wins) do
|
||||||
|
count = count + 1
|
||||||
if (count > 0) then
|
end
|
||||||
|
|
||||||
|
if count > 0 then
|
||||||
wf_app:getWindows()[1]:focus()
|
wf_app:getWindows()[1]:focus()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
--------------------------------------
|
|
||||||
-- SWITCH TO IF GLOBALLY OPEN
|
-- SWITCH TO IF GLOBALLY OPEN
|
||||||
-- Switches to application if there's an instance of it open
|
-- Switches to application if there's an instance of it open
|
||||||
--------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
function switchToIfApplicationOpen(appName)
|
function switchToIfApplicationOpen(appName)
|
||||||
local runningApps = hs.application.runningApplications()
|
local runningApps = hs.application.runningApplications()
|
||||||
local isOpen = false
|
local isOpen = false
|
||||||
for _, app in pairs(runningApps) do
|
for _, app in pairs(runningApps) do
|
||||||
if app:name() == appName then
|
if app:name() == appName then
|
||||||
isOpen = true
|
isOpen = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if (isOpen) then
|
if isOpen then
|
||||||
hs.application.open(appName)
|
hs.application.open(appName)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
--------------------------------------
|
|
||||||
-- KEY COMBO TO APPLICATION
|
-- KEY COMBO TO APPLICATION
|
||||||
-- Sends keystrokes but only if the specified application is focused
|
-- Sends keystrokes but only if the specified application is focused
|
||||||
--------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
function sendKeyComboToApplication(appComboTable)
|
function sendKeyComboToApplication(appComboTable)
|
||||||
|
|
||||||
for appComboPair in ipairs(appComboTable) do
|
for appComboPair in ipairs(appComboTable) do
|
||||||
|
|
||||||
app = appComboPair[1]
|
app = appComboPair[1]
|
||||||
mods = appComboPair[2]
|
mods = appComboPair[2]
|
||||||
key = appComboPair[3]
|
key = appComboPair[3]
|
||||||
|
|
||||||
wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true})
|
wf_app = wf.new(false):setAppFilter(app, { currentSpace = true, visible = true })
|
||||||
|
|
||||||
local wins = wf_app:getWindows()
|
local wins = wf_app:getWindows()
|
||||||
local count = 0
|
local count = 0
|
||||||
for _ in pairs(wins) do count = count + 1 end
|
for _ in pairs(wins) do
|
||||||
|
count = count + 1
|
||||||
if (count > 0)
|
|
||||||
then
|
|
||||||
hs.eventtap.keyStroke(mods, key)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if count > 0 then
|
||||||
|
hs.eventtap.keyStroke(mods, key)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------------
|
---------------------------------------------------------------------------
|
||||||
-- A R C H I V E --
|
-- ARCHIVE
|
||||||
-------------------
|
--
|
||||||
|
-- Notes:
|
||||||
|
-- - Win-tab is now just set in system settings
|
||||||
|
-- - Desktop / window action hotkeys are now managed with Rectangle.app
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
-- Desktop Action Hotkeys (MOVED TO SYSTEM SETTINGS)
|
-- Desktop Action Hotkeys (MOVED TO SYSTEM SETTINGS)
|
||||||
|
|
||||||
-- -- Show Desktop (like windows or KDE)
|
-- -- Show Desktop (like windows or KDE)
|
||||||
--
|
--
|
||||||
-- hs.hotkey.bind({"alt"}, "d", function()
|
-- hs.hotkey.bind({"alt"}, "d", function()
|
||||||
-- hs.eventtap.keyStroke({"fn"}, "f11")
|
-- hs.eventtap.keyStroke({"fn"}, "f11")
|
||||||
-- end)
|
-- end)
|
||||||
--
|
--
|
||||||
-- -- Switch Desktops (like windows or KDE)
|
-- -- Switch Desktops (like windows or KDE)
|
||||||
--
|
--
|
||||||
-- hs.hotkey.bind({"ctrl", "alt"}, "left", function()
|
-- hs.hotkey.bind({"ctrl", "alt"}, "left", function()
|
||||||
-- hs.eventtap.keyStroke({"ctrl"}, "left")
|
-- hs.eventtap.keyStroke({"ctrl"}, "left")
|
||||||
-- end)
|
-- end)
|
||||||
--
|
--
|
||||||
-- hs.hotkey.bind({"ctrl", "alt"}, "right", function()
|
-- hs.hotkey.bind({"ctrl", "alt"}, "right", function()
|
||||||
-- hs.eventtap.keyStroke({"ctrl"}, "right")
|
-- hs.eventtap.keyStroke({"ctrl"}, "right")
|
||||||
-- end)
|
-- end)
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
-- -- Expose Windows (Mission Control)
|
-- -- Expose Windows (Mission Control)
|
||||||
--
|
--
|
||||||
-- hs.hotkey.bind({"alt"}, "tab", function()
|
-- hs.hotkey.bind({"alt"}, "tab", function()
|
||||||
-- hs.application.open("Mission Control"):activate()
|
-- hs.application.open("Mission Control"):activate()
|
||||||
-- end)
|
-- end)
|
||||||
|
|
||||||
|
|
||||||
-- Move windows between displays
|
-- Move windows between displays
|
||||||
|
|
||||||
-- hs.hotkey.bind({"ctrl", "shift"}, "right", function()
|
-- hs.hotkey.bind({"ctrl", "shift"}, "right", function()
|
||||||
-- hs.window.focusedWindow():moveToScreen(hs.screen:next())
|
-- hs.window.focusedWindow():moveToScreen(hs.screen:next())
|
||||||
-- end)
|
-- end)
|
||||||
--
|
--
|
||||||
-- hs.hotkey.bind({"ctrl", "shift"}, "left", function()
|
-- hs.hotkey.bind({"ctrl", "shift"}, "left", function()
|
||||||
-- hs.window.focusedWindow():moveToScreen(hs.screen:previous())
|
-- hs.window.focusedWindow():moveToScreen(hs.screen:previous())
|
||||||
-- end)
|
-- end)
|
||||||
|
|
||||||
|
-- The ShiftIt Alternative
|
||||||
-- The ShiftIt Alternative (MOVED TO RECTANGLE)
|
|
||||||
|
|
||||||
-- units = {
|
-- units = {
|
||||||
-- right50 = { x = 0.50, y = 0.00, w = 0.50, h = 1.00 },
|
-- right50 = { x = 0.50, y = 0.00, w = 0.50, h = 1.00 },
|
||||||
@@ -438,7 +533,7 @@ end
|
|||||||
-- botleft50 = { x = 0.00, y = 0.50, w = 0.50, h = 0.50 },
|
-- botleft50 = { x = 0.00, y = 0.50, w = 0.50, h = 0.50 },
|
||||||
-- maximum = { x = 0.00, y = 0.00, w = 1.00, h = 1.00 }
|
-- maximum = { x = 0.00, y = 0.00, w = 1.00, h = 1.00 }
|
||||||
-- }
|
-- }
|
||||||
--
|
--
|
||||||
-- mash = { 'shift', 'ctrl', 'cmd' }
|
-- mash = { 'shift', 'ctrl', 'cmd' }
|
||||||
-- hs.hotkey.bind(mash, 'l', function() hs.window.focusedWindow():move(units.right50, nil, true) end)
|
-- hs.hotkey.bind(mash, 'l', function() hs.window.focusedWindow():move(units.right50, nil, true) end)
|
||||||
-- hs.hotkey.bind(mash, 'h', function() hs.window.focusedWindow():move(units.left50, nil, true) end)
|
-- hs.hotkey.bind(mash, 'h', function() hs.window.focusedWindow():move(units.left50, nil, true) end)
|
||||||
@@ -448,4 +543,3 @@ end
|
|||||||
-- hs.hotkey.bind(mash, '[', function() hs.window.focusedWindow():move(units.upleft50, nil, true) end)
|
-- hs.hotkey.bind(mash, '[', function() hs.window.focusedWindow():move(units.upleft50, nil, true) end)
|
||||||
-- hs.hotkey.bind(mash, ';', function() hs.window.focusedWindow():move(units.botleft50, nil, true) end)
|
-- hs.hotkey.bind(mash, ';', function() hs.window.focusedWindow():move(units.botleft50, nil, true) end)
|
||||||
-- hs.hotkey.bind(mash, "'", function() hs.window.focusedWindow():move(units.botright50, nil, true) end)
|
-- hs.hotkey.bind(mash, "'", function() hs.window.focusedWindow():move(units.botright50, nil, true) end)
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
13
config/neovim/README.md
Normal file
13
config/neovim/README.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Neovim Config
|
||||||
|
|
||||||
|
Backup from live config to this folder:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp ~/.config/nvim/{init.lua,lazy-lock.json} config/neovim/
|
||||||
|
```
|
||||||
|
|
||||||
|
Restore from this folder to live config:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp config/neovim/{init.lua,lazy-lock.json} ~/.config/nvim/
|
||||||
|
```
|
||||||
@@ -1,166 +0,0 @@
|
|||||||
" Win behavior
|
|
||||||
" source $VIMRUNTIME/mswin.vim
|
|
||||||
" behave mswin
|
|
||||||
|
|
||||||
" Window height
|
|
||||||
" set lines=32 columns=110
|
|
||||||
|
|
||||||
" Preferences
|
|
||||||
set mouse=a
|
|
||||||
set encoding=utf-8
|
|
||||||
set autochdir
|
|
||||||
set shiftwidth=4
|
|
||||||
set tabstop=4
|
|
||||||
set linebreak
|
|
||||||
set breakindent
|
|
||||||
set autoindent
|
|
||||||
set wrap
|
|
||||||
set nobinary
|
|
||||||
set relativenumber
|
|
||||||
syntax on
|
|
||||||
|
|
||||||
" Aliases
|
|
||||||
cnoreabbrev ge browse confirm e
|
|
||||||
cnoreabbrev ! aliasrun
|
|
||||||
|
|
||||||
" Map leader key to spacebar (like Doom Emacs)
|
|
||||||
let mapleader = " "
|
|
||||||
|
|
||||||
" Vim Plug Plugins
|
|
||||||
call plug#begin()
|
|
||||||
Plug 'vim-airline/vim-airline'
|
|
||||||
Plug 'vim-airline/vim-airline-themes'
|
|
||||||
Plug 'airblade/vim-gitgutter'
|
|
||||||
Plug 'mangeshrex/everblush.vim'
|
|
||||||
Plug 'ms-jpq/chadtree', {'branch': 'chad', 'do': 'python3 -m chadtree deps'}
|
|
||||||
Plug 'nvim-lua/plenary.nvim'
|
|
||||||
Plug 'nvim-telescope/telescope.nvim'
|
|
||||||
Plug 'akinsho/toggleterm.nvim', {'tag' : 'v1.*'}
|
|
||||||
" Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
|
||||||
Plug 'neovim/nvim-lspconfig'
|
|
||||||
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
|
||||||
Plug 'jiangmiao/auto-pairs'
|
|
||||||
|
|
||||||
Plug 'dhruvasagar/vim-table-mode'
|
|
||||||
|
|
||||||
" Svelte
|
|
||||||
" Plug 'othree/html5.vim'
|
|
||||||
" Plug 'pangloss/vim-javascript'
|
|
||||||
" Plug 'evanleck/vim-svelte', {'branch': 'main'}
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
" Lua Plugins
|
|
||||||
lua require('plugins')
|
|
||||||
|
|
||||||
" Theming
|
|
||||||
set termguicolors
|
|
||||||
set t_Co=256
|
|
||||||
set background=dark
|
|
||||||
colorscheme everblush
|
|
||||||
let g:airline_powerline_fonts = 1
|
|
||||||
let g:airline_theme = 'powerlineish'
|
|
||||||
let g:airline#extensions#tabline#enabled = 1
|
|
||||||
let g:airline#extensions#tabline#fnamemod = ':t'
|
|
||||||
|
|
||||||
" Neovide theming
|
|
||||||
if exists("g:neovide")
|
|
||||||
set guifont=CaskaydiaCove\ Nerd\ Font:h12.5
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Start up plugins
|
|
||||||
autocmd VimEnter * :TSEnable highlight
|
|
||||||
|
|
||||||
" Navigation & Shortcuts
|
|
||||||
|
|
||||||
" Open file tree
|
|
||||||
nnoremap <Leader>op :CHADopen<CR>
|
|
||||||
nnoremap <C-t> :CHADopen<CR>
|
|
||||||
" Toggle terminal buffer
|
|
||||||
nnoremap <Leader>ot :ToggleTerm<CR>
|
|
||||||
nnoremap <C-`> :ToggleTerm<CR>
|
|
||||||
tnoremap <C-`> <C-\><C-n>:ToggleTerm<CR>
|
|
||||||
" Force kill current buffer
|
|
||||||
nnoremap <Leader>bk :bp<bar>sp<bar>bn<bar>bd!<CR>
|
|
||||||
nnoremap <C-k> :bp<bar>sp<bar>bn<bar>bd!<CR>
|
|
||||||
" Close the current window
|
|
||||||
nnoremap <Leader>wd :close<CR>
|
|
||||||
nnoremap <Leader>wk :close<CR>
|
|
||||||
nnoremap <C-x> :close<CR>
|
|
||||||
nnoremap <C-w>d :close<CR>
|
|
||||||
" Close the current tab
|
|
||||||
nnoremap <Leader>td :tabclose<CR>
|
|
||||||
nnoremap <Leader>tk :tabclose<CR>
|
|
||||||
|
|
||||||
" Search for files
|
|
||||||
nnoremap <Leader><Leader> :Telescope find_files<CR>
|
|
||||||
nnoremap <Leader>ff :Telescope find_files<CR>
|
|
||||||
|
|
||||||
" Git status
|
|
||||||
nnoremap <Leader>gs :Telescope git_status<CR>
|
|
||||||
nnoremap <Leader>gc :Telescope git_commits<CR>
|
|
||||||
" map <Leader>bk :bd!<CR>
|
|
||||||
|
|
||||||
" Reload config
|
|
||||||
nnoremap <silent> <Leader>rr :source $MYVIMRC<cr>
|
|
||||||
|
|
||||||
" New buffer
|
|
||||||
nnoremap <Leader>bn :enew<CR>
|
|
||||||
nnoremap <Leader>bc :enew<CR>
|
|
||||||
nnoremap <C-b>n :enew<CR>
|
|
||||||
|
|
||||||
" Global file search
|
|
||||||
" nnoremap <silent> <Leader><Leader>
|
|
||||||
|
|
||||||
" Quit editor
|
|
||||||
nnoremap <silent> <Leader>qq :qa!<CR>
|
|
||||||
|
|
||||||
" Buffer switching
|
|
||||||
nnoremap <Leader>b1 :buffer 1<CR>
|
|
||||||
nnoremap <Leader>b2 :buffer 2<CR>
|
|
||||||
nnoremap <Leader>b3 :buffer 3<CR>
|
|
||||||
nnoremap <Leader>b4 :buffer 4<CR>
|
|
||||||
nnoremap <Leader>b5 :buffer 5<CR>
|
|
||||||
nnoremap <Leader>b6 :buffer 6<CR>
|
|
||||||
nnoremap <Leader>b7 :buffer 7<CR>
|
|
||||||
nnoremap <Leader>b8 :buffer 8<CR>
|
|
||||||
nnoremap <Leader>b9 :buffer 9<CR>
|
|
||||||
nnoremap <A-1> :buffer 1<CR>
|
|
||||||
nnoremap <A-2> :buffer 2<CR>
|
|
||||||
nnoremap <A-3> :buffer 3<CR>
|
|
||||||
nnoremap <A-4> :buffer 4<CR>
|
|
||||||
nnoremap <A-5> :buffer 5<CR>
|
|
||||||
nnoremap <A-6> :buffer 6<CR>
|
|
||||||
nnoremap <A-7> :buffer 7<CR>
|
|
||||||
nnoremap <A-8> :buffer 8<CR>
|
|
||||||
nnoremap <A-9> :buffer 9<CR>
|
|
||||||
|
|
||||||
nnoremap <C-l> :bnext<CR>
|
|
||||||
nnoremap <C-h> :bprev<CR>
|
|
||||||
|
|
||||||
" Tab switching
|
|
||||||
nnoremap <Leader>t1 1gt<CR>
|
|
||||||
nnoremap <Leader>t2 2gt<CR>
|
|
||||||
nnoremap <Leader>t3 3gt<CR>
|
|
||||||
nnoremap <Leader>t4 4gt<CR>
|
|
||||||
nnoremap <Leader>t5 5gt<CR>
|
|
||||||
nnoremap <Leader>t6 6gt<CR>
|
|
||||||
nnoremap <Leader>t7 7gt<CR>
|
|
||||||
nnoremap <Leader>t8 8gt<CR>
|
|
||||||
nnoremap <Leader>t9 9gt<CR>
|
|
||||||
|
|
||||||
nnoremap <C-S-l> :tabnext<CR>
|
|
||||||
nnoremap <C-S-h> :tabprev<CR>
|
|
||||||
|
|
||||||
" Configure coc.nvim
|
|
||||||
" let g:coc_node_path = trim(system('which node'))
|
|
||||||
let g:coc_node_path='/opt/homebrew/bin/node'
|
|
||||||
|
|
||||||
" Telescope.nvim options
|
|
||||||
" :Telescope |<tab>
|
|
||||||
" :Telescope find_files
|
|
||||||
|
|
||||||
" Pandoc file commands
|
|
||||||
" function! PandocCompileMd()
|
|
||||||
" nnoremap <Leader>pp !pandoc compile <CR>
|
|
||||||
" endfunction
|
|
||||||
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
local use = require('packer').use
|
|
||||||
require('packer').startup(function()
|
|
||||||
use 'wbthomason/packer.nvim' -- Package manager
|
|
||||||
use 'neovim/nvim-lspconfig' -- Configurations for Nvim LSP
|
|
||||||
end)
|
|
||||||
|
|
||||||
require'lspconfig'.clangd.setup{}
|
|
||||||
|
|
||||||
201
config/neovim/init.lua
Normal file
201
config/neovim/init.lua
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
-- INSTALL LAZY.NVIM (if not bootstrapping automatically):
|
||||||
|
-- git clone --filter=blob:none https://github.com/folke/lazy.nvim.git --branch=stable \
|
||||||
|
-- ~/.local/share/nvim/lazy/lazy.nvim
|
||||||
|
|
||||||
|
if vim.g.vscode then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.g.mapleader = ' '
|
||||||
|
vim.g.maplocalleader = ' '
|
||||||
|
|
||||||
|
local opt = vim.opt
|
||||||
|
opt.termguicolors = true
|
||||||
|
opt.mouse = 'a'
|
||||||
|
opt.smartindent = true
|
||||||
|
opt.wrap = false
|
||||||
|
opt.relativenumber = true
|
||||||
|
opt.tabstop = 4
|
||||||
|
opt.shiftwidth = 4
|
||||||
|
opt.expandtab = true
|
||||||
|
|
||||||
|
vim.hl.priorities.semantic_tokens = 140
|
||||||
|
vim.hl.priorities.treesitter = 100
|
||||||
|
|
||||||
|
vim.filetype.add({ extension = { svelte = 'svelte' } })
|
||||||
|
vim.api.nvim_create_autocmd('FileType', { pattern = 'markdown', command = 'setlocal wrap' })
|
||||||
|
|
||||||
|
local function map(mode, lhs, rhs)
|
||||||
|
vim.keymap.set(mode, lhs, rhs, { silent = true })
|
||||||
|
end
|
||||||
|
|
||||||
|
for _, m in ipairs({
|
||||||
|
{ 'n', '<c-b>', '<cmd>NvimTreeToggle<cr>' },
|
||||||
|
{ 'n', '<c-`>', '<cmd>ToggleTerm direction="float"<cr>' },
|
||||||
|
{ 't', '<c-`>', '<cmd>ToggleTerm<cr>' },
|
||||||
|
{ 'n', '<leader>gs', '<cmd>Telescope git_status<cr>' },
|
||||||
|
{ 'n', '<leader>gc', '<cmd>Telescope git_commits<cr>' },
|
||||||
|
{ 'n', '<leader>:', '<cmd>Telescope commands<cr>' },
|
||||||
|
{ 'n', '<leader><leader>', '<cmd>Telescope find_files<cr>' },
|
||||||
|
{ 'n', '<leader>f', '<cmd>Telescope grep_string<cr>' },
|
||||||
|
{ 'n', '<leader>b', '<cmd>Telescope buffers<cr>' },
|
||||||
|
{ 'n', 'B', '<cmd>Telescope buffers<cr>' },
|
||||||
|
{ 'n', '<leader>e', vim.diagnostic.open_float },
|
||||||
|
{ 'n', '\\', vim.lsp.buf.hover },
|
||||||
|
{ 'n', '<a-k>', '<cmd>GitGutterPrevHunk<cr>' },
|
||||||
|
{ 'n', '<a-j>', '<cmd>GitGutterNextHunk<cr>' },
|
||||||
|
{ 'n', '<c-h>', '<cmd>bp<cr>' },
|
||||||
|
{ 'n', '<c-l>', '<cmd>bn<cr>' },
|
||||||
|
}) do
|
||||||
|
map(m[1], m[2], m[3])
|
||||||
|
end
|
||||||
|
|
||||||
|
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
||||||
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
|
'git',
|
||||||
|
'clone',
|
||||||
|
'--filter=blob:none',
|
||||||
|
'https://github.com/folke/lazy.nvim.git',
|
||||||
|
'--branch=stable',
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
require('lazy').setup({
|
||||||
|
{
|
||||||
|
'Mofiqul/vscode.nvim',
|
||||||
|
name = 'vscode',
|
||||||
|
priority = 1000,
|
||||||
|
lazy = false,
|
||||||
|
config = function() require('vscode').setup({ transparent = true }) end,
|
||||||
|
},
|
||||||
|
{ 'airblade/vim-gitgutter' },
|
||||||
|
{
|
||||||
|
'nvim-lualine/lualine.nvim',
|
||||||
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||||
|
config = function() require('lualine').setup({ options = { theme = 'vscode', globalstatus = true } }) end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
build = ':TSUpdate',
|
||||||
|
config = function()
|
||||||
|
local wanted = { 'svelte', 'javascript', 'typescript', 'html', 'css' }
|
||||||
|
local ts_runtime = vim.fn.stdpath('data') .. '/lazy/nvim-treesitter/runtime'
|
||||||
|
if vim.loop.fs_stat(ts_runtime) then
|
||||||
|
vim.opt.rtp:append(ts_runtime)
|
||||||
|
end
|
||||||
|
require('nvim-treesitter').setup({ install_dir = vim.fn.stdpath('data') .. '/site' })
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
|
pattern = wanted,
|
||||||
|
callback = function() pcall(vim.treesitter.start) end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
|
config = function()
|
||||||
|
local capabilities = vim.tbl_deep_extend(
|
||||||
|
'force',
|
||||||
|
vim.lsp.protocol.make_client_capabilities(),
|
||||||
|
require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
)
|
||||||
|
|
||||||
|
local function on_attach(client, bufnr)
|
||||||
|
if client.server_capabilities.semanticTokensProvider then
|
||||||
|
vim.lsp.semantic_tokens.start(bufnr, client.id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local defaults = {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
}
|
||||||
|
local servers = {
|
||||||
|
basedpyright = {},
|
||||||
|
ts_ls = {},
|
||||||
|
svelte = {},
|
||||||
|
rust_analyzer = {},
|
||||||
|
}
|
||||||
|
|
||||||
|
for server, opts in pairs(servers) do
|
||||||
|
vim.lsp.config(server, vim.tbl_deep_extend('force', defaults, opts))
|
||||||
|
vim.lsp.enable(server)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{ 'hrsh7th/cmp-nvim-lsp' },
|
||||||
|
{
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
dependencies = { 'hrsh7th/cmp-nvim-lsp' },
|
||||||
|
config = function()
|
||||||
|
local cmp = require('cmp')
|
||||||
|
cmp.setup({
|
||||||
|
mapping = {
|
||||||
|
['<C-n>'] = cmp.mapping(function()
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
||||||
|
else
|
||||||
|
cmp.complete()
|
||||||
|
end
|
||||||
|
end, { 'i', 's' }),
|
||||||
|
['<C-p>'] = cmp.mapping(function()
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select })
|
||||||
|
end
|
||||||
|
end, { 'i', 's' }),
|
||||||
|
['<CR>'] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.confirm({ select = true })
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { 'i', 's' }),
|
||||||
|
},
|
||||||
|
sources = { { name = 'nvim_lsp' } },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'nvim-tree/nvim-tree.lua',
|
||||||
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||||
|
config = function() require('nvim-tree').setup({ view = { width = 42 } }) end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
|
dependencies = { 'nvim-lua/plenary.nvim', 'nvim-telescope/telescope-fzf-native.nvim' },
|
||||||
|
config = function()
|
||||||
|
local actions = require('telescope.actions')
|
||||||
|
require('telescope').setup({
|
||||||
|
defaults = {
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
['<Esc>'] = actions.close,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
extensions = {
|
||||||
|
fzf = {
|
||||||
|
fuzzy = true,
|
||||||
|
override_generic_sorter = true,
|
||||||
|
override_file_sorter = true,
|
||||||
|
case_mode = 'smart_case',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
require('telescope').load_extension('fzf')
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
|
||||||
|
{
|
||||||
|
'akinsho/toggleterm.nvim',
|
||||||
|
version = '*',
|
||||||
|
config = function() require('toggleterm').setup() end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
if not pcall(vim.cmd.colorscheme, 'vscode') then
|
||||||
|
print('Failed to load colorscheme - probably has not been installed')
|
||||||
|
end
|
||||||
16
config/neovim/lazy-lock.json
Normal file
16
config/neovim/lazy-lock.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "44acfe887d4056f704ccc4f17513ed41c9e2b2e6" },
|
||||||
|
"nvim-tree.lua": { "branch": "master", "commit": "e11ce83ed9a00f065bf676ae4e6c261c766989ba" },
|
||||||
|
"nvim-treesitter": { "branch": "main", "commit": "3edb01f912867603c2aef9079f208f0244c0885b" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||||
|
"telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" },
|
||||||
|
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
|
||||||
|
"vim-gitgutter": { "branch": "main", "commit": "0acb772e76064cc406664ab595b58b3fac76488a" },
|
||||||
|
"vscode": { "branch": "main", "commit": "aa1102a7e15195c9cca22730b09224a7f7745ba8" }
|
||||||
|
}
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
-- INSTALL PACKER:
|
|
||||||
-- git clone --depth 1 https://github.com/wbthomason/packer.nvim\
|
|
||||||
-- ~/.local/share/nvim/site/pack/packer/start/packer.nvim
|
|
||||||
|
|
||||||
-- check for vscode nvim plugin
|
|
||||||
-- (https://github.com/vscode-neovim/vscode-neovim)
|
|
||||||
if vim.g.vscode then
|
|
||||||
do return end
|
|
||||||
else
|
|
||||||
if vim.g.neovide then
|
|
||||||
vim.o.guifont = "CaskaydiaCove Nerd Font:h14"
|
|
||||||
vim.g.neovide_hide_mouse_when_typing = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- aliases
|
|
||||||
|
|
||||||
local o = vim.o
|
|
||||||
local c = vim.cmd
|
|
||||||
local map = vim.api.nvim_set_keymap
|
|
||||||
|
|
||||||
-- options
|
|
||||||
|
|
||||||
o.termguicolors = true
|
|
||||||
o.mouse = 'a'
|
|
||||||
-- o.autoindent = true
|
|
||||||
o.smartindent = true -- replacing autoindent with this
|
|
||||||
o.wrap = false
|
|
||||||
o.nobinary = true
|
|
||||||
o.relativenumber = true
|
|
||||||
o.tabstop = 4
|
|
||||||
o.shiftwidth = 4
|
|
||||||
o.expandtab = true
|
|
||||||
|
|
||||||
-- set wrap if markdown file
|
|
||||||
vim.cmd('autocmd FileType markdown setlocal wrap')
|
|
||||||
|
|
||||||
-- NOTE: pcall prevents plugin system from shitting itself on first load
|
|
||||||
if not pcall(function()
|
|
||||||
c.colorscheme 'catppuccin'
|
|
||||||
end) then
|
|
||||||
print("Failed to load colorscheme - probably has not been installed")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- keybinds
|
|
||||||
|
|
||||||
-- file management
|
|
||||||
-- map('n', '<c-t>', ':CHADopen<cr>', {silent = true})
|
|
||||||
map('n', '<c-b>', ':NvimTreeToggle<cr>', {silent = true})
|
|
||||||
|
|
||||||
map('n', '<c-`>', ':ToggleTerm direction="float"<cr>', {silent = true})
|
|
||||||
-- exit terminal requires <Cmd> prefix
|
|
||||||
map('t', '<c-`>', '<Cmd>:ToggleTerm<cr>', {silent = true})
|
|
||||||
|
|
||||||
map('n', '<Space>gs', ':Telescope git_status<cr>', {silent = true})
|
|
||||||
map('n', '<Space>gc', ':Telescope git_commits<cr>', {silent = true})
|
|
||||||
map('n', '<Space>:', ':Telescope commands<cr>', {silent = true})
|
|
||||||
map('n', '<Space><Space>', ':Telescope find_files<cr>', {silent = true})
|
|
||||||
map('n', '<Space>f', ':Telescope grep_string<cr>', {silent = true})
|
|
||||||
|
|
||||||
-- buffer management
|
|
||||||
map('n', '<c-h>', ':bp<cr>', {silent = true})
|
|
||||||
map('n', '<c-l>', ':bn<cr>', {silent = true})
|
|
||||||
|
|
||||||
-- plugin configs
|
|
||||||
|
|
||||||
vim.g['airline_powerline_fonts'] = 1
|
|
||||||
vim.g['airline_theme'] = 'powerlineish'
|
|
||||||
vim.g['airline#extensions#tabline#enabled'] = 1
|
|
||||||
vim.g['airline#extensions#tabline#fnamemod'] = ':t'
|
|
||||||
|
|
||||||
-- plugin imports
|
|
||||||
|
|
||||||
return require('packer').startup(function(use)
|
|
||||||
|
|
||||||
-- Packer can manage itself
|
|
||||||
use 'wbthomason/packer.nvim'
|
|
||||||
|
|
||||||
-- Visual
|
|
||||||
use 'vim-airline/vim-airline'
|
|
||||||
use 'vim-airline/vim-airline-themes'
|
|
||||||
use { "catppuccin/nvim", as = "catppuccin" }
|
|
||||||
use 'airblade/vim-gitgutter'
|
|
||||||
|
|
||||||
-- Editor
|
|
||||||
use {'neovim/nvim-lspconfig', config = function()
|
|
||||||
local lspc = require('lspconfig')
|
|
||||||
lspc['pyright'].setup{}
|
|
||||||
lspc['tsserver'].setup{}
|
|
||||||
lspc['clojure_lsp'].setup{}
|
|
||||||
lspc['racket_langserver'].setup{}
|
|
||||||
lspc['rust_analyzer'].setup{}
|
|
||||||
lspc['gopls'].setup{}
|
|
||||||
end}
|
|
||||||
use 'hrsh7th/cmp-nvim-lsp'
|
|
||||||
use {'hrsh7th/nvim-cmp', config = function()
|
|
||||||
local cmp = require 'cmp'
|
|
||||||
cmp.setup {
|
|
||||||
sources = {
|
|
||||||
{ name = 'nvim_lsp' },
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end}
|
|
||||||
|
|
||||||
-- use {'ms-jpq/chadtree', branch = 'chad'}
|
|
||||||
use {"nvim-tree/nvim-tree.lua", config = function()
|
|
||||||
require("nvim-tree").setup()
|
|
||||||
end}
|
|
||||||
use {"nvim-tree/nvim-web-devicons"}
|
|
||||||
|
|
||||||
use 'nvim-lua/plenary.nvim'
|
|
||||||
use 'nvim-telescope/telescope.nvim'
|
|
||||||
use {"akinsho/toggleterm.nvim", tag = '*', config = function()
|
|
||||||
require("toggleterm").setup()
|
|
||||||
end}
|
|
||||||
use {'nvim-treesitter/nvim-treesitter', run = ':TSUpdate', config = function()
|
|
||||||
require'nvim-treesitter.configs'.setup{
|
|
||||||
highlight = {enable = true}
|
|
||||||
}
|
|
||||||
end}
|
|
||||||
|
|
||||||
-- use 'martinsione/darkplus.nvim'
|
|
||||||
|
|
||||||
-- NOTE: requires Node.js >= 17
|
|
||||||
-- use {'github/copilot.vim', run = ':Copilot setup'}
|
|
||||||
--
|
|
||||||
-- Specify Filetype for .python Files
|
|
||||||
vim.api.nvim_exec([[
|
|
||||||
autocmd BufNewFile,BufRead *.sage set filetype=python
|
|
||||||
]], false)
|
|
||||||
|
|
||||||
end)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
" Win behavior
|
|
||||||
" source $VIMRUNTIME/mswin.vim
|
|
||||||
" behave mswin
|
|
||||||
|
|
||||||
" Window height
|
|
||||||
" set lines=32 columns=110
|
|
||||||
|
|
||||||
" Preferences
|
|
||||||
set encoding=utf-8
|
|
||||||
set autochdir
|
|
||||||
set shiftwidth=4
|
|
||||||
set tabstop=4
|
|
||||||
set linebreak
|
|
||||||
set breakindent
|
|
||||||
set autoindent
|
|
||||||
set wrap
|
|
||||||
set nobinary
|
|
||||||
set relativenumber
|
|
||||||
syntax on
|
|
||||||
set belloff=all
|
|
||||||
|
|
||||||
set guifont=CaskaydiaCove\ Nerd\ Font:h12
|
|
||||||
|
|
||||||
" Aliases
|
|
||||||
cnoreabbrev ge browse confirm e
|
|
||||||
cnoreabbrev ! aliasrun
|
|
||||||
|
|
||||||
" Plugins
|
|
||||||
call plug#begin()
|
|
||||||
Plug 'vim-airline/vim-airline'
|
|
||||||
Plug 'vim-airline/vim-airline-themes'
|
|
||||||
Plug 'airblade/vim-gitgutter'
|
|
||||||
Plug 'flazz/vim-colorschemes'
|
|
||||||
Plug 'tomlion/vim-solidity'
|
|
||||||
Plug 'zah/nim.vim'
|
|
||||||
Plug 'NLKNguyen/papercolortheme'
|
|
||||||
Plug 'ackyshake/VimCompletesMe'
|
|
||||||
Plug 'preservim/nerdtree'
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
" Theming
|
|
||||||
set t_Co=256
|
|
||||||
set background=dark
|
|
||||||
colorscheme PaperColor
|
|
||||||
let g:airline_powerline_fonts = 1
|
|
||||||
let g:airline_theme = 'powerlineish'
|
|
||||||
let g:airline#extensions#tabline#enabled = 1
|
|
||||||
let g:airline#extensions#tabline#fnamemod = ':t'
|
|
||||||
|
|
||||||
|
|
||||||
" Navigation & Shortcuts
|
|
||||||
|
|
||||||
" NERDTree Stuff
|
|
||||||
nnoremap <leader>n :NERDTreeFocus<CR>
|
|
||||||
nnoremap <C-n> :NERDTree<CR>
|
|
||||||
nnoremap <C-t> :NERDTreeToggle<CR>
|
|
||||||
nnoremap <C-f> :NERDTreeFind<CR>
|
|
||||||
|
|
||||||
" Copy/paste stuff
|
|
||||||
" inoremap <C-c> "+y
|
|
||||||
" inoremap <C-v> <C-o>:"+p<CR>
|
|
||||||
|
|
||||||
" Tab stuff
|
|
||||||
nnoremap <A-1> 1gt
|
|
||||||
nnoremap <A-2> 2gt
|
|
||||||
nnoremap <A-3> 3gt
|
|
||||||
nnoremap <A-4> 4gt
|
|
||||||
nnoremap <A-5> 5gt
|
|
||||||
nnoremap <A-6> 6gt
|
|
||||||
nnoremap <A-7> 7gt
|
|
||||||
nnoremap <A-8> 8gt
|
|
||||||
nnoremap <A-9> 9gt
|
|
||||||
nnoremap <A-0> 10gt-
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
" Win behavior
|
|
||||||
" source $VIMRUNTIME/mswin.vim
|
|
||||||
" behave mswin
|
|
||||||
|
|
||||||
" Window height
|
|
||||||
set lines=32 columns=110
|
|
||||||
|
|
||||||
" Preferences
|
|
||||||
set encoding=utf-8
|
|
||||||
set autochdir
|
|
||||||
set shiftwidth=4
|
|
||||||
set tabstop=4
|
|
||||||
set linebreak
|
|
||||||
set breakindent
|
|
||||||
set autoindent
|
|
||||||
set wrap
|
|
||||||
set conceallevel=0
|
|
||||||
set backspace=2
|
|
||||||
set backspace=indent,eol,start
|
|
||||||
set fileformat=unix
|
|
||||||
set fileformats=unix,dos
|
|
||||||
set nobinary
|
|
||||||
set relativenumber
|
|
||||||
syntax on
|
|
||||||
set shell=pwsh.exe
|
|
||||||
|
|
||||||
" Aliases
|
|
||||||
cnoreabbrev ge browse confirm e
|
|
||||||
cnoreabbrev ! aliasrun
|
|
||||||
|
|
||||||
" Plugins
|
|
||||||
call plug#begin()
|
|
||||||
Plug 'vim-airline/vim-airline'
|
|
||||||
Plug 'vim-airline/vim-airline-themes'
|
|
||||||
Plug 'airblade/vim-gitgutter'
|
|
||||||
Plug 'preservim/nerdtree'
|
|
||||||
Plug 'flazz/vim-colorschemes'
|
|
||||||
Plug 'tomlion/vim-solidity'
|
|
||||||
Plug 'zah/nim.vim'
|
|
||||||
Plug 'ycm-core/YouCompleteMe'
|
|
||||||
Plug 'NLKNguyen/papercolor-theme'
|
|
||||||
" Plug 'vim-syntastic/syntastic'
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
" Theming
|
|
||||||
set t_Co=256
|
|
||||||
set guifont=Cascadia_Code_PL:h9
|
|
||||||
set background=dark
|
|
||||||
colorscheme PaperColor
|
|
||||||
let g:airline_powerline_fonts = 1
|
|
||||||
let g:airline_theme = 'powerlineish'
|
|
||||||
let g:airline#extensions#tabline#enabled = 1
|
|
||||||
let g:airline#extensions#tabline#fnamemod = ':t'
|
|
||||||
|
|
||||||
" Hide GVim Elements
|
|
||||||
set guioptions-=m
|
|
||||||
set guioptions-=T
|
|
||||||
set guioptions-=r
|
|
||||||
set guioptions-=L
|
|
||||||
set guioptions-=e
|
|
||||||
|
|
||||||
" Navigation & Shortcuts
|
|
||||||
" inoremap <C-c> "+y
|
|
||||||
" inoremap <C-v> <C-o>:"+p<CR>
|
|
||||||
nnoremap <C-n> :NERDTreeToggle<CR>
|
|
||||||
|
|
||||||
nnoremap <A-1> 1gt
|
|
||||||
nnoremap <A-2> 2gt
|
|
||||||
nnoremap <A-3> 3gt
|
|
||||||
nnoremap <A-4> 4gt
|
|
||||||
nnoremap <A-5> 5gt
|
|
||||||
nnoremap <A-6> 6gt
|
|
||||||
nnoremap <A-7> 7gt
|
|
||||||
nnoremap <A-8> 8gt
|
|
||||||
nnoremap <A-9> 9gt
|
|
||||||
nnoremap <A-0> 10gt
|
|
||||||
File diff suppressed because it is too large
Load Diff
66
config/zed/keymap.json
Normal file
66
config/zed/keymap.json
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
// Zed keymap
|
||||||
|
//
|
||||||
|
// For information on binding keys, see the Zed
|
||||||
|
// documentation: https://zed.dev/docs/key-bindings
|
||||||
|
//
|
||||||
|
// To see the default key bindings run `zed: open default keymap`
|
||||||
|
// from the command palette.
|
||||||
|
[
|
||||||
|
{
|
||||||
|
// (All contexts)
|
||||||
|
"bindings": {
|
||||||
|
"cmd-shift-g": "git_panel::ToggleFocus",
|
||||||
|
"cmd->": "project_panel::ToggleHideHidden",
|
||||||
|
"cmd-1": ["pane::ActivateItem", 0],
|
||||||
|
"cmd-2": ["pane::ActivateItem", 1],
|
||||||
|
"cmd-3": ["pane::ActivateItem", 2],
|
||||||
|
"cmd-4": ["pane::ActivateItem", 3],
|
||||||
|
"cmd-5": ["pane::ActivateItem", 4],
|
||||||
|
"cmd-6": ["pane::ActivateItem", 5],
|
||||||
|
"cmd-7": ["pane::ActivateItem", 6],
|
||||||
|
"cmd-8": ["pane::ActivateItem", 7],
|
||||||
|
"cmd-9": ["pane::ActivateItem", 8],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"context": "Editor && vim_mode == insert",
|
||||||
|
"bindings": {
|
||||||
|
// "j k": "vim::NormalBefore"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"context": "Editor",
|
||||||
|
"bindings": {
|
||||||
|
"cmd-l": null,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"context": "((FileFinder || FileFinder > Picker > Editor) || FileFinder > Picker > menu)",
|
||||||
|
"bindings": {
|
||||||
|
"cmd-l": null,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"bindings": {
|
||||||
|
"cmd-l": "workspace::ToggleRightDock",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"context": "ContextEditor > Editor",
|
||||||
|
"bindings": {
|
||||||
|
"cmd-shift-g": null,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"context": "Pane",
|
||||||
|
"bindings": {
|
||||||
|
"cmd-shift-g": null,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"context": "Workspace",
|
||||||
|
"bindings": {
|
||||||
|
"cmd-w": null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
70
config/zed/settings.json
Normal file
70
config/zed/settings.json
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
// Zed settings
|
||||||
|
//
|
||||||
|
// For information on how to configure Zed, see the Zed
|
||||||
|
// documentation: https://zed.dev/docs/configuring-zed
|
||||||
|
//
|
||||||
|
// To see all of Zed's default settings without changing your
|
||||||
|
// custom settings, run `zed: open default settings` from the
|
||||||
|
// command palette (cmd-shift-p / ctrl-shift-p)
|
||||||
|
{
|
||||||
|
"project_panel": {
|
||||||
|
"hide_hidden": false,
|
||||||
|
},
|
||||||
|
"features": {
|
||||||
|
"edit_prediction_provider": "copilot",
|
||||||
|
},
|
||||||
|
"agent_ui_font_size": 15.0,
|
||||||
|
"toolbar": {
|
||||||
|
"breadcrumbs": true,
|
||||||
|
"code_actions": false,
|
||||||
|
},
|
||||||
|
"git_panel": {
|
||||||
|
"tree_view": true,
|
||||||
|
},
|
||||||
|
"ui_font_family": ".SystemUIFont",
|
||||||
|
"icon_theme": "Material Icon Theme",
|
||||||
|
"agent_servers": {
|
||||||
|
"opencode": {
|
||||||
|
"type": "registry",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"buffer_font_family": "CaskaydiaCove Nerd Font",
|
||||||
|
"session": {
|
||||||
|
"trust_all_worktrees": true,
|
||||||
|
},
|
||||||
|
"vim_mode": true,
|
||||||
|
"terminal": {
|
||||||
|
"font_family": "MesloLGS NF",
|
||||||
|
},
|
||||||
|
"base_keymap": "VSCode",
|
||||||
|
"ui_font_size": 14.0,
|
||||||
|
"buffer_font_size": 12.0,
|
||||||
|
"file_types": {
|
||||||
|
"Jinja2": ["*.j2"],
|
||||||
|
"YAML": ["*.yml.template", "*.yaml.template"],
|
||||||
|
},
|
||||||
|
"theme": {
|
||||||
|
"mode": "system",
|
||||||
|
"light": "Ayu Light",
|
||||||
|
"dark": "VSCode Dark Modern",
|
||||||
|
},
|
||||||
|
"theme_overrides": {
|
||||||
|
"VSCode Dark Modern": {
|
||||||
|
"editor.background": "#121212",
|
||||||
|
"editor.active_line.background": "#1f1f1f",
|
||||||
|
"tab_bar.background": "#121212",
|
||||||
|
"tab.active_background": "#262626",
|
||||||
|
"terminal.background": "#141414",
|
||||||
|
"panel.background": "#161616",
|
||||||
|
"text": "#fff",
|
||||||
|
"text.muted": "#ddd",
|
||||||
|
"toolbar.background": "#171717",
|
||||||
|
"editor.gutter.background": "#171717",
|
||||||
|
"border": "#444",
|
||||||
|
"version_control.deleted": "#f11",
|
||||||
|
"version_control.added": "#2e1",
|
||||||
|
"version_control.conflict": "#e1f",
|
||||||
|
"version_control.modified": "#08f",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
wget https://dl.google.com/android/repository/commandlinetools-mac-9123335_latest.zip -O ~/Downloads/as-mac-cli-tools.zip
|
|
||||||
|
|
||||||
mkdir -p ~/opt
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
#!/usr/bin/env bb
|
|
||||||
|
|
||||||
(require '[clojure.string :as str :refer [split]])
|
|
||||||
(require '[babashka.tasks :as tasks :refer [shell]])
|
|
||||||
|
|
||||||
(def drive-dest "turtlebasket-gdrive:/macbook-air-m1")
|
|
||||||
(def paths ["Desktop"
|
|
||||||
"Documents/Personal Knowledge Base"
|
|
||||||
"Documents/Berkeley Notes"])
|
|
||||||
|
|
||||||
;; currently not used
|
|
||||||
(def exclude ["*.swp" ".git" "node_modules" "__pycache__" ".DS_Store"])
|
|
||||||
|
|
||||||
(for [path paths]
|
|
||||||
(future
|
|
||||||
(let [res
|
|
||||||
(shell "rclone" "sync"
|
|
||||||
path
|
|
||||||
(format "%s/%s" drive-dest (-> path (split #"/") last))
|
|
||||||
"--progress" "--retries" 1 "--delete-excluded")]
|
|
||||||
(if (= (get res "exit") 0)
|
|
||||||
(println (format "Backed up %s" path))
|
|
||||||
(println (get res "error"))))))
|
|
||||||
;; (for [item exclude] (cons "--exclude" item))))
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
from concurrent.futures import ThreadPoolExecutor
|
|
||||||
from subprocess import run as srun
|
|
||||||
|
|
||||||
DEST="turtlebasket-gdrive:/macbook-air-m1"
|
|
||||||
paths=[
|
|
||||||
"Desktop"
|
|
||||||
"Documents/Personal Knowledge Base"
|
|
||||||
"Documents/Berkeley Notes"
|
|
||||||
]
|
|
||||||
|
|
||||||
with ThreadPoolExecutor(max_workers=4) as executor:
|
|
||||||
for path in paths:
|
|
||||||
fname = path.split("/")[-1]
|
|
||||||
srun("rclone", "sync",
|
|
||||||
path,
|
|
||||||
f'{DEST}/{fname}',
|
|
||||||
"--progress", "--rertries", 1, "--delete-excluded")
|
|
||||||
79
scripts/ntfy-cmd
Executable file
79
scripts/ntfy-cmd
Executable file
@@ -0,0 +1,79 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# ntfy-cmd — run any command, then send ntfy success/failure notification (via curl)
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# ntfy-cmd <command> [args...]
|
||||||
|
#
|
||||||
|
# Example:
|
||||||
|
# ntfy-cmd make build
|
||||||
|
# ntfy-cmd bash -c "sleep 10 && false"
|
||||||
|
# ntfy-cmd ls /nonexistent
|
||||||
|
#
|
||||||
|
# Notes:
|
||||||
|
# - Requires $NTFY_ME_TOPIC set (e.g., mytopic)
|
||||||
|
# - Optional $NTFY_HOST (defaults to https://ntfy.sh)
|
||||||
|
# - Captures exit code and reports SUCCESS/FAILURE via ntfy with duration.
|
||||||
|
|
||||||
|
set -uo pipefail # no `-e`, so we can handle nonzero exits ourselves
|
||||||
|
|
||||||
|
if [ -z "${NTFY_ME_TOPIC:-}" ]; then
|
||||||
|
echo "Error: NTFY_ME_TOPIC environment variable not set."
|
||||||
|
echo "Set it like: export NTFY_ME_TOPIC=mytopic"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set default ntfy host if not provided
|
||||||
|
NTFY_HOST="${NTFY_HOST:-https://ntfy.sh}"
|
||||||
|
|
||||||
|
if [ $# -lt 1 ]; then
|
||||||
|
echo "Usage: $0 <command> [args...]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Reconstruct command with proper quoting for display
|
||||||
|
original_cmd=""
|
||||||
|
for arg in "$@"; do
|
||||||
|
if [[ "$arg" =~ [[:space:]] ]]; then
|
||||||
|
original_cmd="$original_cmd \"$arg\""
|
||||||
|
else
|
||||||
|
original_cmd="$original_cmd $arg"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
original_cmd="${original_cmd# }" # Remove leading space
|
||||||
|
|
||||||
|
start_time=$(date +%s)
|
||||||
|
hostname=$(hostname)
|
||||||
|
|
||||||
|
# Run the command directly, preserving exit code
|
||||||
|
"$@"
|
||||||
|
code=$?
|
||||||
|
|
||||||
|
end_time=$(date +%s)
|
||||||
|
elapsed=$((end_time - start_time))
|
||||||
|
duration="$(printf '%02dh:%02dm:%02ds' $((elapsed/3600)) $((elapsed%3600/60)) $((elapsed%60)))"
|
||||||
|
|
||||||
|
if [ $code -eq 0 ]; then
|
||||||
|
title="✅ Command exited - SUCCESS"
|
||||||
|
else
|
||||||
|
title="❌ Command exited - FAILURE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Truncate if too long (keep first 100 chars + "..." if truncated)
|
||||||
|
cmd_str="$original_cmd"
|
||||||
|
if [ ${#cmd_str} -gt 100 ]; then
|
||||||
|
cmd_str="${cmd_str:0:100}..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
body="Command: $cmd_str
|
||||||
|
Host: $hostname
|
||||||
|
Duration: $duration
|
||||||
|
Exit code: $code"
|
||||||
|
|
||||||
|
curl -fsS -X POST \
|
||||||
|
-H "Title: $title" \
|
||||||
|
-d "$body" \
|
||||||
|
"$NTFY_HOST/$NTFY_ME_TOPIC" >/dev/null 2>&1 || echo "Warning: failed to send ntfy notification" >&2
|
||||||
|
|
||||||
|
exit $code
|
||||||
|
|
||||||
36
scripts/ntfy-msg
Executable file
36
scripts/ntfy-msg
Executable file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# ntfy-msg — send a message to ntfy (via curl)
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# ntfy-msg <message>
|
||||||
|
#
|
||||||
|
# Example:
|
||||||
|
# ntfy-msg "Build finished"
|
||||||
|
#
|
||||||
|
# Notes:
|
||||||
|
# - Requires $NTFY_ME_TOPIC set (e.g., mytopic)
|
||||||
|
# - Optional $NTFY_HOST (defaults to https://ntfy.sh)
|
||||||
|
|
||||||
|
set -u
|
||||||
|
|
||||||
|
if [ -z "${NTFY_ME_TOPIC:-}" ]; then
|
||||||
|
echo "Error: NTFY_ME_TOPIC environment variable not set."
|
||||||
|
echo "Set it like: export NTFY_ME_TOPIC=mytopic"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set default ntfy host if not provided
|
||||||
|
NTFY_HOST="${NTFY_HOST:-https://ntfy.sh}"
|
||||||
|
|
||||||
|
if [ $# -lt 1 ]; then
|
||||||
|
echo "Usage: $0 <message>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
message="$*"
|
||||||
|
|
||||||
|
curl -fsS -X POST \
|
||||||
|
-d "$message" \
|
||||||
|
"$NTFY_HOST/$NTFY_ME_TOPIC" >/dev/null 2>&1 || echo "Warning: failed to send ntfy message" >&2
|
||||||
|
|
||||||
13
scripts/tmux2
Executable file
13
scripts/tmux2
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# simple wrapper for tmux that creates a new session for current directory if one doesn't exist
|
||||||
|
# meant for scoping sessions by /Projects/<project-name>/
|
||||||
|
|
||||||
|
session="$(basename "$PWD")"
|
||||||
|
|
||||||
|
tmux has-session -t "$session" 2>/dev/null
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
exec tmux attach -t "$session"
|
||||||
|
else
|
||||||
|
exec tmux new -s "$session"
|
||||||
|
fi
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
envr=~/Projects/env
|
|
||||||
|
|
||||||
mkdir -vp ~/.bin ~/Projects
|
|
||||||
|
|
||||||
echo 'export PATH="~/.bin:$PATH"' > ~/.bashrc
|
|
||||||
|
|
||||||
# nvim install
|
|
||||||
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
|
|
||||||
chmod u+x nvim.appimage
|
|
||||||
mv nvim.appimage ~/.bin/nvim
|
|
||||||
|
|
||||||
# nvim packer install
|
|
||||||
git clone --depth 1 https://github.com/wbthomason/packer.nvim\
|
|
||||||
~/.local/share/nvim/site/pack/packer/start/packer.nvim
|
|
||||||
|
|
||||||
# dotfiles
|
|
||||||
git clone https://github.com/turtlebasket/env $envr
|
|
||||||
mkdir -p ~/.config/nvim
|
|
||||||
cp -v $envr/config/neovim/macos/init.lua ~/.config/nvim/init.lua
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user