using-vim-in-place-of-writeroom.html

blog/2011/10/12/using-vim-in-place-of-writeroom.html

Disclaimer: This content is not owned by the current webmaster nor do we claim the credit.  Ownership of this domain has changed hands. This URL however as a courtesy to web users is a  historic copy of what was originally published.

Conner Mcdaniel has created a new blog athttps://connermcd.wordpress.com You can find all of his current publication there.

Using vim in place of WriteRoom
Oct 12, 2011

Fullscreen editors, also called distraction-free editors, have become popular lately. It’s appealing to have nothing but the words you’re editing before you. However, these editors are often lacking some of the most elemental of features and sometimes cost money. Fortunately, it’s pretty easy to make MacVim into an exact replica of WriteRoom (or gVim into DarkRoom on Windows). Put the following into your .vimrc:

let g:writeroom = 0
let g:transparency = &transparency
function! WriteRoom()
if has(“gui_running”)
if g:writeroom == 0
let g:writeroom = 1
set columns=80
set fullscreen
set linebreak
set nocursorline
set nolist
set nonumber
set noshowmode
set rulerformat=%{strftime(‘%b %e %I:%M %p’)}
set transparency=0
hi NonText guifg=bg
else
let g:writeroom = 0
set cursorline
set list
set nofullscreen
set nolinebreak
set number
set rulerformat=
set showmode
let &transparency=g:transparency
hi clear
endif
endif
endfunction
This creates a function that you can execute to put MacVim into WriteRoom mode. If you don’t want the clock display then you can comment out the lines about rulerformat. Personally, I like to keep track of time when I’m in fullscreen mode. You can also change the lines and columns to best fit your screen size. Then, you can map a shortcut to execute the function. I use gw for normal mode and \w for insert mode.

nmap gw :exe WriteRoom()
imap w :exe WriteRoom()i
It’s pretty easy to make vim look however you want. If you happened to have some secret passion for notepad then it wouldn’t be difficult to make vim look that way either.

blog/2014/01/28/getting-things-done.html

Disclaimer: This content is not owned by the current webmaster nor do we claim the credit.  Ownership of this domain has changed hands. This URL however as a courtesy to web users is a  historic copy of what was originally published.

Conner Mcdaniel has created a new blog athttps://connermcd.wordpress.com You can find all of his current publication there.

Getting things done
Jan 28, 2014

Sometimes it’s difficult being productive. Procrastination can be a nasty problem. So, to help, I’ve made a simple script to keep me on track. It’s much like the pomodoro technique but without all the excess theory and pretense. It’s really just a command line egg timer that integrates with tmux, mpd, libnotify, espeak and any other custom commands you might like. It would not be difficult to extend its functionality either. The basic usage looks like this:

USAGE:

gtd [ -bcmnst ] [ work length ] [ break length ]

OPTIONS:

-b : start on a break
-c : custom command (defaults to “clear”)
-m : toggle MPD on change
-n : notify on change
-s : speak command
-t : show time in tmux status bar
The tmux integration really just updates a temporary file with the time remaining on the timer and refreshes your tmux session. You could use this in your tmux status bar like this for example:

set-option -g status-right “#(cat /tmp/gtd)#[fg=colour15,noreverse,bg=colour233] #(date ‘+%a %m/%d %I:%M %P’) ”
This sets the right side of your status bar to the time remaining in the timer (if the timer is on) and then the date and time. You could just as easily read this into conky or GeekTool (the OSX equivalent).

You can find the project here and add any suggestions to the issue tracker. Hope it helps someone else!

blog/2014/01/28/getting-things-done.html

blog/2014/01/28/getting-things-done.html

Disclaimer: This content is not owned by the current webmaster nor do we claim the credit.  Ownership of this domain has changed hands. This URL however as a courtesy to web users is a  historic copy of what was originally published.

Conner Mcdaniel has created a new blog athttps://connermcd.wordpress.com You can find all of his current publication there.

Getting things done
Jan 28, 2014

Sometimes it’s difficult being productive. Procrastination can be a nasty problem. So, to help, I’ve made a simple script to keep me on track. It’s much like the pomodoro technique but without all the excess theory and pretense. It’s really just a command line egg timer that integrates with tmux, mpd, libnotify, espeak and any other custom commands you might like. It would not be difficult to extend its functionality either. The basic usage looks like this:

USAGE:

gtd [ -bcmnst ] [ work length ] [ break length ]

OPTIONS:

-b : start on a break
-c : custom command (defaults to “clear”)
-m : toggle MPD on change
-n : notify on change
-s : speak command
-t : show time in tmux status bar
The tmux integration really just updates a temporary file with the time remaining on the timer and refreshes your tmux session. You could use this in your tmux status bar like this for example:

set-option -g status-right “#(cat /tmp/gtd)#[fg=colour15,noreverse,bg=colour233] #(date ‘+%a %m/%d %I:%M %P’) ”
This sets the right side of your status bar to the time remaining in the timer (if the timer is on) and then the date and time. You could just as easily read this into conky or GeekTool (the OSX equivalent).

You can find the project here and add any suggestions to the issue tracker. Hope it helps someone else!

blog/2011/10/21/notetaking-with-vim.html

blog/2011/10/21/notetaking-with-vim.html

Notetaking with vim
Oct 21, 2011

Eventually I realized that Notational Velocity was just an extra keyboard shortcut and window on my desktop, so I ditched it for some better alternatives in vim. I’m especially fond of using ack and the ack plugin for vim. I’m using these mappings for my .vimrc

map n :e! /notes
map ] :Note
map [ :NoteTab
map 0 :Nls
command -nargs=1 Note :exe “e! ” . fnameescape(“/notes/.txt”)
command -nargs=1 NoteTab :exe “tabnew ” . fnameescape(“/notes/.txt”)
command -nargs=1 Nls :Ack –text “” /notes
I’ve also made some snippets to help with notetaking in markdown.

snippet img
![${1}](/notes/img/${2})${3}
snippet t
# `expand(“%:r”)`
> Date: `strftime(“%m-%d-%y”)`
> Instructor: ${1} `

## ${2}
The video also references my post about WriteRoom mode in vim.

blog/2015/04/04/studying-chess-on-linux.html

blog/2015/04/04/studying-chess-on-linux.html

Studying chess on linux
Apr 4, 2015

I’ve been playing a lot more chess lately as it can be quite addicting. There are numerous places and ways to study chess, but I wanted to share a few things I’ve figured out from a linux perspective. I mostly play on chess.com since I find their android app to be one of the better ones (though not without bugs). It doesn’t really matter what service you use to play others so long as you are able to get the Portable Game Notation (PGN) file for your games. This contains a record of all the moves made in the game, you and the opponent’s rating, and some other data.

One thing chess.com doesn’t have on it’s web-based app that some other services do is a chess engine to evaluate positions when doing post-game analysis. Fortunately, you can do this yourself quite easily on linux if you have the game’s PGN. First, install Scid vs. PC which is a chess swiss army knife but importantly allows importing PGN files and evaluating games with various chess engines. Basically if the chess engine exists and can be installed on linux, you can use it. Stockfish is a very popular open-source chess engine and one of the engines I frequently use. Once you install it you can set up Scid vs. PC to analyze your games with it. Just go to Tools → Analysis Engines → New and add in stockfish using stockfish as the command and $HOME/.scidvspc as the directory. Make sure the protocol is UCI and you can give it a shortcut key or make it the default engine if you like.

Now just import a PGN file by copying it to your clipboard and going to Edit → Paste PGN → Import and you’ve got the game loaded into the system. Click the little train engine above the board to get the chess engine going and scroll through the game with your mouse wheel. Now you can evaluate any chess game you can get a PGN file for in real time. Pretty handy for improving your skills.