~skiqqy/.dotfiles

952c6709f243efa7341e385ddf3f641f9dfcbe2d — Stephen Cochrane 3 months ago 36fe2e1
Tidy up vim, added support for atom
M Makefile => Makefile +5 -1
@@ 2,7 2,7 @@
DIR=$(shell pwd)

# Default install
all: setupbin bin install vim bash zsh
all: setupbin bin install vim bash zsh atom

update:
	git pull


@@ 26,6 26,9 @@ setupbin:
	cp $(DIR)/miscfiles/scripts/* ~/bin/local/
	-rm -f ~/bin/local/upd # We need to custom build this

atom:
	@bash miscfiles/atom/atom.sh install

# Sets up custom updating script based on install location
bin:
	$(shell echo "INSTALL_LOC=$(PWD)" > ~/bin/local/upd)


@@ 146,6 149,7 @@ uninstall: install
		echo "zsh uninstall succsesful!"; \
		rm -rf ~/.backup/.dfZSH; \
	fi
	-bash miscfiles/atom/atom.sh rm

test:
	bash .test.sh

A miscfiles/atom/atom.sh => miscfiles/atom/atom.sh +65 -0
@@ 0,0 1,65 @@
#!/usr/bin/env bash

ROOT=$(realpath "${BASH_SOURCE/atom.sh/}/../../") # Find the root of the project
! command -v atom && exit

# Add names of packages to install here
packages()
{
	cat << EOF
atom-ide-ui
ide-java
vim-modeline
vim-mode-plus
java-import-wiz
busy
EOF
}

add()
{
	! command -v apm && return
	rm -rf "$HOME/.backup/.atom"
	mv "$HOME/.atom/" "$HOME/.backup/.atom" 2> /dev/null
	mkdir -p "$HOME/.atom"
	touch "$HOME/.backup/.dfATOM"

	mapfile -t packages < <(packages)

	apm install ${packages[*]} # i want splitting

	for cfg in "$ROOT/miscfiles/atom"/*.cson
	do
		ln -s "$cfg" "$HOME/.atom/$(basename "$cfg")"
	done
}

remove()
{
	if [ -f "$HOME/.backup/.dfATOM" ]
	then
		rm -rf "$HOME/.atom"
		mv "$HOME/.backup/.atom" "$HOME/.atom"
		rm "$HOME/.dfATOM"
	else
		return
	fi
}

main()
{
	case "$1" in
		install|i)
			add
			;;
		remove|rm)
			remove
			;;
		*)
			echo "Unknown cmd: $1"
			exit 1
			;;
	esac
}

main "$@"

A miscfiles/atom/config.cson => miscfiles/atom/config.cson +17 -0
@@ 0,0 1,17 @@
"*":
  "atom-ide-ui":
    "atom-ide-diagnostics-ui": {}
  core:
    telemetryConsent: "no"
    themes: [
      "one-dark-ui"
      "gruvbox"
    ]
  editor: {}
  "exception-reporting":
    userId: "8f5a5545-ab60-4c8d-9dc0-a9a563747b7f"
  "ide-java":
    javaHome: "/home/skippy/.sdkman/candidates/java/current"
    virtualMachine: {}
  welcome:
    showOnStartup: false

A miscfiles/atom/keymap.cson => miscfiles/atom/keymap.cson +5 -0
@@ 0,0 1,5 @@
'atom-text-editor':
  'ctrl-shift-o': 'java-import-wiz:organize-imports'
  'shift-p': 'pane:show-previous-item'
  'shift-n': 'pane:show-next-item'
  'shift-x': 'core:close'

M miscfiles/vim/.vimrc => miscfiles/vim/.vimrc +4 -4
@@ 14,16 14,16 @@ endif
call plug#begin('~/.vim/plugged')
Plug 'dense-analysis/ale'
Plug 'tpope/vim-fugitive'
Plug 'sodapopcan/vim-twiggy'
Plug 'gregsexton/gitv'
Plug 'morhetz/gruvbox'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'rhysd/vim-clang-format'
Plug 'valloric/vim-indent-guides'
Plug 'fedorenchik/VimCalc3'
Plug 'airblade/vim-gitgutter'
Plug 'scrooloose/nerdtree'
"Plug 'sodapopcan/vim-twiggy'
"Plug 'gregsexton/gitv'
"Plug 'fedorenchik/VimCalc3'
"Plug 'rhysd/vim-clang-format'
call plug#end()
" }}}