Commit 2608748c authored by treyzania's avatar treyzania

Lots and lots of changed to get Emacs on macOS to be nice, at least for Go.

parent 827b6311
......@@ -9,7 +9,7 @@ esac
# Make sure that we ran .profile, do it now just in case. This might happen on
# some macOS machines, I think.
if [ -z $TZ_DOT_PROFILE_RUN ]; then
if [ -z "$TZ_DOT_PROFILE_RUN" ]; then
source $HOME/.profile
fi
......@@ -18,7 +18,7 @@ fi
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend > /dev/null
shopt -s histappend 2> /dev/null
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=10000000
......@@ -26,11 +26,11 @@ HISTFILESIZE=20000000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize > /dev/null
shopt -s checkwinsize 2> /dev/null
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
shopt -s globstar > /dev/null
shopt -s globstar 2> /dev/null
# make less more friendly for non-text input files, see lesspipe(1)
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
......
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
......@@ -19,17 +20,29 @@
(global-set-key (kbd "C-<PageUp>") 'windmove-left)
(global-set-key (kbd "C-<PageDown>") 'windmove-right)
; macOS is dumb with how it handles sessions so we have to manually do this :(
(when (string-equal system-type "darwin")
(use-package exec-path-from-shell
:ensure t
:config
(exec-path-from-shell-copy-env "GOPATH") ; y u do dis 2 me?
(setq exec-path-from-shell-check-startup-files nil)) ; I know what I'm doing.
;(if (null (string-match-p "go/bin" (getenv "PATH")))
; (setenv "PATH" (concat (substitute-in-file-name "$HOME/.go/bin") ":" (getenv "PATH"))))
;(if (null (getenv "GOPATH"))
; (setenv "GOPATH" (substitute-in-file-name "$HOME/.go")))
(exec-path-from-shell-initialize))
;;; Core stuff
(use-package flycheck
:ensure t
:init (global-flycheck-mode)
:config
; BROKEN
(setq-default flycheck-disabled-checkers '(emacs-lisp-checkdoc))
)
(setq-default flycheck-disabled-checkers '(emacs-lisp-checkdoc)))
(use-package company
:ensure t)
:ensure t
:init (global-company-mode))
(use-package neotree
:ensure t
......@@ -37,6 +50,22 @@
(global-set-key [f8] 'neotree-toggle)
(setq neo-theme 'arrow))
(use-package lsp-mode
:ensure t
:hook (prog-mode . lsp)
:commands (lsp lsp-deferred)
:config
(setq lsp-enable-snippet nil))
; TODO Make this look nicer.
;(use-package lsp-ui
; :ensure t
; :commands lsp-ui)
(use-package company-lsp
:ensure t
:commands company-lsp)
;;; Rust stuff
(use-package rust-mode
:ensure t
......@@ -46,7 +75,7 @@
(use-package cargo
:ensure t
:after rust-mode
:hook ((rust-mode . cargo-minor-mode)))
:hook (rust-mode . cargo-minor-mode))
; We're probably not going to be using Racer if we're not on Linux.
; TODO Switch to using rls or rust-analyzer.
......@@ -72,23 +101,6 @@
:ensure t
:hook ((before-save . gofmt-before-save)))
; BROKEN
;(use-package company-go
; :hook ((go-mode . (lambda ()
; (set (make-local-variable 'company-backends) '(company-go))
; (company-mode))))
; :config
; (setq company-begin-commands '(self-insert-command))) ; autocomplete only after typing
; BROKEN
(use-package go-autocomplete
:ensure t
:config
(add-hook 'completion-at-point-functions 'go-complete-at-point))
; I don't think I need this.
;(use-package rust-playground)
;;; C stuff
(use-package cc-mode
:ensure t
......
......@@ -2,8 +2,11 @@
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# So that we're sure we ran this file.
export TZ_DOT_PROFILE_RUN=yup
# if running bash
if [ -n "$BASH_VERSION" ]; then
if [ -n "$BASH_VERSION" ] && [ -z "$TZ_DOT_BASHRC_RUN" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
......@@ -24,7 +27,7 @@ fi
# OPAM configuration
if [ -d ~/.opam ]; then
. /home/treyzania/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
. $HOME/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
fi
# Maven
......@@ -46,6 +49,3 @@ if [ -d ~/bin ]; then
fi
fi
# So that we're sure we ran this file.
export TZ_DOT_PROFILE_RUN=yup
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment