@ompugao_ blog

hello this wonderful world

a happy new year

Happy New Year!

I wish you a healthy happy, and prosperous new year.

how to erase already existed characters

So far, I always wondered why vim cannot erase the characters over insert-mode starting point. “:help backspace” doesn’t provide an answer to my question.

Ans.:

set backspace=indent,eol,start

“:help i_backspacing” gives me an answer. How can I find such a help text query!!!

I also feel these difficulty in googling some topic.

“What kind of text should I insert to this textbox…”

Can’t git push –force

Today, I cannot git push –force.(Please don’t say I should not do the command…)

% git push --force origin master
Counting objects: 11, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (8/8), 931 bytes, done.
Total 8 (delta 6), reused 4 (delta 2)
error: denying non-fast forward refs/heads/master (you should pull first)
To ******/*******
 ! [remote rejected] master -> master (non-fast forward)
 error: failed to push some refs to '****************'

Why????

Answer:

ssh repos_machine
cd path/to/git/bare/repos
cat config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = true
        sharedrepository = 1
[receive]
        denyNonFastforwards = true    <<<===!!!!!!!

By changing the receive.denyNonFastforwards option to ‘false’, you can git push –force.

I’ve never seen this option until today.

change my filer on vim

let g:netrw_liststyle=3でディレクトリ移動ができない · Issue #275 · vim-jp/issues

にissue登録したら、伸びた。

netrw.vimをちらっとみたら、foldingだけでお腹いっぱいになる。

ずいぶんと根の深い問題のようだったので、しぶしぶnetrwを止め、nerdtreeに移行しました。

NeoBundle 'scrooloose/nerdtree'
let NERDTreeShowHidden = 1
nnoremap <C-@><C-t> :<C-u>NERDTreeToggle<CR>
nnoremap <C-@><C-f> :<C-u>NERDTreeFocus<CR>
nnoremap <space>e   :<C-u>NERDTree<CR>
let g:NERDTreeWinPos="left" "or right
let g:NERDTreeIgnore=['\.swp$', '\~$']

vim-jpのみなさんには頭が下がります。

// なぜかvim-jpのwriterにして頂いたんですが。。。僕を振っても何も出てこないですよぉー

追記:

@ynkdirさんがbugfixして下さいましたね。

https://github.com/vim-jp/issues/issues/275#issuecomment-11187945

素晴らしい。

I wrote a termtter plugin called mute.rb

Today, I wrote a termtter plugin that mutes statuses that includes some words or is tweeted by some users.

Hey Me, WHEN YOU ARE GOING TO WRITE YOUR GRADUATION THESIS!?!?!?

I wrote a vim plugin called ctrlp-z

Today, I wrote a vim plugin called ctrlp-z

This is a interface to fasd via ctrlp.

One example of setting .vimrc is as follows.

nnoremap <silent><C-p><C-f> :<C-u>CtrlPF<CR>
nnoremap <silent><C-p><C-z> :<C-u>CtrlPZ<CR>

CtrlPZ is a function to change your working directory(:lcd), and CtrlPF is a function to edit your most recently used file(:edit/:tabedit).

This plugin is so short (thanks to the ctrlp’s cool user commands!) that you can understand what is written in the code at a glance.

Thanks.

python and ruby, English and Japanese

まぁよくあるネタなんでしょうが。

例えば

python:
    sorted([4,3,2,1])
ruby:
    [4,3,2,1].sort

python:
    I'll *sort* the array, [4,3,2,1].
ruby:
    配列[4,3,2,1]をsortする

とか

python:
    len([3,2,1,4])
ruby:
    [3,2,1,4].length

python:
    the *length* of the array,[3,2,1,4]
ruby:
    配列[3,2,1,4]の長さ

とか

python:
    ' '.join(["hoge","fuga","piyo"])
ruby:
    ["hoge","fuga","piyo"].join(' ')

python:
    the charactor ' ' joins the array,["hoge","fuga","piyo"]
ruby:
    配列["hoge","fuga","piyo"]を文字' 'でつなぐ

みたいにpythonは英語,rubyは日本語で読めばいいんだと思った。