Skip to content

Instantly share code, notes, and snippets.

@deris
deris / check_file_width.pl
Created January 5, 2020 22:30
ファイルの行ごとの幅チェック
use strict;
use warnings;
use Encode;
use constant MAX_WIDTH => 90;
use constant TAB_WIDTH => 4;
# ディレクトリ走査
sub traverse {
my $dir = shift;
command -nargs=1 CppCreateClass call s:cpp_create_class(<q-args>)
function! s:cpp_create_class(class_name)
if a:class_name !~ '^\a\w*$'
echom printf('[error] invalid parameter(%s)', a:class_name)
return
endif
let class_name = substitute(a:class_name, '^.', '\u&', '')
let file_name = substitute(a:class_name, '^.\+$', '\L&\E', '')
if exists ("b:current_syntax")
finish
endif
syntax match duzzleField / / contained
syntax region DuzzleMap start=/\%^/ end=/^\ze\[.*\]/ contains=duzzleField
highlight duzzleFieldHi guibg=lightcyan ctermbg=lightcyan
@deris
deris / 1_176_vimrc_reading.vim
Created November 19, 2015 16:54
vimrc読書会の1回目から176回目までに読んだvimrcからVim pluginを雑に抽出したリスト
NeoBundle '2072/PHP-Indenting-for-VIm'
NeoBundle '29decibel/codeschool-vim-theme'
NeoBundle '5long/pytest-vim-compiler'
NeoBundle '5t111111/alt-gtags.vim'
NeoBundle '5t111111/markdown-preview.vim'
NeoBundle '5t111111/neat-json.vim'
NeoBundle 'Align'
NeoBundle 'AndrewRadev/inline_edit.vim'
NeoBundle 'AndrewRadev/multichange.vim'
NeoBundle 'AndrewRadev/splitjoin.vim'
@deris
deris / vimorg.go
Created November 19, 2015 16:37
vim.orgのScriptを新しい順に取得しratingが10以上をコンソールに出力
package main
import (
"fmt"
"github.com/PuerkitoBio/goquery"
"os"
"strconv"
)
const topURL = "http://www.vim.org/scripts/"
@deris
deris / auto_textwidth.vim
Created April 1, 2015 22:03
固定幅自動改行
" 120幅で改行する
set textwidth=120
" 自動で改行する
set formatoptions+=t
" 挿入時、'textwidth'より短くても改行する
set formatoptions-=l
" 'textwidth'より短ければ、挿入時以降の空白でなくても改行する
set formatoptions-=v
" gqコマンドを使えば、既存のコードも自動で改行する

Vim Debugger Pluginでやりたいこと

Basic

  • gdbで実行する
  • gdbでアタッチする
  • gdbでリモートデバッグする
  • デバッグ中のソースファイルをバッファ上で表示する
@deris
deris / open_neobundlepath2.vim
Created July 4, 2013 17:31
NeoBundleの相対パスを開く(operator-user対応)
NeoBundle 'tyru/open-browser'
NeoBundle 'kana/vim-operator-user'
call operator#user#define('open-neobundlepath', 'OpenNeoBundlePath')
map gz <Plug>(operator-open-neobundlepath)
function! OpenNeoBundlePath(motion_wise)
if line("'[") != line("']")
return
endif
let start = col("'[") - 1
@deris
deris / open_neobundlepath1.vim
Created July 4, 2013 17:30
NeoBundleの相対パスを開く(from .vimrc)
NeoBundle 'tyru/open-browser'
nnoremap gz vi':<C-u>call ExecuteWithSelectedText('OpenBrowser https://github.com/%s')<CR>
vnoremap gz :<C-u>call ExecuteWithSelectedText('OpenBrowser https://github.com/%s')<CR>
" visualモードで最後に選択したテキストを%sで指定してコマンドを実行する {{{
function! ExecuteWithSelectedText(command)
if a:command !~? '%s'
return
endif