A Foolish Manifesto

fREWdiculous!

Splits, panes, and tiles

How do you manage numerous windows when you have a gigantic viewing space? Or what if you have a really tiny viewing space? At work I have two 22″ monitors and maximization is just too ridiculous to consider and it is typically a huge waste of space.

I decided that if I am going to have a lot of windows open I should look into something that can help me tile things correctly. A lot of the tiling solutions out there are all or nothing. Once you use them you can no longer have overlapping windows, you must use their strange layouts, and if you don’t know their hotkeys you can’t use your computer. I decided that for now, none of those are an option.

Instead I found a program called GridMove. It allows you to have numerous grids to snap windows into. You can achieve “snapping” with mouse interaction or with various hotkeys. Overall I have been extremely happy with it.

Work Splits

I even wrote a tiny AHK script to open programs for one of my projects and place them in the right place.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#o::

   Run "C:Documents and SettingsfrewMy DocumentsCodeaircraft_ducting"
   WinWait, "C:Documents and SettingsfrewMy DocumentsCodeaircraft_ducting",,3
   sendinput,#6
   Run "C:Program FilesApache Software FoundationApache2.2logserror.log"
   WinWait, BareTail,,3
   sendinput,#5
   Run "C:Program FilesVimvim72gvim.exe" -c "call ACDRI()" -S C:Documents and SettingsfrewMy DocumentsCodeaircraft_ductingsession
   WinWait, GVIM,,3
   sendinput,#4
   Run "C:Program FilesMozilla Firefoxfirefox.exe" -new-window http://localhost:8080/devcgi/init.plx
   WinWait, "Mozilla Firefox",,3
   sendinput,#1

return

But that’s not all! I tend to use splits in my text editor a lot, and with that in mind you may notice the about call to ACDRI() and the S switch. S reloads all of my previous editor settings, including splits, and ACDRI() opens my project file.

1
2
3
4
5
6
7
8
9
10
11
12
13
function! ACDRIEnd()
   wincmd h
   wincmd h
   wincmd h
   q!
   mksession! "C:Documents and SettingsfrewMy DocumentsCodeaircraft_ducting"session
   qa
endfunction

function! ACDRI()
   Project "C:Documents and SettingsfrewMy DocumentsCodeaircraft_ductingproject"
   set foldlevel=1
endfunction

And lastly, at home where monitor space is much more of an issue, I tend to have gvim and a console side by side, with numerous splits each. The console splits are achieved with ^a S and ^a |. You can move to the next one with ^a .

Linux Laptop Screenshot

Anyway, does anyone have any other tips having to do with automated window management?

  • 3 Comments
  • Filed under: Uncategorized
  • Vim Settings

    Today I am just going to talk about my favorite vim “stuff.” A lot of this I have gathered over the past 3-5 years of serious vim usage. I used vim before that, but not with this heavy of customization. I’ll start with the simple stuff and move up from there.

    Basic settings:

    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
    " Enable Line Numbers
    set number

    " Ignore case for searches
    set ignorecase

    " Unless you type an uppercase letter
    set smartcase

    " Incremental searching is sexy
    set incsearch

    " Highlight things that we find with the search
    set hlsearch

    " This is totally awesome - remap jj to escape
    " in insert mode.  You'll never type jj anyway,
    " so it's great!
    inoremap jj <Esc>

    " If you have caps lock on disable too many J's
    nnoremap JJJJ <Nop>

    " Set off the other paren
    highlight MatchParen ctermbg=4

    " no longer press shift to enter commands
    nnoremap ; :
    nnoremap : ;
    vnoremap ; :
    vnoremap : ;

    I also highly recommend the InkPot color scheme for gui mode and metacosm for console mode. Here’s some code to pull that off:

    1
    2
    3
    4
    5
    6
    " Favorite Color Scheme
    if has("gui_running")
       colorscheme inkpot
    else
       colorscheme metacosm
    endif

    I also use some plugins to make my life easier.

    • matchit: allows you to match things like html tags and other complicated matches with %.
    • NERD_commenter: simple keystrokes to comment/uncomment any code.
    • project: this allows you to have a user defined file listing on the left (or right) which I find quite nice for navigation. You can also use it to have special mappings defined when you open a file in a specific project.
    • surround: surround anything with quotes, parens, braces, xml tags… Great for html editing, but I use this all the time for normal code. (And I just used it to put all of these items in a list easily!)

    Do you have any suggestions for killer additions to vim?

  • 2 Comments
  • Filed under: Uncategorized