Skip to content

Instantly share code, notes, and snippets.

View gaveen's full-sized avatar

Gaveen Prabhasara gaveen

View GitHub Profile
@gaveen
gaveen / basic.vim
Last active March 18, 2020 01:09
Gists for the blog post about vimfiles at: https://gaveen.me/2020/02/my-vim-story/
" Basic settings
set nocompatible " behave like vim, not old vi
set modelines=0 " don't use modelines
set viminfo='20,\"50 " use a viminfo file,...
set history=50 " and limit history
set ruler " show the cursor position
set title " show title on the window
set autoread " reload file if changed outside vim
set autowrite " save file on some commands
set scrolloff=1 " minimal no. of lines around cursor
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="font">
<edit mode="assign" name="autohint">
<bool>true</bool>
</edit>
</match>
<!-- Enable sub-pixel rendering -->
<match target="font">
@gaveen
gaveen / beautify.sh
Created February 10, 2013 14:02
Simple script to work with Pandoc. Uses all files inside the current directory with names ending with the file extension $INEXT (assuming they are of the file format $INFMT) to generate files of format $OUTFMT with respective file names and the extension $OUTEXT, styled with the stylesheet $CSSFILE.
#!/usr/bin/env bash
INFMT="markdown"
INEXT="md"
OUTFMT="html"
OUTEXT="html"
CSSFILE="./pandoc.css"
for INFILE in $(ls *.$INEXT)
do
@gaveen
gaveen / pandoc.css
Created October 7, 2012 10:51
A simple CSS file I use with Pandoc
/*
This is a simple CSS file I pass as -c when generating a HTML
file out of my markdown file with a bunch of links inside, using
Pandoc.
*/
body {
width: 960px;
margin: 0 150px 50px;
font: 13px/1.3 'DejaVu Sans', sans-serif;
@gaveen
gaveen / .vimrc-snip
Created December 9, 2011 19:27
Part of my vimrc which sets indentation (tabs, spaces, etc.)
" I'm using the following config to make my code look the same everywhere.
set bs=indent,eol,start " allow backspacing over everything
set autoindent " enable auto-indentation
set tabstop=2 " no. of spaces for tab in file
set shiftwidth=2 " no. of spaces for step in autoindent
set softtabstop=2 " no. of spaces for tab when editing
set expandtab " expand tabs into spaces
set smarttab " smart tabulation and backspace
@gaveen
gaveen / extension.js
Created December 9, 2011 04:51
GNOME Shell extention - ConnectionManager - Set Icon
// Trying to set icon
let icon = new St.Icon({ icon_name: 'emblem-cm-symbolic',
icon_type: St.IconType.SYMBOLIC,
icon_size: 16 });
this.actor.get_children().forEach(function(c) { c.destroy() });
this.actor.add_actor(icon);
// Place the 'emblem-cm-symbolic.svg' in the same directory
# .bashrc
# Cool bash prompt (with git goodness)
function parse_git_branch {
BRANCH_PROMPT=$(__git_ps1)
if [ -n "$BRANCH_PROMPT" ]; then
BR_GIT_STATUS=$(get_git_status)
echo $BRANCH_PROMPT$BR_GIT_STATUS
fi
}
set guifont=DejaVu\ Sans\ Mono\ 11
set columns=80
set guioptions-=T
set guioptions-=r
set guioptions-=L
colorscheme monokai
" Set the key to launch conque - terminal
nnoremap <leader>t :ConqueTermSplit bash<cr>
" Disabling filetype before Pathogen. Loaded later.
filetype off
" Invoke pathogen
call pathogen#runtime_append_all_bundles()