photo
Jordan Sissel
geek

Fri, 24 Oct 2003

vim - indenting

So rather than start writing my own indent function, I decided to read more about cindent. The option, cinoptions, lets you tell vim how to react to things. What I was looking for was:
When I am typing a function call, and break the line because it's too long, I'd like the new line to start aligned with the open parenthesis, like this:

System.out.println("Hello there, how are you? kthx." + 
                   "Java is fun");
		   ^

I want vim to automatically indent to the column position marked by the caret, ^ - Turns out vim has this functionality already (duh, it has almost evrything).

:set cinoptions=(0

This, when cindent is enabled, will cause vim to auto indent to match your parentheses usage.

Comments: 0 (view comments)
Tags:
Permalink: /productivity/80
posted at: 09:56

Thu, 23 Oct 2003

vim rocks me.

So yeah - I was explaining the beauties of cindent and folding in vim to a werkt today and when I went back to my room decided to pull up the help on cindent, etc. Looked at indentexpr and decided I needed to learn more vim. What indentexpr lets you do is set a vim function (Or perl/python/ruby) tell vim how much to indent.

More on this later after I write a vim script to do exactly what I want...

Comments: 0 (view comments)
Tags:
Permalink: /productivity/79
posted at: 20:14

sshall again

So xapply -f doesn't cut it for when I want interactive ssh sessions, so I updated my sshall script to use the apply syntax instead of xargs - this lets me do

sshall

and actually get a login prompt. If I used xapply (as previously) it would complain about not being able to grab stdin (or a tty) because we were doing:

cat hostlist | xapply -f 'ssh ...'

This would give the error message (for each host):
project1 -
Pseudo-terminal will not be allocated because stdin is not a terminal.
The solution to this problem is varied. You'll probably need the -t option for ssh: ssh -t user@server will allocate a terminal for you on the remote server so console-based applications will work.

Comments: 0 (view comments)
Tags:
Permalink: /productivity/78
posted at: 08:48

Tue, 21 Oct 2003

bourne shell goodness.

So until now I never knew how to pipe things into my shell scripts - I'm smacking myself on the head now for not having figured this out sooner.

In unix, the standard file descriptors stdin, stdout, and stderr are numbered 0, 1, and 2, respectively. I've always done descriptor redirection, such as:

grep ^Poop myfile.txt 2>&1 > /dev/null

This will redirect stderr (fd #2) to stdout (fd #1). stdout is then redirected to /dev/null.

What I never bothered trying was redirecting stdin

#!/bin/sh

echo "Printing output:"
sed -e 's/^./Output: &/' <&0 

Note the <&0 - this will use our stdin as the stin for sed.
Now, let's try running it:
ls | ./myscript

The output is just how I want:

whack(~/bin) [590] > /bin/ls | sh myls.sh
Printing output:
Output: Mrandom
Output: fix
Output: hostlist
Output: intarweb
Output: logtail
Output: malbums
Output: mclear
Output: minfo
Output: myls.sh

Comments: 0 (view comments)
Tags:
Permalink: /geekery/77
posted at: 18:38

Tue, 07 Oct 2003

x2x2x2x2x

I love my laptop keyboard and mouse nipple. I love them lots, and since my desktop keyboard is kinda borked right now (some keys don't work all the time) I decided I'd use x2x from my laptop -> my desktop. My destop also has x2x from it to my ultra1.
If the mouse from my laptop is being sent to the desktop currently, then I can use the desktop's mouse to go to the ultra1's head and use mouse+keyboard there...
so I end up using laptop keyboard + desktop mouse on the ultra1.. haha <3 x2x

Comments: 0 (view comments)
Tags:
Permalink: /productivity/76
posted at: 10:16

Sun, 05 Oct 2003

Terminal fun?

While perusing manpages (col, specifically) I found that terminals respond to ^N by switching to an alternate character set (a drawing set, perhaps) while ^O will switch back to normal.

I often cat things I should not, and end up borking my terminal display, typing echo "^V^O" where ^V is CTRL+V and ^O is CTRL+O. This will echo ^O to your terminal and reset your character set.

Comments: 0 (view comments)
Tags:
Permalink: /geekery/75
posted at: 17:00

vi seminar!

Finally gave a real vi seminar, the notes can be found here:
vi Seminar

Comments: 0 (view comments)
Tags:
Permalink: /geekery/74
posted at: 16:48

Fri, 03 Oct 2003

ion-devel

So with much a-fiddling, I discovered that you can create floating workspaces with the default keybinding "F9" - At the prompt, "Go to or create workspace: " enter WFloatWS:<workspace name> where <workspace name> can be anything. Hitting F2 starts up my friend, xterm, on this new floating workspace.

I haven't yet figured out how to create empty WFloatFrames, but I'm working on it. It seems that if the parent frame has only one child you can't cfocus the parent until the child is dead.

That is:

WIonWS
  |
  +---> WIonFrame
    |
    +----> WFloatWS
You can't give focus to the WIonFrame until WFloatWS either is destroyed or moved outside of the frame. I'm sure there's a way around this.

Comments: 0 (view comments)
Tags:
Permalink: /productivity/72
posted at: 11:44

Wed, 01 Oct 2003

ion rocks me

I've been comfortable with my assumption that ion was lacking in a way to do floating workspaces and windows and had groomed my desktop enviroment to fit this assumption. However, yesterday as I was poking around in the various lua config files I saw how to create floating workspaces.

From what little bit I've played with this feature you can do a ton of crazy cool things (From simply having a full-screen floating workspace to attaching a floating workspace to an existing WIonFrame.)

Mad kudos to Tuomo for writing such a kick ass window manager. I'm going to produce some documentation soon on how to use Lua in Ion and a brief introduction on the floatws module and how to use it.

Comments: 0 (view comments)
Tags:
Permalink: /productivity/71
posted at: 13:10

Search this site

Navigation

Metadata

Home About Resume My Code (SVN)

Articles

ARP Security Dynamic DNS with DHCP OpenLDAP+Kerberos+SASL PPP over SSH SSH Security: /bin/false Week of Unix Tools Work Efficiency

Projects

fex firefox tabsearch firefox urledit grok keynav liboverride newpsm (FreeBSD) nis2ldap pam_captcha poor man's backup Solaris audio utility xboxproxy xdotool xmlpresenter xpathtool misc scripts

Presentations

Yahoo! Hack Day '06 Unix Essentials Vi/Vim Essentials

Tag Cloud

Calendar

< October 2003 >
SuMoTuWeThFrSa
    1 2 3 4
5 6 7 8 91011
12131415161718
19202122232425
262728293031 

Friends

BarCamp Kent Brewster Tantek Çelik John Resig Wesley Shields Tyler Shields

Technorati