Komodo: Change Default File Preferences - komodo

In Komodo, I can change file preferences by right clicking on the file and going to File Preferences. Is there a way to change the default file preferences any time I open a new file?
Komodo edit 11.1.0 mac

You can set some defaults under Edit menu > Preferences > [ File Opening | Syntax & Spell Checking | Languages ].

Related

Fontforge: Export a glyph to SVG with fontforge command line

How to export a glyph (from its unicode) to SVG with Fontforge command line ?
I also need to specify the font size and keep the original margins it has in the font.
You may have found your answer already, but I just had to do this with the latest build of FontForge. The old answer of this command:
fontforge -lang=ff -c 'Open($1); SelectWorthOutputting(); foreach Export("svg"); endloop;' font.ttf
From a command prompt didn't want to work on Windows10 (I assume a permission issue), but you could give it a try. A quick work-around is to do it via the GUI Execute Script.
Run FontForge (For Windows10 installed in the Program Files (x86) directory, you may need to right-click "run_fontforge.exe" --> Run As Administrator).
Open the font you want to export.
Go to File > Execute Script
Paste: SelectWorthOutputting(); foreach Export("svg"); endloop;
Select "FF" radial button.
Hit OK
It'll save to the FontForge folder (where run_fontforge.exe is located).
On Windows os (Tested on win10)
this is from inside a BATCH file:
c:\Programs\FontForge\bin\fontforge.exe -lang=ff -c "Open($1); SelectWorthOutputting(); foreach Export('%%e_%%f_%%n_%%u.eps'); endloop;" %1
this is directly on the command line:
c:\Programs\FontForge\bin\fontforge.exe -lang=ff -c "Open($1); SelectWorthOutputting(); foreach Export('%e_%f_%n_%u.eps'); endloop;" font-file.ttf
note - the color is not exported. And I don't know if it's unimplemented, or a bug.

How to open a "-" dashed filename using terminal?

I tried gedit, nano, vi, leafpad and other text editors , it won't open, I tried cat and other file looking commands, and I ensure you it's a file not a directory!
This type of approach has a lot of misunderstanding because using - as an argument refers to STDIN/STDOUT i.e dev/stdin or dev/stdout .So if you want to open this type of file you have to specify the full location of the file such as ./- .For eg. , if you want to see what is in that file use cat ./-
Both cat < - and ./- command will give you the output
you can use redirection
cat < -file_name
It looks like the rev command doesn't treat - as a special character.
From the man page
The rev utility copies the specified files to standard output, reversing the order of characters in every line.
so
rev - | rev
should show what's in the file in the correct order.
I tried with pico or vi command.pico readme which allowed me open in editor and read the contents.
if you want to open this type of file you have to specify the full location of the file such as ./- .For eg. , if you want to see what is in that file use cat ./-
cat ./- is the syntax that reveals the correct password for bandit the "rev -" reveals something else

gvim open dialog file type filter

I like using the file browser in gvim sometimes, however what I don't like is that the file filter is always set to the current file type being edited.
For example, if I have a .cpp file open in the current buffer and go to the file open dialog the file filter is set to "C++ source files (*.cpp *.c++)". I would prefer that headers are displayed too by default (say).
Is there a way to change this default behavior?
Thanks to #benjifisher, I found the help for :browse which shows how to do what I wanted.
More specifically, the default filetype plugin for C/C++ contains these lines:
let b:browsefilter = "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" .
\ "C Header Files (*.h)\t*.h\n" .
\ "C Source Files (*.c)\t*.c\n" .
\ "All Files (*.*)\t*.*\n"
I copied the file into my local vim ftplugin directory and modified to my liking which now takes precedence over the system version.
If anyone, like me, wants a quick and simple way to disable this behaviour altogether in vimrc:
autocmd FileType * let b:browsefilter = ''
From first reply in this thread
I had a similar issue that I solved without having to copy the c.vim file to ~/.vim/ftplugin. To support *.cc as a C++ extension, in GVim on Ubuntu I edited the /usr/share/vim/vim74/ftplugin/c.vim file to add the extension:
let b:browsefilter = "C++ Source Files (*.cpp *.c++ *cc)\t*.cpp;*.c++;*.cc\n" .
\ "C Header Files (*.h)\t*.h\n" .
\ "C Source Files (*.c)\t*.c\n" .
\ "All Files (*.*)\t*.*\n"
Then restarted GVim and it worked without copying c.vim.

How to apply and override preferences with tshark?

I am writing a plugin for wireshark-1.9.2. We do not have GUI on the server, so we use tshark. My question is how to add and apply new preferences with tshark?
My $HOME/.wireshark/preferences file contains only one line:
ls_payload_display_len: 20
When I run tshark, I get a warning:
Syntax error in preference ls_payload_display_len (applying your preferences once should remove this warning)
I can access the value of the preference in the dissector code with function prefs_register_uint_preference(...). But I cannot override it with the -o option when start tshark:
tshark: Invalid -o flag "ls_payload_display_len:80"
So, the two questions are:
How do I apply my preferences file with tshark, so that the syntax error warning won't show again?
How do I override preferences values with the -o option of tshark?
Thanks.
It appears that for an attempt to set a non-existent preference, Wireshark and TShark don't report it as a non-existent preference, they report it as a "Syntax error in preference" in the preferences file and as an "Invalid -o flag" on the command line.
prefs_register_uint_preference() takes, as its first argument, a pointer to a module_t, so you must have referenced a preferences module. The prefs_register_module() call takes a name argument, so the module has a name; the full name for your preference includes the module name, so, if your preference module's name is "my_protocol", your preference's name would be "my_protocol.ls_payload_display_len", and you would have to use that full name in the preferences file and on the command line, e.g.
my_protocol.ls_payload_display_len: 20
and
tshark -o my_protocol.ls_payload_display_len:80

Menu items messed up while using MacVim with Vim Latex

I just installed macvim yesterday and I have been trying to install vim latex today.
The one thing I am confused about is the menu items on the top bar:
-------------------------------------------------------------------------------
<apple icon> File Edit Tools Syntax TeX-Suite TeX-Environments TeX-Elements
-------------------------------------------------------------------------------
| Packages > |_____
| Templates > | 1: |
| Macros > | 2: |
|----------- | 3: |
| Compile | 4: |
| View |-----
| ... |
-------------
So in words if you go TeX-Suite -> Templates there is a sub menu with menu items: 1: 2: 3: 4:.
Now I know that these templates live here:
% pwd
/Users/me/.vim/ftplugin/latex-suite/templates
% ls
IEEEtran.tex article.tex report.tex report_two_column.tex
and they are named correctly.
Also I know that the :TTemplate vim command should do the same thing. When I type that I get this result:
Choose a template file:
(1) IEEEtran (2) article
(3) report (4) report_two_column
Enter number or name of file :
So I am thinking that this must be a bug in MacVim. Is this a reasonable assumption? Any fixes?
The problem is that vim-latex puts the template name after the <Tab> when they set up the menus (see ":h menu"). This text is supposed to show a hint as to what command to use to access that particular menu item (e.g. File->Save has ":w" after <Tab>) and on most platforms it is displayed flush right on the menu items. However, on Mac OS X it is only possible to show keyboard shortcuts to the right in a menu item, so the text is instead displayed in a popup window if you let the mouse hover over the menu item for a while.
The only way to get around this problem is to edit the vim-latex menu files and delete the <Tab> from each menu command.
I just installed vim-latex on OS X. To get the templates menu items to show up I changed the line
exe "amenu ".g:Tex_TemplatesMenuLocation."&".i.":<Tab>".fname." ".
to
exe "amenu ".g:Tex_TemplatesMenuLocation."&".fname." ".
in the file ~/.vim/ftplugin/latex-suite/templates.vim. To get the items under TeX-Suite -> Macros to show up I changed the lines
exe "amenu ".g:Tex_MacrosMenuLocation."&Delete.&".i.":<tab>".fname." :call <SID>DeleteMacro('".fname."')<CR>"
exe "amenu ".g:Tex_MacrosMenuLocation."&Edit.&".i.":<tab>".fname." :call <SID>EditMacro('".fname."')<CR>"
exe "imenu ".g:Tex_MacrosMenuLocation."&".i.":<tab>".fname." <C-r>=<SID>ReadMacro('".fname."')<CR>"
exe "nmenu ".g:Tex_MacrosMenuLocation."&".i.":<tab>".fname." i<C-r>=
to
<SID>ReadMacro('".fname."')<CR>"
exe "amenu ".g:Tex_MacrosMenuLocation."&Delete.&".fname." :call <SID>DeleteMacro('".fname."')<CR>"
exe "amenu ".g:Tex_MacrosMenuLocation."&Edit.&".fname." :call <SID>EditMacro('".fname."')<CR>"
exe "imenu ".g:Tex_MacrosMenuLocation."&".fname." <C-r>=<SID>ReadMacro('".fname."')<CR>"
exe "nmenu ".g:Tex_MacrosMenuLocation."&".fname." i<C-r>=<SID>ReadMacro('".fname."')<CR>"
in ~/.vim/ftplugin/latex-suite/custommacros.vim.

Resources