let name = "John" echo "Hello, " . name You can either put this in a script (script.vim) and run it (:source script.vim), or you can type the commands individually in normal mode as :let and :echo. function! SuperTab() let l:part = strpart(getline('.'),col('.')-2,1) if (l:part =~ '^\W\?$') return "\<Tab>" else return "\<C-n>" endif endfunction imap <Tab> <C-R>=SuperTab()<CR> Here’s another example
I have a big HTML file that has lots of markup that looks like this: <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <span style="font-size: small; font-family: Times New Roman;">stuff here</span> </p> I'm trying to do a Vim search-and-replace to get rid of all class="" and style="" but I'm having trouble making the match ungreedy. My first attempt was this %s/style=".*?"//g but Vim doesn't see
I am trying to create a Vim mapping that will operate on the current line, taking a string like this: [boiled cabbage, mad donkey, elephant, very dark fudge] And quoting all the list elements to end up with this: ["boiled cabbage", "mad donkey", "elephant", "very dark fudge"] I tried with vim regexes, but figured it would be easier to write a function that takes the current line as an argument and
Learn Vimscript the Hard Way is a book for users of the Vim editor who want to learn how to customize Vim. It is not a guide to using Vim. Before reading this book you should be comfortable editing text in Vim and know what terms like "buffer", "window" and "insert mode" mean. The book is divided roughly into three sections: The first covers basic Vim commands that you can use in your ~/.vimrc fil
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く