This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Softwrap long lines (and correct for improper kakoune movement behavior) | |
add-highlighter global/softwrap wrap -word -indent | |
define-command goto-center -docstring 'Jump to the center of the view' %{ | |
execute-keys %sh{ | |
echo $kak_window_range $kak_cursor_line | ( | |
read y x h w l | |
num_lines=$((l-y-(h+1)/2)) | |
if [ $num_lines -lt 0 ]; then | |
echo "${num_lines##-}j" | |
elif [ $num_lines -gt 0 ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Replicate expandtab from vim. | |
declare-option -docstring "Expand <tab> to spaces based on tabstop." bool expandtab yes | |
# Replicate softtabstop from vim. | |
declare-option -docstring "Make tabstop number of spaces feel like a <tab> when pressing <tab> or <backspace> in insert mode." int softtabstop 4 | |
# Helper function for inserting a <tab> | |
def softtabstop-insert-tab -hidden %{ | |
evaluate-commands -no-hooks -draft -itersel %{ | |
try %sh{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Memory profiling utilities | |
''' | |
import gc | |
import inspect | |
import linecache | |
import os.path | |
import sys | |
import time | |
import threading |