diff --git a/.config/emacs/init.org b/.config/emacs/init.org index 630507b..ec9a1a0 100644 --- a/.config/emacs/init.org +++ b/.config/emacs/init.org @@ -1235,7 +1235,8 @@ Ace Window will show a hint if there are more than 2 windows, but I don't really (set-frame-name (file-name-nondirectory (directory-file-name (nth 2 proj-name))))) proj-name))) - (add-hook 'project-find-functions #'joe/project-root-override) +;; TODO: There's an issue with this and it's causing some weird nesting/recursion + ;; (add-hook 'project-find-functions #'joe/project-root-override) (define-key 'ctl-x-5-prefix "n" #'set-frame-name)) @@ -1830,7 +1831,7 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i (with-eval-after-load 'rustic ;; Don't autostart (setq rustic-lsp-setup-p nil) - (define-key rustic-mode-map (kbd "") #'rustic-cargo-run) + ;; (define-key rustic-mode-map (kbd "") #'joe/save-then-recompile) (setq lsp-rust-analyzer-server-display-inlay-hints t) (setq lsp-rust-analyzer-display-lifetime-elision-hints-enable "always") diff --git a/.config/i3/config b/.config/i3/config new file mode 100644 index 0000000..f7e0797 --- /dev/null +++ b/.config/i3/config @@ -0,0 +1,210 @@ +# This file has been auto-generated by i3-config-wizard(1). +# It will not be overwritten, so edit it as you like. + +# Should you change your keyboard layout some time, delete +# this file and re-run i3-config-wizard(1). +# + +# i3 config file (v4) +# +# Please see http://i3wm.org/docs/userguide.html for a complete reference! + +focus_follows_mouse no + +set $mod Mod4 +set $hyper Shift+Control+Mod1+Mod4 + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +font pango:monospace 6 + +# This font is widely installed, provides lots of unicode glyphs, right-to-left +# text rendering and scalability on retina/hidpi displays (thanks to pango). +#font pango:DejaVu Sans Mono 8 + +# Before i3 v4.8, we used to recommend this one as the default: +# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 +# The font above is very space-efficient, that is, it looks good, sharp and +# clear in small sizes. However, its unicode glyph coverage is limited, the old +# X core fonts rendering does not support right-to-left and this being a bitmap +# font, it doesn’t scale on retina/hidpi displays. + +bindsym $hyper+i workspace 2, mode "default" +bindsym $hyper+e [class=Thunderbird] focus, mode "default" +bindsym $hyper+u [class=Unity] focus, mode "default" +bindsym $hyper+v [class=Emacs] focus, mode "default" +bindsym $hyper+r [class=jetbrains-rider] focus, mode "default" +bindsym $hyper+t workspace 1, mode "default" + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# start a terminal +# bindsym $mod+Return exec i3-sensible-terminal +bindsym $mod+Return exec --no-startup-id ~/dotfiles/scripts/i3_cwd_term.sh +bindsym $mod+Shift+Return exec "~/dotfiles/scripts/i3_cwd_term.sh"; exec "i3-msg floating enabled" + +# kill focused window +bindsym $mod+Shift+q kill + +# start dmenu (a program launcher) +# bindsym $mod+d exec dmenu_run +# There also is the (new) i3-dmenu-desktop which only displays applications +# shipping a .desktop file. It is a wrapper around dmenu, so you need that +# installed. +bindsym $mod+d exec --no-startup-id i3-dmenu-desktop + +# change focus +bindsym $mod+h focus left +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+l focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left move workspace to output left +bindsym $mod+Right move workspace to output right + +# move focused window +bindsym $mod+Shift+h move left +bindsym $mod+Shift+j move down +bindsym $mod+Shift+k move up +bindsym $mod+Shift+l move right + +# move to next container +bindsym $mod+Control+h focus output left; +bindsym $mod+Control+j focus parent; focus down; +bindsym $mod+Control+k focus parent; focus up; +bindsym $mod+Control+l focus output right; + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5%; exec --no-startup-id pactl set-sink-mute 0 0 +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5%; exec --no-startup-id pactl set-sink-mute 0 0 +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle + +bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 10 +bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 10 + + +# split in horizontal orientation +bindsym $mod+s split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+w layout stacking +bindsym $mod+t layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +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 +bindsym $mod+m workspace music +bindsym $mod+c workspace 0:chat + +# 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 +bindsym $mod+Shift+m move container to workspace music +bindsym $mod+Shift+c move container to workspace 0:chat + +bindsym $mod+n workspace next_on_output +bindsym $mod+p workspace prev_on_output + +bindsym $mod+Control+1 focus output DP-3 +bindsym $mod+Control+2 focus output DP-1 +bindsym $mod+Control+3 focus output DP-0 + +# reload the configuration file +bindsym $mod+Shift+r reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Control+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" + +bindsym $hyper+l exec --no-startup-id i3lock -i ~/Pictures/wallpaper.png -t ; exec systemctl suspend + +set $resizeAmount 5 +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym h resize shrink width $resizeAmount px or $resizeAmount ppt + bindsym j resize grow height $resizeAmount px or $resizeAmount ppt + bindsym k resize shrink height $resizeAmount px or $resizeAmount ppt + bindsym l resize grow width $resizeAmount px or $resizeAmount ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width $resizeAmount px or $resizeAmount ppt + bindsym Down resize grow height $resizeAmount px or $resizeAmount ppt + bindsym Up resize shrink height $resizeAmount px or $resizeAmount ppt + bindsym Right resize grow width $resizeAmount px or $resizeAmount ppt + + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" +} + +bindsym $mod+r mode "resize" + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + status_command i3status + position top +} + + +bindsym $hyper+m exec --no-startup-id ~/dotfiles/scripts/work_setup.sh +bindsym $mod+Mod1+m exec --no-startup-id ~/dotfiles/scripts/laptop_setup.sh +bindsym $hyper+s exec --no-startup-id ~/dotfiles/scripts/single_monitor.sh +bindsym $hyper+k exec --no-startup-id ~/dotfiles/scripts/ergo.sh +# bindsym $hyper+k exec --no-startup-id ~/dotfiles/scripts/laptop_setup.sh + +# i3lock -i ~/Pictures/new3.png -t + +for_window [class="Unity" title="Hold On"] floating enable, move container to workspace 4 +for_window [class="Unity" title="Starting Unity..."] floating enable, move container to workspace 4 +for_window [class="Teensy"] floating enable +# for_window [class="sun-awt-X11-XWindowPeer"][window_type=popup_menu] focus +# for_window [class="sun-awt-X11-XFramePeer"] focus diff --git a/.config/kak/ranger.kak b/.config/kak/ranger.kak new file mode 100644 index 0000000..4bb49a7 --- /dev/null +++ b/.config/kak/ranger.kak @@ -0,0 +1,59 @@ +# http://ranger.nongnu.org +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + +define-command ranger-open-on-edit-directory \ + -docstring 'Start the ranger file system explorer when trying to edit a directory' %{ + hook global RuntimeError "\d+:\d+: '\w+' (.*): is a directory" %{ evaluate-commands %sh{ + directory=$kak_hook_param_capture_1 + echo ranger $directory + }} +} + +define-command \ + -params .. -file-completion \ + -docstring %{ranger []: open the file system explorer to select buffers to open + All the optional arguments are forwarded to the ranger utility} \ + ranger %{ evaluate-commands %sh{ + if [ -n "${TMUX}" ]; then + tmux split-window -h \ + ranger $@ --cmd " \ + map eval \ + fm.execute_console('shell \ + echo evaluate-commands -client ' + ranger.ext.shell_escape.shell_escape('$kak_client') + ' edit {file} | \ + kak -p '.format(file=fm.thisfile.path) + ranger.ext.shell_escape.shell_escape('$kak_session') + '; \ + tmux select-pane -t $kak_client_env_TMUX_PANE') \ + if fm.thisfile.is_file else fm.execute_console('move right=1')" + + elif [ -n "${STY}" ]; then + + script="/tmp/kak-ranger-${kak_client}-${kak_session}.sh" + selections="/tmp/kak-ranger-${kak_client}-${kak_session}.txt" + cat > "$script" << EOF +#! /usr/bin/env sh +cd "$PWD" +ranger --choosefiles="$selections" $@ +while read -r f; do + printf %s "evaluate-commands -client '${kak_client}' edit '\"\$f\"'" | kak -p '${kak_session}' +done < "$selections" +screen -X remove +rm -f "$selections" "$script" +EOF + + tty="$(ps -o tty ${kak_client_pid} | tail -n 1)" + screen -X eval \ + 'split -h' \ + 'focus down' \ + "screen sh '$script'" \ + < "/dev/$tty" + + elif [ -n "$WINDOWID" ]; then + setsid $kak_opt_termcmd " \ + ranger $@ --cmd "'"'" \ + map eval \ + fm.execute_console('shell \ + echo evaluate-commands -client ' + ranger.ext.shell_escape.shell_escape('$kak_client') + ' edit {file} | \ + kak -p '.format(file=fm.thisfile.path) + ranger.ext.shell_escape.shell_escape('$kak_session') + '; \ + xdotool windowactivate $kak_client_env_WINDOWID') \ + if fm.thisfile.is_file else fm.execute_console('move right=1')"'"' < /dev/null > /dev/null 2>&1 & + fi +}} diff --git a/.config/kak/word-mode.kak b/.config/kak/word-mode.kak new file mode 100644 index 0000000..fd42fd9 --- /dev/null +++ b/.config/kak/word-mode.kak @@ -0,0 +1,43 @@ +declare-user-mode word +map global normal w ':enter-user-mode -lock word' +map global word w w -docstring 'select to next word start' +map global word W W -docstring 'extend to next word start ' +map global word b b -docstring 'select to previous word start' +map global word B B -docstring 'extend to previous word start' +map global word e e -docstring 'select to next word end' +map global word E E -docstring 'extend to next word end' +map global word q -docstring 'select to next WORD start' +map global word Q -docstring 'extend to next WORD start' +map global word v -docstring 'select to previous WORD start' +map global word V -docstring 'extend to previous WORD start' +map global word r -docstring 'select to next WORD end' +map global word R -docstring 'extend to next WORD end' + +def -hidden select-next-subword %{ + exec /[A-Z][a-z]+|[A-Z]+|[a-z]+ +} +def -hidden extend-next-subword %{ + exec ?[A-Z][a-z]+|[A-Z]+|[a-z]+ +} +def -hidden select-prev-subword %{ + exec [A-Z][a-z]+|[A-Z]+|[a-z]+ +} +def -hidden extend-prev-subword +%{ + exec [A-Z][a-z]+|[A-Z]+|[a-z]+ +} +map global word s :select-next-subword -docstring 'select to next subword' +map global word S :extend-next-subword -docstring 'extend to next subword' +map global word a :select-prev-subword -docstring 'select to previous subword' +map global word A :extend-prev-subword -docstring 'extend to previous subword' + +map global word d d +map global word y y +map global word h h +map global word j j +map global word k k +map global word l l +map global word H H +map global word J J +map global word K K +map global word L L diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index a98e784..d834c7f 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -56,6 +56,8 @@ map kitty_mod+j neighboring_window down map kitty_mod+k neighboring_window up map kitty_mod+l neighboring_window right +map ctrl+y paste_from_clipboard + map kitty_mod+p previous_tab map kitty_mod+n next_tab map kitty_mod+q close_tab diff --git a/.config/qutebrowser/autoconfig.yml b/.config/qutebrowser/autoconfig.yml new file mode 100644 index 0000000..747496b --- /dev/null +++ b/.config/qutebrowser/autoconfig.yml @@ -0,0 +1,10 @@ +# If a config.py file exists, this file is ignored unless it's explicitly loaded +# via config.load_autoconfig(). For more information, see: +# https://github.com/qutebrowser/qutebrowser/blob/master/doc/help/configuring.asciidoc#loading-autoconfigyml +# DO NOT edit this file by hand, qutebrowser will overwrite it. +# Instead, create a config.py - see :help for details. + +config_version: 2 +settings: + content.notifications.enabled: + https://www.reddit.com: false diff --git a/.config/qutebrowser/bookmarks/urls b/.config/qutebrowser/bookmarks/urls new file mode 100644 index 0000000..e69de29 diff --git a/.config/qutebrowser/quickmarks b/.config/qutebrowser/quickmarks new file mode 100644 index 0000000..e69de29 diff --git a/.config/scripts/add_command.sh b/.config/scripts/add_command.sh new file mode 100755 index 0000000..ba879c1 --- /dev/null +++ b/.config/scripts/add_command.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +if [ -z "$1" ]; +then + echo "Provide a command, alternative pass the -l to add the last command in history" + exit 1 +fi + +file=$HOME/School/CCOM4088-CyberSecurity/commands + + +if [ "$1" = "-l" ] +then + tail ~/.histfile -n 2 | head -n 1 | sed 's/^.*;//' >> $file +else + echo "$1" >> $file +fi + +tail $file diff --git a/.config/scripts/i3_cwd_term.sh b/.config/scripts/i3_cwd_term.sh new file mode 100755 index 0000000..b1983c7 --- /dev/null +++ b/.config/scripts/i3_cwd_term.sh @@ -0,0 +1,26 @@ +#!/bin/bash +ACTIVE_WINDOW=$(xdpyinfo | grep focus | cut -f4 -d " ") +ACTIVE_WM_CLASS=$(xprop -id $ACTIVE_WINDOW | grep WM_CLASS) +if [[ $ACTIVE_WM_CLASS == *"Alacritty"* ]] +then + # Get PID. If _NET_WM_PID isn't set, bail. + PID=$(xprop -id $ACTIVE_WINDOW | grep _NET_WM_PID | grep -oP "\d+") + if [[ "$PID" == "" ]] + then + alacritty + fi + # Get first child of terminal + CHILD_PID=$(pgrep -P $PID) + if [[ "$PID" == "" ]] + then + alacritty + fi + # Get current directory of child. The first child should be the shell. + SHELL_CWD=$(readlink -e "/proc/${CHILD_PID}/cwd") + # Start alacritty with the working directory + alacritty --working-directory $SHELL_CWD +else + alacritty +fi + +# alacritty --working-directory "$(readlink -e /proc/"$(pgrep -P "$(xdo pid)" | tail -n 1)"/cwd)" diff --git a/.config/scripts/laptop_setup.sh b/.config/scripts/laptop_setup.sh new file mode 100755 index 0000000..0fd158d --- /dev/null +++ b/.config/scripts/laptop_setup.sh @@ -0,0 +1,6 @@ +#!/bin/sh +xrandr --output DP-0 --primary --mode 1920x1080 --pos 0x0 --panning 1920x1080 --dpi 96 \ + --output DP-1 --off \ + --output DP-2 --off \ + --output DP-3 --off \ + --output DP-4 --off \ diff --git a/.config/scripts/single_monitor.sh b/.config/scripts/single_monitor.sh new file mode 100755 index 0000000..11db68a --- /dev/null +++ b/.config/scripts/single_monitor.sh @@ -0,0 +1,13 @@ +#!/bin/sh +xrandr --output DP-0 --mode 1920x1080 --pos 0x0 --dpi 96 \ + --output DP-4 --primary --mode 1920x1080 --pos 1920x0 --right-of DP-0 --dpi 96 +i3-msg "workspace music; move workspace to output DP-0; + workspace 0:chat; move workspace to output DP-4; + workspace 1; move workspace to output DP-4; + workspace 2; move workspace to output DP-4; + workspace 3; move workspace to output DP-4; + workspace 4; move workspace to output DP-4; + workspace 5; move workspace to output DP-4; + workspace 6; move workspace to output DP-4; + workspace 7; move workspace to output DP-4; + workspace 3" diff --git a/.config/scripts/work_setup.sh b/.config/scripts/work_setup.sh new file mode 100755 index 0000000..b375eef --- /dev/null +++ b/.config/scripts/work_setup.sh @@ -0,0 +1,17 @@ +#!/bin/sh +xrandr \ +--output HDMI-0 --off \ +--output DP-4 --off \ +--output DP-2 --off \ +--output DP-3 --mode 1920x1080 --pos 0x0 --panning 1920x1080+0+0 --dpi 96 \ +--output DP-1 --primary --mode 1920x1080 --pos 1920x0 --panning 1920x1080+1920+0 --dpi 96 \ +--output DP-0 --mode 1920x1080 --pos 3840x0 --panning 1920x1080+3840+0 --dpi 96 +i3-msg "workspace 1; move workspace to output DP-3; + workspace music; move workspace to output DP-0; + workspace 0:chat; move workspace to output DP-1; + workspace 2; move workspace to output DP-3; + workspace 3; move workspace to output DP-1; + workspace 4; move workspace to output DP-1; + workspace 5; move workspace to output DP-1; + workspace 6; move workspace to output DP-1; + workspace 3" diff --git a/.config/touchegg/touchegg.conf b/.config/touchegg/touchegg.conf new file mode 100644 index 0000000..d5488cb --- /dev/null +++ b/.config/touchegg/touchegg.conf @@ -0,0 +1,140 @@ + + + + + 50 + + + 15 + + + auto + auto + + + + + + + true + + + + + + true + + + + + + auto + true + auto + + + + + + auto + true + auto + + + + + + true + F84A53 + F84A53 + + + + + + true + + + + + + false + Super_L + A + begin + + + + + + + begin + + + + + + + begin + + + + + + + + + + + + + + + + + true + Control_L + KP_Subtract + KP_Add + + + + + + true + Control_L + KP_Add + KP_Subtract + + + + + diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..674d763 --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,103 @@ +set -g default-shell /usr/bin/fish +set -g base-index 1 +set -s escape-time 0 +set -g history-limit 50000 +set -g display-time 3000 +set -g display-panes-time 3000 +set -g status-interval 5 +set -g default-terminal "screen-256color" +set -g status-keys emacs +set -g renumber-windows on +setw -g pane-base-index 1 +setw -g automatic-rename off +setw -g mode-keys vi + +set -g prefix C-s +unbind C-b +unbind '"' +unbind % +unbind Left +unbind Right +unbind Up +unbind Down +unbind [ +bind C-s send-prefix + +bind r source-file ~/.tmux.conf \; display "config reloaded" +bind v split-window -h -c '#{pane_current_path}' +bind s split-window -v -c '#{pane_current_path}' +bind X confirm-before -p "kill-window #W? (y/n)" kill-window +bind \; command-prompt +bind o if-shell '[ #{pane_index} = 1 ]' \ + 'last-pane ; swap-pane -dt 1' \ + 'swap-pane -dt 1' \ + +set -g mouse on +bind -T copy-mode-vi C-WheelUpPane send-keys -X halfpage-up +bind -T copy-mode-vi C-WheelDownPane send-keys -X halfpage-down + +# bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection c" +bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "clip.exe" + +bind-key -T copy-mode-vi u send-keys -X halfpage-up +bind-key -T copy-mode-vi d send-keys -X halfpage-down +bind-key -T copy-mode-vi v send-keys -X begin-selection +bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel +bind-key -T copy-mode-vi r send-keys -X rectangle-toggle + +bind -n C-h select-pane -L +bind -n C-j select-pane -D +bind -n C-k select-pane -U +bind -n C-l select-pane -R +bind -n C-S-Left swap-window -t -1 \; previous-window +bind -n C-S-Right swap-window -t +1 \; next-window +# bind -n M-1 select-window -t :=1 +# bind -n M-2 select-window -t :=2 +# bind -n M-3 select-window -t :=3 +# bind -n M-4 select-window -t :=4 +# bind -n M-5 select-window -t :=5 +# bind -n M-6 select-window -t :=6 +# bind -n M-7 select-window -t :=7 +# bind -n M-8 select-window -t :=8 +# bind -n M-9 select-window -t :=9 +bind -n F1 select-window -t :=1 +bind -n F2 select-window -t :=2 +bind -n F3 select-window -t :=3 +bind -n F4 select-window -t :=4 +bind -n F5 select-window -t :=5 +bind -n F6 select-window -t :=6 +bind -n F7 select-window -t :=7 +bind -n F8 select-window -t :=8 +bind -n F9 select-window -t :=9 +bind -n M-l next-window +bind -n M-h previous-window +bind -n M-k send-keys C-l +bind -n M-m resize-pane -Z +bind -n M-n switch-client -n +bind -n M-p switch-client -p +bind -n M-i copy-mode + +set -g status-position top +set -g status-justify centre +set -g status-style fg=black,bg=colour238 +set -g status-left '#[bg=green,] #S ' +set-window-option -g window-status-format '#[bg=blue,fg=black,dim] #I #[bg=blue,fg=black,dim]#W ' +set-window-option -g window-status-current-format '#[bg=colour254,fg=black] [#I] #[bg=colour254,fg=black]#W ' +set -g status-right '#[bg=cyan] %H:%M #[bg=green] %A, %e %b %Y ' +set -g status-left-length 100 + +# set -g window-style 'fg=colour248,bg=colour233' +set -g window-style 'fg=colour248,bg=colour235' +set -g window-active-style 'fg=colour255,bg=colour236' +set -g pane-border-style 'fg=colour244,bg=colour235' +set -g pane-active-border-style 'fg=colour244,bg=colour235' + +set -g @resurrect-capture-pane-contents 'on' +set -g @resurrect-processes 'ranger' +set -g @resurrect-save 'S' +set -g @resurrect-restore 'R' + +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'schasse/tmux-jump' + +run -b ~/.tmux/plugins/tpm/tpm diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..cbfe0b0 --- /dev/null +++ b/.vimrc @@ -0,0 +1,551 @@ +if &shell =~# 'fish$' + set shell=bash +endif +set nocompatible +set runtimepath+=~/.vim/bundle/neobundle.vim/ +filetype off +call neobundle#begin(expand('~/.vim/bundle/')) + +" Utilities +NeoBundleFetch 'Shougo/neobundle.vim' +NeoBundle 'tpope/vim-dispatch' +NeoBundle 'Shougo/vimproc.vim' +NeoBundle 'Shougo/neocomplete' +NeoBundle 'Shougo/neosnippet' +NeoBundle 'Shougo/neosnippet-snippets' +NeoBundle 'scrooloose/nerdtree' +NeoBundle 'scrooloose/syntastic' +NeoBundle 'mhinz/vim-startify' +NeoBundle 'junegunn/vim-easy-align' +NeoBundle 'kien/ctrlp.vim' +NeoBundle 'sgur/ctrlp-extensions.vim' +NeoBundle 'Lokaltog/vim-easymotion' +NeoBundle 'jrhorn424/vim-multiple-cursors' +NeoBundle 'rking/ag.vim' +NeoBundle 'sjl/gundo.vim' +NeoBundle 'tpope/vim-fugitive' + +" Enhancements +NeoBundle 'tpope/vim-surround' +NeoBundle 'tpope/vim-repeat' +NeoBundle 'tpope/vim-commentary' +NeoBundle 'tpope/vim-eunuch' +NeoBundle 'dhruvasagar/vim-vinegar' +NeoBundle 'terryma/vim-smooth-scroll' +NeoBundle 'Raimondi/delimitMate' +NeoBundle 'bling/vim-airline' +NeoBundle 'bkad/CamelCaseMotion' +NeoBundle 'vim-scripts/Parameter-Text-Objects' +NeoBundle 'osyo-manga/vim-over' +NeoBundle 'tmhedberg/matchit' +NeoBundle 'matze/vim-move' +NeoBundle 'xolox/vim-misc' +NeoBundle 'xolox/vim-colorscheme-switcher' +NeoBundle 'haya14busa/incsearch.vim' +NeoBundle 'rhysd/clever-f.vim' +NeoBundle 'christoomey/vim-tmux-navigator' + +" Language +NeoBundle 'Rip-Rip/clang_complete' +NeoBundle 'dag/vim-fish' +NeoBundle 'marijnh/tern_for_vim' +NeoBundle 'jelera/vim-javascript-syntax' +NeoBundle 'hail2u/vim-css3-syntax' +NeoBundle 'groenewege/vim-less' +NeoBundle 'othree/javascript-libraries-syntax.vim' +NeoBundle 'OmniSharp/omnisharp-vim' +NeoBundle 'xolox/vim-lua-ftplugin' +NeoBundle 'tclem/vim-arduino' +" NeoBundle 'jplaut/vim-arduino-ino/' + +" Web +NeoBundle 'mattn/emmet-vim' +NeoBundle 'ap/vim-css-color' +NeoBundle 'KabbAmine/vCoolor.vim' +NeoBundle 'Valloric/MatchTagAlways' +NeoBundle 'vim-scripts/closetag.vim' +NeoBundle 'jaxbot/browserlink.vim' + +call neobundle#end() + +filetype plugin indent on +set history=2000 +set ruler +set laststatus=2 +set formatoptions=t +set relativenumber +set noshowmatch +set splitbelow +set splitright +set hidden +set wildmenu +set wildmode=longest,full +set backspace=eol,start,indent +set novisualbell +set noerrorbells +let loaded_matchparen=0 +set clipboard=unnamed +set tabstop=4 +set shiftwidth=4 +set expandtab +set sessionoptions-= +set sessionoptions-=buffers +set sessionoptions-=blank +set guioptions-=r +set guioptions-=L +set guioptions-=e +set mouse=a +set foldmethod=syntax +set foldcolumn=1 +set nrformats+=alpha +set nowrap + +let mapleader = "\" +" Macros +" To List +noremap mtl f[xxbi<ea>bbiListb +" To Array +noremap mta f>Bdiwxf>xi[]B +" Replace Word +nnoremap rw :%s/\<\>/ +" Clean up Interface +nnoremap mi ddJO4jdd2kcc +" Extract Definition +nnoremap med "vyiwmv^/\u:nohlsearchy`v"ty`vov = new t();^v$hdV"ldk`v +" Delete Outer Function +nnoremap mdaf viBdVkpmtgv<}dd`t +" Delete Surrounding Function +vnoremap mdif "tdxXvBdt +" Add Constructor +nnoremap mac "tyiwjopublic t() {}iO// +" Create Yield from IEnumerator +nnoremap mye "tyiwmtowhile (t.MoveNext()) yield return t.Current;`t +" Create Yield from Task +nnoremap myt "tyiwmtowhile (!t.IsCompleted) yield return null;`t +" Add Curly Braces to inline if +nnoremap mif ^f(%ls {lio}kw +" Surround with if statement +vnoremap mif dOif () {}ikVp=iBk^f(a +" Add ContextMenu to Function +nnoremap mcm ^f(hyiwO[ContextMenu(""")]j^f(b +" Add this.varName = varName; +nnoremap mthis mmyiwothis.* = *;`m +" Extra Line +" alt + o +noremap +noremap / :nohlsearch +nnoremap D d$ +nnoremap Y y$ +nnoremap vv ^v$h +noremap \ q +nnoremap vim :tabe $MYVIMRC +noremap sr :w:so % +nnoremap ' ` +nnoremap ` ' +noremap $ g_ +nnoremap :w +noremap = mt=i}`t +" Buffers +nnoremap q :bw +nnoremap bb :b# +nnoremap bd :b#:bd# +" Windows +nnoremap wq :windo bw +noremap 10< +noremap 10> +noremap 4+ +noremap 4- +" MacVim has different alt codes so gotta check if gui_running, there are the codes in order +" alt + ; +" alt + o & alt + O +" alt + h & alt + l +" if has("gui_running") +" inoremap » A; +" nnoremap » A; +" nnoremap ï ok +" nnoremap Ï Oj +" noremap è gT +" noremap ì gt +" noremap È :tabmove -1 +" nnoremap Ì :tabmove +1 +" else + inoremap … A; + nnoremap … A;; + nnoremap ø ok + nnoremap Ø Oj + noremap ˙ gT + noremap ¬ gt + noremap Ó :tabmove -1 + nnoremap Ò :tabmove +1 + " Map vim-move in terminal + vmap ∆ MoveBlockDown + vmap ˚ MoveBlockUp + nmap ∆ MoveLineDown + nmap ˚ MoveLineUp +" endif + +" open Help in vertical window +if (!exists(":H")) + command -nargs=* -complete=help H vertical belowright help +endif + +augroup insert_mode_stuff + autocmd! + au InsertEnter * set cursorline + au InsertLeave * set nocursorline + autocmd BufNewFile,BufRead * setlocal formatoptions=t + autocmd BufNewFile,BufRead * set colorcolumn=80 +augroup END + +command! CDC cd %:p:h + +" Show syntax definition where cursor is placed +func! SynStack() + if !exists("*synstack") + return + endif + echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') +endfunc +nnoremap syn :call SynStack() + +" Toggle booleans +func! ToggleBool() + let l:word = expand("") + if l:word ==? "true" + let l:word = "false" + elseif l:word ==? "false" + let l:word = "true" + elseif l:word ==? "public" + let l:word = "protected" + elseif l:word ==? "protected" + let l:word = "private" + elseif l:word ==? "private" + let l:word = "public" + else + return "\" + endif + return "ciw" . l:word . "\" +endfunc +nnoremap ToggleBool() +command! Retab set ts=2 noet | retab! | set et ts=4 | retab + +command! DeleteBadWhiteSpace %s/\s\+$//e | %s/^\s\+$//e | %s/\r//e +command! Reformat %s/\(\\)(/\1 (/e | g/) {\$/normal $i/e + +" Searching +set incsearch +set ignorecase +set smartcase +set hlsearch +nohlsearch + +" Appearance +syntax on +set number +set t_Co=256 +set linespace=2 +if has("gui_running") + set guifont=Andale\ Mono:h12 + colorscheme jellybeans + " colorscheme autumnleaf +else + " colorscheme solarized + colorscheme jellybeans + " Solarized + " set background=dark +endif + +func! SetFont(size) + exec 'set guifont=Andale\ Mono:h' . a:size +endfun +command! -nargs=1 FontSize :call SetFont() + +" DelimitMate +let g:delimitMate_expand_cr=1 +let g:delitMate_expand_space=0 + +" CameCase Text Object +map q CamelCaseMotion_w +map Q CamelCaseMotion_b +omap iq CamelCaseMotion_iw +xmap iq CamelCaseMotion_iw + +" Parameter Text Object +let g:no_parameter_object_maps = 1 +vmap ia ParameterObjectI +omap ia ParameterObjectI +vmap aa ParameterObjectA +omap aa ParameterObjectA + +" Easy Motion +let g:EasyMotion_do_mapping=0 +let g:EasyMotion_keys = 'asdfjkleirwuo' +nmap , (easymotion-prefix) +nmap S (easymotion-sl2) +nmap ,f (easymotion-f) +nmap ,F (easymotion-F) +nmap ,t (easymotion-t) +nmap ,T (easymotion-T) +nmap ,w (easymotion-w) +nmap ,W (easymotion-W) +nmap ,b (easymotion-b) +nmap ,B (easymotion-B) +nmap ,e (easymotion-e) +nmap ,E (easymotion-E) +nmap ,ge (easymotion-ge) +nmap ,gE (easymotion-gE) +nmap ,j (easymotion-j) +nmap ,k (easymotion-k) +vmap ,j (easymotion-j) +vmap ,k (easymotion-k) +nmap ,n (easymotion-n) +nmap ,N (easymotion-N) +nmap ,s (easymotion-s2) +nmap ,/ (easymotion-sn) + +" Clever-F +let g:clever_f_across_no_line=1 + +" Incsearch.vim +map / (incsearch-forward) +map ? (incsearch-backward) +map g/ (incsearch-stay) +let g:incsearch#consistent_n_direction = 1 +let g:incsearch#emacs_like_keymap = 1 + +" Javascript Libraries +let g:used_javascript_libs = 'jquery,angularjs,angularui,sugar' + +" Gundo +noremap g :GundoToggle + +" Easy Align +vmap (EasyAlign) +nmap e (EasyAlign) + +" Go to URLs +vnoremap du "uy:silent !open http://docs.unity3d.com/Documentation/ScriptReference/u.html +nnoremap dg :call GoToUrl("google") +nnoremap du :call GoToUrl("unity") +nnoremap dm :call GoToUrl("msdn") +fun! GoToUrl(options) + let keyword = expand("") + if (a:options == "google") + let url = "http://www.google.com/search?q=" + elseif (a:options == "unity") + let url = "http://docs.unity3d.com/Documentation/ScriptReference/30_search.html?q=" + elseif (a:options == "msdn") + let url = "http://social.msdn.microsoft.com/Search/en-US?query=" + endif + + exec '!open ' . url . keyword +endfun + +" Scrolling Speed +noremap :call smooth_scroll#up(&scroll, 10, 3) +noremap :call smooth_scroll#down(&scroll, 10, 3) +noremap :call smooth_scroll#up(&scroll*2, 10, 4) +noremap :call smooth_scroll#down(&scroll*2, 10, 4) +noremap :call smooth_scroll#up(&scroll/5, 15, 1) +noremap :call smooth_scroll#down(&scroll/5, 15, 1) + +" Startify +let g:startify_session_dir = "~/.vim/sessions/" +let g:startify_list_order = [ ['SESSIONS'], 'sessions', ['FILES'], 'files', ['BOOKMARKS'], 'bookmarks', ] +let g:startify_bookmarks = ["~/.vim/", "ftp://ftp.ferano.io//", "~/Documents/Work/", "~/Documents/Work/jflib/Assets/jflib/", "~/Documents/Work/jamtok/project/Assets/", "~/Documents/Work/poptok/Assets/Scripts"] +let g:startify_files_number = 7 +let g:startify_session_persistence = 1 +let g:startify_enable_special = 0 +" Load custom header +:source ~/.vim/startify_header.vim + +" NERDTree +let NERDTreeIgnore=['.meta$[[file]]'] + +" Emmet +let g:user_emmet_leader_key='' +let g:user_emmet_install_global = 0 +augroup emmet_stuff + autocmd FileType html,css EmmetInstall +augroup END + +" MatchTagAlways +highlight MatchParen ctermfg=black ctermbg=lightgreen guifg=#002b36 guibg=#b58900 + +" Ag.vim +let g:agformat="%f:%l:%m" +noremap a :Ag! +let g:agprg="ag --column --smart-case" + +" C Stuff +" augroup c_bindings +" autocmd! +" au FileType c noremap ) ?{w99[{:nohlsearch +" au FileType c noremap ( j0?{w99[{%/{:nohlsearch +" augroup END + +" Arduino +augroup arduino_files + autocmd! + au BufRead,BufNewFile *.pde set filetype=arduino + au BufRead,BufNewFile *.ino set filetype=arduino +augroup END +" let g:vim_arduino_library_path = "/Applications/Arduino.app" +" let g:vim_arduino_serial_port = "/dev/tty.usbmodem1d1131" + +" Lua Stuff +let g:lua_check_syntax = 0 +let g:lua_complete_omni = 1 + +" Compile and run current C file +nnoremap cc :!gcc -Wall -o %:r % +nnoremap cr :!gcc -Wall -o %:r % && ./%:r + +let g:clang_library_path="/Users/josephferano/src/clang+llvm-3.3-x86_64-apple-darwin12/lib/libclang.dylib" + +" CtrlP +set wildignore+=*/tmp/*,*/Temp/*,*/Library/*,*/Builds/*,*.png,*.jpg,*.asset,*.unity,*.csproj,*.gif,*.so,*.swp,*.zip,*.meta,*.ttc,*.userprefs,*.mat,*.mp3,*.ogg,*.wav,*.bmp,*.anim,*.TTF,tags +let g:ctrlp_custom_ignore = { 'dir': '\v[\/](obj|bin|node_modules|bower_components)|(\.(swp|ico|git|svn))$', 'file': '\v\.(exe|so|dll|meta|prefab|unity3d|sln)$', 'link': 'some_bad_symbolic_links', } +let g:ctrlp_map = 'p' +noremap :CtrlP +noremap m :CtrlPMRU +noremap b :CtrlPBuffer +noremap t :CtrlPBufTag +noremap l :CtrlPLine +noremap y :CtrlPYankring +noremap c :CtrlPCmdline +let g:ctrlp_match_window="ttb,min:1,max:15,results:15" +let g:ctrlp_session_dir=".vim/sessions/" +let g:ctrlp_by_filename = 1 +let g:ctrlp_working_path_mode = '' +let g:ctrlp_buffer_func = { 'enter': 'CtrlpMaps' } + +func! CtrlpMaps() + nnoremap :call DeleteBuffer() + " nnoremap :call QuickLook() +endfunc + +func! s:QuickLook() + let line = getline('.') + let l:path = getcwd() . substitute(line, '> ', '/', "") + call system("qlmanage -p 2>/dev/null '" . path . "'") +endfunc + +func! s:DeleteBuffer() + let line = getline('.') + let bufid = line =~ '\[\d\+\*No Name\]$' ? str2nr(matchstr(line, '\d\+')) + \ : fnamemodify(line[2:], ':p') + exec "bd" bufid + exec "norm \" +endfunc + +" Syntastic +let g:syntastic_cs_checkers = ['syntax'] + +" OmniSharp +augroup omnisharp_complete + autocmd! + autocmd FileType cs set commentstring=//\ %s + autocmd FileType cs setlocal omnifunc=OmniSharp#Complete + autocmd FileType cs nnoremap og :OmniSharpGotoDefinition + autocmd FileType cs nnoremap ofi :OmniSharpFindImplementations + autocmd FileType cs nnoremap ofu :OmniSharpFindUsages + autocmd FileType cs nnoremap odc :OmniSharpDocumentation + autocmd FileType cs nnoremap oft :OmniSharpFindType + autocmd FileType cs nnoremap ofs :OmniSharpFindSymbol + autocmd FileType cs nnoremap ofm :OmniSharpFindMembers + autocmd FileType cs nnoremap oht :OmniSharpHighlightTypes + autocmd FileType cs nnoremap orl :OmniSharpReloadSolution + autocmd FileType cs nnoremap oso :OmniSharpStopServer + autocmd FileType cs nnoremap osa :OmniSharpStartServer + autocmd FileType cs nnoremap oad :OmniSharpAddToProject + autocmd FileType cs nnoremap ob :OmniSharpBuildAsync + autocmd FileType cs nnoremap orn :OmniSharpRenameToh + autocmd FileType cs nnoremap oca :OmniSharpGetCodeActions + autocmd FileType cs vnoremap oca :call OmniSharp#GetCodeActions('visual') + autocmd FileType cs nnoremap f :OmniSharpTypeLookup + autocmd FileType cs nnoremap F mmF(h:OmniSharpTypeLookup`m + autocmd FileType cs nnoremap ( :OmniSharpNavigateDown + autocmd FileType cs nnoremap ) :OmniSharpNavigateUp +augroup END + +set completeopt=longest,menuone +let g:OmniSharp_typeLookupInPreview = 0 +let g:OmniSharp_timeout = 100 +if has("gui_running") + hi link csAttributeType Constant + hi link csUnspecifiedStatement Constant + hi link csInterfaceDeclaration Repeat +else + hi link csAttributeType Special + hi link csUnspecifiedStatement PreProc + hi link csInterfaceDeclaration StorageClass + hi link csModifier Identifier + hi link csClass Constant + hi link csType Constant + hi link CSharpUserType Identifier +endif +" source ~/Documents/Work/vim-csharp-repl/plugin/csharp-repl.vim + +" NeoComplete +let g:acp_enableAtStartup = 0 +let g:neocomplete#enable_at_startup = 1 +let g:neocomplete#enable_smart_case = 1 +let g:neocomplete#sources#syntax#min_keyword_length = 2 +let g:neocomplete#max_list = 25 +let g:neocomplete#lock_buffer_name_pattern = '\*ku\*' +let g:neocomplete#sources#dictionary#dictionaries = { + \ 'default' : '', + \ 'vimshell' : $HOME.'/.vimshell_hist', + \ 'scheme' : $HOME.'/.gosh_completions' + \ } +call neocomplete#custom#source('_', 'sorters', []) + +if !exists('g:neocomplete#sources') + let g:neocomplete#sources = {} +endif +if !exists('g:neocomplete#keyword_patterns') + let g:neocomplete#keyword_patterns = {} +endif +let g:neocomplete#keyword_patterns['default'] = '\h\w*' +let g:neocomplete#enable_auto_select = 1 +let g:neocomplete#disable_auto_complete = 0 +inoremap neocomplete#complete_common_string() +inoremap pumvisible() ? neocomplete#cancel_popup() : "\" +imap pumvisible() ? neocomplete#close_popup() : "\" +if !exists('g:neocomplete#sources#omni#input_patterns') + let g:neocomplete#sources#omni#input_patterns = {} +endif +let g:neocomplete#force_overwrite_completefunc = 1 +let g:neocomplete#sources.cs = ['omni'] +let g:neocomplete#sources#omni#input_patterns.cs = '.*[^-!@%?/|&\{}\+\*\(<>\")\=);]' +let g:neocomplete#sources#omni#input_patterns.js = '[^. \t]\.\w*' +let g:neocomplete#sources#omni#input_patterns.c = '[^[:digit:] *;\{\()]\w*' +let g:neocomplete#sources#omni#input_patterns.lua = '[^. \t]\.\w*' +let g:clang_complete_auto=1 +let g:clang_auto_select=0 +let g:clang_use_library=1 +let g:neocomplete#enable_refresh_always = 0 +augroup js_aus + autocmd! + autocmd FileType javascript setlocal omnifunc=tern#Complete + autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS + autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags + autocmd FileType python setlocal omnifunc=pythoncomplete#Complete + autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags +augroup END + +" NeoSnippet +imap neosnippet#expandable_or_jumpable() ? "\(neosnippet_expand_or_jump)" : "\" +smap (neosnippet_expand_or_jump) +xmap (neosnippet_expand_target) +let g:neosnippet#enable_snipmate_compatibility = 1 +let g:neosnippet#snippets_directory='~/.vim/snippet' +smap neosnippet#expandable_or_jumpable() ? +\ "\(neosnippet_expand_or_jump)" +\: "\" + +if has('conceal') + set conceallevel=2 concealcursor=i +endif +" diff --git a/README.org b/README.org new file mode 100644 index 0000000..2110b90 --- /dev/null +++ b/README.org @@ -0,0 +1,13 @@ +* Old Dotfiles + +This is a collection of all my old dotfiles, they are here more as a reference +rather than anything I'm actively using. For my active Dotfiles, please see [[https://git.ferano.io/JosephFerano/Dotfiles][this]] +repository. + +To summarize, my main workflow for a long time was zsh, vim, tmux, i3wm, and +ranger. There are configs for other window managers, terminal file managers, and +utilities as well. I also have dotfiles for various text editors I used for +different periods of time including vim, neovim, kakoune, and IntelliJ. Some +dotfiles might be broken or seriously outdated and may not work anymore, but as +I mentioned they're here for reference. +