Browse Source

Define configuration

master
jcmdln 3 years ago
commit
75c303297f
8 changed files with 1045 additions and 0 deletions
  1. 71
    0
      .alias
  2. 16
    0
      .bashrc
  3. 161
    0
      .config/i3/config
  4. 546
    0
      .emacs
  5. 0
    0
      .gitignore
  6. 17
    0
      .profile
  7. 61
    0
      .tmux.conf
  8. 173
    0
      .vimrc

+ 71
- 0
.alias View File

@@ -0,0 +1,71 @@
# ~/.alias

## cp
alias cp="cp -ip"
alias cr="cp -ir"

## curl
alias hurl="curl -f#LO"

## df
alias df="df -h"
alias di="df -hi"

## dig
alias dit="dig +noall +nocmd +answer +multiline"

## du
alias du="du -hs ./*"

## free
alias free="free -h"

## ls
ls="-hSF --group-directories-first --color=auto"
alias l="ls -C $ls"
alias la="ls -aC $ls"
alias ll="ls -al $ls"
alias ls="ls -C $ls"

## mkdir
alias mkdir="mkdir -vp $@"

## more
alias more="less"

## mv
alias mv="mv -i"

## nano
alias nano="nano -EOSWcimx"

## ps
alias pss="ps -af | head -1; ps -af | grep -v grep"
alias psw="watch 'ps -af | sort -rk4'"

## rm
alias rf="rm -rf"
alias rm="rm -i"
alias rr="rm -ir"

## screen
alias screen="screen"

## scrot
alias ss="scrot -s ~/Pictures/'Screenshot-%Y%m%d'.png"

## tar
alias mktar="tar -zcvf archive_`date +%Y%m%d`-`date +%H%M%S`.tar.gz"
alias untar="tar -vxf"


### Extras #######################################

mkcd() {
mkdir -vp $1
cd $1
}

weather() {
curl http://wttr.in/$1
}

+ 16
- 0
.bashrc View File

@@ -0,0 +1,16 @@
# ~/.bashrc

[ -f /etc/bashrc ]; . /etc/bashrc
[ -f /etc/profile ]; . /etc/profile
[ -f ~/.bash_profile ]; . ~/.bash_profile
[ -f ~/.profile ]; . ~/.profile
[ -f ~/.alias ]; . ~/.alias

HISTTIMEFORMAT="(%m/%d/%y) %T "
PROMPT_COMMAND='history -a'
PS1="[\u@\h \W]$ "

shopt -s histappend
shopt -s checkwinsize

export HISTTIMEFORMAT PROMPT_COMMAND PS1

+ 161
- 0
.config/i3/config View File

@@ -0,0 +1,161 @@
# ~/.config/i3/config

## Set default modifier key to <Win>
set $mod Mod4

## Start program launcher
bindsym $mod+d exec dmenu_run
#bindsym $mod+d exec --no-startup-id i3-dmenu-desktop

## Start a terminal
bindsym $mod+Return exec gnome-terminal

## Reload i3
set $mode_reload Reload i3 config (r), Live restart of i3 (Shift+r)
bindsym $mod+Shift+r mode "$mode_reload"
mode "$mode_reload" {
bindsym r reload
bindsym Shift+r restart

bindsym Return mode "default"
bindsym Escape mode "default"
}

## System mode prompt
exec xset s off -dpms
set $Locker xset s 10 dpms 10 && i3lock -c 3f3f3f -n && xset s off -dpms
set $mode_system Lock (l), Logout (Shift+l), Suspend (s), Hibernate (h), Reboot (r), Shutdown (Shift+s)
bindsym $mod+Home mode "$mode_system"
mode "$mode_system" {
bindsym l exec --no-startup-id $Locker, mode "default"
bindsym Shift+l exec --no-startup-id i3-msg exit, mode "default"
bindsym s exec --no-startup-id $Locker && systemctl suspend, mode "default"
bindsym h exec --no-startup-id $Locker && systemctl hibernate, mode "default"
bindsym r exec --no-startup-id systemctl reboot, mode "default"
bindsym Shift+s exec --no-startup-id systemctl poweroff -i, mode "default"

bindsym Return mode "default"
bindsym Escape mode "default"
}


### Movement #####################################

## change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

## move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

## Window splitting
bindsym $mod+h split h
bindsym $mod+v split v

## Fullscreen focused container
bindsym $mod+f fullscreen toggle

## Cycle frame layout
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split

## Toggle floating on focused frame
bindsym $mod+Shift+space floating toggle

## change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle

## focus the parent container
bindsym $mod+a focus parent

## focus the child container
#bindsym $mod+d focus child

## switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10

## move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10

## Drag floating windows with Mouse+$mod
floating_modifier $mod

## Resize window
bindsym $mod+r mode "resize"
mode "resize" {
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt

bindsym Return mode "default"
bindsym Escape mode "default"
}

## kill focused window
bindsym $mod+Shift+q kill


### Appearance ###################################

## Window title font
font pango:monospace 8

## Start i3bar
bar {
status_command i3status
}


### Media ########################################

## Volume control
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle

bindsym XF86AudioPlay exec --no-startup-id pactl play-pause
bindsym XF86AudioPause exec --no-startup-id pactl pause

bindsym XF86AudioNext exec --no-startup-id pactl next
bindsym XF86AudioPrev exec --no-startup-id pactl previous

## Screen brightness control
bindsym XF86MonBrightnessUp exec xbacklight -inc 20
bindsym XF86MonBrightnessDown exec xbacklight -dec 20

+ 546
- 0
.emacs View File

@@ -0,0 +1,546 @@
;; ~/.emacs

;;; Startup ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(when (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(when (fboundp 'tool-bar-mode) (tool-bar-mode -1))

(setq
initial-scratch-message nil
inhibit-splash-screen t
inhibit-startup-buffer-menu t
column-number-mode t
visible-bell t

prefer-coding-system 'utf-8
set-default-coding-systems 'utf-8
set-language-environment "UTF-8"
set-locale-environment "en_US.UTF-8")

(fset 'yes-or-no-p 'y-or-n-p)
(global-visual-line-mode t)
(show-paren-mode t)
(xterm-mouse-mode t)

(load-theme 'tango-dark)
(set-face-attribute
'default nil
:family "Mono" :weight 'normal
:height 96 :width 'normal)


;;; Better Defaults ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Autosave/Backups
(setq
auto-save-default nil
auto-save-file-name-transforms `((".*" "~/.emacs.d/backup/" t))
backup-directory-alist `((".*" . "~/.emacs.d/backup/"))
delete-by-moving-to-trash t
delete-old-versions t
delete-selection-mode t
kept-new-versions 2
load-prefer-newer t
vc-follow-symlinks t
vc-make-backup-files t
version-control t)

;; Cut/Paste
(setq
require-final-newline t
save-interprogram-paste-before-kill t
select-enable-primary nil)

;; Indentation
(setq
c-basic-offset 2
cperl-indent-level 2
js-indent-level 2
indent-tabs-mode nil
tab-width 2)

;; Mouse
(setq
mouse-wheel-follow-mouse 't
mouse-wheel-progressive-speed nil
mouse-wheel-scroll-amount '(3 ((shift) . 3))
mouse-yank-at-point t)

;; Scrolling
(setq
auto-window-vscroll nil
scroll-conservatively 101
scroll-down-aggressively 0.0
scroll-margin 0
scroll-preserve-screen-position 1
scroll-step 1
scroll-up-aggressively 0.0)


;;; Custom ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages
(quote
(company ranger eww-lnum circe xclip undo-tree flycheck counsel company-go cmake-ide auto-dictionary auto-compile async rtags go-mode geiser elpy smartparens rainbow-delimiters highlight-indent-guides diff-hl package-utils use-package))))


;;; Repositories ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(require 'package)
(setq
package-user-dir "~/.emacs.d/pkg/"
package-archives
'(("GNU ELPA" . "http://elpa.gnu.org/packages/")
("MELPA Stable" . "https://stable.melpa.org/packages/")
("MELPA" . "https://melpa.org/packages/"))
package-archive-priorities
'(("MELPA Stable" . 3)
("GNU ELPA" . 2)
("MELPA" . 1)))
(package-initialize)

(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(require 'use-package)
(setq use-package-always-ensure t)
(use-package package-utils)


;;; Server ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(require 'server)
(unless (server-running-p)
(server-start))

(defun server-reinstall()
"Remove packages, then run server-reload"
(interactive)
(if (file-exists-p "~/.emacs.d/pkg")
(delete-directory "~/.emacs.d/pkg" t))
(server-reload))

(defun server-kill()
"Delete current Emacs server, then kill Emacs"
(interactive)
(server-force-delete)
(kill-emacs))

(defun server-reload()
"Reload init file"
(interactive)
(if (file-exists-p "~/.emacs.d/init.el")
(load-file "~/.emacs.d/init.el"))
(eshell-exports))

(defun server-stop()
"Prompt to save buffers, then kill Emacs."
(interactive)
(save-buffers-kill-emacs))

(defun server-update()
"Refresh package contents, then update all packages."
(interactive)
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
(package-utils-upgrade-all))


;;; Extras ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun eshell-exports()
"Store desired environment variables for eshell."
(setenv "EDITOR" "emacsclient")
(setenv "GIT_EDITOR" "emacsclient")
(setenv "PATH" (getenv "PATH"))
(setenv "PROMPT_COMMAND" "")
(setenv "SHELL" (getenv "SHELL"))
(setenv "TERM" (getenv "TERM")))

(defun eshell-new()
"Open a new instance of eshell."
(interactive)
(eshell 'N))

(defun eww-new()
"Open a new instance of eww."
(interactive)
(let ((url (read-from-minibuffer "Enter URL or keywords: ")))
(switch-to-buffer (generate-new-buffer "*eww*"))
(eww-mode)
(eww url)))

(defun scratch-new()
"Open a new scratch buffer."
(interactive)
(switch-to-buffer (generate-new-buffer "*scratch*"))
(lisp-mode))


;;; Input ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(global-set-key (kbd "C-x x") 'kill-buffer-and-window)
(global-set-key (kbd "<C-iso-lefttab>") 'previous-buffer)
(global-set-key (kbd "<backtab>") 'previous-buffer)
(global-set-key (kbd "<C-tab>") 'next-buffer)
(global-set-key (kbd "C-x C-b") 'ibuffer)
(global-set-key (kbd "<M-down>") 'windmove-down)
(global-set-key (kbd "<M-left>") 'windmove-left)
(global-set-key (kbd "<M-right>") 'windmove-right)
(global-set-key (kbd "<M-up>") 'windmove-up)
(global-set-key (kbd "C-c <down>") 'windmove-down)
(global-set-key (kbd "C-c <left>") 'windmove-left)
(global-set-key (kbd "C-c <right>") 'windmove-right)
(global-set-key (kbd "C-c <up>") 'windmove-up)

(global-set-key (kbd "<mouse-4>") (lambda() (interactive)(scroll-down 4)))
(global-set-key (kbd "<mouse-5>") (lambda() (interactive)(scroll-up 4)))

(global-set-key (kbd "C-c C-c") 'comment-or-uncomment-region)

(global-set-key
(kbd "C-x C-c")
(lambda() (interactive)
(if (y-or-n-p "Quit Emacs? ")
(server-stop))))

(global-set-key
(kbd "M--")
(lambda() (interactive)
(split-window-vertically)
(other-window 1 nil)
(switch-to-next-buffer)))

(global-set-key
(kbd "M-=")
(lambda() (interactive)
(split-window-horizontally)
(other-window 1 nil)
(switch-to-next-buffer)))


;;; Editor ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(add-hook 'lisp-mode-hook 'linum-mode)
(add-hook 'prog-mode-hook 'linum-mode)
(add-hook 'text-mode-hook 'linum-mode)

(add-hook
'before-save-hook
(lambda()
(delete-trailing-whitespace)
(if (not indent-tabs-mode)
(untabify (point-min)(point-max))
nil)))

(use-package diff-hl
:init
(add-hook 'prog-mode-hook 'diff-hl-mode)
(add-hook 'text-mode-hook 'diff-hl-mode))

(use-package highlight-indent-guides
:init
(add-hook 'prog-mode-hook 'highlight-indent-guides-mode)

:config
(setq highlight-indent-guides-method 'character))

(use-package ibuffer
:init
(add-hook
'ibuffer-hook
(lambda()
(ibuffer-do-sort-by-alphabetic)
(ibuffer-do-sort-by-major-mode))))

(use-package rainbow-delimiters
:init
(add-hook 'markdown-mode-hook 'rainbow-delimiters-mode)
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
(add-hook 'text-mode-hook 'rainbow-delimiters-mode))

(use-package smartparens
:init
(add-hook 'markdown-mode-hook 'smartparens-mode)
(add-hook 'prog-mode-hook 'smartparens-mode)
(add-hook 'text-mode-hook 'smartparens-mode)
:config
(setq
sp-highlight-pair-overlay nil
sp-highlight-wrap-overlay nil
sp-highlight-wrap-tag-overlay nil))


;;; Languages ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(use-package elpy
:init
(add-hook
'elpy-mode-hook
(lambda()
(setq
tab-width 4
indent-tabs-mode 1)))

:config
(elpy-enable))

;; (use-package geiser)

(use-package go-mode
:init
(add-hook 'before-save-hook 'gofmt-before-save)
(add-hook
'go-mode-hook
(lambda()
(setq
tab-width 4
indent-tabs-mode 1))))

;; (use-package rtags)


;;; Utilities ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(use-package async
:init
(async-bytecomp-package-mode '(all)))

(use-package auto-compile
:init
(auto-compile-on-load-mode)
(auto-compile-on-save-mode))

(use-package auto-dictionary)

;; (use-package cmake-ide
;; :init
;; (cmake-ide-setup))

(use-package company
:init
(add-hook 'prog-mode-hook 'company-mode)
(add-hook 'text-mode-hook 'company-mode))

(use-package company-go
:init
(setq
company-tooltip-limit 20
company-idle-delay .5
company-echo-delay 0
company-begin-commands '(self-insert-command)))

(use-package counsel
:config
(global-set-key (kbd "M-x") 'counsel-M-x)
(global-set-key (kbd "C-x C-f") 'counsel-find-file)
(global-set-key (kbd "<f1> f") 'counsel-describe-function)
(global-set-key (kbd "<f1> v") 'counsel-describe-variable)
(global-set-key (kbd "<f1> l") 'counsel-find-library)
(global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol)
(global-set-key (kbd "<f2> u") 'counsel-unicode-char)
(global-set-key (kbd "C-c g") 'counsel-git)
(global-set-key (kbd "C-c j") 'counsel-git-grep)
(global-set-key (kbd "C-c l") 'counsel-ag)
(global-set-key (kbd "C-x l") 'counsel-locate)
(global-set-key (kbd "C-S-o") 'counsel-rhythmbox)
(define-key read-expression-map (kbd "C-r") 'counsel-expression-history))

(use-package flycheck
:init
(add-hook 'prog-mode-hook 'flycheck-mode))

(use-package flymake)

(use-package flyspell
:init
(add-hook 'flyspell-mode-hook (auto-dictionary-mode 1))
(add-hook 'markdown-mode-hook 'flyspell-mode)
(add-hook 'prog-mode-hook 'flyspell-mode)
(add-hook 'text-mode-hook 'flyspell-mode))

(use-package ivy
:init
(ivy-mode 1)
(setq
ivy-use-virtual-buffers t
enable-recursive-minibuffers t)

:config
(global-set-key (kbd "C-c C-r") 'ivy-resume)
(global-set-key (kbd "<f6>") 'ivy-resume))

(use-package swiper
:init
(global-set-key "\C-s" 'swiper))

(use-package undo-tree)

(use-package xclip
:init
(xclip-mode 1))


;;; Misc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(use-package circe
:init
(add-hook 'circe-chat-mode-hook 'my-circe-prompt)
(add-hook 'circe-message-option-functions 'my-circe-message-option-chanserv)
(add-hook 'lui-mode-hook (lambda() (my-lui-setup)(my-circe-set-margin)))

:config
(require 'circe-chanop)
(enable-circe-color-nicks)

(setq
circe-default-part-message ""
circe-default-quit-message ""
circe-format-server-topic "*** Topic change by {userhost}: {topic-diff}"
circe-reduce-lurker-spam t
circe-use-cycle-completion t
lui-fill-type nil
lui-flyspell-alist '((".*" "american"))
lui-flyspell-p t
lui-time-stamp-format "%H:%M:%S"
lui-time-stamp-position 'left-margin)

(defun my-circe-set-margin() (setq left-margin-width 8))
(setf (cdr (assoc 'continuation fringe-indicator-alist)) nil)

(defun my-lui-setup()
(setq
fringes-outside-margins t
left-margin-width 8
word-wrap t
wrap-prefix " "))

(defun my-circe-prompt()
(lui-set-prompt
(concat (propertize
(concat (buffer-name) ">")
'face 'circe-prompt-face)
" ")))

(defun my-circe-message-option-chanserv (nick user host command args)
(when (and (string= "ChanServ" nick)
(string-match "^\\[#.+?\\]" (cadr args)))
'((dont-display . t))))

(if (file-exists-p "~/.emacs.d/circe.el")
(load-file "~/.emacs.d/circe.el")))

(use-package eshell
:init
(add-hook
'eshell-mode-hook
(lambda()
(eshell-exports)

(add-to-list 'eshell-visual-commands "htop")
(add-to-list 'eshell-visual-commands "less")
(add-to-list 'eshell-visual-commands "nano")
(add-to-list 'eshell-visual-commands "ssh")
(add-to-list 'eshell-visual-commands "tail")
(add-to-list 'eshell-visual-commands "top")
(add-to-list 'eshell-visual-commands "vi")
(add-to-list 'eshell-visual-commands "vim")
(add-to-list 'eshell-visual-commands "watch")

;; clear
(eshell/alias "clear" "\clear $*")

;; cp
(eshell/alias "cp" "cp -ip $*")
(eshell/alias "cr" "cp -ipr $*")

;; curl
(eshell/alias "hurl" "curl --fail --location --remote-name-all --progress-bar $*")

;; df
(eshell/alias "df" "df -h $*")
(eshell/alias "di" "df -hi $*")

;; dig
(eshell/alias "dit" "dig +noall +nocmd +answer +multiline $*")

;; du
(eshell/alias "du" "du -h --max-depth=1 | sort -hr $*")

;; free
(eshell/alias "free" "free -h $*")

;; ls
(eshell/alias "l" "ls -hSC --color=auto --group-directories-first $*")
(eshell/alias "la" "ls -ahSC --color=auto --group-directories-first $*")
(eshell/alias "ll" "ls -halS --color=auto --group-directories-first $*")
(eshell/alias "ls" "ls -hSC --color=auto --group-directories-first $*")

;; mkdir
(eshell/alias "mkcd" "mkdir -vp $1; cd $1")
(eshell/alias "mkdir" "mkdir -vp $*")

;; mv
(eshell/alias "mv" "mv -i $*")

;; ps
(eshell/alias "pss" "ps aux | grep -v grep | sort -hrk3 $*")
(eshell/alias "psw" "watch 'ps aux | grep -v grep | sort -hrk3'")

;; rm
(eshell/alias "rf" "rm -rf $*")
(eshell/alias "rm" "rm -i $*")
(eshell/alias "rr" "rm -ir $*")

;; tar
(eshell/alias "mkgz" "tar -vzcf $1.tar.gz $1")
(eshell/alias "mkxz" "tar -vcJf $1.tar.xz $1")
(eshell/alias "untar" "tar -vxf $*")))

:config
(setq
eshell-cmpl-cycle-completions nil
eshell-error-if-no-glob t
eshell-hist-ignoredups t
eshell-history-size 4096
eshell-prefer-lisp-functions nil
eshell-prompt-function
(lambda nil
(concat
"[" (user-login-name)"@"(system-name)" "
(if (= (length (eshell/pwd))
(length (getenv "HOME")))
"~"
(eshell/basename (eshell/pwd)))
"]"
(if (= (user-uid) 0) "# " "$ ")))
eshell-prompt-regexp "^[^#$\n]*[#$] "
eshell-save-history-on-exit t
eshell-scroll-to-bottom-on-input 'all))

(use-package eww
:config
(setq
browse-url-browser-function 'eww-browse-url
shr-blocked-images "http"))

(use-package eww-lnum
:config
(define-key eww-mode-map "f" 'eww-lnum-follow)
(define-key eww-mode-map "F" 'eww-lnum-universal))

(use-package ranger)

+ 0
- 0
.gitignore View File


+ 17
- 0
.profile View File

@@ -0,0 +1,17 @@
# ~/.profile

[ -n "$SSH_CLIENT" -a -z "`type -P cat`" ]; source /etc/profile

EDITOR="emacsclient"
LANG="en_US.UTF-8"
TERM="xterm-256color"

GOPATH="$HOME/.local/gopath"
GOROOT="$HOME/.local/goroot"

PROGPATH="$GOPATH:$GOROOT/bin"
GLOBALPATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin"
LOCALPATH="$HOME/.local/bin:$HOME/.bin:$HOME/bin"
PATH="$GLOBALPATH:$LOCALPATH:$PROGPATH"

export GOPATH GOROOT EDITOR LANG PATH TERM

+ 61
- 0
.tmux.conf View File

@@ -0,0 +1,61 @@
# ~/.tmux.conf

### General ######################################

## Force reload of config file
unbind r
bind r source-file ~/.tmux.conf

## Terminal
set-option -g xterm-keys on
set -g default-terminal "screen-256color"

## Keybind preference
setw -g mode-keys vi
set-option -g status-keys vi
set -g mouse on

## Display
set -s escape-time 0
set-option -g repeat-time 0
set -g base-index 1
setw -g pane-base-index 1

## Activate inner-most session (when nesting tmux) to send commands
bind a send-prefix

## History
set -g history-limit 4096


### Keybinds #####################################

## Return to previous window when prefix is pressed twice
bind C-a last-window
bind C-b last-window

## Window cycle/swap
bind e previous-window
bind f next-window
bind E swap-window -t -1
bind F swap-window -t +1
bind -n M-[ previous-window
bind -n M-] next-window

## Moving between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind -n M-h select-pane -L
bind -n M-l select-pane -R
bind -n M-k select-pane -U
bind -n M-j select-pane -D

## Easy split pane commands
unbind '"'
unbind %
bind = split-window -h
bind - split-window -v
bind -n M-= split-window -h
bind -n M-- split-window -v

+ 173
- 0
.vimrc View File

@@ -0,0 +1,173 @@
" ~/.vimrc

""" Vim-Plug ====================================

if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

call plug#begin('~/.vim/plugged') " Minimalist Vim Plugin Manager


""" Settings ====================================

Plug 'tpope/vim-sensible' " Sensible Defaults

set t_BE= " Disable bracketed paste
set nocompatible " be iMproved, required
set nobackup "
set noswapfile "
set termencoding=utf-8 " UTF8 as default encoding
set encoding=utf-8 " ...


""" Input =======================================

set mouse=a " Enable mouse support
set clipboard=unnamedplus " Share X11 clipboard
let mapleader = ','

"
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l

" Fold Mappings
inoremap <leader>z <C-O>za
nnoremap <leader>z za
onoremap <leader>z <C-C>za
vnoremap <leader>z zf

" Use <leader>/ to clear search highlight
nmap <silent> <leader>/ :nohlsearch<CR>

"
set pastetoggle=<F2>
set listchars=tab:\|.,trail:.,extends:#,nbsp:.

" Write target file as sudo using 'tee' buffer
function SudoWrite()
w !sudo tee %
endfunction


""" Display =====================================

Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
let g:airline#extensions#tabline#enabled = 1

Plug 'edkolev/tmuxline.vim'
let g:tmuxline_powerline_separators = 0

if has('gui_running')
try
colorscheme slate
set guifont=Noto\ Mono\ Regular\ 10
set background=dark
set guioptions-=m "remove menu bar
set guioptions-=T "remove toolbar
set guioptions-=r "remove right-hand scroll bar
set guioptions-=L "remove left-hand scroll bar
catch
endtry
endif


""" Utilities ===================================

Plug 'spolu/dwm.vim' " Tiled Window Management
Plug 'Shougo/vimfiler.vim' " Powerful file explorer
Plug 'tpope/vim-eunuch' " Helpers for UNIX
Plug 'tpope/vim-dispatch' " Async Build/Test
Plug 'benmills/vimux' " tmux Integration

Plug 'mileszs/ack.vim' " Enhanced Grepping within Vim
if executable('ag')
let g:ackprg = 'ag --vimgrep'
endif

Plug 'ctrlpvim/ctrlp.vim' " Fuzzy file/buffer/mru/tag/etc finder
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn)$',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': 'some_bad_symbolic_links',
\ }
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']

Plug 'universal-ctags/ctags' " ctags implementation
Plug 'majutsushi/tagbar' " Displays tags in a window
nmap <F8> :TagbarToggle<CR>

Plug 'francoiscabrol/ranger.vim'


""" Languages ===================================

Plug 'sheerun/vim-polyglot' " Language Support

Plug 'scrooloose/syntastic' " Syntax checking hacks for vim
nmap <leader>c :SyntasticCheck<CR>
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_error_symbol="S>"
let g:syntastic_style_error_symbol="E>"
let g:syntastic_warning_symbol="W>"
let g:syntastic_style_warning_symbol="W>"

Plug 'fatih/vim-go' " Go development plugin for Vim
let g:go_auto_type_info = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_interfaces = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:go_highlight_extra_types = 1


""" Editor ======================================

set tabstop=4 " Tabs are 4 columns
set shiftwidth=4 " ...
set softtabstop=4 " ...
set expandtab " Change tabs to spaces

set list " Show whitespace
set number " Show line numbers
set wrap linebreak nolist
autocmd BufWritePre * %s/\s\+$//e " Delete trailing whitespace on save

Plug 'tpope/vim-sleuth' " Heuristically set buffer options
Plug 'nathanaelkane/vim-indent-guides' " Visaully display indent level

Plug 'junegunn/vim-easy-align' " Easier text alignment
xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)

Plug 'ervandew/supertab' " Vim insert mode completions with Tab
Plug 'tpope/vim-surround' " Quoting/Parenthesizing made simple
Plug 'junegunn/limelight.vim' " Hyperfocus-writing in Vim


""" Version Control System ======================

Plug 'airblade/vim-gitgutter' " Show git diff in the gutter
nmap <Leader>ha <Plug>GitGutterStageHunk
nmap <Leader>hr <Plug>GitGutterUndoHunk

Plug 'tpope/vim-fugitive' " Git wrapper
Plug 'tpope/vim-git' " Git integration
Plug 'mattn/gist-vim' " Gist upload (GitHub)

call plug#end()

Loading…
Cancel
Save