blob: 2168b37a6b26feb664fd256797387df884bcbb9d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
{ fzf, tmux }:
''
# Highlight any files whose names start with "zsh" as sh
hook global BufCreate (.*/)?\.?zsh.* %{
set-option buffer filetype sh
}
# Highlight files ending in .conf as ini
# (Will probably be close enough)
hook global BufCreate .*\.conf %{
set-option buffer filetype ini
}
# Highlight files ending in .html.erb as html
hook global BufCreate .*\.html.erb %{
set-option buffer filetype html
}
# Strip trailing whitespace on save
hook global BufWritePre .*(?<!\.diff)$ %{
try %{execute-keys -draft %{%s\h+$<ret>d}}
echo
}
define-command -docstring "import from the system clipboard" clipboard-import %{
set-register dquote %sh{pbpaste}
echo -markup "{Information}imported system clipboard to register """
}
define-command -docstring "export to the system clipboard" clipboard-export %{
nop %sh{ printf "%s" "$kak_main_reg_dquote" | pbcopy }
echo -markup "{Information}exported register "" to system clipboard"
}
define-command -docstring "open a file using fzf" open %{
edit %sh{
git ls-files -oc --exclude-standard |
${fzf}/bin/fzf-tmux -r 80 --reverse
}
}
alias global o open
define-command -params 1.. -docstring "change file modes" chmod %{
nop %sh{ chmod $@ "$kak_buffile" }
}
declare-option str last_test
define-command -docstring "intelligently run code" run %{
evaluate-commands -save-regs x %{
write
nop %sh{${tmux}/bin/tmux split-window -hl 80 "$kak_buffile; read"}
}
}
define-command mkdirp %{
nop %sh{mkdir -p "$(dirname "$kak_buffile")"}
}
define-command mkdirpw %{
mkdirp
write
}
map global normal <a-Y> :clipboard-import<ret>
map global normal <a-y> :clipboard-export<ret>
map global normal / /(?i)
# Allow indenting from any position in the line, with the correct indentation.
map global insert <tab> '<a-;><a-gt>'
map global insert <s-tab> '<a-;><lt>'
map -docstring "Remove Symbol hashrockets" global user \
<gt> 's:\S+<space>+=<gt><ret>;<a-?><space>+<ret>c:<esc>h<a-/>:<ret>d'
map -docstring "Convert single quotes to double quotes" global user \
%{'} %{s'<ret>r"}
map -docstring "Toggle line comments" global user \
%{#} %{:comment-line<ret>}
declare-user-mode bookmarks
map -docstring "Edit bookmarked file" global user b \
%{:enter-user-mode bookmarks<ret>}
map -docstring "wiki" global bookmarks w %{:edit-wiki-index<ret>}
set-option global indentwidth 2
set-option global ui_options ncurses_assistant=none
set-option global scrolloff 5,5
set-option global autoreload yes
add-highlighter global/ number-lines -hlcursor -separator "│"
add-highlighter global/ show-matching
''
|