Browse Source

Update vim with Vundle/new plugins

Switch to chunkwm tiling manager on mac
Use khd to capture keys for chunkwm
update zsh aliases and exports
remotes/remote_mirror_0048a893dc9c9faa373a1b34fba08204/master
Andrew Zah 1 year ago
parent
commit
14a638763f
Signed by: Andrew Zah <zah@andrewzah.com> GPG Key ID: 0AE942445EB70FAA
8 changed files with 388 additions and 17 deletions
  1. 97
    0
      .chunkwmrc
  2. 0
    5
      .gitconfig
  3. 146
    0
      .khdrc
  4. 11
    0
      .muttrc
  5. 110
    9
      .nvimrc
  6. 3
    1
      .zshrc
  7. 10
    0
      zsh/aliases.zsh
  8. 11
    2
      zsh/exports.zsh

+ 97
- 0
.chunkwmrc View File

@@ -0,0 +1,97 @@
1
+#!/bin/bash
2
+
3
+#
4
+# NOTE: specify the absolutepath to the directory to use when
5
+#       loading a plugin. '~' expansion is supported.
6
+#
7
+
8
+chunkc core::plugin_dir /usr/local/opt/chunkwm/share/chunkwm/plugins
9
+
10
+#
11
+# NOTE: if enabled, chunkwm will monitor the specified plugin_dir
12
+#       and automatically reload any '.so' file that is changed.
13
+#
14
+
15
+chunkc core::hotload 1
16
+
17
+#
18
+# NOTE: the following are config variables for the chunkwm-tiling plugin.
19
+#
20
+
21
+chunkc set global_desktop_mode           bsp
22
+chunkc set 4_desktop_mode                float
23
+chunkc set 5_desktop_mode                float
24
+
25
+chunkc set 1_desktop_tree                ~/.chunkwm_layouts/dev_1
26
+
27
+chunkc set global_desktop_offset_top     10
28
+chunkc set global_desktop_offset_bottom  10
29
+chunkc set global_desktop_offset_left    10
30
+chunkc set global_desktop_offset_right   10
31
+chunkc set global_desktop_offset_gap     15
32
+
33
+# chunkc set 3_desktop_offset_top          190
34
+
35
+chunkc set desktop_padding_step_size     10.0
36
+chunkc set desktop_gap_step_size         5.0
37
+
38
+chunkc set bsp_spawn_left                1
39
+chunkc set bsp_optimal_ratio             1.618
40
+chunkc set bsp_split_mode                optimal
41
+chunkc set bsp_split_ratio               0.5
42
+
43
+chunkc set window_focus_cycle            monitor
44
+chunkc set mouse_follows_focus           0
45
+chunkc set window_float_next             0
46
+chunkc set window_float_center           1
47
+chunkc set window_region_locked          1
48
+
49
+#
50
+# NOTE: shell commands require escaped quotes
51
+#       to pass value containing a whitespace.
52
+#
53
+# chunkc set mouse_modifier              \"cmd shift\"
54
+chunkc set mouse_modifier                fn
55
+
56
+chunkc set preselect_border_color        0xffd75f5f
57
+chunkc set preselect_border_width        5
58
+chunkc set preselect_border_radius       0
59
+
60
+#
61
+# NOTE: these settings require chwm-sa.
62
+#       (https://github.com/koekeishiya/chwm-sa)
63
+#
64
+
65
+chunkc set window_float_topmost          0
66
+chunkc set window_fade_inactive          0
67
+chunkc set window_fade_alpha             0.85
68
+chunkc set window_fade_duration          0.25
69
+chunkc set window_use_cgs_move           0
70
+
71
+#
72
+# NOTE: the following are config variables for the chunkwm-border plugin.
73
+#
74
+
75
+chunkc set focused_border_color          0xff775759
76
+chunkc set focused_border_width          5
77
+chunkc set focused_border_radius         0
78
+chunkc set focused_border_skip_floating  0
79
+
80
+#
81
+# NOTE: specify plugins to load when chunkwm starts.
82
+#       if chunkc plugin_dir is not set, the absolutepath is necessary.
83
+#
84
+
85
+chunkc core::load border.so
86
+chunkc core::load tiling.so
87
+chunkc core::load ffm.so
88
+
89
+#
90
+# NOTE: shell commands require escaped quotes
91
+#       to pass value containing a whitespace.
92
+#
93
+
94
+chunkc tiling::rule --owner Spotify --role AXWindow --subrole AXDialog --state tile
95
+chunkc tiling::rule --owner Firefox --role AXWindow --subrole AXDialog --state tile
96
+chunkc tiling::rule --owner Finder --name Copy --state float
97
+chunkc tiling::rule --owner \"App Store\" --state float

+ 0
- 5
.gitconfig View File

@@ -10,9 +10,6 @@
10 10
 
11 11
         # git add --all
12 12
         aa = add --all
13
-
14
-        # pretty log 
15
-        lg = log --color --graph --pretty=format:'%Cred%h%Creset %C(yellow) %G? %Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
16 13
         
17 14
         # delete branch
18 15
         brdel = branch -D
@@ -94,8 +91,6 @@
94 91
         insteadOf = gl:
95 92
 [url "git@gitlab.com:"]
96 93
         insteadOf = gls:
97
-[url "git@github.com:"]
98
-	insteadOf = https://github.com/
99 94
 
100 95
 [init]
101 96
         templatedir = ~/.config/git/templates/init

+ 146
- 0
.khdrc View File

@@ -0,0 +1,146 @@
1
+# reload config
2
+cmd + alt + ctrl - r : khd -e "reload"
3
+
4
+# open terminal, blazingly fast compared to iTerm/Hyper
5
+cmd - return : open -na /Applications/Kitty.app
6
+
7
+# focus window
8
+alt - h : chunkc tiling::window --focus west
9
+alt - j : chunkc tiling::window --focus south
10
+alt - k : chunkc tiling::window --focus north
11
+alt - l : chunkc tiling::window --focus east
12
+
13
+cmd - j : chunkc tiling::window --focus prev
14
+cmd - k : chunkc tiling::window --focus next
15
+
16
+# equalize size of windows
17
+shift + alt - 0 : chunkc tiling::desktop --equalize
18
+
19
+# swap window
20
+shift + alt - h : chunkc tiling::window --swap west
21
+shift + alt - j : chunkc tiling::window --swap south
22
+shift + alt - k : chunkc tiling::window --swap north
23
+shift + alt - l : chunkc tiling::window --swap east
24
+
25
+# move window
26
+shift + cmd - h : chunkc tiling::window --warp west
27
+shift + cmd - j : chunkc tiling::window --warp south
28
+shift + cmd - k : chunkc tiling::window --warp north
29
+shift + cmd - l : chunkc tiling::window --warp east
30
+
31
+# move floating windows / windows on a floating space
32
+shift + alt - up     : chunkc tiling::window --warp-floating fullscreen
33
+shift + alt - left   : chunkc tiling::window --warp-floating left
34
+shift + alt - right  : chunkc tiling::window --warp-floating right
35
+shift + cmd - left   : chunkc tiling::window --warp-floating top-left
36
+shift + cmd - right  : chunkc tiling::window --warp-floating top-right
37
+shift + ctrl - left  : chunkc tiling::window --warp-floating bottom-left
38
+shift + ctrl - right : chunkc tiling::window --warp-floating bottom-right
39
+
40
+# send window to desktop
41
+shift + alt - x : chunkc tiling::window --send-to-desktop $(chunkc get _last_active_desktop)
42
+shift + alt - z : chunkc tiling::window --send-to-desktop prev
43
+shift + alt - c : chunkc tiling::window --send-to-desktop next
44
+shift + alt - 1 : chunkc tiling::window --send-to-desktop 1
45
+shift + alt - 2 : chunkc tiling::window --send-to-desktop 2
46
+shift + alt - 3 : chunkc tiling::window --send-to-desktop 3
47
+shift + alt - 4 : chunkc tiling::window --send-to-desktop 4
48
+shift + alt - 5 : chunkc tiling::window --send-to-desktop 5
49
+shift + alt - 6 : chunkc tiling::window --send-to-desktop 6
50
+
51
+# send window to desktop and switch desktop
52
+shift + cmd - x : `id=$(chunkc get _last_active_desktop); chunkc tiling::window -d $id; khd -p "cmd + alt - $id" &> /dev/null`
53
+shift + cmd - z : chunkc tiling::window -d prev; khd -p "cmd + alt - z"
54
+shift + cmd - c : chunkc tiling::window -d next; khd -p "cmd + alt - c"
55
+shift + cmd - 1 : chunkc tiling::window -d 1; khd -p "cmd + alt - 1"
56
+shift + cmd - 2 : chunkc tiling::window -d 2; khd -p "cmd + alt - 2"
57
+shift + cmd - 3 : chunkc tiling::window -d 3; khd -p "cmd + alt - 3"
58
+shift + cmd - 4 : chunkc tiling::window -d 4; khd -p "cmd + alt - 4"
59
+shift + cmd - 5 : chunkc tiling::window -d 5; khd -p "cmd + alt - 5"
60
+shift + cmd - 6 : chunkc tiling::window -d 6; khd -p "cmd + alt - 6"
61
+
62
+# switch to last active desktop
63
+cmd + alt - x   : `id=$(chunkc get _last_active_desktop); khd -p "cmd + alt - $id" &> /dev/null`
64
+
65
+# focus monitor
66
+ctrl + alt - z  : chunkc tiling::monitor -f prev
67
+ctrl + alt - c  : chunkc tiling::monitor -f next
68
+ctrl + alt - 1  : chunkc tiling::monitor -f 1
69
+ctrl + alt - 2  : chunkc tiling::monitor -f 2
70
+ctrl + alt - 3  : chunkc tiling::monitor -f 3
71
+
72
+# send window to monitor and follow focus
73
+ctrl + cmd - z  : chunkc tiling::window --send-to-monitor prev; chunkc tiling::monitor -f prev
74
+ctrl + cmd - c  : chunkc tiling::window --send-to-monitor next; chunkc tiling::monitor -f next
75
+ctrl + cmd - 1  : chunkc tiling::window --send-to-monitor 1; chunkc tiling::monitor -f 1
76
+ctrl + cmd - 2  : chunkc tiling::window --send-to-monitor 2; chunkc tiling::monitor -f 2
77
+ctrl + cmd - 3  : chunkc tiling::window --send-to-monitor 3; chunkc tiling::monitor -f 3
78
+
79
+# increase region size
80
+shift + alt - a : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge west
81
+shift + alt - s : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge south
82
+shift + alt - w : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge north
83
+shift + alt - d : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge east
84
+
85
+# decrease region size
86
+shift + cmd - a : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge west
87
+shift + cmd - s : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge south
88
+shift + cmd - w : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge north
89
+shift + cmd - d : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge east
90
+
91
+# set insertion point for focused container
92
+ctrl + alt - f : chunkc tiling::window --use-insertion-point cancel
93
+ctrl + alt - h : chunkc tiling::window --use-insertion-point west
94
+ctrl + alt - j : chunkc tiling::window --use-insertion-point south
95
+ctrl + alt - k : chunkc tiling::window --use-insertion-point north
96
+ctrl + alt - l : chunkc tiling::window --use-insertion-point east
97
+
98
+# rotate tree
99
+alt - r : chunkc tiling::desktop --rotate 90
100
+
101
+# mirror tree y-axis
102
+alt - y : chunkc tiling::desktop --mirror vertical
103
+
104
+# mirror tree x-axis
105
+alt - x : chunkc tiling::desktop --mirror horizontal
106
+
107
+# toggle desktop offset
108
+alt - a : chunkc tiling::desktop --toggle offset
109
+
110
+# toggle window fullscreen
111
+alt - f : chunkc tiling::window --toggle fullscreen
112
+
113
+# toggle window native fullscreen
114
+shift + alt - f : chunkc tiling::window --toggle native-fullscreen
115
+
116
+# toggle window parent zoom
117
+alt - d : chunkc tiling::window --toggle parent
118
+
119
+# toggle window split type
120
+alt - e : chunkc tiling::window --toggle split
121
+
122
+# float / unfloat window
123
+alt - t : chunkc tiling::window --toggle float
124
+
125
+# toggle sticky, float and resize to picture-in-picture size
126
+alt - s : chunkc tiling::window --toggle sticky;\
127
+          chunkc tiling::window --warp-floating pip-right
128
+
129
+# float next window to be tiled
130
+shift + alt - t : chunkc set window_float_next 1
131
+
132
+# change layout of desktop
133
+ctrl + alt - a : chunkc tiling::desktop --layout bsp
134
+ctrl + alt - s : chunkc tiling::desktop --layout monocle
135
+ctrl + alt - d : chunkc tiling::desktop --layout float
136
+
137
+ctrl + alt - w : chunkc tiling::desktop --deserialize ~/.chunkwm_layouts/dev_1
138
+
139
+# remap caps-lock to escape for this config only !!!
140
+# macos sierra can also perform this remap for a given keyboard
141
+- capslock : khd -p "- escape"
142
+
143
+# key remap for norwegian layout \ { }
144
+cmd - 7 : khd -p "shift + alt - 7"
145
+cmd - 8 : khd -p "shift + alt - 8"
146
+cmd - 9 : khd -p "shift + alt - 9"

+ 11
- 0
.muttrc View File

@@ -0,0 +1,11 @@
1
+folder-hook 'zah_andrew_gmail' 'source ~/.mutt/account_zah_andrewzah.conf'
2
+folder-hook 'zah_andrewzah' 'source ~/.mutt/account_zah_andrew_gmail.conf'
3
+
4
+source ~/.mutt/account_zah_andrew_gmail.conf
5
+#source ~/.mutt/account_zah_andrewzah.conf
6
+
7
+macro index <f2> '<sync-mailbox><refresh><enter-command>source ~/.mutt/zah_andrewzah.conf<enter><change-folder>!<enter>'
8
+macro index <f3> '<sync-mailbox><refresh><enter-command>source ~/.mutt/zah_andrew_gmail.conf<enter><change-folder>!<enter>'
9
+
10
+# Fetch mail shortcut
11
+bind index G imap-fetch-mail

+ 110
- 9
.nvimrc View File

@@ -1,9 +1,42 @@
1
+set nocompatible
2
+filetype off
3
+
1 4
 " Leader key
2 5
 let mapleader = ","
3 6
 
4
-" Load plugins
5
-execute pathogen#infect()
6
-" Gruvbo
7
+set rtp+=/usr/local/opt/fzf
8
+set rtp+=~/.vim/bundle/Vundle.vim
9
+call vundle#begin()
10
+
11
+Plugin 'VundleVim/Vundle.vim'
12
+Plugin 'tpope/vim-fugitive'
13
+Plugin 'tpope/vim-fireplace'
14
+Plugin 'venantius/vim-eastwood'
15
+Plugin 'morhetz/gruvbox'
16
+Plugin 'yuttie/comfortable-motion.vim'
17
+Plugin 'fisadev/FixedTaskList.vim'
18
+Plugin 'nathanaelkane/vim-indent-guides'
19
+Plugin 'luochen1990/rainbow'
20
+Plugin 'tpope/vim-surround'
21
+Plugin 'godlygeek/tabular'
22
+Plugin 'bhurlow/vim-parinfer'
23
+Plugin 'rosenfeld/conque-term'
24
+Plugin 'scrooloose/nerdcommenter'
25
+Plugin 'junegunn/fzf.vim'
26
+Plugin 'majutsushi/tagbar'
27
+
28
+call vundle#end()
29
+filetype plugin on
30
+
31
+set hidden
32
+
33
+nnoremap ' `
34
+nnoremap ` '
35
+
36
+set title
37
+
38
+set history=1000
39
+" Gruvbox
7 40
 set background=dark
8 41
 " let g:gruvbox_italic = 1
9 42
 colorscheme gruvbox
@@ -11,6 +44,7 @@ colorscheme gruvbox
11 44
 filetype plugin indent on
12 45
 runtime macros/matchit.vim
13 46
 
47
+" Get out of insert mode with jj 
14 48
 inoremap jj <Esc>
15 49
 
16 50
 syntax enable 
@@ -26,14 +60,34 @@ nmap <leader>x :wq<cr>
26 60
 
27 61
 set scrolloff=3
28 62
 
63
+
64
+let g:fzf_tags_command = 'ctags --extra=+f -R'
65
+let g:fzf_colors =
66
+\ { 'fg':      ['fg', 'Normal'],
67
+  \ 'bg':      ['bg', 'Normal'],
68
+  \ 'hl':      ['fg', 'Comment'],
69
+  \ 'fg+':     ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
70
+  \ 'bg+':     ['bg', 'CursorLine', 'CursorColumn'],
71
+  \ 'hl+':     ['fg', 'Statement'],
72
+  \ 'info':    ['fg', 'PreProc'],
73
+  \ 'prompt':  ['fg', 'Conditional'],
74
+  \ 'pointer': ['fg', 'Exception'],
75
+  \ 'marker':  ['fg', 'Keyword'],
76
+  \ 'spinner': ['fg', 'Label'],
77
+  \ 'header':  ['fg', 'Comment'] }
78
+
79
+nmap <Leader>t :Tags<CR>
80
+nmap <Leader>b :Buffers<CR>
81
+nmap <c-p> :Files<cr>
29 82
 " Ctrl-P
30
-let g:ctrlp_map = '<c-p>'
31
-let g:ctrlp_cmd = 'CtrlP'
32
-let g:ctrlp_working_path_mode = 'ra'
83
+"let g:ctrlp_map = '<c-p>'
84
+"let g:ctrlp_cmd = 'CtrlP'
85
+"let g:ctrlp_working_path_mode = 'ra'
33 86
 
34
-" oo/OO insert newline without entering INSERT
35
-" nmap oo o<Esc>k
36
-" nmap OO O<Esc>j
87
+nnoremap <C-e> 3<C-e>
88
+nnoremap <C-y> 3<C-y>
89
+
90
+set ruler
37 91
 
38 92
 " Line Numbers
39 93
 set number
@@ -67,6 +121,15 @@ set hls is
67 121
 " nnoremap <silent> <C-l><C-l> :nohl<CR><C-l>
68 122
 nnoremap <silent> <Leader>l :nohl<CR>
69 123
 
124
+" Quick timeouts on key combinations.
125
+set timeoutlen=300
126
+
127
+set shortmess=atI
128
+
129
+set incsearch
130
+set ignorecase " Ignore case when searching...
131
+set smartcase  " Except when starting with a capital
132
+
70 133
 " NerdTree
71 134
 map <F2> :NERDTreeToggle<CR>
72 135
 
@@ -86,6 +149,29 @@ nnoremap <C-H> <C-W><C-H>
86 149
 vmap <C-x> :!pbcopy<CR>  
87 150
 vmap <C-c> :w !pbcopy<CR><CR>
88 151
 
152
+" Double leader key for toggling visual-line mode
153
+nmap <silent> <Leader><Leader> V
154
+vmap <Leader><Leader> <Esc>
155
+
156
+" When pressing <leader>cd switch to the directory of the open buffer
157
+map <Leader>cd :lcd %:p:h<CR>:pwd<CR>
158
+
159
+" Use backspace key for matchit.vim
160
+nmap <BS> %
161
+xmap <BS> %
162
+
163
+" Disable arrow movement, resize splits instead.
164
+
165
+let g:elite_mode = 1
166
+if get(g:, 'elite_mode')
167
+	nnoremap <Up>    :resize +2<CR>
168
+	nnoremap <Down>  :resize -2<CR>
169
+	nnoremap <Left>  :vertical resize +2<CR>
170
+	nnoremap <Right> :vertical resize -2<CR>
171
+endif
172
+
173
+let g:comfortable_motion_scroll_down_key = "j"
174
+let g:comfortable_motion_scroll_up_key = "k"  
89 175
 " Autoset slang -> slim syntax highlighting
90 176
 au BufRead,BufNewFile *.slang set filetype=slim
91 177
 
@@ -96,6 +182,21 @@ au BufRead,BufNewFile *.ecr set filetype=erb
96 182
 nnoremap <leader>ss :call MakeSession()<cr>
97 183
 nnoremap <leader>sl :call LoadSession()<cr>
98 184
 
185
+" tagbar
186
+nnoremap <silent> <c-b> :TagbarToggle<CR>
187
+
188
+" Clojure
189
+" au Filetype clojure nmap <c-c><c-k> :Require<cr>  
190
+
191
+" ================ Persistent Undo ==================
192
+" Keep undo history across sessions, by storing in file.
193
+" Only works all the time.
194
+if has('persistent_undo') && isdirectory(expand('~').'/.vim/backups')
195
+  silent !mkdir ~/.vim/backups > /dev/null 2>&1
196
+  set undodir=~/.vim/backups
197
+  set undofile
198
+endif
199
+
99 200
 set ssop-=options       " do not store options (vimrc) in a session
100 201
 "" Make and load method to save session per dir
101 202
 function! MakeSession()

+ 3
- 1
.zshrc View File

@@ -6,9 +6,11 @@ source ~/.zsh/aliases.zsh
6 6
 source ~/.zsh/functions.zsh
7 7
 source ~/.zsh/history.zsh
8 8
 source ~/.zsh/secret-exports.zsh
9
+~/.zsh/macosx.sh
10
+
9 11
 ZSH_THEME="theunraveler"
10 12
 
11
-plugins=(git lein brew ruby wd)
13
+plugins=(git lein brew ruby wd last-working-dir)
12 14
 
13 15
 source $ZSH/oh-my-zsh.sh
14 16
 source $ZSH/plugins/zsh-up/up.plugin.zsh

+ 10
- 0
zsh/aliases.zsh View File

@@ -3,3 +3,13 @@ alias ll="ls -al"
3 3
 alias pubkey="more ~/.ssh/id_rsa.pub | pbcopy | echo '=> Public key copied to pasteboard.'"
4 4
 
5 5
 alias git=hub
6
+
7
+# Clojure
8
+alias lr="lein repl"
9
+
10
+# Docker
11
+alias dcu="docker-compose up"
12
+alias dcd="docker-compose down"
13
+alias dcb="docker-compose build"
14
+
15
+alias ctags="`brew --prefix`/bin/ctags -f ./.git/tags"

+ 11
- 2
zsh/exports.zsh View File

@@ -1,5 +1,4 @@
1
-# PATH
2
-export PATH=/usr/local/bin:$PATH~/bin:/usr/local/sbin:~/bin
1
+#!/usr/bin/env bash
3 2
 
4 3
 # ZSH 
5 4
 export ZSH=/Users/andrew/.oh-my-zsh
@@ -32,3 +31,13 @@ export EDITOR='nvim'
32 31
 # Lang and Locale
33 32
 export LANG='en_US.UTF-8';
34 33
 export LC_ALL='en_US.UTF-8';
34
+
35
+export LDFLAGS=-L/usr/local/opt/libxml2/lib
36
+export CPPFLAGS=-I/usr/local/opt/libxml2/include
37
+export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig
38
+
39
+#########
40
+# Apps
41
+#########
42
+
43
+export MAIN_SITE_DB_URL="postgres://kemalyst:kemalyst@localhost:5432/main_site_dev"

Loading…
Cancel
Save