About: Faster directory browsing from command line   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

Here is the usage of $c: Imagine you are editing "~/Desktop/project/view/core/admin/MenuEdit.tmpl" and the cwd (current working directory) is "~/Desktop/project". Now imagine that you need to edit something else in the MenuEdit directory (admin dir), but you don't want to change the cwd. Then you go to the Vim commandline and press $c, and it will transform to "e ~/Desktop/project/view/core/admin/". That is, the $c expands to "e " + the directory of the current file. Here is the usage of : Enter commandline and press $c, then press , your commandline should then be "e ~/Desktop/project/view/core/".

AttributesValues
rdfs:label
  • Faster directory browsing from command line
rdfs:comment
  • Here is the usage of $c: Imagine you are editing "~/Desktop/project/view/core/admin/MenuEdit.tmpl" and the cwd (current working directory) is "~/Desktop/project". Now imagine that you need to edit something else in the MenuEdit directory (admin dir), but you don't want to change the cwd. Then you go to the Vim commandline and press $c, and it will transform to "e ~/Desktop/project/view/core/admin/". That is, the $c expands to "e " + the directory of the current file. Here is the usage of : Enter commandline and press $c, then press , your commandline should then be "e ~/Desktop/project/view/core/".
Version
  • 5(xsd:double)
dbkwik:vim/property/wikiPageUsesTemplate
Previous
  • 1054(xsd:integer)
Author
  • Amir Salihefendic
Complexity
  • intermediate
Created
  • 2005(xsd:integer)
ID
  • 1055(xsd:integer)
NEXT
  • 1058(xsd:integer)
Rating
  • 2(xsd:integer)
abstract
  • Here is the usage of $c: Imagine you are editing "~/Desktop/project/view/core/admin/MenuEdit.tmpl" and the cwd (current working directory) is "~/Desktop/project". Now imagine that you need to edit something else in the MenuEdit directory (admin dir), but you don't want to change the cwd. Then you go to the Vim commandline and press $c, and it will transform to "e ~/Desktop/project/view/core/admin/". That is, the $c expands to "e " + the directory of the current file. I also found out that I sometimes needed to go to a parent directory from the commandline and I found it really tiring to use backspace. Here is the usage of : Imagine you are editing "~/Desktop/project/view/core/admin/MenuEdit.tmpl" and you would like to step to core/ directory to edit a file there. Enter commandline and press $c, then press , your commandline should then be "e ~/Desktop/project/view/core/". That is, the on commandline deletes text till last slash. Why use this? It's nice to have when working on bigger projects. It's especially useful for MVC (model, view and controller) kind of applications where the different parts are split into different directories. It's also useful in Java applications where you have source in one directory and tests in another. func! Cwd() let cwd = getcwd() return "e " . cwd endfunc func! DeleteTillSlash() let cmd = getcmdline() let cmd_edited = substitute(cmd, "\\(.*/\\).*", "\\1", "") if cmd == cmd_edited let cmd_edited = substitute(cmd, "\\(.*/\\).*/", "\\1", "") endif return cmd_edited endfunc func! CurrentFileDir() return "e " . expand("%:p:h") . "/" endfunc cno $c e eCurrentFileDir() cmap eDeleteTillSlash()
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software