float32
float64
int
int8
int16
int32
int64
Vim Advent Calendar 2012 の230日目の記事です。昨日の記事は@manga_osyoさんで、明日の記事はvital.vimコミッタの@rbtnnさんです。
今回は意表をついてVim scriptの入門記事です。
Vim script初級者レベルを10段階に分割すると、そのうち簡単な方から3つは、以下のようになります。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Inspired by Linux alt-drag or Better Touch Tools move/resize functionality | |
function get_window_under_mouse() | |
-- Invoke `hs.application` because `hs.window.orderedWindows()` doesn't do it | |
-- and breaks itself | |
local _ = hs.application | |
local my_pos = hs.geometry.new(hs.mouse.getAbsolutePosition()) | |
local my_screen = hs.mouse.getCurrentScreen() |
- 13" Macbook Pro 3.3 GHz i7 (late 2016)
- Microsoft Surface Book (2016)
- Dell up3216q 32" monitor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelectorAll('tr[id^=tr_line_of_]').forEach(el => { | |
const start = el.querySelector('input[name^=start]'); | |
const end = el.querySelector('input[name^=end]'); | |
const button = el.querySelector('.btn'); | |
const holiday = el.querySelector('#uneditable_holiday'); | |
if (!!start.value && !!end.value) { | |
return; | |
} | |
if (holiday.innerText.match(/休/)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" status bar colors | |
au InsertEnter * hi statusline guifg=black guibg=#d7afff ctermfg=black ctermbg=magenta | |
au InsertLeave * hi statusline guifg=black guibg=#8fbfdc ctermfg=black ctermbg=cyan | |
hi statusline guifg=black guibg=#8fbfdc ctermfg=black ctermbg=cyan | |
" Status line | |
" default: set statusline=%f\ %h%w%m%r\ %=%(%l,%c%V\ %=\ %P%) | |
" Status Line Custom | |
let g:currentmode={ |
記事の執筆には、Markdown形式を利用してください。 Markdownにはさまざまな流派がありますが、GitHub Flavored Markdown(https://github.github.com/gfm/ )をベースとした書式を採用します。
書籍を執筆するための形式として考えると、Markdownには不足している機能が多々あります。 しかし、次のような利点があるので、Markdownを採用することにします。
- 最低限の構造しかないので、見た目でごまかせる余地が少ない
- 原稿を著者自身が再利用してもらいやすくしたい
例文を組み込んだAlfred Workflowを作りました: Alfred Git Commit Message Example
以下転載:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create file: | |
sudo vim /usr/share/applications/intellij.desktop | |
// add the following | |
[Desktop Entry] | |
Version=13.0 | |
Type=Application | |
Terminal=false | |
Icon[en_US]=/home/rob/.intellij-13/bin/idea.png | |
Name[en_US]=IntelliJ |
OlderNewer