SlideShare une entreprise Scribd logo
1  sur  1
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Tendances (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
 

Similaire à Vim Eye for the Rails Guy - Cheatsheet

Love Your Command Line
Love Your Command LineLove Your Command Line
Love Your Command LineLiz Henry
 
Becoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola PaolucciBecoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola PaolucciAtlassian
 
Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009Bastian Feder
 
May The Nodejs Be With You
May The Nodejs Be With YouMay The Nodejs Be With You
May The Nodejs Be With YouDalibor Gogic
 
Php Development With Eclipde PDT
Php Development With Eclipde PDTPhp Development With Eclipde PDT
Php Development With Eclipde PDTBastian Feder
 
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 Foobrian_dailey
 
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 lineJanos Gyerik
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentationbrian_dailey
 
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-01Alex Kavanagh
 
Hacking with ruby2ruby
Hacking with ruby2rubyHacking with ruby2ruby
Hacking with ruby2rubyMarc Chung
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slidesharetomcopeland
 
I18nize Scala programs à la gettext
I18nize Scala programs à la gettextI18nize Scala programs à la gettext
I18nize Scala programs à la gettextNgoc Dao
 
Unix Command Line Productivity Tips
Unix Command Line Productivity TipsUnix Command Line Productivity Tips
Unix Command Line Productivity TipsKeith Bennett
 
Composer: putting dependencies on the score
Composer: putting dependencies on the scoreComposer: putting dependencies on the score
Composer: putting dependencies on the scoreRafael Dohms
 

Similaire à 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
 

Dernier

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 

Dernier (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 

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