add vim shortcut to toggle folds
This commit is contained in:
parent
2b2f476804
commit
d75f09890e
@ -1,5 +1,10 @@
|
|||||||
# https://wiki.archlinux.org/title/Xorg/Keyboard_configuration
|
# https://wiki.archlinux.org/title/Xorg/Keyboard_configuration
|
||||||
setxkbmap -layout us,in -variant ,mal -option grp:win_space_toggle
|
setxkbmap -layout us,in -variant ,mal -option grp:win_space_toggle
|
||||||
|
|
||||||
|
# Useful for checking spelling of words
|
||||||
|
word() {
|
||||||
|
grep "$1" /etc/dictionaries-common/words
|
||||||
|
}
|
||||||
|
|
||||||
# z-eyes
|
# z-eyes
|
||||||
~/z-eyes.sh &
|
~/z-eyes.sh &
|
||||||
|
@ -173,6 +173,10 @@ hc keybind XF86MonBrightnessDown spawn xbacklight -dec 1%
|
|||||||
#hc keybind XF86AudioPrev spawn playerctl previous
|
#hc keybind XF86AudioPrev spawn playerctl previous
|
||||||
#hc keybind XF86AudioNext spawn playerctl next
|
#hc keybind XF86AudioNext spawn playerctl next
|
||||||
|
|
||||||
|
# Original volume keys don't work. Use what we got!
|
||||||
|
hc keybind XF86AudioPrev spawn amixer -D pulse sset Master 5%-
|
||||||
|
hc keybind XF86AudioPlay spawn amixer -D pulse sset Master 5%+
|
||||||
|
|
||||||
# Lock screen
|
# Lock screen
|
||||||
hc keybind Control-Shift-l spawn bash -c 'i3lock -c 000000 && sleep 5s && exec systemctl suspend'
|
hc keybind Control-Shift-l spawn bash -c 'i3lock -c 000000 && sleep 5s && exec systemctl suspend'
|
||||||
hc keybind Mod4-l spawn i3lock -c 444444
|
hc keybind Mod4-l spawn i3lock -c 444444
|
||||||
|
@ -71,6 +71,10 @@ c.content.notifications.enabled = False
|
|||||||
## Don't start playing videos automatically. Data is expensive.
|
## Don't start playing videos automatically. Data is expensive.
|
||||||
c.content.autoplay = False
|
c.content.autoplay = False
|
||||||
|
|
||||||
|
## Auto-complete
|
||||||
|
c.completion.open_categories = ["quickmarks", "bookmarks", "history", "filesystem"]
|
||||||
|
c.completion.show = "auto"
|
||||||
|
|
||||||
## Per-domain settings
|
## Per-domain settings
|
||||||
with config.pattern("*://.youtube.com") as youtube:
|
with config.pattern("*://.youtube.com") as youtube:
|
||||||
youtube.content.cookies.accept = "never"
|
youtube.content.cookies.accept = "never"
|
||||||
|
@ -22,43 +22,43 @@ static int newposition = 0;
|
|||||||
static Bool npisrelative = False;
|
static Bool npisrelative = False;
|
||||||
|
|
||||||
#define SETPROP(p) { \
|
#define SETPROP(p) { \
|
||||||
.v = (char *[]){ "/bin/sh", "-c", \
|
.v = (char *[]){ "/bin/sh", "-c", \
|
||||||
"prop=\"`xwininfo -children -id $1 | grep '^ 0x' | sed -e's@^ *\\(0x[0-9a-f]*\\) \"\\([^\"]*\\)\".*@\\1 \\2@' | xargs -0 printf %b | dmenu -l 10`\" &&" \
|
"prop=\"`xwininfo -children -id $1 | grep '^ 0x' | sed -e's@^ *\\(0x[0-9a-f]*\\) \"\\([^\"]*\\)\".*@\\1 \\2@' | xargs -0 printf %b | dmenu -l 10`\" &&" \
|
||||||
"xprop -id $1 -f $0 8s -set $0 \"$prop\"", \
|
"xprop -id $1 -f $0 8s -set $0 \"$prop\"", \
|
||||||
p, winid, NULL \
|
p, winid, NULL \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MODKEY ControlMask
|
#define MODKEY ControlMask
|
||||||
static Key keys[] = { \
|
static Key keys[] = { \
|
||||||
/* modifier key function argument */
|
/* modifier key function argument */
|
||||||
{ MODKEY|ShiftMask, XK_Return, focusonce, { 0 } },
|
{ MODKEY|ShiftMask, XK_Return, focusonce, { 0 } },
|
||||||
{ MODKEY|ShiftMask, XK_Return, spawn, { 0 } },
|
{ MODKEY|ShiftMask, XK_Return, spawn, { 0 } },
|
||||||
{ MODKEY, XK_t, spawn, SETPROP("_TABBED_SELECT_TAB") },
|
{ MODKEY, XK_t, spawn, SETPROP("_TABBED_SELECT_TAB") },
|
||||||
|
|
||||||
{ MODKEY|ShiftMask, XK_l, rotate, { .i = +1 } },
|
{ MODKEY|ShiftMask, XK_l, rotate, { .i = +1 } },
|
||||||
{ MODKEY|ShiftMask, XK_h, rotate, { .i = -1 } },
|
{ MODKEY|ShiftMask, XK_h, rotate, { .i = -1 } },
|
||||||
{ MODKEY|ShiftMask, XK_j, movetab, { .i = -1 } },
|
{ MODKEY|ShiftMask, XK_j, movetab, { .i = -1 } },
|
||||||
{ MODKEY|ShiftMask, XK_k, movetab, { .i = +1 } },
|
{ MODKEY|ShiftMask, XK_k, movetab, { .i = +1 } },
|
||||||
{ MODKEY, XK_Tab, rotate, { .i = 0 } },
|
{ MODKEY, XK_Tab, rotate, { .i = 0 } },
|
||||||
|
|
||||||
{ MODKEY, XK_1, move, { .i = 0 } },
|
{ MODKEY, XK_1, move, { .i = 0 } },
|
||||||
{ MODKEY, XK_2, move, { .i = 1 } },
|
{ MODKEY, XK_2, move, { .i = 1 } },
|
||||||
{ MODKEY, XK_3, move, { .i = 2 } },
|
{ MODKEY, XK_3, move, { .i = 2 } },
|
||||||
{ MODKEY, XK_4, move, { .i = 3 } },
|
{ MODKEY, XK_4, move, { .i = 3 } },
|
||||||
{ MODKEY, XK_5, move, { .i = 4 } },
|
{ MODKEY, XK_5, move, { .i = 4 } },
|
||||||
{ MODKEY, XK_6, move, { .i = 5 } },
|
{ MODKEY, XK_6, move, { .i = 5 } },
|
||||||
{ MODKEY, XK_7, move, { .i = 6 } },
|
{ MODKEY, XK_7, move, { .i = 6 } },
|
||||||
{ MODKEY, XK_8, move, { .i = 7 } },
|
{ MODKEY, XK_8, move, { .i = 7 } },
|
||||||
{ MODKEY, XK_9, move, { .i = 8 } },
|
{ MODKEY, XK_9, move, { .i = 8 } },
|
||||||
{ MODKEY, XK_0, move, { .i = 9 } },
|
{ MODKEY, XK_0, move, { .i = 9 } },
|
||||||
|
|
||||||
{ MODKEY, XK_q, killclient, { 0 } },
|
{ MODKEY, XK_q, killclient, { 0 } },
|
||||||
|
|
||||||
{ 0, XK_F11, fullscreen, { 0 } },
|
{ 0, XK_F11, fullscreen, { 0 } },
|
||||||
|
|
||||||
// User defined
|
// User defined
|
||||||
{ MODKEY, XK_Left, rotate, { .i = +1 } },
|
{ MODKEY, XK_Left, rotate, { .i = +1 } },
|
||||||
{ MODKEY, XK_Right, rotate, { .i = -1 } },
|
{ MODKEY, XK_Right, rotate, { .i = -1 } },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
22
vim/.vimrc
22
vim/.vimrc
@ -44,6 +44,28 @@ autocmd! TabLeave * let g:last_tab_backup = g:last_tab | let g:last_tab = tabpag
|
|||||||
autocmd! TabClosed * let g:last_tab = g:last_tab_backup
|
autocmd! TabClosed * let g:last_tab = g:last_tab_backup
|
||||||
nmap <silent> gl :exe "tabn " . g:last_tab<cr>
|
nmap <silent> gl :exe "tabn " . g:last_tab<cr>
|
||||||
|
|
||||||
|
" Toggle fold tree under cursor
|
||||||
|
nnoremap <Tab> zA
|
||||||
|
|
||||||
|
|
||||||
|
" " Default values for registers
|
||||||
|
" "" c with gcc
|
||||||
|
" let @c = ':w %
:!gcc % -o a.out;./a.out
'
|
||||||
|
"
|
||||||
|
" "" sml with mlton
|
||||||
|
" let @n = ':w %
:!tmux run-shell -b -t 1 "mlton -output a.out %; ./a.out"
'
|
||||||
|
"
|
||||||
|
" "" python with python3
|
||||||
|
" "let @p = ':w %
:!python3 %
'
|
||||||
|
"
|
||||||
|
" "" latex with pdflatex
|
||||||
|
" let @x = ':w %
:!pdflatex %
'
|
||||||
|
"
|
||||||
|
" "" Add code block in markdown
|
||||||
|
" let @e = 'o```Ypko'
|
||||||
|
"
|
||||||
|
" "" run sml with smlnj
|
||||||
|
" let @s = ':w %
:!rlwrap sml %
'
|
||||||
|
|
||||||
|
|
||||||
" https://stackoverflow.com/questions/18296192/vim-compile-and-run-shortcut
|
" https://stackoverflow.com/questions/18296192/vim-compile-and-run-shortcut
|
||||||
|
@ -29,6 +29,9 @@ map [normal] <PageUp> scroll full-up
|
|||||||
map [normal] <Left> navigate previous
|
map [normal] <Left> navigate previous
|
||||||
map [normal] <Right> navigate next
|
map [normal] <Right> navigate next
|
||||||
|
|
||||||
|
# Copy path of current file to clipboard
|
||||||
|
map [normal] <C-o> exec "bash -c \"echo $FILE | xclip -i -sel clip\""
|
||||||
|
|
||||||
# Don't make it that easy to quit zathura
|
# Don't make it that easy to quit zathura
|
||||||
unmap q
|
unmap q
|
||||||
unmap [index] q # I guess default mode is normal mode
|
unmap [index] q # I guess default mode is normal mode
|
||||||
|
Loading…
Reference in New Issue
Block a user