Skip to content

Instantly share code, notes, and snippets.

View sablime's full-sized avatar
💭
I may be slow to respond.

Charles Cooper sablime

💭
I may be slow to respond.
View GitHub Profile
@k-takata
k-takata / buildvim.bat
Created March 13, 2019 04:16
Batch file for building (g)Vim using MSVC
@echo off
setlocal
:: Default I/F versions.
set LUA_VER=51
set PERL_VER=528
set PYTHON_VER=27
set PYTHON3_VER=37
set RUBY_VER=25
set RUBY_API_VER_LONG=2.5.0
@PeterRincker
PeterRincker / SortGroup.vim
Last active December 26, 2024 12:17
Sort groups of lines in vim
" :[range]SortGroup[!] [n|f|o|b|x] /{pattern}/
" e.g. :SortGroup /^header/
" e.g. :SortGroup n /^header/
" See :h :sort for details
function! s:sort_by_header(bang, pat) range
let pat = a:pat
let opts = ""
if pat =~ '^\s*[nfxbo]\s'
let opts = matchstr(pat, '^\s*\zs[nfxbo]')
use strict;
use warnings;
use Encode;
use Encode::Locale;
use UV;
use Glib;
use Gtk2 -init;
use Time::Piece;
diff --git a/Makefile.PL b/Makefile.PL
index 12fa302..3a2496c 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -60,7 +60,8 @@ elsif ($^O eq 'sunos' || $^O eq 'solaris') {
cc_libs 'm', 'socket', 'nsl', 'kstat', 'pthreads';
}
elsif ($^O eq 'MSWin32') {
- cc_libs 'm', 'ws2_32';
+ cc_append_to_ccflags '-D_WIN32_WINNT=0x600';
diff --git a/Makefile.PL b/Makefile.PL
index 12fa302..6818e15 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -60,7 +60,8 @@ elsif ($^O eq 'sunos' || $^O eq 'solaris') {
cc_libs 'm', 'socket', 'nsl', 'kstat', 'pthreads';
}
elsif ($^O eq 'MSWin32') {
- cc_libs 'm', 'ws2_32';
+ cc_append_to_ccflags '-D_WIN32_WINNT=0x600';
@kana
kana / preview-colorscheme.vim
Created April 13, 2012 09:19
A poor man's previewer for Vim's colorscheme
" Usage: :source this file.
let s:file = expand('<sfile>')
function! s:go()
let inData = 0
for line in readfile(s:file)
if inData && line =~# 'xxx'
let name = split(line)[0]
execute printf('syntax match test%s /^%s .*/', name, name)
@ynkdir
ynkdir / wdiff.vim
Created January 18, 2012 14:28
wdiff.vim
" Usage:
" Copy this file to your ~/.vim/autoload directory.
" :edit oldfile
" :new newfile
" :call wdiff#highlight(2, 1) " wdiff#highlight(winnr1, winnr2)
let s:save_cpo = &cpo
set cpo&vim
function wdiff#highlight(Awinnr, Bwinnr)
// http://ido.nu/kuma/2007/10/01/diff-onp-javascript-implementation/
/*
Copyright (c) 2007, KUMAGAI Kentaro
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of this project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.