How to have a filename extension recognized as another, real case requires: .bashrc must be recognized/treated as .sh filename extension thanks before
This is the default behaviour so it should work automatically, [see here](https://github.com/geany/geany/blob/d2740f21feb84b6f951398c6f683674b2b56bfed...). Documentation [is here](https://www.geany.org/manual/current/index.html#filetype-extensions)
Apologize, I've been using it of debian mainstream so won't work as there's no such file from debian Any idea how to a simplest solution?
`Menu->tools->Configuration Files->filetype_extensions.conf`
not work, even after make it up one in `~/.config/geany` (previously nothing there a `filetype_extensions.conf`)
Not sure whether your distri did patch that file or some local configuration is conflicting... .bashrc should already be recognized as Sh -- https://github.com/geany/geany/blob/master/data/filetype_extensions.conf#L67 -- and this is working at least here. Would you mind double checking?
![Screen bashrc](https://user-images.githubusercontent.com/25836673/102716242-318ea580-430d-1...) ![Screen sh](https://user-images.githubusercontent.com/25836673/102716256-4703cf80-430d-1...)
On **MX debian** `filetype_extensions.conf` # Filetype extension configuration file for Geany # Insert as many items as you want, separate them with a ";". # See Geany's main documentation for details. [Extensions] Abaqus=*.inp; Abc=*.abc;*.abp; ActionScript=*.as; Ada=*.adb;*.ads; Arduino=*.ino;*.pde; Asciidoc=*.asciidoc;*.adoc; ASM=*.asm;*.asm51;*.a51;*.s;*.S;*.sx; Batch=*.bat;*.cmd;*.nt; CAML=*.ml;*.mli; C=*.c;*.xpm; C++=*.cpp;*.cxx;*.c++;*.cc;*.h;*.hpp;*.hxx;*.h++;*.hh;*.C;*.H; Clojure=*.clj;*.cljs;*.cljc; CUDA=*.cu;*.cuh;*.h; C#=*.cs; CMake=CMakeLists.txt;*.cmake;*.ctest; COBOL=*.cob;*.cpy;*.cbl;*.cobol; CoffeeScript=*.coffee;Cakefile;*.Cakefile;*.coffee.erb;*.iced;*.iced.erb; Conf=*.conf;*.ini;config;*rc;*.cfg;*.desktop;*.properties;control; CSS=*.css; Cython=*.pyx;*.pxd;*.pxi; D=*.d;*.di; Diff=*.diff;*.patch;*.rej;*.debdiff;*.dpatch; Docbook=*.docbook; Erlang=*.erl;*.hrl; F77=*.f;*.for;*.ftn;*.f77;*.F;*.FOR;*.FTN;*.fpp;*.FPP; Ferite=*.fe; Forth=*.fs;*.fth; Fortran=*.f90;*.f95;*.f03;*.f08;*.F90;*.F95;*.F03;*.F08; FreeBasic=*.bas;*.bi;*.vbs; Genie=*.gs; GLSL=*.glsl;*.frag;*.vert; Go=*.go; Graphviz=*.gv;*.dot; Haskell=*.hs;*.lhs;*.hs-boot;*.lhs-boot; Haxe=*.hx; HTML=*.htm;*.html;*.shtml;*.hta;*.htd;*.htt;*.cfm;*.tpl; Java=*.java;*.jsp; Javascript=*.js; JSON=*.json; LaTeX=*.tex;*.sty;*.idx;*.ltx;*.latex;*.aux;*.bib; Lisp=*.lisp; Lua=*.lua; Make=*.mak;*.mk;GNUmakefile;makefile;Makefile;makefile.*;Makefile.*; Markdown=*.mdml;*.markdown;*.md;*.mkd;*.mkdn;*.mdwn;*.mdown;*.mdtxt;*.mdtext; Matlab/Octave=*.m; NSIS=*.nsi;*.nsh; Objective-C=*.m;*.mm;*.h; Pascal=*.pas;*.pp;*.inc;*.dpr;*.dpk; Perl=*.pl;*.perl;*.pm;*.agi;*.pod; PHP=*.php;*.php3;*.php4;*.php5;*.phtml; Po=*.po;*.pot; Python=*.py;*.pyw;SConstruct;SConscript;wscript; PowerShell=*.ps1;*.psm1; reStructuredText=*.rest;*.reST;*.rst; R=*.R;*.r; Rust=*.rs; Ruby=*.rb;*.rhtml;*.ruby;*.gemspec;Gemfile;rakefile;Rakefile; Scala=*.scala;*.scl; Sh=*.sh;configure;configure.in;configure.in.in;configure.ac;*.ksh;*.mksh;*.zsh;*.ash;*.bash;.bashrc;bash.bashrc;.bash_*;bash_*;*.m4;PKGBUILD;*profile; SQL=*.sql; Tcl=*.tcl;*.tk;*.wish;*.exp; Txt2tags=*.t2t; Vala=*.vala;*.vapi; Verilog=*.v; VHDL=*.vhd;*.vhdl; XML=*.xml;*.sgml;*.xsl;*.xslt;*.xsd;*.xhtml;*.xul;*.dtd;*.xtpl;*.mml;*.mathml; YAML=*.yaml;*.yml; Zephir=*.zep; None=*;
# Note: restarting is required after editing groups [Groups] Programming=Arduino;Clojure;CUDA;Cython;Genie;Scala; Script=Graphviz; Markup= Misc=JSON; None=
Your `filetype_extensions.conf` is missing all the `*`s.
NOT ME MARKDOWN MAKE IT MISSING
Add code block around above paste and removed `` from in front of the comment lines. Probably better to paste your exact file in between the `ini` code block I added.
To me it looks like it's detecting as shell script (though can't be sure, as @elextr said, your screenshots don't show the statusbar where it tells the file type). I suspect that probably your complex Bash script is tripping up the simplistic shell script lexer, though will need to see the status bar to be sure.
after reset bar; filetype: conf ![Screen bashrc](https://user-images.githubusercontent.com/25836673/102726260-d3cf7d00-434f-1...)
Yup `.bashrc` matches conf's `*rc` pattern and that happens to be found before shell. (The order is that of an internal filetype list)
If more than one pattern matches its undetermined which will be found.
it's bit buggy even after move Sh line to precede *rc then it'd resist to work unless clear that *rc
As I said above `The order is that of an internal filetype list` which is not in `filetype.extensions` order.
Closed #2694.
github-comments@lists.geany.org