SlideShare uma empresa Scribd logo
1 de 1
Baixar para ler offline
Vim Eye For the Rails Guy                             Working with Multiple Files
                                                      :e path/to/filename – edit file
Karmen Blake
                                                      :NERDTree – opens left hand file explorer
http://blog.dudeblake.com
                                                      ctags
                                                               control+] - navigate to definition
Movement
                                                               control+t - navigate back on stack
command + <arrows>
                                                               g+] - list all occurrences of word
h l k j – left, right, up, down
                                                               :tags – shows tag stack
b w – word left, word right
                                                               :tag <method or class definition> - open or list
                                                               :tag /<definition> - search substring
Insert/Append Text
                                                      :Rfind substring of filename – search for, give you options
i – start insert mode
                                                      to open file/directory in Rails project
a – append after cursor
                                                      :Renvironment – opens environment.rb by default
o – open blank line below current line
                                                      :Rinitializer – opens routes.rb by default
Esc – exit insert mode
                                                      :A – alternate file most often the spec file
                                                      :R – related file, read rails.vim docs
Editing
                                                      gf – mac daddy go anywhere command
u – undo last command
                                                               if clicked anywhere in relevant string it will do its
control + p – autocomplete word
                                                               best to go to related file. Examples with tons more
column edit
                                                               in rails.vim docs,
         control + v (visual block)
                                                               Po*st.find ---> models/post.rb
         use arrows to select column to replace
                                                               has_many :c*omments ---> models/comment.rb
         c + new text + Esc
                                                      gt – switch between open tabs
indent
                                                      <leader>b – view all buffers and select one (open files)
         :> - indents current line
                                                      :bd – close a buffer (file)
         :>> - indents current line twice
         :> # - indent # of lines
                                                      Opening windows
         :>> # - indents twice # of lines
                                                      :sp path/to/filename – open file in horizontal split window
surround
                                                      :vsp path/to/filename – open file in vertical split window
         cs<old><new> (cs“*)
                                                      :AS – open alternate file in horizontal split
         ds<delimiter> – remove delimiters
                                                      :AV – open alternate file in vertical split
         csw<delimiter> - surrounds word
                                                      :RS – open related file in horizontal split
         yss<delimiter> - surround line
                                                      :RV – open related file in vertical split

                                                      Running Specs
Marking Text
                                                      :.Rake – runs one spec
v – start visual mode
                                                      :Rake – runs whole spec suite
V – start Linewise visual mode
                                                      Exit
Visual Commands
                                                      command + s (save)
aw – select word
                                                      :w – save but don't exit
ap – select paragraph
                                                      :wq – save and exit
                                                      :q! - quit and ignores edits
Copy/Cut and Paste
yy – yank (copy) line
                                                      Vim Plugins
dd – delete (cut) line
                                                          •    Rails: http://www.vim.org/scripts/script.php?script_id=1567
p – put (paste) clipboard after cursor
                                                          •    Fuzzy Finder: http://www.vim.org/scripts/script.php?
Search/Replace                                                 script_id=1984
                                                          •
/pattern – search for pattern                                  NERDTree: http://www.vim.org/scripts/script.php?script_id=1658
n – repeat search forward                                 •    surround: http://www.vim.org/scripts/script.php?script_id=1697
:set hlsearch – highlight all results of search
:nohlsearch to turn off highlights
:%s/old/new/g – replace all old with new in file
:begline#,endline#/old/new/g – replace old with new
between beg/end line #s

Mais conteúdo relacionado

Mais procurados

Logrotate sh
Logrotate shLogrotate sh
Logrotate sh
Ben Pope
 
Study2study#4 nginx conf_1_24
Study2study#4 nginx conf_1_24Study2study#4 nginx conf_1_24
Study2study#4 nginx conf_1_24
Naoya Nakazawa
 

Mais procurados (12)

Logrotate sh
Logrotate shLogrotate sh
Logrotate sh
 
Study2study#4 nginx conf_1_24
Study2study#4 nginx conf_1_24Study2study#4 nginx conf_1_24
Study2study#4 nginx conf_1_24
 
tools
toolstools
tools
 
tit
tittit
tit
 
Linux fundamental - Chap 05 filter
Linux fundamental - Chap 05 filterLinux fundamental - Chap 05 filter
Linux fundamental - Chap 05 filter
 
skipfish
skipfishskipfish
skipfish
 
Os Treat
Os TreatOs Treat
Os Treat
 
Capistrano2
Capistrano2Capistrano2
Capistrano2
 
Common mistakes functional java | Oracle Code One 2018
Common mistakes functional java | Oracle Code One 2018Common mistakes functional java | Oracle Code One 2018
Common mistakes functional java | Oracle Code One 2018
 
Common mistakes functional java vjug
Common mistakes functional java vjugCommon mistakes functional java vjug
Common mistakes functional java vjug
 
Build Your Own Tools
Build Your Own ToolsBuild Your Own Tools
Build Your Own Tools
 
IJTC%202009%20JRuby
IJTC%202009%20JRubyIJTC%202009%20JRuby
IJTC%202009%20JRuby
 

Semelhante a Vim Eye for the Rails Guy - Cheatsheet

DevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung FooDevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung Foo
brian_dailey
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
tomcopeland
 

Semelhante a Vim Eye for the Rails Guy - Cheatsheet (20)

Love Your Command Line
Love Your Command LineLove Your Command Line
Love Your Command Line
 
Becoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola PaolucciBecoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola Paolucci
 
Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009
 
Vim and Python
Vim and PythonVim and Python
Vim and Python
 
Os Wilhelm
Os WilhelmOs Wilhelm
Os Wilhelm
 
May The Nodejs Be With You
May The Nodejs Be With YouMay The Nodejs Be With You
May The Nodejs Be With You
 
Vim Hacks
Vim HacksVim Hacks
Vim Hacks
 
Vim Hacks
Vim HacksVim Hacks
Vim Hacks
 
Php Development With Eclipde PDT
Php Development With Eclipde PDTPhp Development With Eclipde PDT
Php Development With Eclipde PDT
 
DevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung FooDevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung Foo
 
Simple tricks to speed you up on the command line
Simple tricks to speed you up on the command lineSimple tricks to speed you up on the command line
Simple tricks to speed you up on the command line
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentation
 
Git::Hooks
Git::HooksGit::Hooks
Git::Hooks
 
Subversionn Introduction at SuperMondays 2009-09-01
Subversionn Introduction at SuperMondays 2009-09-01Subversionn Introduction at SuperMondays 2009-09-01
Subversionn Introduction at SuperMondays 2009-09-01
 
Hacking with ruby2ruby
Hacking with ruby2rubyHacking with ruby2ruby
Hacking with ruby2ruby
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
 
I18nize Scala programs à la gettext
I18nize Scala programs à la gettextI18nize Scala programs à la gettext
I18nize Scala programs à la gettext
 
Unix Command Line Productivity Tips
Unix Command Line Productivity TipsUnix Command Line Productivity Tips
Unix Command Line Productivity Tips
 
Composer: putting dependencies on the score
Composer: putting dependencies on the scoreComposer: putting dependencies on the score
Composer: putting dependencies on the score
 
EC2
EC2EC2
EC2
 

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

Vim Eye for the Rails Guy - Cheatsheet

  • 1. Vim Eye For the Rails Guy Working with Multiple Files :e path/to/filename – edit file Karmen Blake :NERDTree – opens left hand file explorer http://blog.dudeblake.com ctags control+] - navigate to definition Movement control+t - navigate back on stack command + <arrows> g+] - list all occurrences of word h l k j – left, right, up, down :tags – shows tag stack b w – word left, word right :tag <method or class definition> - open or list :tag /<definition> - search substring Insert/Append Text :Rfind substring of filename – search for, give you options i – start insert mode to open file/directory in Rails project a – append after cursor :Renvironment – opens environment.rb by default o – open blank line below current line :Rinitializer – opens routes.rb by default Esc – exit insert mode :A – alternate file most often the spec file :R – related file, read rails.vim docs Editing gf – mac daddy go anywhere command u – undo last command if clicked anywhere in relevant string it will do its control + p – autocomplete word best to go to related file. Examples with tons more column edit in rails.vim docs, control + v (visual block) Po*st.find ---> models/post.rb use arrows to select column to replace has_many :c*omments ---> models/comment.rb c + new text + Esc gt – switch between open tabs indent <leader>b – view all buffers and select one (open files) :> - indents current line :bd – close a buffer (file) :>> - indents current line twice :> # - indent # of lines Opening windows :>> # - indents twice # of lines :sp path/to/filename – open file in horizontal split window surround :vsp path/to/filename – open file in vertical split window cs<old><new> (cs“*) :AS – open alternate file in horizontal split ds<delimiter> – remove delimiters :AV – open alternate file in vertical split csw<delimiter> - surrounds word :RS – open related file in horizontal split yss<delimiter> - surround line :RV – open related file in vertical split Running Specs Marking Text :.Rake – runs one spec v – start visual mode :Rake – runs whole spec suite V – start Linewise visual mode Exit Visual Commands command + s (save) aw – select word :w – save but don't exit ap – select paragraph :wq – save and exit :q! - quit and ignores edits Copy/Cut and Paste yy – yank (copy) line Vim Plugins dd – delete (cut) line • Rails: http://www.vim.org/scripts/script.php?script_id=1567 p – put (paste) clipboard after cursor • Fuzzy Finder: http://www.vim.org/scripts/script.php? Search/Replace script_id=1984 • /pattern – search for pattern NERDTree: http://www.vim.org/scripts/script.php?script_id=1658 n – repeat search forward • surround: http://www.vim.org/scripts/script.php?script_id=1697 :set hlsearch – highlight all results of search :nohlsearch to turn off highlights :%s/old/new/g – replace all old with new in file :begline#,endline#/old/new/g – replace old with new between beg/end line #s