Skip to content

Instantly share code, notes, and snippets.

Vim Debugger Pluginでやりたいこと

Basic

  • gdbで実行する
  • gdbでアタッチする
  • gdbでリモートデバッグする
  • デバッグ中のソースファイルをバッファ上で表示する
@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コマンドを使えば、既存のコードも自動で改行する
@deris
deris / gist:2819673
Created May 28, 2012 15:15
検索文字列をレジスタでグローバル置換
" 検索文字列をレジスタでグローバル置換
function! s:ReplaceGlobalSearchToRegister()
let l:reg = getreg(v:register)
let l:cmd = '%substitute//'
let l:opt = '/g'
execute l:cmd . l:reg . l:opt
endfunction
nnoremap <silent> <Space>rs :<C-u>call <SID>ReplaceGlobalSearchToRegister()<CR>
@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 / class_tree.rb
Last active December 16, 2015 19:39
クラス階層を表示するクラスメソッド
# add print class tree method to Object
class Object
def self.print_class_tree
@class_tree ||= {}
# create class tree if not yet
ObjectSpace.each_object(Class) do |cls|
next if self == cls
# skip is cls is no name
@deris
deris / gitlogviewer.vim
Created May 9, 2013 15:10
GitLogViewer inspired by ujihisa's vimrc
" Inspired by ujihisa's vimrc
function! s:GitLogViewer()
" vnewだとコミットメッセージが切れてしまうのでnew
new
VimProcRead git log -u 'ORIG_HEAD..HEAD'
set filetype=git-log.git-diff
setlocal foldmethod=expr
setlocal foldexpr=getline(v:lnum)=~'^commit'?'>1':getline(v:lnum+1)=~'^commit'?'<1':'='
setlocal foldtext=FoldTextOfGitLog()
endfunction
@deris
deris / error.txt
Last active December 17, 2015 22:49
error
-----> Fetching custom git buildpack... done
-----> Ruby/Rack app detected
-----> Vendoring binaries
Fetching cairo-1.12.8.tgz
/tmp/build_2z0sqxbwxc8m1/vendor/cairo-1.12.8
Exporting cairo-1.12.8.tgz build and include paths
Fetching pixman-0.28.0.tgz
/tmp/build_2z0sqxbwxc8m1/vendor/pixman-0.28.0
Exporting pixman-0.28.0.tgz build and include paths
-----> Using Ruby version: ruby-2.0.0
@deris
deris / gist:5730298
Last active December 18, 2015 05:09
連番入力Vim script(from manga_osyo's code at Lingr)
function! s:fix_number(pattern, ...)
if a:0 > 2
return
endif
let s:start = exists('g:fix_number_default_start') ? g:fix_number_default_start : 0
let s:step = exists('g:fix_number_default_step') ? g:fix_number_default_step : 1
if a:0 >= 1
let s:start = a: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
@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