Skip to content

Instantly share code, notes, and snippets.

View Osse's full-sized avatar

Øystein Walle Osse

View GitHub Profile
From a7cf2ded07bc5651e707075a0ac454cbdf7e3f5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=98ystein=20Walle?= <[email protected]>
Date: Sat, 27 Apr 2013 13:53:13 +0200
Subject: [PATCH] Add option to change working dir when opening a file
Introduce a new option startify_change_dir to make Startify change the
working directory to the directory of the file being opened. The default
is 0 so that default behaviour is unchanged.
---
doc/startify.txt | 7 +++++++
osse@bigge:~/AUR[master]$ BLOCKSIZE="'1" ls -l
total 24,576
drwxr-xr-x 4 osse users 4096 Jan 17 19:22 byobu
-rw-r--r-- 1 osse users 2409 Oct 27 2012 byobu.tar.gz
-rw-r--r-- 1 osse users 219 Apr 8 19:35 cwwrapper
drwxr-xr-x 3 osse users 4096 Apr 10 16:47 dghrfs
drwxr-xr-x 4 osse users 4096 Mar 9 20:15 ldm
-rw-r--r-- 1 osse users 762 Feb 17 12:03 ldm.tar.gz
@Osse
Osse / patch.patch
Created September 29, 2013 17:11
Proposed patch
From 024fa57d0d2bb0d3fd409eb447c869ff59d544e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=98ystein=20Walle?= <[email protected]>
Date: Sun, 29 Sep 2013 19:03:53 +0200
Subject: [PATCH] Don't consider escaped trailing spaces as errors
---
autoload/airline/extensions/whitespace.vim | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/autoload/airline/extensions/whitespace.vim b/autoload/airline/extensions/whitespace.vim
@Osse
Osse / gist:7099481
Created October 22, 2013 12:10 — forked from mhinz/gist:7098910
function! s:set_cursor() abort
let s:oldline = exists('s:newline') ? s:newline : 5
let s:newline = line('.')
let headoff = s:headoff + 2 + s:secoff
" going BOTH WAYS !!!!
let direction = 2 * (s:newline > s:oldline) - 1
while index(s:section_header_lines, s:newline) != -1
let s:newline += direction
endwhile
@Osse
Osse / no
Created November 7, 2013 07:58
Snippet from /usr/share/X11/xkb/symbols/no
partial alphanumeric_keys
xkb_symbols "vimlayout" {
// Modifies the basic Norwegian layout to add movement
// and braces/brackets to useful keys
include "no(basic)"
name[Group1]="Norwegian (Vim)";
@Osse
Osse / zshrc
Created November 9, 2013 16:59
Debian /etc/zshrc
# /etc/zsh/zshrc: system-wide .zshrc file for zsh(1).
#
# This file is sourced only for interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#
# Global Order: zshenv, zprofile, zshrc, zlogin
READNULLCMD=${PAGER:-/usr/bin/pager}
@Osse
Osse / startify.diff
Created December 4, 2013 10:24
Make relative names
diff --git a/autoload/startify.vim b/autoload/startify.vim
index 6f59b0e..f204078 100644
--- a/autoload/startify.vim
+++ b/autoload/startify.vim
@@ -318,7 +318,7 @@ function! s:show_files(cnt) abort
let entries[fullpath] = 1
let index = s:get_index_as_string(cnt)
- call append('$', ' ['. index .']'. repeat(' ', (3 - strlen(index))) . fname)
+ call append('$', ' ['. index .']'. repeat(' ', (3 - strlen(index))) . fnamemodify(fname, ':.'))
@Osse
Osse / gist:7795424
Last active December 30, 2015 07:19
-tree-filter for the ages
--tree-filter 'rm -rf *.suo *.user *.sln.docstates [Dd]ebug [Dd]ebugPublic [Rr]elease x64 build bld [Bb]in [Oo]bj [Tt]est[Rr]esult* [Bb]uild[Ll]og.* *.VisualState.xml TestResult.xml *_i.c *_p.c *_i.h *.ilk *.meta *.obj *.pch *.pdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj *.log *.vspscc *.vssscc .builds *.pidb *.svclog *.scc _Chutzpah* ipch *.aps *.ncb *.opensdf *.sdf *.cachefile *.psess *.vsp *.vspx \$tf *.gpState _ReSharper* *.[Rr]e[Ss]harper *.DotSettings.user .JustCode _TeamCity* *.dotCover *.ncrunch* _NCrunch_* .*crunch*.local.xml *.mm.* AutoTest.Net [Ee]xpress DocProject/buildhelp DocProject/Help/*.HxT DocProject/Help/*.HxC DocProject/Help/*.hhc DocProject/Help/*.hhk DocProject/Help/*.hhp DocProject/Help/Html2 DocProject/Help/html publish *.Publish.xml *.azurePubxml csx *.build.csdef AppPackages sql *.Cache ClientBin [Ss]tyle[Cc]op.* ~\$* *~ *.dbmdl *.dbproj.schemaview *.[Pp]ublish.xml *.pfx *.publishsettings Generated_Code _UpgradeReport_Files Backup* UpgradeLog*.XML UpgradeLog*.htm Ap
@Osse
Osse / blink.vim
Last active December 31, 2015 13:19
Damian Conway's blink thing
@Osse
Osse / git-dirtyclone
Last active January 2, 2016 17:39
git dirtyclone
#!/bin/bash
# Usage: git dirtyclone <url> [<dir>]
if (( $# < 1 || $# > 3 )); then
echo 'Usage: git dirtyclone <url> [<dir>]' >&2
exit 1
fi
url=$1
if (( $# == 2 )); then