commit ef5973455b4062134db81bb3b2d1dfd636a56bcb parent 59fe11e0a64c0527829cd1319d48f6b269fac76c Author: Yohanes Bandung Bondowoso <hi@ybbond.id> Date: Wed, 5 May 2021 23:26:32 +0700 update terminal configs, remove doom Diffstat:
| M | .config/nvim/coc-settings.json | | | 82 | ++++++++++++++++++++++++++++++++++++++++---------------------------------------- |
| M | .config/nvim/init.vim | | | 23 | +++++++++++++++++------ |
| D | .doom.d/config.el | | | 255 | ------------------------------------------------------------------------------- |
| D | .doom.d/init.el | | | 183 | ------------------------------------------------------------------------------- |
| D | .doom.d/packages.el | | | 53 | ----------------------------------------------------- |
| M | .gitconfig | | | 6 | +++--- |
| M | .hammerspoon/init.lua | | | 386 | +++++++++++++++++++++++++++++++++++++++++++------------------------------------ |
| M | .vimrc | | | 51 | +++++++++++++++++++++++++++++++++------------------ |
| M | .zshrc | | | 57 | ++++++++++++++++++++++++++++----------------------------- |
9 files changed, 332 insertions(+), 764 deletions(-)
diff --git a/.config/nvim/coc-settings.json b/.config/nvim/coc-settings.json @@ -46,47 +46,47 @@ "command": "/Users/yohanesbandung/bin/reason-language-server", "filetypes": ["reason", "ocaml"] }, - "ccls": { - "command": "ccls", - "filetypes": ["c", "cpp", "objc", "objcpp"], - "rootPatterns": [ - ".ccls", - "compile_commands.json", - ".vim/", - ".git/", - ".hg/" - ], - "initializationOptions": { - "cache": { - "directory": "/tmp/ccls" - }, - "clang": { - "resourceDir": "/Library/Developer/CommandLineTools/usr/lib/clang/11.0.0", - "extraArgs": [ - "-isystem", - "/usr/local/include", - "-L", - "/usr/local/lib", - "-l", - "SDL2", - "-isystem", - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1", - "-isystem", - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include", - "-isystem", - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include", - "-isystem", - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include", - "-isystem", - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks", - "-isystem", - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1", - "-I", - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/" - ] - } - } - }, + //"ccls": { + // "command": "ccls", + // "filetypes": ["c", "cpp", "objc", "objcpp"], + // "rootPatterns": [ + // ".ccls", + // "compile_commands.json", + // ".vim/", + // ".git/", + // ".hg/" + // ], + // "initializationOptions": { + // "cache": { + // "directory": "/tmp/ccls" + // }, + // "clang": { + // "resourceDir": "/Library/Developer/CommandLineTools/usr/lib/clang/11.0.0", + // "extraArgs": [ + // "-isystem", + // "/usr/local/include", + // "-L", + // "/usr/local/lib", + // "-l", + // "SDL2", + // "-isystem", + // "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1", + // "-isystem", + // "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include", + // "-isystem", + // "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include", + // "-isystem", + // "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include", + // "-isystem", + // "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks", + // "-isystem", + // "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1", + // "-I", + // "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/" + // ] + // } + // } + //}, "golang": { "command": "gopls", "args": [], diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim @@ -259,6 +259,9 @@ nnoremap <expr> 0 &wrap == 1 ? 'g0' : '0' " NORMAL MODE """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" keep asterisk and pound to be case sensitive +nnoremap <leader>* :let @/='\C\<' . expand('<cword>') . '\>'<CR>:let v:searchforward=1<CR>n +nnoremap <leader># :let @/='\C\<' . expand('<cword>') . '\>'<CR>:let v:searchforward=0<CR>n " reload all opened buffer nnoremap <leader>br :bufdo e<cr> @@ -340,21 +343,28 @@ nnoremap gB :bprevious<cr> \ rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --color "always" \ -g "*.{css,js,jsx,ts,tsx,json,re,php,md,styl,jade,html,config,py,cpp,c,go,hs,rb,conf}" \ -g "!{.git,node_modules,coverage,vendor,build}/*" ' - " command! -bang -nargs=* Strings call fzf#vim#grep(g:rg_command .shellescape(<q-args>), 1, <bang>0) + + " NOTES + " the {'options': '-e'} limits to only search literal text https://github.com/BurntSushi/ripgrep/issues/1119 + " the {'options': '--delimiter : --nth 4..'} option limit the string search only for file content command! -bang -nargs=* StringsAll \ call fzf#vim#grep( \ 'rg --column --line-number --hidden --no-ignore --no-heading --color=always --smart-case -- '.shellescape(<q-args>), 1, \ fzf#vim#with_preview({'options': '--preview-window=down:50% --layout=reverse --delimiter : --nth 4..'}), <bang>0) + " OLD + " command! -bang -nargs=* Strings call fzf#vim#grep(g:rg_command .shellescape(<q-args>), 1, <bang>0) command! -bang -nargs=* Strings \ call fzf#vim#grep( \ 'rg --column --line-number --hidden --glob "!{.git,node_modules,flow-typed,operation-types.flow.js,generatedTypes}" --no-heading --color=always --smart-case -- '.shellescape(<q-args>), 1, \ fzf#vim#with_preview({'options': '--preview-window=down:50% --layout=reverse --delimiter : --nth 4..'}), <bang>0) - command! -bang -nargs=* StringsAndFile + command! -bang -nargs=* StringsWhole + \ call fzf#vim#grep( + \ 'rg --column --line-number --hidden --glob "!{.git,node_modules,flow-typed,operation-types.flow.js,generatedTypes}" --no-heading --color=always --smart-case -- '.shellescape(<q-args>), 1, + \ fzf#vim#with_preview({'options': '-e --preview-window=down:50% --layout=reverse --delimiter : --nth 4..'}), <bang>0) + command! -bang -nargs=* StringsAndFileWhole \ call fzf#vim#grep( \ 'rg --column --line-number --hidden --glob "!{.git,node_modules,flow-typed,operation-types.flow.js,generatedTypes}" --no-heading --color=always --smart-case -- '.shellescape(<q-args>), 1, - \ fzf#vim#with_preview({'options': '--preview-window=down:50% --layout=reverse'}), <bang>0) - " the {'options': '--delimiter : --nth 4..'} option limit the string search - " only for file content + \ fzf#vim#with_preview({'options': '-e --preview-window=down:50% --layout=reverse'}), <bang>0) command! -bang -nargs=? -complete=dir FilesAll \ call fzf#vim#files(<q-args>, fzf#vim#with_preview({'options': ['--preview-window=down:50%', '--layout=reverse', '--info=inline']}), <bang>0) @@ -364,7 +374,8 @@ nnoremap gB :bprevious<cr> " nnoremap <C-o> :Strings<cr> " nnoremap <C-i> :Files<cr> noremap <C-i> :Strings<cr> - noremap <C-s> :StringsAndFile<cr> + noremap <C-s> :StringsWhole<cr> + noremap <leader><C-s> :StringsAndFileWhole<cr> noremap <leader><C-i> :StringsAll<cr> noremap <C-p> :Files --cached --others --exclude-standard<cr> noremap <leader><C-p> :FilesAll<cr> diff --git a/.doom.d/config.el b/.doom.d/config.el @@ -1,255 +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. -(setq user-full-name "Yohanes Bandung Bondowoso" - user-mail-address "hi@ybbond.dev") - -;; Doom exposes five (optional) variables for controlling fonts in Doom. Here -;; are the three important ones: -;; -;; + `doom-font' -;; + `doom-variable-pitch-font' -;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for -;; presentations or streaming. -;; -;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd -;; font string. You generally only need these two: -;; (setq doom-font (font-spec :family "monospace" :size 12 :weight 'semi-light) -;; doom-variable-pitch-font (font-spec :family "sans" :size 13)) - -(setq doom-theme 'doom-gruvbox) - -(setq display-line-numbers-type 'relative) -(setq whitespace-action '(auto-cleanup)) -(setq savehist-mode -1) - -(setq company-idle-delay nil) - -(setq org_dir "~/Dropbox/org/") -(setq org-adapt-indentation nil) - -(global-set-key (kbd "s-b") 'ivy-switch-buffer) -(global-set-key (kbd "s-K") 'kill-buffer) -(global-set-key (kbd "s-l") 'org-roam-find-file) - -;; Better Copy-Paste and Clipboard Handling -;; Disable Emacs' integration of killring with clipboard -(setq select-enable-clipboard nil) -;; Remove hook for clipboard configurations from Emacs to command mode -(remove-hook 'tty-setup-hook 'doom-init-clipboard-in-tty-emacs-h) -;; Enable ⌘+c and ⌘+v for clipboard handling -(defun rc-clipboard-yank () - "Copies the active region to the system clipboard." - (interactive) - (when (region-active-p) - (gui-set-selection 'CLIPBOARD - (buffer-substring (region-beginning) (region-end))))) -(defun rc-clipboard-paste () - "Pastes text from the system clipboard." - (interactive) - (let ((text (gui-get-selection 'CLIPBOARD))) - (when text (insert-for-yank text)))) -(map! :v "s-c" #'rc-clipboard-yank - :nvi "s-v" #'rc-clipboard-paste) -(define-key! :keymaps '(evil-ex-completion-map) "s-v" #'rc-clipboard-paste) -(define-key! :keymaps +default-minibuffer-maps "s-v" #'rc-clipboard-paste) - -;; General Configurations -;; (use-package! general -;; :config -;; (general-evil-setup)) - -;; Evil -(use-package! evil - :init - (setq evil-move-cursor-back nil) - ;; (setq evil-respect-visual-line-mode t) - (setq evil-kill-on-visual-paste nil) - (setq evil-disable-insert-state-bindings t)) - ;; :general - ;; ([remap evil-emacs-state] 'evil-normal-state) - ;; (general-nmap "j" 'evil-next-visual-line) - ;; (general-nmap "k" 'evil-previous-visual-line) - ;; (general-nmap "gj" 'evil-next-line) - ;; (general-nmap "gk" 'evil-previous-line) - ;; (general-imap "C-f" 'delete-forward-char)) -(map! :after evil - :map evil-normal-state-map - "C-z" 'evil-normal-state - "j" 'evil-next-visual-line - "k" 'evil-previous-visual-line - "gj" 'evil-next-line - "gk" 'evil-previous-line - :map evil-insert-state-map - "C-f" 'delete-forward-char - "C-z" 'evil-normal-state) - -;; Snipe -(after! evil-snipe - (setq evil-snipe-smart-case t) - (setq evil-snipe-scope 'whole-buffer) - (setq evil-snipe-auto-scroll t) - (setq evil-snipe-repeat-keys t) - (setq evil-snipe-repeat-scope 'whole-buffer)) - -;; Ivy -(map! :after ivy - :map ivy-minibuffer-map - "S-SPC" nil - "C-SPC" 'ivy-restrict-to-matches) - -;; Dired -(after! dired - ;; (setq dired-listing-switches "-aBhl --group-directories-first" - (setq dired-listing-switches "-aBhl" - dired-dwim-target t - dired-recursive-copies (quote always) - dired-recursive-deletes (quote top))) - -;; Deft -(use-package! deft - :after org - :config - (setq deft-recursive t) - ;; (setq deft-use-filter-string-for-filename t) - (setq deft-default-extension "org") - (setq deft-incremental-search t) - (setq deft-directory org_dir) - (add-hook 'after-init-hook 'org-roam-db-build-cache) - :bind - ("s-d" . deft)) - -;; Org-roam -(use-package! org-roam - :hook - (after-init . org-roam-mode)) -(after! org-roam - (add-hook 'after-init-hook 'org-roam-mode) - :config - (setq org-roam-directory org_dir) - (setq org-roam-db-location "~/org/org-roam.db") - (setq org-roam-link-title-format "[[%s]]") - (set-company-backend! 'org-mode '(company-capf)) - - (setq org-roam-dailies-capture-templates - '(("d" "daily" plain (function org-roam-capture--get-point) - "%?" - :file-name "%<%Y-%m-%d>" - :immediate-finish t - :head "#+title: %<%A>, %<%d> %<%B> %<%Y> -#+roam_tags: journals\n -\n -* %<%A>, %<%d> %<%B> %<%Y>" - :unnarrowed t))) - - (setq org-roam-capture-templates - '(("d" "default" plain (function org-roam-capture--get-point) - "%?" - :file-name "%<%Y%m%d%H%M%S>-${slug}" - :head "#+title: ${title}\n" - :immediate-finish t - :unnarrowed t) - ("k" "kumparan" plain (function org-roam-capture--get-point) - "%?" - :file-name "%<%Y%m%d%H%M%S>-${slug}" - :head "#+title: ${title} -#+roam_tags: kumparan -- backlinks :: [[file:20200630143644-kumparan.org][kumparan]]" - :immediate-finish t - :unnarrowed t) - ("c" "companies" plain (function org-roam-capture--get-point) - "%?" - :file-name "%<%Y%m%d%H%M%S>-${slug}" - :head "#+title: ${title} -#+roam_tags: companies\n" - :immediate-finish t - :unnarrowed t) - ("m" "medias" plain (function org-roam-capture--get-point) - "%?" - :file-name "%<%Y%m%d%H%M%S>-${slug}" - :head "#+title: ${title} -#+roam_tags: medias\n" - :immediate-finish t - :unnarrowed t) - ("p" "products" plain (function org-roam-capture--get-point) - "%?" - :file-name "%<%Y%m%d%H%M%S>-${slug}" - :head "#+title: ${title} -#+roam_tags: products\n" - :immediate-finish t - :unnarrowed t) - ("i" "people" plain (function org-roam-capture--get-point) - "%?" - :file-name "%<%Y%m%d%H%M%S>-${slug}" - :head "#+title: ${title} -#+roam_tags: people\n" - :immediate-finish t - :unnarrowed t)))) - -;; Org-journal -(use-package! org-journal - :bind - ("C-c j" . org-journal-new-entry) - ("C-c b" . org-journal-previous-entry) - ("C-c f" . org-journal-next-entry) - :config - (setq org-journal-dir org_dir - org-journal-date-prefix "#+title: " - org-journal-file-format "%Y-%m-%d.org" - org-journal-date-format "%A, %d %B %Y\n")) - -;; Org-mode -(after! org - :init - (require 'find-lisp) - (setq org-agenda-files (find-lisp-find-files org_dir "tasks\.org$")) - (setq org-agenda-start-with-log-mode '(state)) - (setq org-agenda-start-day "-9d") - (map! :map org-mode-map - :n "gj" #'evil-next-line - :n "gk" #'evil-previous-line - :n "M-j" #'org-metadown - :n "M-k" #'org-metaup - :n "C-s-r" #'org-roam-insert - :i "C-s-r" #'org-roam-insert - :n "s-r" #'org-roam-buffer-toggle-display - :i "s-r" #'org-roam-buffer-toggle-display) - :config - (setq org-directory org_dir - org-ellipsis " ▼ " - org-id-link-to-org-use-id nil - org-pretty-entities t - org-log-done 'note - org-log-into-drawer t - org-log-refile t - org-src-fontify-natively t - org-hide-emphasis-markers t) - (setq org-todo-keywords - '((sequence "TODO(t!)" "INPROGRESS(p!)" "INTEST(i!)" "FEEDBACK(f!)" "HOLD(h!)" "|" "MERGED(m!)" "DONE(d@/!)" "CANCELLED(c!)") - (sequence "[ ](T)" "[-](S)" "[?](W)" "|" "[X](D)"))) - (setq org-todo-keyword-faces - '(("TODO" :foreground "ffff00" :weight normal :underline t) - ("INPROGRESS" :foreground "#e39ff6" :weight normal :underline t) - ("INTEST" :foreground "#0098dd" :weight normal :underline t) - ("FEEDBACK" :foreground "#0098ee" :weight normal :underline t) - ("HOLD" :foreground "#9f7efe" :weight normal :underline t) - ("MERGED" :foreground "#50a14f" :weight normal :underline t) - ("DONE" :foreground "#50a14f" :weight bold :underline t) - ("CANCELLED" :foreground "#ff6480" :weight normal :underline t) - ("[-]" :foreground "#e39ff6" :weight bold) - ("[?]" :foreground "#9f7efe" :weight bold))) - (setq org-roam-dailies-capture-templates - '(("d" "daily" plain (function org-roam-capture--get-point) - "%?" - :file-name "%<%Y-%m-%d>" - :immediate-finish t - :head "#+title: %<%A>, %<%d> %<%B> %<%Y> -#+roam_tags: journals\n -\n -* %<%A>, %<%d> %<%B> %<%Y>" - :unnarrowed t)))) diff --git a/.doom.d/init.el b/.doom.d/init.el @@ -1,183 +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 "Module Index" link where you'll find -;; a comprehensive list of Doom's modules and 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 - ;;chinese - ;;japanese - ;;layout ; auie,ctsrnm is the superior home row - - :completion - (company +childframe) ; 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 - - :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 - ;;fill-column ; a `fill-column' indicator - 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 ; tasing you for misspelling mispelling - ;;grammar ; tasing grammar mistake every you make - - :tools - ;;ansible - ;;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 - 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... - ;;cc ; C/C++/Obj-C madness - ;;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 - ;;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 - ;;faust ; dsp, but you get to keep your soul - ;;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 - ;;(haskell +dante) ; a language that's lazier than I am - ;;hy ; readability of scheme w/ speed of python - ;;idris ; - ;;json ; At least it ain't XML - ;;(java +meghanada) ; 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 - ;;factor - ;;ledger ; an accounting system in Emacs - ;;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 +journal) ; 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 ; Fe2O3.unwrap().unwrap().unwrap().unwrap() - ;;scala ; java, but good - ;;scheme ; 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 - - :email - ;;(mu4e +gmail) - ;;notmuch - ;;(wanderlust +gmail) - - :app - ;;calendar - ;;irc ; how neckbeards socialize - ;;(rss +org) ; emacs as an RSS reader - ;;twitter ; twitter client https://twitter.com/vnought - - :config - ;;literate - (default +bindings +smartparens)) diff --git a/.doom.d/packages.el b/.doom.d/packages.el @@ -1,53 +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) - -(package! org-roam - :recipe (:host github :repo "org-roam/org-roam")) diff --git a/.gitconfig b/.gitconfig @@ -15,9 +15,9 @@ hist40 = "--no-pager log --pretty=format:'%C(yellow)%h%C(reset) %C(green)%ad%C(reset) | %C(reset)%s %C(bold)[%an]%C(reset) %C(blue)%d%C(reset)' --graph --date=short --max-count=40" [user] - name = Yohanes Bandung Bondowoso - email = hi@ybbond.id - signingkey = 56DAADB152461C806792DBAB84773B93988681A0 + name = Yohanes Bandung Bondowoso + email = hi@ybbond.id + signingkey = 56DAADB152461C806792DBAB84773B93988681A0 [filter "lfs"] clean = git-lfs clean -- %f diff --git a/.hammerspoon/init.lua b/.hammerspoon/init.lua @@ -1,177 +1,210 @@ --- option + ctrl + h to make active window half to the left -hs.hotkey.bind({"alt", "ctrl"}, "H", function() - local win = hs.window.focusedWindow() - local f = win:frame() - local screen = win:screen() - local max = screen:frame() - - f.x = max.x - f.y = max.y - f.w = max.w / 2 - f.h = max.h - win:setFrame(f) -end) - --- option + ctrl + l to make active window half to the right -hs.hotkey.bind({"alt", "ctrl"}, "L", function() - local win = hs.window.focusedWindow() - local f = win:frame() - local screen = win:screen() - local max = screen:frame() - - f.x = max.x + (max.w / 2) - f.y = max.y - f.w = max.w / 2 - f.h = max.h - win:setFrame(f) -end) - --- option + ctrl + j to make active window two-third to the left -hs.hotkey.bind({"alt", "ctrl"}, "J", function() - local win = hs.window.focusedWindow() - local f = win:frame() - local screen = win:screen() - local max = screen:frame() - - f.x = max.x - f.y = max.y - f.w = max.w * (2/3) - f.h = max.h - win:setFrame(f) -end) - --- option + ctrl + k to make active window two-third to the right -hs.hotkey.bind({"alt", "ctrl"}, "K", function() - local win = hs.window.focusedWindow() - local f = win:frame() - local screen = win:screen() - local max = screen:frame() - - f.x = max.x + (max.w * (1/3)) - f.y = max.y - f.w = max.w * (2/3) - f.h = max.h - win:setFrame(f) -end) - --- option + ctrl + i to make active window one-third to the right -hs.hotkey.bind({"alt", "ctrl"}, "I", function() - local win = hs.window.focusedWindow() - local f = win:frame() - local screen = win:screen() - local max = screen:frame() - - f.x = max.x + (max.w * (2/3)) - f.y = max.y - f.w = max.w * (1/3) - f.h = max.h - win:setFrame(f) -end) - --- option + ctrl + u to make active window one-third to the left -hs.hotkey.bind({"alt", "ctrl"}, "U", function() - local win = hs.window.focusedWindow() - local f = win:frame() - local screen = win:screen() - local max = screen:frame() - - f.x = max.x - f.y = max.y - f.w = max.w * (1/3) - f.h = max.h - win:setFrame(f) -end) - --- option + ctrl + s to make active window three-fourth to the left -hs.hotkey.bind({"alt", "ctrl"}, "S", function() - local win = hs.window.focusedWindow() - local f = win:frame() - local screen = win:screen() - local max = screen:frame() - - f.x = max.x - f.y = max.y - f.w = max.w * (3/4) - f.h = max.h - win:setFrame(f) -end) - --- option + ctrl + d to make active window aligned right -hs.hotkey.bind({"alt", "ctrl"}, "D", function() - local win = hs.window.focusedWindow() - local f = win:frame() - local screen = win:screen() - local max = screen:frame() - - f.x = max.x + max.w - f.w - f.y = max.y - win:setFrame(f) -end) - --- option + ctrl + c to make active window centered -hs.hotkey.bind({"alt", "ctrl"}, "C", function() - local win = hs.window.focusedWindow() - local f = win:frame() - local screen = win:screen() - local max = screen:frame() - - -- f.x = max.x + (max.w * (1/6)) - -- f.y = max.y + (max.h * (1/6)) - -- f.w = max.w * (2/3) - -- f.h = max.h * (2/3) - -- f.x = max.x + (max.w * (1/8)) - -- f.y = max.y + (max.h * (1/8)) - -- f.w = max.w * (3/4) - -- f.h = max.h * (3/4) - f.x = max.x + (max.w * (3/16)) - f.y = max.y + (max.h * (2/16)) - f.w = max.w * (5/8) - f.h = max.h * (6/8) - win:setFrame(f) -end) - --- option + ctrl + enter to make active window maximized -hs.hotkey.bind({"alt", "ctrl"}, "Return", function() - local win = hs.window.focusedWindow() - local f = win:frame() - local screen = win:screen() - local max = screen:frame() - - f.x = max.x - f.y = max.y - f.w = max.w - f.h = max.h - win:setFrame(f) -end) - --- option + ctrl + N to make active window centered tall -hs.hotkey.bind({"alt", "ctrl"}, "N", function() - local win = hs.window.focusedWindow() - local f = win:frame() - local screen = win:screen() - local max = screen:frame() - - f.x = max.x + (max.w * (4/16)) - f.w = max.w * (4/8) - f.y = max.y - f.h = max.h - win:setFrame(f) -end) - --- layoutWatcher = hs.eventtap.new({hs.eventtap.event.types.flagsChanged}, function(e) --- local flags = e:getFlags() --- if flags.cmd and not (flags.alt or flags.shift or flags.ctrl or flags.fn) then --- local keyCode = e:getKeyCode() --- if keyCode == 0x37 then --- hs.alert.show("left cmd key") --- elseif keyCode == 0x36 then --- hs.alert.show("right cmd key") --- end --- end --- end):start() - --- option + ctrl + r to reload config -hs.hotkey.bind({"alt", "ctrl"}, "R", function() +local hyper = {'cmd', 'alt', 'ctrl', 'shift'} + +-- Load and create a new switcher +local HyperKey = hs.loadSpoon("HyperKey") +hyperKey = HyperKey:new(hyper) + +-- Bind some applications to keys +hyperKey + :bind('l'):toApplication('/Applications/FSNotes.app') + +-- Bind some functions to keys +local reloadHammerspoon = function() + -- hs.application.launchOrFocus("Hammerspoon") hs.reload() -end) -hs.alert.show("Config loaded") +end + +hyperKey + :bind('r'):toFunction("Reload Hammerspoon", reloadHammerspoon) + +-------------------------------------------------------------------- +-- screen manipulation +-------------------------------------------------------------------- + +-- -- option + ctrl + h to make active window half to the left +-- hs.hotkey.bind({"alt", "ctrl"}, "H", function() +-- local win = hs.window.focusedWindow() +-- local f = win:frame() +-- local screen = win:screen() +-- local max = screen:frame() + +-- f.x = max.x +-- f.y = max.y +-- f.w = max.w / 2 +-- f.h = max.h +-- win:setFrame(f) +-- end) + +-- -- option + ctrl + l to make active window half to the right +-- hs.hotkey.bind({"alt", "ctrl"}, "L", function() +-- local win = hs.window.focusedWindow() +-- local f = win:frame() +-- local screen = win:screen() +-- local max = screen:frame() + +-- f.x = max.x + (max.w / 2) +-- f.y = max.y +-- f.w = max.w / 2 +-- f.h = max.h +-- win:setFrame(f) +-- end) + +-- -- option + ctrl + j to make active window two-third to the left +-- hs.hotkey.bind({"alt", "ctrl"}, "J", function() +-- local win = hs.window.focusedWindow() +-- local f = win:frame() +-- local screen = win:screen() +-- local max = screen:frame() + +-- f.x = max.x +-- f.y = max.y +-- f.w = max.w * (2/3) +-- f.h = max.h +-- win:setFrame(f) +-- end) + +-- -- option + ctrl + k to make active window two-third to the right +-- hs.hotkey.bind({"alt", "ctrl"}, "K", function() +-- local win = hs.window.focusedWindow() +-- local f = win:frame() +-- local screen = win:screen() +-- local max = screen:frame() + +-- f.x = max.x + (max.w * (1/3)) +-- f.y = max.y +-- f.w = max.w * (2/3) +-- f.h = max.h +-- win:setFrame(f) +-- end) + +-- -- option + ctrl + i to make active window one-third to the right +-- hs.hotkey.bind({"alt", "ctrl"}, "I", function() +-- local win = hs.window.focusedWindow() +-- local f = win:frame() +-- local screen = win:screen() +-- local max = screen:frame() + +-- f.x = max.x + (max.w * (2/3)) +-- f.y = max.y +-- f.w = max.w * (1/3) +-- f.h = max.h +-- win:setFrame(f) +-- end) + +-- -- option + ctrl + u to make active window one-third to the left +-- hs.hotkey.bind({"alt", "ctrl"}, "U", function() +-- local win = hs.window.focusedWindow() +-- local f = win:frame() +-- local screen = win:screen() +-- local max = screen:frame() + +-- f.x = max.x +-- f.y = max.y +-- f.w = max.w * (1/3) +-- f.h = max.h +-- win:setFrame(f) +-- end) + +-- -- option + ctrl + s to make active window three-fourth to the left +-- hs.hotkey.bind({"alt", "ctrl"}, "S", function() +-- local win = hs.window.focusedWindow() +-- local f = win:frame() +-- local screen = win:screen() +-- local max = screen:frame() + +-- f.x = max.x +-- f.y = max.y +-- f.w = max.w * (3/4) +-- f.h = max.h +-- win:setFrame(f) +-- end) + +-- -- option + ctrl + d to make active window aligned right +-- hs.hotkey.bind({"alt", "ctrl"}, "D", function() +-- local win = hs.window.focusedWindow() +-- local f = win:frame() +-- local screen = win:screen() +-- local max = screen:frame() + +-- f.x = max.x + max.w - f.w +-- f.y = max.y +-- win:setFrame(f) +-- end) + +-- -- option + ctrl + c to make active window centered +-- hs.hotkey.bind({"alt", "ctrl"}, "C", function() +-- local win = hs.window.focusedWindow() +-- local f = win:frame() +-- local screen = win:screen() +-- local max = screen:frame() + +-- -- f.x = max.x + (max.w * (1/6)) +-- -- f.y = max.y + (max.h * (1/6)) +-- -- f.w = max.w * (2/3) +-- -- f.h = max.h * (2/3) +-- -- f.x = max.x + (max.w * (1/8)) +-- -- f.y = max.y + (max.h * (1/8)) +-- -- f.w = max.w * (3/4) +-- -- f.h = max.h * (3/4) +-- f.x = max.x + (max.w * (3/16)) +-- f.y = max.y + (max.h * (2/16)) +-- f.w = max.w * (5/8) +-- f.h = max.h * (6/8) +-- win:setFrame(f) +-- end) + +-- -- option + ctrl + c to make active window centered smaller +-- hs.hotkey.bind({"alt", "ctrl", "shift"}, "C", function() +-- local win = hs.window.focusedWindow() +-- local f = win:frame() +-- local screen = win:screen() +-- local max = screen:frame() + +-- f.x = max.x + (max.w * (5/16)) +-- f.y = max.y + (max.h * (2/16)) +-- f.w = max.w * (3/8) +-- f.h = max.h * (6/8) +-- win:setFrame(f) +-- end) + +-- -- option + ctrl + enter to make active window maximized +-- hs.hotkey.bind({"alt", "ctrl"}, "Return", function() +-- local win = hs.window.focusedWindow() +-- local f = win:frame() +-- local screen = win:screen() +-- local max = screen:frame() + +-- f.x = max.x +-- f.y = max.y +-- f.w = max.w +-- f.h = max.h +-- win:setFrame(f) +-- end) + +-- -- option + ctrl + N to make active window centered tall +-- hs.hotkey.bind({"alt", "ctrl"}, "N", function() +-- local win = hs.window.focusedWindow() +-- local f = win:frame() +-- local screen = win:screen() +-- local max = screen:frame() + +-- f.x = max.x + (max.w * (4/16)) +-- f.w = max.w * (4/8) +-- f.y = max.y +-- f.h = max.h +-- win:setFrame(f) +-- end) + +-- -- layoutWatcher = hs.eventtap.new({hs.eventtap.event.types.flagsChanged}, function(e) +-- -- local flags = e:getFlags() +-- -- if flags.cmd and not (flags.alt or flags.shift or flags.ctrl or flags.fn) then +-- -- local keyCode = e:getKeyCode() +-- -- if keyCode == 0x37 then +-- -- hs.alert.show("left cmd key") +-- -- elseif keyCode == 0x36 then +-- -- hs.alert.show("right cmd key") +-- -- end +-- -- end +-- -- end):start() + +hs.alert.show("Config loaded")+ \ No newline at end of file diff --git a/.vimrc b/.vimrc @@ -23,11 +23,41 @@ set hlsearch nnoremap <LEADER><SPACE> :nohlsearch<CR> nnoremap <LEADER>% :source %<CR> -inoremap jk <ESC> nnoremap j gj nnoremap k gk -vnoremap j gj -vnoremap k gk + +inoremap jk <ESC> +inoremap <C-D> <DEL> + +" navigating buffers +nnoremap gb :bnext<cr> +nnoremap gB :bprevious<cr> + +augroup numbertoggle + if &number == 1 + autocmd! + autocmd BufEnter,FocusGained,InsertLeave * set relativenumber + autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber + endif +augroup end + +function ToggleNumberToggle(numberVar) + " Reset group + augroup numbertoggle + autocmd! + augroup end + + " Enable if toggled on + if a:numberVar + augroup numbertoggle + if &number == 1 + autocmd! + autocmd BufEnter,FocusGained,InsertLeave * set relativenumber + autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber + endif + augroup end + endif +endfunction if !isdirectory($HOME."/.vim") call mkdir($HOME."/.vim", "", 0770) @@ -42,19 +72,4 @@ if has ('persistent_undo') set undoreload=500 endif -if exists('$TMUX') - " tmux will only forward escape sequences to the terminal if surrounded by a DCS sequence - let &t_SI .= "\<Esc>Ptmux;\<Esc>\<Esc>[5 q\<Esc>\\" - let &t_SR .= "\<Esc>Ptmux;\<Esc>\<Esc>[4 q\<Esc>\\" - let &t_EI .= "\<Esc>Ptmux;\<Esc>\<Esc>[1 q\<Esc>\\" - autocmd VimLeave * silent !echo -ne "\033Ptmux;\033\033[0 q\033\\" -else - " make the ^[ sign with: - " (INSERT MODE) <C-v><ESC> - " make sure it shows different color than the rest - set t_SI=[5\ q - set t_SR=[4\ q - set t_EI=[1\ q -endif - set rtp+=/usr/local/opt/fzf diff --git a/.zshrc b/.zshrc @@ -25,9 +25,10 @@ SPACESHIP_PROMPT_ORDER=( exec_time jobs exit_code - # vi_mode + vi_mode char ) + SPACESHIP_PROMPT_FIRST_PREFIX_SHOW=true SPACESHIP_PROMPT_SEPARATE_LINE=false SPACESHIP_BATTERY_SHOW=always @@ -41,6 +42,7 @@ SPACESHIP_GIT_SUFFIX=']' SPACESHIP_GIT_BRANCH_PREFIX='•' SPACESHIP_GIT_BRANCH_SUFFIX='•' # SPACESHIP_GIT_STATUS_COLOR='#da2c20' +SPACESHIP_VI_MODE_COLOR=grey SPACESHIP_GIT_STATUS_PREFIX='<' SPACESHIP_GIT_STATUS_SUFFIX='>' SPACESHIP_DIR_PREFIX='[' @@ -175,6 +177,9 @@ bindkey -M viins '^F' autosuggest-accept bindkey -M viins '^P' history-substring-search-up bindkey -M viins '^N' history-substring-search-down +if command -v pyenv 1>/dev/null 2>&1; then + eval "$(pyenv init -)" +fi ######################################################################## # END OF BANDUNG's EXPORTS @@ -216,14 +221,6 @@ function test_kantal { echo "now your @ argument $@" } -function tempjson { - nvim ~/tempjson$1.json -} - -function commit { - git add . && git commit -m "$1" -} - nn () { # Block nesting of nnn in subshells @@ -264,7 +261,7 @@ export NNN_TRASH=1 # START OF BANDUNG's ALIASES ######################################################################## -eval "$(hub alias -s)" +# eval "$(hub alias -s)" # projects alias kapp="cd ${KUMPATH}/app" @@ -326,25 +323,27 @@ bindkey -M viins 'jk' vi-cmd-mode KEYTIMEOUT=10 # Change cursor shape for different vi modes. -function zle-keymap-select { - if [[ ${KEYMAP} == vicmd ]] || - [[ $1 = 'block' ]]; then - echo -ne '\e[1 q' - - elif [[ ${KEYMAP} == main ]] || - [[ ${KEYMAP} == viins ]] || - [[ ${KEYMAP} = '' ]] || - [[ $1 = 'beam' ]]; then - echo -ne '\e[5 q' - fi -} -zle -N zle-keymap-select - -_fix_cursor() { - echo -ne '\e[5 q' -} - -precmd_functions+=(_fix_cursor) +# function zle-keymap-select { +# if [[ ${KEYMAP} == vicmd ]] || +# [[ $1 = 'block' ]]; then +# echo -ne '\e[1 q' + +# elif [[ ${KEYMAP} == main ]] || +# [[ ${KEYMAP} == viins ]] || +# [[ ${KEYMAP} = '' ]] || +# [[ $1 = 'beam' ]]; then +# echo -ne '\e[5 q' +# fi +# } +# zle -N zle-keymap-select + +# _fix_cursor() { +# echo -ne '\e[5 q' +# } + +# precmd_functions+=(_fix_cursor) + +eval spaceship_vi_mode_enable precmd () { echo -n -e "\a"