From 2ae16a5cf808b0c36a514889262dd7ddc597f489 Mon Sep 17 00:00:00 2001 From: js0ny Date: Thu, 20 Mar 2025 20:01:49 +0000 Subject: [PATCH] feat(ideavim): Use intellimacs as base for ideavim --- .gitignore | 2 ++ Justfile | 84 ++++++++++++++++++++++++++++++++++++++---------- common/ideavimrc | 20 ++++++++++-- 3 files changed, 87 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index a6d3409..0c31ce4 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,5 @@ lazy-lock.json # Emacs *.elc + +common/**/*current* \ No newline at end of file diff --git a/Justfile b/Justfile index 39bf3c6..80b773e 100644 --- a/Justfile +++ b/Justfile @@ -1,26 +1,76 @@ set shell := ["fish", "-c"] set windows-shell := ["pwsh", "-c"] -check_info: - shellcheck -x -s sh **/*.sh platforms/mac/yabairc - shellcheck -x -s bash **/*.bash tools/bash/* scripts/*.{sh,zsh,bash} **/*.bashrc -check: - shellcheck -x -s sh --severity=error **/*.sh platforms/mac/yabairc - shellcheck -x -s bash --severity=error **/*.bash tools/bash/* **/*.bashrc -format: - shfmt -w -i 2 -ci -bn -p **/*.sh - shfmt -w -i 2 -ci -bn -ln bash **/*.bash platforms/mac/sketchybar/sketchybarrc - # Ignore syntax errors in zsh files - shfmt -w -i 2 -ci -bn -ln bash **/*.zsh tools/zsh/**/* **/zshrc || true -pull: - git pull github master - git pull codeberg master +DOTFILES := join(home_directory(), ".dotfiles") +XDG_CONFIG_HOME := \ + if env_var("XDG_CONFIG_HOME") != "" {env_var("XDG_CONFIG_HOME")} \ + else { + if os_family() == "windows" { + env_var("APPDATA") + } else { + join(home_directory(), ".config") + } + } -push: - git push github master - git push codeberg master +XDG_DATA_HOME := \ + if env_var("XDG_DATA_HOME") != "" {env_var("XDG_DATA_HOME")} \ + else { + if os_family() == "windows" { + env_var("LOCALAPPDATA") + } else { + join(home_directory(), ".local/share") + } + } + + +test: + echo {{DOTFILES}} + echo {{XDG_CONFIG_HOME}} + echo {{XDG_DATA_HOME}} init: git remote remove origin git remote add github git@github.com:js0ny/dotfiles.git git remote add codeberg git@codeberg.org:js0ny/dotfiles.git + +check: + @just check_shell +format: + @just format_shell + + +push: + git push github master + git push codeberg master + +setup: + @just ideavim + +ideavim: + ln -sf {{DOTFILES}}/common/ideavimrc $XDG_CONFIG_HOME/ideavim/ideavimrc + git clone https://github.com/MarcoIeni/intellimacs {{join(home_directory(), ".local/share/intellimacs")}} + +[private] +pull: + git pull github master + git pull codeberg master + + +[private] +[unix] +check_shell: + shellcheck -x -s sh --severity=error **/*.sh platforms/mac/yabairc + shellcheck -x -s bash --severity=error **/*.bash tools/bash/* **/*.bashrc + +[private] +[unix] +format_shell: + shfmt -w -i 2 -ci -bn -p **/*.sh + shfmt -w -i 2 -ci -bn -ln bash **/*.bash platforms/mac/sketchybar/sketchybarrc + # Ignore syntax errors in zsh files + shfmt -w -i 2 -ci -bn -ln bash **/*.zsh tools/zsh/**/* **/zshrc || true + +[private] +check_info: + shellcheck -x -s sh **/*.sh platforms/mac/yabairc + shellcheck -x -s bash **/*.bash tools/bash/* scripts/*.{sh,zsh,bash} **/*.bashrc \ No newline at end of file diff --git a/common/ideavimrc b/common/ideavimrc index f4b0436..922446e 100644 --- a/common/ideavimrc +++ b/common/ideavimrc @@ -7,7 +7,16 @@ " Linking: " ln -sf $DOTFILES/common/ideavimrc $XDG_CONFIG_HOME/ideavim/ideavimrc -""" Basic Configs """ +source ~/.local/share/intellimacs/spacemacs.vim + +source ~/.local/share/intellimacs/extra.vim +source ~/.local/share/intellimacs/major.vim +source ~/.local/share/intellimacs/hybrid.vim + +source ~/.local/share/intellimacs/which-key.vim + + +" """ Basic Configs """ let mapleader = " " " set to """ Colemak """ @@ -25,6 +34,13 @@ noremap K N noremap j e noremap J E +noremap H :bp +noremap I :bn +noremap N 5j +noremap E 5k + + + " Y to yank to end of line noremap Y y$ @@ -95,7 +111,7 @@ nnoremap gr :action ShowUsages nnoremap gi :action GotoImplementation nnoremap gpi :action QuickImplementations nnoremap gs :action GotoSuperMethod -nnoremap ga :action +nnoremap ga :action ShowIntentionActions nnoremap gq :action ShowIntentionActions nnoremap ge :action GotoNextError