Is it possible to get syntax highlighting for .gitignore files when using cat?  Update:  Tried sudo apt-get install python-pygments as suggested by @rovo but when using comments in the .gitignore it stops working.  Sample .gitignore (does not work):  # JetBrains IDEs .idea   Sample .gitignore (works):  .idea
122971
Sometimes I quickly want to view the contents of a file from the command line. For this I of course use , but it is often source files in ,  or simple . For these files it would be handy if cat could give some color markup to the files, so that it reads more easy.  Can cat do such a thing?
34452
Some of the git commands have many options, and it would often be useful to search through them for the one I need - I was just looking for the option which controls the TAB width in git-gui, but there are about 200 completions for git config. An obvious workaround is to copy all the completions into an editor and search through them, but I'd rather do  [something] | grep tab   There are no man or info pages for compgen, help compgen doesn't even explain its own options, and there's no auto-complete for compgen (how's that for irony?).  PS:  doesn't work.  PPS: This is not a question about git-gui - The  was elsewhere.  PPPS: This is not about auto-completing commands, only command parameters.
4886
If I understand the cat manual correctly:       concatenate files and print on the standard output   cat will take files as argument and print them on standard output. What I don't get is if I use the command:    cat img.png &gt; copy.png   I will obtain 2 png files identical while if I just    cat img.png     I have all chance that my terminal get messed up and misinterpret what I type.     How's that possible?   Binary values are still binary data. Why it does not simply shows a series of 0 and 1 or the interpretation of those binary data in ASCII or whatever the encoding in terminal is?   Is this behavior also possible by cating a text file containing strange characters?   Should a mechanism to prevent this behavior  like try{}catch{} statement should be implemented?
42087
Writing a python script and it needs to find out what language a block of code is written in. I could easily write this myself, but I'd like to know if a solution already exists.  Pygments is insufficient and unreliable.
2149
I'm working on a large document which contains several figures. Due to the figures it takes a long time to compile.   I would like to comment out all the figures while I'm working and then put them back in at the end. To do this, I added something like   \renewenvironment{figure}{\begin{comment}}{\end{comment}}  which I could then comment out when needed. However, this just doesn't work and gives all sorts of problems. Specifically, I tried to compile this -   \documentclass[12pt]{article} \usepackage{graphicx} \usepackage{comment} %\renewenvironment{figure}{\begin{comment}}{\end{comment}} \begin{document} \begin{figure} \begin{center} \includegraphics{image.png} \end{center} \end{figure} \end{document}   With the % everything compiled perfectly. If I remove the %, I get an error  Excluding 'comment' comment.) Runaway argument? ! File ended while scanning use of \next.
114516
This question led to a new package:      How can I display the full path of the tex file that I compile? It is a simple file, no include or input present.  Edit: I use MiKTeX 2.9 on a Windows 7 64-bit.  Less demanding: If not possible, then I will be satisfied with a partial path (at least one or two folders up + the filename).
108921
I'd like to make commands I've typed (input) into terminal stand out from all the output.   For example:  imac:~ buster$ chmod -R g-w myfolder  imac:~ buster$ cd myfolder imac:myfolder buster$ ls -l total 0 drwxr-xr-x   9 root  admin   306 Apr 20  2010 bin drwxr-xr-x   7 root  admin   238 Apr 20  2010 include drwxr-xr-x  73 root  admin  2482 May 18 17:16 lib drwxr-xr-x   6 root  admin   204 Apr 20  2010 man imac:myfolder buster$ echo Go Giants! Go Giants!  bold jumps to mind but I'd accept a color or even highlighting the whole line...   I'm sure there's a way to do this but it's not obvious to me...  thanks!
42956
Do you think it would be worthwhile to provide hints as to what language to use for the syntax highlighting?  Sometimes I find the highlighting on SQL or VB.NET answers is more distracting than helpful; for example:       to pick the two I've been looking at recently.
119657
I require use of the  package of similar one which support Prolog syntax-highlighting.  Given that I use the  "IDE", how do I enable shell-escape?    Though I attempted—see above—I still receive this in my output:  ! Package minted Error: You must invoke LaTeX with the -shell-escape flag.
48436
Is there way to switch on syntax highlighting in ?   Personally I use it for editing and collaborating on C++ files, but PHP or SQL syntax highlighting also would be interesting.
7676
I want to highlight C/C++/Java/C# etc source codes in my website.  How can I do this?  Is it a CPU intensive job to highlight the source code?
124263
I want to add .gitignore file to my local repo. My local repo is a clone from my Drupal 8 distro from Acquia Cloud.  What are best practices for my .gitignore file for Acquia Cloud hosted sites? I followed .   For example: do i have to ignore settings.php and not settings*.php? Regarding this quote from :      Drupal 8 You can modify .gitignore so that it ignores settings.php   (not settings*.php). Then, you can update the standard settings.php   with the Drupal 8 local settings file checker:    Where is settings.local.php for, mentioned in the Quote above from ?   Currently my .gitignore file looks like this:  # This file contains default .gitignore rules. To use it, copy it to .gitignore, # and it will cause files like your settings.php and user-uploaded files to be # excluded from Git version control. This is a common strategy to avoid # accidentally including private information in public repositories and patch # files. # # Because .gitignore can be specific to your site, this file has a different # name; updating Drupal core will not override your custom .gitignore file.  # Ignore core and vendor when managing dependencies with Composer. # core # vendor  # Ignore configuration files that may contain sensitive information. sites/*/settings*.php sites/*/services*.yml  # Ignore paths that contain user-generated content. sites/*/files sites/*/private sites/*/files-private  cache/ files/  # Ignore SimpleTest multi-site environment. sites/simpletest  # If you prefer to store your .gitignore file in the sites/ folder, comment # or delete the previous settings and uncomment the following ones, instead.  # Ignore configuration files that may contain sensitive information. # */settings*.php  # Ignore paths that contain user-generated content. # */files # */private  # Ignore SimpleTest multi-site environment. # simpletest  # Ignore default text files /CHANGELOG.txt /COPYRIGHT.txt /INSTALL*.txt /LICENSE.txt /MAINTAINERS.txt /UPGRADE.txt /README.txt sites/all/README.txt sites/all/modules/README.txt sites/all/themes/README.txt  # ------------------------------------------------------------------------------ # SublimeText files # ------------------------------------------------------------------------------  # Workspace settings. *.sublime-workspace  # Project settings. *.sublime-project  # ------------------------------------------------------------------------------ # OSX # ------------------------------------------------------------------------------  # Common OSX files. .AppleDouble .DS_Store .LSOverride  # Thumbnails. ._*  # Files that might appear in the root of a volume. .DocumentRevisions-V100 .fseventsd .Spotlight-V100 .TemporaryItems .Trashes .VolumeIcon.icns  # Directories potentially created on remote AFP share. .apdisk .AppleDB .AppleDesktop Network Trash Folder Temporary Items  # ------------------------------------------------------------------------------ # Windows # ------------------------------------------------------------------------------  # Windows image file caches. ehthumbs.db Thumbs.db  # Folder config file. Desktop.ini  # Recycle Bin used on file shares. $RECYCLE.BIN/  # Windows Installer files. *.cab *.msi *.msm *.msp  # Windows shortcuts. *.lnk  # ------------------------------------------------------------------------------ # Linux # ------------------------------------------------------------------------------  # Tilde files. *~  # KDE directory preferences. .directory  # Linux trash folder which might appear on any partition or disk. .Trash-*   What do i have to change to make it perfect?
112700
When you edit the body of a post, the "How to Format" widget is shown in the right sidebar. It mentions the syntax highlighting function, even on  like :    It's probably also a good idea to move the part about code fences down for non-technical sites (like ); other formatting options are more important there.
85162
When I open up the command line and type in git, I get a bunch of completions for arguments of git, like add, commit, merge, and so on.  How do I add this kind of completion to my own apps?  So far, I've been able to specify the first level of completion like this:  $ complete -W "asd asdf" ./test.py  $ ./test.py asd asd asdf   But it tries to keep going after that:  $ ./test.py asdf asd asd asdf   I've tried setting a completion for the second level by running complete -W "lol" "./test.py asd", but that doesn't work.  What's the proper way to set these up? And once I've figured out all of the commands, where do I have to put them? Running a big list of these commands in .bashrc, every time a terminal is opened, doesn't seem too efficient (plus I don't want to mess with users' files if I don't have to).
38340
Is there a command to show the directory/file name when cat files?  For example: assume two files f1.txt and f2.txt are under ./tmp  ./tmp/f1.txt ./tmp/f2.txt    Then when I do cat ./tmp/*.txt, only the content of files will be shown. But how to firstly show the file name, then the content?, e.g.:   (The needed command):  ./tmp/f1.txt:    This is from f1.txt  and so on  ./tmp/f1.txt:  This is from f2.txt ...   Is there a command to do it? (There seems to be no option for 'cat' to show the file names)
111672
Is there a meta-package for installing commonly used developer tools such as cmake, autoconf, g++, etc.? The intent is to have roughly the same range of command-line tools as one has after installing XCode and the Mac SDK on Apple.
75726
I hate to clutter my source code files with licensing/attribution comments but some times it is a requirement. So having dozens of source code files (organized in a tree of subdirectories) written I need to add the same multiline comment to the beginning of each of them.  I suspect this is a very easy task to do with standard GNU/Linux command line tools though I am hardly proficient in making any serious use of them, so I beg your pardon and ask for your help.  What I need is to replace every theTargetFile.txt in ./*.txt (including in subdirectories recursively) with something like cat theCommonComment.txt theTargetFile.txt.   I would also prefer to exclude files fitting a particular more specific mask like consider all *.txt but leave *.DontTouch.txt intact.  I think the hardest part of what I actually need is a fancy find-based spell that would run through subdirectories, include *.txt files and exclude *.DontTouch.txt files.