Skip to content

Instantly share code, notes, and snippets.

@sooop
sooop / build_vim.bat
Created February 14, 2014 01:52
Build script for vim (python enabled)
@echo off
REM Run this batch file from any directory to build gvim.exe and vim.exe.
REM But first edit the paths and Python version number.
REM --- Specify Vim /src folder ---
set VIMSRC=D:\temp\vim74\src
REM --- Add MinGW /bin directory to PATH ---
PATH = C:\MinGW\bin;%PATH%
REM --- Also make sure that PYTHON, PYTHON_VER below are correct. ---
"pycomment
"comment selected line
function! PyComment#com()
let b:l1 = line("'<")
let b:l2 = line("'>")
let b:cmd_ = ":" . b:l1 . "," . b:l2 . "s/^/#/g"
exec b:cmd_
endfunction

:g[lobal]

사용법 : :[range]g[lobal]/{pattern}/[cmd]

주어진 범위에 대해 패턴에 매칭하는 줄에 대해서만 주어진 명령을 실행한다.

사용예

빈줄을 모두 삭제하는 명령

" toggle comment line
function! SetCommentPrefix()
let s:comment_prefix = "#"
if &filetype == "vim"
" for vim, inline comment start with \"
let s:comment_prefix = "\""
elseif &filetype ==? "c" || &filetype ==? "objc" || &filetype ==? "cpp"
let s:comment_prefix = "//"
endif
"SECTION: color change function {{{1
"===============================================================================
"TOPIC: Functions {{{2
"FUNCTION: PrepareColorList
"---------------------------
let s:colorindex = 0
function! PrepareColorList()
let s:colorlist = []
if !exists('s:colorlist[0]')
let s:colorlist = split(glob("$VIMRUNTIME/colors/*.vim"), "\n")
@sooop
sooop / toggle-fn-key.applescript
Last active August 29, 2015 13:57
키보드의 fn키 동작을 변경하도록 설정하는 애플 스크립트
tell application "System Preperences"
reveal anchor "keyboardTab" of pane "com.apple.preference.keyboard"
tell application "System Events" to click checkbox 1 of tab group 1 of window 1 of application process "System Preferences"
end tell
if application "System Preferences" is running then
tell application "System Preferences" to quit
end if
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any

C Storage Class

C언어에서 함수나 변수의 범위와 유지시간(lifetime)은 그 저장소 클래스에 의해 결정된다. 각각의 변수는 유지시간 혹은 값이 저장되는 문맥을 가지고 있다. 함수는 변수처럼 특정한 스코프내에서만 존재하며, 보인다.

링커는 함수의 이름으로 각 함수를 구분하기 때문에, 우연히 이름을 맞춘다면(?) 함수가 실행될 수는 있다.

C에는 4가지 저장 클래스가 있다. auto, register, static, extern이 그것이다.

@charset "utf-8";
$fontStackPlain: "Apple SD Gothic Neo Regular", "대한", "Malgun Gothic", serif;
$fontStackCode: "Envy Code R", "Monaco", "Menlo", "Consolas", monospace;
$fontSizeH1: 2em;
$fontSizeH2: 1.8em;
$fontSizeH3: 1.4em;
$fontSizeTitle: 3em;
$colorCode: #09976A;
$colorCodeInline: $colorCode + #080808;
@sooop
sooop / sass.md
Last active August 29, 2015 13:57

SASS

문법

모든 문법 작성은 SCSS 기준으로 작성한다.

규칙 네스팅

중괄호 속에 하위 요소에 대한 스타일을 지정하는 형태로 네스팅한다.