Commit 1a3164b0 authored by treyzania's avatar treyzania

Made .bashrc and .profile more robust, also added .emacs setup.

parent ca1a6626
......@@ -7,12 +7,18 @@ case $- in
*) return;;
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
source $HOME/.profile
fi
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
shopt -s histappend > /dev/null
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=10000000
......@@ -20,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
shopt -s checkwinsize > /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
shopt -s globstar > /dev/null
# make less more friendly for non-text input files, see lesspipe(1)
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
......@@ -97,3 +103,8 @@ fi
# Github doesn't let you use the same key on multiple accounts.
alias gitdel='GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa.github-delbonis" git'
# machine-specific settings
if [ -f $HOME/'.bashrc.local' ]; then
source $HOME/'.bashrc.local'
fi
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives
(cons "gnu" (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)
; Column numbers!
(setq column-number-mode t)
(global-set-key (kbd "C-<PageUp>") 'windmove-left)
(global-set-key (kbd "C-<PageDown>") 'windmove-right)
(use-package company
:ensure t
:init (global-flycheck-mode))
(use-package flycheck)
(use-package neotree
:config
(global-set-key [f8] 'neotree-toggle)
(setq neo-theme 'arrow))
(use-package rust-mode
:config
(setq rust-format-on-save t))
(use-package cargo
:after rust-mode
:hook ((rust-mode . cargo-minor-mode)))
(use-package racer
:hook ((rust-mode . racer-mode)
(racer-mode . eldoc-mode)
(racer-mode . company-mode))
:config
(define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common)
(setq company-tooltip-align-annotations t)
(setq racer-cmd "~/.cargo/bin/racer" ;; Rustup binaries
racer-rust-src-path "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src")) ;; Rust source code
(use-package flycheck-rust
:hook ((flycheck-mode . flycheck-rust-setup)))
(use-package go-mode)
(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
; idk what this is
;(add-hook 'go-mode-hook )
; I don't think I need this.
(use-package rust-playground)
; which key just runs everywhere
(use-package which-key)
(which-key-mode)
; c
(use-package company-c-headers
:init
(add-to-list 'company-backends 'company-c-headers))
(add-hook 'c-mode-common-hook 'hs-minor-mode)
(setq c-default-style "linux")
(use-package cc-mode
:hook ((prog-mode . (lambda () (interactive)
(setq show-trailing-whitespace 1)))
(c-mode . (lambda ()
(define-key c-mode-base-map (kbd "<tab>") 'company-complete)))))
; idk what this is yet
;(use-package ggtags
; :hook ((c-mode . ggtags)))
; smoother scrolling
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ;; one line at a time
(setq mouse-wheel-progressive-speed nil) ;; don't accelerate scrolling
(setq mouse-wheel-follow-mouse 't) ;; scroll window under mouse
(setq scroll-step 1) ;; keyboard scroll one line at a time
(setq calendar-latitude 42)
(setq calendar-longitude -71)
(put 'scroll-left 'disabled nil)
(setq custom-file ".emacs.d/.custom.el")
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
......@@ -34,7 +28,7 @@ if [ -d ~/.opam ]; then
fi
# Maven
MVNDIR=/opt/apache-maven-3.5.2
MVNDIR=/opt/apache-maven-3.6.1
if [ -d $MVNDIR ]; then
export PATH="$MVNDIR/bin:$PATH"
fi
......@@ -52,3 +46,6 @@ 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