Hatena::Groupvim

vim and plasticity

 | 

2009-06-17

Command-line mode

05:05

現ファイル名が%で表されることは知っていたけど、

:!javac %

それだけでは不便なので、もっと細かく指定出来ないものかと思っていた。

やっと発見。


6. Ex special characters				*cmdline-special*


In Ex commands, at places where a file name can be used, the following
characters have a special meaning.  These can also be used in the expression
function expand() |expand()|.
	%	Is replaced with the current file name.		  *:_%* *c_%*
	#	Is replaced with the alternate file name.	  *:_#* *c_#*
	#n	(where n is a number) is replaced with the file name of
		buffer n.  "#0" is the same as "#".
	##	Is replaced with all names in the argument list	  *:_##* *c_##*
		concatenated, separated by spaces.  Each space in a name
		is preceded with a backslash.
	#<n	(where n is a number > 0) is replaced with old	  *:_#<* *c_#<*
		file name n.  See |:oldfiles| or |v:oldfiles| to get the
		number.							*E809*
		{only when compiled with the +eval and +viminfo features}

ファイル名関連の取得修飾子。長いので抜粋。

							 *filename-modifiers*
	 *:_%:* *::8* *::p* *::.* *::~* *::h* *::t* *::r* *::e* *::s* *::gs*
The file name modifiers can be used after "%", "#", "#n", "<cfile>", "<sfile>",
"<afile>" or "<abuf>".  They are also used with the |fnamemodify()| function.
These are not available when Vim has been compiled without the |+modify_fname|
feature.
These modifiers can be given, in this order:
	:p	Make file name a full path.  Must be the first modifier.  Also
		changes "~/" (and "~user/" for Unix and VMS) to the path for
		the home directory.  If the name is a directory a path
		separator is added at the end.  For a file name that does not
		exist and does not have an absolute path the result is
		unpredictable.

	:h	Head of the file name (the last component and any separators
		removed).  Cannot be used with :e, :r or :t.
		Can be repeated to remove several components at the end.
		When the file name ends in a path separator, only the path
		separator is removed.  Thus ":p:h" on a directory name results
		on the directory name itself (without trailing slash).
		When the file name is an absolute path (starts with "/" for
		Unix; "x:\" for MS-DOS, WIN32, OS/2; "drive:" for Amiga), that
		part is not removed.  When there is no head (path is relative
		to current directory) the result is empty.
	:t	Tail of the file name (last component of the name).  Must
		precede any :r or :e.
	:r	Root of the file name (the last extension removed).  When
		there is only an extension (file name that starts with '.',
		e.g., ".vimrc"), it is not removed.  Can be repeated to remove
		several extensions (last one first).
	:e	Extension of the file name.  Only makes sense when used alone.
		When there is no extension the result is empty.
		When there is only an extension (file name that starts with
		'.'), the result is empty.  Can be repeated to include more
		extensions.  If there are not enough extensions (but at least
		one) as much as possible are included.

簡単なまとめ:

%:p が現bufferのfullPath。

%:h がHeader。file名抜かしたpath。

%:t がTail。Header以外。

%:t:r がRoot拡張子無しのfile名。

%:t:e がExtension。拡張子


拡張子を取り去るにはもっと簡単な方法が。

					*extension-removal* *:_%<*
If a "<" is appended to "%", "#", "#n" or "CTRL-V p" the extension of the file
name is removed (everything after and including the last '.' in the file
name).  This is included for backwards compatibility with version 3.0, the
":r" form is preferred.  Examples: >

よってjava fileをvim上でcompile,runするには

:!javac %; java %<

とすれば良いと。で適当にどこかのキーにMapすればいいと。


:au BufNewFile,BufRead *.java noremap <leader><leader> :!javac %; java %<<cr>

こんな感じか。


追記:

~/.vimrcに以下を追加して、

filetype plugin on

~/.vim/ftplugin/java.vimに以下を書いた。

nnoremap <buffer> <leader><leader> :<c-u>!javac %; java %<lt><cr>

もうfiletype-detectされてるため、autocmdはいらないようだ。c.vimとcpp.vimも作って試してみた。

参考:help filetypes


新しいfiletype作るなら

:help new-filetype

を参考にすると。

ヘルプ強い。

command-line modeでの操作

03:27

help見てたらC-Wなんてもの見つけた。

CTRL-W
Delete the word before the cursor.

CTRL-Hでちまちま消す必要なかったのだね。

ふと思い立ってTerminalでも試してみたらzshでもbashでも使えて噴いた。ずっと欲しいと思ってたよこの機能。

StitchesStitches 2011/07/09 21:11 These topics are so cofunsing but this helped me get the job done.

uvxenwtuvxenwt 2011/07/10 00:24 5cnnWn <a href="http://veoutzanwfee.com/">veoutzanwfee</a>

jnxvmhvslkojnxvmhvslko 2011/07/10 20:30 CvbbSy , [url=http://mmhpnqhmsxvk.com/]mmhpnqhmsxvk[/url], [link=http://ahtezymyylxy.com/]ahtezymyylxy[/link], http://arivdxtdetii.com/

ipwdofcdfbipwdofcdfb 2011/07/11 20:23 SecTcO <a href="http://jcmlvsnfzpoe.com/">jcmlvsnfzpoe</a>

paljtydtaxrpaljtydtaxr 2011/07/12 22:44 8CaEIS , [url=http://yiowgcntnemt.com/]yiowgcntnemt[/url], [link=http://aivyeqzrfzps.com/]aivyeqzrfzps[/link], http://awysqhficrfm.com/

pfizer viagrapfizer viagra 2016/09/15 04:13
You've gotten good knowlwdge on this website. weferhervvbt

golistergolister 2017/02/02 18:39
I could subscribe.

OiikbMubOiikbMub 2017/05/23 11:09 online payday loans mississippi
- <a href="https://onlinepaydayloanquickes.com">fast online payday loans
</a>
bad credit online payday loans
- <a href=https://onlinepaydayloanquickes.com/>online payday loans reviews
</a>

imnwgMubimnwgMub 2017/05/23 19:07 payday loans online
- <a href="http://paydayloansonlineglhf.com">payday loans online
</a>
paydayloansonlineglhf.com
- <a href=http://paydayloansonlineglhf.com/>paydayloansonlineglhf.com
</a>

izkmeMubizkmeMub 2017/05/24 08:13 anabolicsteroidsnpc.com
- <a href="https://anabolicsteroidsnpc.com">anabolic definition
</a>
what are steroids
- <a href=https://anabolicsteroidsnpc.com/>anabolicsteroidsnpc.com
</a>

iffygMubiffygMub 2017/05/24 09:49 anabolism
- <a href="https://anabolicsteroidsnpc.com">types of steroids
</a>
steroids online
- <a href=https://anabolicsteroidsnpc.com/>types of steroids
</a>

idserMubidserMub 2017/05/24 11:28 anabolic steroids side effects
- <a href="https://anabolicsteroidsnpc.com">anabolics
</a>
legal anabolic steroids
- <a href=https://anabolicsteroidsnpc.com/>anabolic pathways
</a>

StaceyDesStaceyDes 2017/06/11 23:47 loans for people with poor credit payday loans no brokers bad credit <a href=http://usa-payday-loans.org/>loans for people with bad credit rating</a> get a quick loan

StaceyDesStaceyDes 2017/06/11 23:47 cash loans for people with bad credit no direct deposit payday loans <a href=http://usa-payday-loans.org/>payday loans online pa</a> fast cash today

StaceyDesStaceyDes 2017/06/11 23:52 personal loans with fair credit i need a loan <a href=http://usa-payday-loans.org/>online easy loans</a> payday loans monthly payments

StaceyDesStaceyDes 2017/06/12 02:38 payday loans lake charles short term payday loan <a href=http://usa-payday-loans.org/>online personal loans</a> unsecured loan lenders

StaceyDesStaceyDes 2017/06/12 02:38 borrow cash now nimble small loans <a href=http://usa-payday-loans.org/>loan rates</a> payday loans nampa id

StaceyDesStaceyDes 2017/06/12 02:42 personal loans texas pay day laons <a href=http://usa-payday-loans.org/>easy loans for bad credit</a> payday loans louisville ky

StaceyDesStaceyDes 2017/06/12 03:25 need personal loan now money quick <a href=http://usa-payday-loans.org/>payday loans rockford il</a> need money right now

StaceyDesStaceyDes 2017/06/12 03:25 no fee loans loans in texas <a href=http://usa-payday-loans.org/>online personal loans for bad credit</a> loans bad credit

StaceyDesStaceyDes 2017/06/12 03:28 payday loans cheyenne wy ssi payday loans <a href=http://usa-payday-loans.org/>payday loans without a checking account</a> large unsecured loans bad credit

StaceyDesStaceyDes 2017/06/12 18:43 where can i get a small loan with bad credit payday loan nj <a href=http://usa-payday-loans.org/>payday loans salina ks</a> payday loans in arlington tx

StaceyDesStaceyDes 2017/06/12 19:00 payday loans benefits accepted small loan companies <a href=http://usa-payday-loans.org/>unsecured loans online</a> check advance loans

StaceyDesStaceyDes 2017/06/12 19:15 payday loan nj i need cash today <a href=http://usa-payday-loans.org/>cash advance tampa</a> loans bad credit

StaceyDesStaceyDes 2017/06/12 19:15 payday loans cleveland ohio payday loan online bad credit <a href=http://usa-payday-loans.org/>loans for bad credit no guarantor no fees</a> loans for disabled

StaceyDesStaceyDes 2017/06/12 19:17 loan for no credit easiest payday loans <a href=http://usa-payday-loans.org/>payday loans as seen on tv</a> utah payday loans

StaceyDesStaceyDes 2017/06/12 21:48 need cash now money lenders <a href=http://usa-payday-loans.org/>banks that do personal loans</a> immediate loans

StaceyDesStaceyDes 2017/06/12 21:48 american payday loan loan payday <a href=http://usa-payday-loans.org/>payday loan colorado springs</a> online cash advance

StaceyDesStaceyDes 2017/06/12 21:48 get cash loan now interest free loan <a href=http://usa-payday-loans.org/>no doc loan</a> first payday loan free

StaceyDesStaceyDes 2017/06/13 01:12 borrow money fast where can i borrow money <a href=http://usa-payday-loans.org/>real online loans for bad credit</a> check cashing payday loans

StaceyDesStaceyDes 2017/06/13 01:12 alternative loans cashusa <a href=http://usa-payday-loans.org/>signature loans for bad credit</a> online payday advance

StaceyDesStaceyDes 2017/06/13 01:12 cash loans columbus ohio unsecured personal loans poor credit <a href=http://usa-payday-loans.org/>payday lones</a> payday loans in pennsylvania

StaceyDesStaceyDes 2017/06/13 03:28 payday advances online how to get cash fast <a href=http://usa-payday-loans.org/>getting loan with bad credit</a> money loan with bad credit

StaceyDesStaceyDes 2017/06/13 03:28 check advance payday loans kansas city mo <a href=http://usa-payday-loans.org/>payday advance loan</a> payday loans norfolk va

StaceyDesStaceyDes 2017/06/13 03:28 bad credit need loan personal loan interest rates <a href=http://usa-payday-loans.org/>apply for loan with bad credit</a> short term online loans

StaceyDesStaceyDes 2017/06/13 05:45 credit check free next payday advance <a href=http://usa-payday-loans.org/>loans for bad credit</a> fast pay day loans

StaceyDesStaceyDes 2017/06/13 05:45 short term cash advance cash advance akron ohio <a href=http://usa-payday-loans.org/>non payday loans for bad credit</a> take a loan

StaceyDesStaceyDes 2017/06/13 07:58 pay day loans online online loan for bad credit <a href=http://usa-payday-loans.org/>basic bank account for bad credit</a> cash advance dayton ohio

StaceyDesStaceyDes 2017/06/13 11:19 www personal loan com cash advance miami <a href=http://usa-payday-loans.org/>long term loans for bad credit no guarantor</a> i need a loan today

StaceyDesStaceyDes 2017/06/13 11:19 delaware payday loans short cash loans <a href=http://usa-payday-loans.org/>bad credit loans online approval</a> direct loans for bad credit

StaceyDesStaceyDes 2017/06/13 13:33 loans for young adults ach loan <a href=http://usa-payday-loans.org/>online loan bad credit</a> same day payday loans direct lender

StaceyDesStaceyDes 2017/06/13 13:33 flexible loans money borrowing sites <a href=http://usa-payday-loans.org/>loan cash now</a> money lender

StaceyDesStaceyDes 2017/06/13 13:33 personal loans for bad credit in maryland lendingtree loans <a href=http://usa-payday-loans.org/>online lending</a> how can i get a loan

StaceyDesStaceyDes 2017/06/13 15:44 payday loans in montgomery al www payday loans <a href=http://usa-payday-loans.org/>defaulted loans</a> american payday loan

StaceyDesStaceyDes 2017/06/13 15:44 long term payday loan not a payday loan <a href=http://usa-payday-loans.org/>payday loan same day</a> compare payday lenders

StaceyDesStaceyDes 2017/06/13 15:44 payday cash advances money in minutes loan <a href=http://usa-payday-loans.org/>how to get fast cash</a> online payday loans texas

StaceyDesStaceyDes 2017/06/13 18:00 bad credit loans now lenders for people with bad credit <a href=http://usa-payday-loans.org/>short term bad credit loans</a> personal small loans

StaceyDesStaceyDes 2017/06/13 18:00 payday loan calgary emergency cash <a href=http://usa-payday-loans.org/>quick cash advance</a> loans from direct lenders

kgzflmAdenokgzflmAdeno 2017/06/21 23:20 what is a cash advance
<br />
<a href="http://paydayourloansonline.com#242/">best payday loans</a> <br />
<a href="http://paydayourloansonline.com#070/">personal loans </a> <br />
http://paydayourloansonline.com#440/ - payday loans online <br />
ace cash advance
#gagahshsnsnfbfhhw2333

kbviurAdenokbviurAdeno 2017/06/23 09:06 need a payday loans, castle payday loans reviews, payday loans no bank account needed, payday loans san antonio <a href="http://paydayourloansonline.com/#personal"> loans with bad credit </a> payday loans same day, payday loans birmingham al <a href="http://paydayourloansonline.com/#loan"> short term loans </a> easy payday loans online, payday loans peoria il, payday loans jackson ms, payday loans roanoke va, payday loans direct lenders only, can you have two payday loans at once http://paydayourloansonline.com/#loan - online payday loans faxless payday loans, payday online loans, payday loans in houston #helloganamana2233

BriaxVorBriaxVor 2017/07/01 19:22 Пожалуйста, прочтите инструкции ниже для правильного использования новой версии программы. От этого напрямую зависит, насколько эффективно Вы сможете применить преимущества именно последних версий программы. </br>
<a href=http://mail.ru>Bingosio</a>
Новый инструмент распознавания изображений: </br>
<a href=https://gooogle.com/>Bingosio</a>
В состав программного комплекса XRumer </br> включен новый инструмент распознавания изображений XEvil, значительно повышающий эффективность комплекса, и многократно расширяющий потенциальный охват ресурсов для размещения Вашей рекламы. По состоянию на </br> года программа способна распознавать свыше 8400 типов изображений – буквенных, числовых, арифметических. Подробности Вы можете прочесть на нашем сайте. </br>

DvuspvAdenoDvuspvAdeno 2017/07/02 17:46 hahgsgdnna - google.com google.com - hywyywkkkkkkzzzzsssss

DargtkAdenoDargtkAdeno 2017/07/04 02:51 hhhhhhbbbxbxcv - google.com google.com - hjgjasdfkjwieururu

jackHexjackHex 2017/07/15 22:29 We do not recommend specific pharmacies, but you can search for verified international online pharmacies at PharmacyChecker.
A pharmacy can refuse to fill our prescription if you are from another city say you live a mile from Orlando and you are trying to find your meds.
Generic ViagraGeneric Viagra is starting to replace it's original as customers become more educated to the...

<a href=http://kamagra100mgoraljelly.today>kamagra now</a>

jackHexjackHex 2017/07/16 20:23 It surpassed my expectations for learning and connection.
Aircraft departing the circuit from other legs must broadcast intentions and depart in a manner that does not conflict with aircraft in or joining the circuit.
How alprazolam affects pregnancy.

<a href=http://kamagra100mgoraljelly.today>kamagra100mgoraljelly.today</a>

DbkgefAdenoDbkgefAdeno 2017/07/19 10:39 google.com - #000999uuquuqyshshshx

nhldncAdenonhldncAdeno 2017/07/29 02:47 topzp68x1g</br>
free male enhancement</br>
<a href="http://malesenhancement.com"> king size male enhancement</a> </br>
<a href="http://malesenhancement.com"> male enhancement products</a> </br>
<a href="http://malesenhancement.com"> male enhancement pills that work</a> </br>
evoxa male enhancement

ctaletfmghctaletfmgh 2017/08/05 10:13 jpuyoxrn http://maydaviendn.com/component/k2/itemlist/user/19134 <a href="http://cartonerahued.net/index.php/component/k2/itemlist/user/423501">Where To Buy Rice Paper Uk</a> ここで、ラフィク

lendiccolendicco 2017/09/11 11:03 すべての
<a href=http://lendicoplus.com>lendicoplus</a>
投稿者

tshkilanttshkilant 2017/09/13 08:25 すべての
http://tshkila.com tvasset.com w7677.com whiterockers.com lendicoplus.com yahappimbls.com
投稿者

bretxxxppbretxxxpp 2017/10/04 05:59 すべての http://bretxxx.com/ 投稿者

joeyxxxbkjoeyxxxbk 2017/10/04 21:34 すべての http://joeyxxx.com/ 投稿者

huluxxxifhuluxxxif 2017/10/05 16:14 すべての http://huluxxx.com/ 投稿者

emotorrshemotorrsh 2017/10/06 08:59 すべての https://emotorrents.com/ 投稿者

remNetremNet 2017/10/19 23:31 Просадка, затирание, провисание повреждение герметичности (продув, сквозняк) оконных створок – перечисленное обыкновенное явление, которое со временем возникает во всех абсолютно металлопластиковых окнах и дверях. И их следовательно полагается регулировать (обслуживать), для того чтобы избегнуть, в последующем, дорогостоящего ремонта.
Это в целом как в машине услуга прохождения тех осмотра : в случае, если в нужное время не поменять масло, не устранить стук или посторонний шум – исходы могут быть грустными или катастрофическими. (как к примеру замена масла один в год или раз в 10000 км. – обходится к примеру 957 грн. Однако ремонтные работы двигателя по стоимости 9557 грн.) У нас мастерят высокопроффесиональные умельцы, те что помогают уладить любую неприятность и ублажить даже самого разборчивого клиента Заказывайте <a href=http://remontokna.com.ua>ремонт пластиковых окон киев</a> у нас, у проффесионалов.



Купить <a href=http://remontokna.com.ua/remont-okon/9-zhalyuzi-na-okna.html>жалюзи</a> самые лучшие цены у нас!

limtorrenbolimtorrenbo 2017/10/20 09:07 すべての <a href=https://limtorrent.com/>limetorrents</a> 投稿者

gtaletijjqgtaletijjq 2017/11/15 21:03 ilxqtvsn http://viagrainimper.info l arginine viagra <a href="http://tuxrentalonline.com/">buy viagra</a>

ftaletntewftaletntew 2017/11/16 05:18 pzcuxlpm http://viagrainimper.info revatio vs viagra <a href="http://viagrainimper.info/">viagra supplements</a>

Znitf628dZnitf628d 2017/11/17 17:02 Swedish girl anal. Big naked booty clapping. X Video Pourn. <a href="http://pornonaft.net/">http://pornonaft.net</a> Anime sexslave. Hot muslim boys. Real Indian Xxx.

ThomasEteceThomasEtece 2017/11/22 15:43 ThomasEteceThomasEtece

RobertSwipsRobertSwips 2017/11/26 12:28 RobertSwipsRobertSwipsRobertSwips
http://meuhedet.online

bibliotdsbibliotds 2017/12/13 12:26 すべての http://bibliotecaistoreco.com/top/MILFs 投稿者

cukuramzzcukuramzz 2017/12/14 09:42 すべての http://cukurambareskort.com/new/ 投稿者

siteserrnsiteserrn 2017/12/15 05:20 すべての http://siteservisleri.com/ 投稿者

unskillmyunskillmy 2017/12/15 19:44 すべての http://unskill.ru 投稿者

ゲスト



トラックバック - http://vim.g.hatena.ne.jp/ruicc/20090617
 |