Editors

My heart lies with GNU Emacs. It is probably my most used tool at work because I take a crapload of notes. The pages on this site are written in Emacs in markdown (because mkdocs supports it well). Some other notes are in org format. And the bulk of my work-related notes (dating back to 2007) are in one big fat plain text file that is, as of December 2017, 26252 lines long.

I'm pretty comfortable with Vim as well. I use it for quick and dirty editing for my projects. For longer sessions I invariably swtich to Emacs.

Note

My dotfiles for both editors are at this github repo.

On a new machine I clone this repo, copy the dotfiles over and:

Yay!

Compile GNU Emacs on Centos/Fedora/RHEL

yum -y groupinstall "Development Tools" 
yum -y install gtk+-devel gtk2-devel \
    libXpm-devel libpng-devel giflib-devel \
    libtiff-devel libjpeg-devel \
    ncurses-devel gpm-devel dbus-devel \
    dbus-glib-devel dbus-python \
    GConf2-devel pkgconfig \
    libXft-devel 

wget https://ftp.gnu.org/pub/gnu/emacs/emacs-25.1.tar.xz

tar xvJf  emacs-25.1.tar.xz
cd emacs-25.1
./configure
make
sudo make install

Disable underscore to subscript conversion in org-mode

Add this to the top of the .org file:

#+OPTIONS: ^:nil

Or set this:

(setq org-export-with-sub-superscripts nil)

Org-mode Keybindings

Basic keybindings

Checkboxes

Publishing/Exporting

Org-mode code blocks

Set font in gvim permanently

:set guifont?
set guifont=Hack:h9:cANSI

Separate vim settings for windows and linux

if ($OS == 'Windows_NT')
  " do someting
else
  " do something else
endif

Searching in vimwiki

Seems to be a wrapper around some vim grep functionality.

vim-fugitive cheatsheet

:Git # Run any arbitrary git command from inside Vim
:Gwrite # Stage the current file to the index
:Gread # Revert current file to last checked in version
:Gremove # Delete the current file and the corresponding Vim buffer
:Gmove # Rename the current file and the corresponding Vim buffer
:Gcommit # Opens up a commit window in a split window
:Ggrep keyword # Will search for 'keyword' in working copy files (excluding untracked files)

:Gstatus # Opens a status window. Open file with an enter, jump directly between files with {ctrl-n} and {ctrl-p}
:Gdiff # Performs a vimdiff against the index version of the file. Opens a vertical split window (index file on the left, working copy on the right). Navigate through hunks using {[c} for previous and {]c} for next

:Glog # Loads all previous revisions of the current file into the quickfix list.

Vim tips

:%s: *$::
/ CtrlR CtrlW
gf
CtrlA/CtrlX

References

Larger guides from the rest of the internet are below.

Emacs

Vim