LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-04-2017, 01:38 PM   #1
validator456
Member
 
Registered: Apr 2013
Location: Rotterdam, The Netherlands
Distribution: Crunchbang Linux
Posts: 165

Rep: Reputation: Disabled
Browsing through code with tags?


On a regular basis I have to open a SVG file (Scalable Vector Graphics) and because these files can be quite large, I have difficulty browsing the code, especially if there is an error.
Example (simplified):

Code:
<g>  
  <g>  
      </g>  
  <g>  
      </g>    
</g> 
How can I jump from one tag to its end tag? For instance, if my cursor is on the first tag <g>, how can I go to the end tag </g> (The last tag in the example).

So, in short, my question is, how can I browse code in the best way?
 
Old 08-04-2017, 01:50 PM   #2
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: Devuan, Slackware
Posts: 423

Rep: Reputation: 106Reputation: 106
Depends on the editor you use. I use vim and with the "set showmatch" option in .vimrc if you have the cursor on one bracket for example it highlights the corresponding one
 
2 members found this post helpful.
Old 08-04-2017, 01:55 PM   #3
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Ubuntu, Devuan, OpenBSD
Posts: 2,362
Blog Entries: 3

Rep: Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044Reputation: 1044
Emacs will open SVG files as in nXML mode and allow you to edit the file as XML. So in emacs you could bind keys to nxml-down-element, nxml-backward-element, nxml-forward-element, and nxml-backward-up-element.
 
2 members found this post helpful.
Old 08-04-2017, 02:50 PM   #4
validator456
Member
 
Registered: Apr 2013
Location: Rotterdam, The Netherlands
Distribution: Crunchbang Linux
Posts: 165

Original Poster
Rep: Reputation: Disabled
Quote:
"Browsing through code
:set mps+=<:>
matchpairs does the job for me in Vim. See above.

This is the page that discusses it and more: http://vim.wikia.com/wiki/Moving_to_matching_braces

There is also a vim plugin that offers more but I haven't looked into it.

Thank you for your answers, both of you.
 
  


Reply

Tags
code, vim


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] faq.php?faq=vb_faq#faq_lqwelcome: [code]tags[/code] schneidz LQ Suggestions & Feedback 1 12-30-2014 10:00 PM
Code Tags custangro LQ Suggestions & Feedback 5 11-16-2013 02:55 PM
tags for inline code fonts jlinkels LQ Suggestions & Feedback 0 02-04-2011 09:27 AM
What are code tags? southsibling LQ Suggestions & Feedback 14 11-25-2008 09:08 AM
Apache: show mp3 id tags in directory browsing? wijnands Linux - Software 1 08-09-2005 07:09 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration