Terminal Question
I think the answers are in here! http://tldp.org/HOWTO/Text-Terminal-HOWTO.html
Terminal Question
I think the answers are in here! http://tldp.org/HOWTO/Text-Terminal-HOWTO.html
I'm seeing how far I can get through Advent of Code using only Vim's editing commands. No Vimscript, variables, or function calls allowed! (Use of the expression register is also STRICTLY limited. I employed it to do adding in some early solutions, but anything more complex is a no-no.)
Solutions are notated using the standard notation used in Vim mappings and documentation. Ctrl-A is notated as <C-A>
, Escape as <Esc>
, Return as <CR>
, etc.
But if a line starts with a colon, then it's an entire ex command: press Enter at the end of the line.
Otherwise, linebreaks aren't meaningful: they're just inserted at places that felt "natural" to me.
Note that I'm well aware the same techniques could be streamlined considerably: my intention with these is — hard as this may be to believe — to aim for clarity over efficiency. I'm not golfing here!
nnoremap <Leader>s <Cmd>call SplitToggle()<CR> | |
command SplitToggle call SplitToggle() | |
function! SplitToggle() abort | |
" Check if there's already a split | |
if !exists('s:split_id') | |
" Create the split | |
vsplit | |
" Move to the new window | |
wincmd p |
#!/bin/sh | |
while read -r line; do | |
tmux send-keys -t1 "$line" C-M | |
done |
This snippet makes Vim automatically continue/end lists in insert mode, similar to the way word processors do:
It supports ordered lists with markers like 1.
and unordered lists with -
markers (because those are the markers I use.)
(It's particularly useful when using an iOS keyboard where punctuation and numerals are slow to access.)
# An edited version of the code for searching for PlaceHolders (^K) from here: | |
# http://vim.wikia.com/wiki/User:Tlgrok/Form_Feeds_and_Vertical_Tabs | |
function! <SID>FindSection (forward) | |
let l:place_holder = nr2char(12) "form feed | |
let l:flags="W" | |
if (!a:forward) | |
let l:flags.="b" | |
endif | |
let l:match=search(l:place_holder, l:flags) |
g_LastCtrlKeyDownTime := 0 | |
g_AbortSendEsc := false | |
g_ControlRepeatDetected := false | |
*CapsLock:: | |
if (g_ControlRepeatDetected) | |
{ | |
return | |
} |
(defun make-cd (title artist rating ripped) | |
(list :title title :artist artist :rating rating :ripped ripped)) | |
(defvar *db* nil) | |
(defun add-record (cd) (push cd *db*)) | |
(defun dump-db () | |
(dolist (cd *db*) | |
(format t "~{~a:~10t~a~%~}~%" cd))) |
require 'formula' | |
class Tads2Compiler <Formula | |
url 'http://www.tads.org/frobtads/frobtads-t2compiler-0.13.tar.gz' | |
md5 '12caf94d9c1e646ae04b44da0df83a30' | |
end | |
class Tads3Compiler <Formula | |
url 'http://www.tads.org/frobtads/frobtads-t3compiler-0.13.tar.gz' | |
md5 '231d359f389be3d28e8134a2b832dd70' |
> Richie's Custom Quix Commands | |
> TITLE: sedm0784-quix.txt | |
> REMARKS: Hello, world. Under construction. Dilute! Dilute! | |
> GITHUB: http://gist.github.com/ | |
> MORE: http://quixapp.com | |
> UPDATED: 2010-08-20 | |
@Richie's Custom Quix Commands | |
rl javascript:function%20iprl5(){var%20d=document,z=d.createElement('scr'+'ipt'),b=d.body;try{if(!b)throw(0);d.title='(Saving...)%20'+d.title;z.setAttribute('src','http://www.instapaper.com/j/78TgmhXbGcGu?u='+encodeURIComponent(d.location.href)+'&t='+(new%20Date().getTime()));b.appendChild(z);}catch(e){alert('Please%20wait%20until%20the%20page%20has%20loaded.');}}iprl5();void(0) Read Later | |
wl javascript:%20(function(){var%20a=document.createElement("script"),b=document.createElement("script"),c=new%20Date(),c=c.getDate();b.src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js";b.type="text/javascript";a.src="http://wacchen.com/javascripts/bookmarklette_min.js?date="+c;a.type="text/javascript";document.body.appendChild(b);document.body.appendChild(a);})(); Watch Lat |