Vim umlaut

Hi,
i just upgraded to Yosemite (10.10.1) and i noticed, that 'vim' does not handle umlauts correctly. I'm using the the default German locale settings and the value of the $LANG environment variable is 'de_DE.UTF-8' however vim is not able to display German umlauts like ü, ä, ö. Typing them in the terminal window however, works fine. I don't remember, that this was a problem in Mavericks...
Does anyone experience the same issue? Or even better: Does anyone know how i can fix this?
Thanks, Ralf

i cannot get the umlaut on my MAC PRO  in any  program   BUT I get it ok on my MacBook Pro vintage 2013   same operating system?
Any idea why ??
entering at the same time the
option key + u key
then entering the vowel you want to umlaut does not work?
ü
ä
ö
Die süßesten früchte fressen nur die großen Tiere

Similar Messages

  • Dir listing with umlauts / special characters

    I've got a directory tree, where several files have umlauts or french accented characters in their names.
    When I do 'ls' in such a directory, I can see the umlauts fine in Terminal, e.g.:
    Die rote Wüste - Michelangelo Antonioni.avi
    Nazarin - Luis Buñuel (span, eng sub, 1959).avi
    I've got the environment variable LC_CTYPE=UTF-8.
    However, when I do this: 'ls > /tmp/f.txt'
    and then open the text file in TextEditor, I get this:
    Die rote WuÃàste - Michelangelo Antonioni.avi
    Nazarin - Luis BunÃÉuel (span, eng sub, 1959).avi
    Does anyone have an idea, how to fix this?
    (BTW: I've got a similar problem when I rsync these files ...)
    Thanks a lot in advance.
    Best regards,
    Gabriel.

    Well, I've been using /Applications/TextEdit for these files, because I was assuming that it handles UTF-8 automatically.
    I opened the files now with Vim (my favorite editor), and, lo and behold, all special characters are fine!
    I think, that solves my problem, because I can even copy-and-paste the text from Vim into my notes.
    Best regards,
    Gabriel.

  • [solved] grep german umlaut using regex? use iconv

    Hi guys,
    when grepping
    "<condition data="Bewölkt"/><temp_f data="45"/>"
    i don't get any output.
    The same grep sequence works fine for words like "Leichter Regen" or "Klar", so i suspect grep fails because of the german umlaut ("ö" in this case).
    Now, this is my current locale:
    LANG=en_US.UTF-8
    LC_CTYPE="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_ALL=
    If i export LC_ALL=de_DE i no longer get 0 output but rather "Bew" instead of "Bewölkt" or "Meistens" instead of "Meistens bewölkt".
    Any ideas how to teach grep to use iso-8859-15 or something like that?
    Here's the relevant part of the function:
    declare -a wetter
    wetter=(`curl -silent "http://www.google.de/ig/api?weather=$1+$2+$3" | grep -o 'condition data=\"[A-Z].*\"/><temp_f' | grep -o '[A-Z][a-z]*'`)
    echo Wetter: $wetter
    Last edited by demian (2010-04-27 16:47:26)

    Yes, i was just now getting into regular expressions and sed so my functions will be very dirty for the time being . I'll try the sed command though, thank you.
    I tried iconv as well as your suggestions but the problem remains.
    When i save the .xml file on my hard drive i can grep "bewölkt" but not when i use curl to view the data. When i use curl grep simply ignores everything after the umlaut:
    curl -silent "http://www.google.de/ig/api?weather=Berlin" | grep -o 'condition data=\"[[:alpha:]]*.*'
    condition data="Meistens bew
    condition data="Wind: W mit Windgeschwindigkeiten von 23 km/h"/>[...]
    Maybe the problem is that i don't seem to have iso8895* locales.
    > fd /usr en_US
    /usr/lib/tupac/localization/en_US.php
    /usr/share/X11/locale/en_US.UTF-8
    /usr/share/X11/locale/en_US.UTF-8/Compose
    /usr/share/X11/locale/en_US.UTF-8/XI18N_OBJS
    /usr/share/X11/locale/en_US.UTF-8/XLC_LOCALE
    /usr/share/i18n/locales/en_US
    /usr/share/locale/en_US
    /usr/share/locale/en_US/LC_MESSAGES
    /usr/share/locale/en_US/LC_MESSAGES/wget.mo
    /usr/share/vim/vim72/spell/en/en_US.diff
    > fd /usr de_DE
    /usr/lib/tupac/localization/de_DE.php
    /usr/share/i18n/locales/de_DE
    /usr/share/i18n/locales/de_DE@euro
    /usr/share/vim/vim72/lang/menu_de_de.latin1.vim
    /usr/share/vim/vim72/lang/menu_de_de.utf-8.vim
    /usr/share/vim/vim72/spell/de/de_DE.diff
    Sorry, I've never localized the system before. I always found it convenient just to stick with en_US.utf8 until now.
    I've already changed the function to use google.com so i don't have the umlaut-problem anymore.
    Regards,
    demian
    Last edited by demian (2010-04-27 10:04:31)

  • Yet another terminal/iterm umlaut irritation

    Hi all
    I'm back again with umlaut issues.
    However I'll begin by describing the set up.
    I have GNU bash, version 3.2.17(1)-release (powerpc-apple-darwin8.9.0) installed.
    I also use vim version 7.1b.1 BETA
    My .bashrc contains the following
    PATH=$PATH:/usr/local/bin/:/Users/duffy/'Java Arkiv'/Glassfish_Arkiv/glassfish/bin/
    export LCALL=svSE.UTF-8
    export LANG=sv_SE.UTF-8
    export JAVA_HOME=/Library/Java/Home
    export TERM=xterm-16color
    alias mysql=/usr/local/mysql/bin/mysql
    alias vim=/opt/local/bin/vim
    alias vimdiff=/opt/local/bin/vimdiff
    SHELL=/opt/local/bin/bash
    my .bash_profile contains
    if [ -f ~/.bashrc ]; then
    source ~/.bashrc
    fi
    my .inputrc contains
    set input-meta on
    set output-meta on
    set convert-meta off
    set meta-flag on
    My terminal settings are as follows
    I login with usr/bin/login
    use xterm-color
    screensettings -> utf-8 encoding, wide characters count as 2
    And in my .vimrc I have set the encoding to utf-8
    That about does it for my set up.
    Now - here goes.
    Terminal command window displays umlauts correctly, and appears to display umlauts correctly when typing. If I do a ls on a directory and see a file called lets påsk.txt the file name looks fine. If i type ls på* I get No such file or directory, however if I mark the file name and do a cut and paste in terminal, i.e I cut and paset "på" and paste it into ls then I get ls på* and it works fine. In other words the keyboard input and terminal output display doesnt seem to be the same. I cant figure out why this is. On top of that, when I start vim I can type å ä ö but everytime I do it uses two spaces, so the word påsk looks like this på sk, thsi despite the fact that the terminal uses utf-8 and vim encoding is set to utf-8.
    Maybe I've missed some info here, but I've pretty much put all the info in here I think is relevant.
    I await words fron the grea Guru out there.

    If i type ls på* I get No such file or directory
    In HFS+, which is the MacOSX's default file system, accented characters in file names are stored in "decomposed form". For example, "å" is stored as "a" + "COMBINING RING ABOVE". The file names output by the ls command are decomposed:
    ls p*.txt | od -t x1 -c
    If you enter "å" from your keyboard, on the other hand, it is in pre-composed form, i.e., a single Unicode character:
    echo å | od -t x1 -c
    If you type "ls -w -l påsk.txt", the "å" is pre-composed and bash passes this pre-composed form to some system call (such as stat(2)). But the system call seems to internally convert it into decomposed form, so it works.
    If you type "ls -w på*", on the other hand, bash gets filenames (which are decomposed) in the current directory and compares them with "på" (which is pre-composed), resulting in no match. A workaround is to use "ls -w pa*", i.e., without the accent.
    I also use vim version 7.1b.1 BETA
    Where did you get this? I guess it has been built without the multibyte support. In vim, type
    :version<Return>
    and search for a string "multi_byte". If it has "-" in front of it then multbyte support is not included in the vim.
    The ones in
    http://macvim.org/OSX/index.php (vim7.0) or
    http://code.google.com/p/macvim/ (vim7.1)
    will support multibyte.
    Or you can build vim7.1 by yourself (if you have Xcode Tools installed).

  • How to delete the EOL in Vim

    This might sound really stupid, but how do you delete a line-break in Vim? Deleting the EOL after the cursor, when you're at the end of a line seems to be 'dw', as that will delete to the next word, therefore deleting the EOL in the middle of it. However, deleting the EOL before the cursor, when you're at the start of a line I can't figure out. 'db' would delete the EOL, but would also delete to the beginning of the word at the end of the line previous. The only way I've found I've been able to use is entering Insert mode and pressing Backspace. Surely this isn't the best method for doing this...

    I don't think any of those does what OP wanted - joining upwards.
    @ bernarcher
    I can't get the negative numbers to work. The manual says only
    gJ Join [count] lines, with a minimum of two lines.
    Don't insert or remove any spaces. {not in Vi}
    Does e.g. '-3gJ' really works for you? Maybe I have some weird settings in my .vimrc.
    EDIT: I was thinking about something like
    map II i<Backspace><Esc>
    Of course you can change the 'II' mapping and maybe add '0':
    map II i<Backspace><Esc>0
    or whatever tells vim to go to the first char of the line.
    '[ count ]II' won't work.
    Last edited by karol (2011-01-24 21:43:05)

  • Umlauts are not displayed correctly in different programs

    Hello!
    I live in germany, but my locale is set to "en_US.UTF8" because I like to have everything in english.
    I do not have any problems with umlauts on the machine, but when I connect with sFTP oder Samba to it, the umlauts in files are not displayed correctly.
    Look at this example
    The upper word is how it looks in "ssh putty" (=locally on the machine), the bottom one is from "filezilla" (from my windows host)
    This is my locale
    locale
    LANG=en_US.UTF-8
    LC_CTYPE="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_ALL=
    When I create a file "asd_aöü" locally on the machine (with the help of ssh - putty), it looks fine, but when I connect by samba or filezilla again the umlauts are not displayed correctly.
    Do you understand my problem? What can I do?
    Thanks!
    Last edited by cyberius (2011-02-19 10:12:19)

    Did you check the locale settings on your Windows machine?

  • German Umlaute don't work after upgrading to Yosemite with Japanese Romaji Layout set on U.S.

    Hi everyone,
    previously i could just use [ALT] + [U] and then press [A] / [a] / [U] / [u] / [O] / [o] to generate the german umlaut version.
    After installing Yosemite this does not work anymore, which is kinda frustrating. Cause it forces me to add another keyboard layout and switch when i have to write a german umlaut.
    I was previously using 'Input Source' > 'Japanese' > Enabled Romaji (Romaji layout was set to U.S.) & Hiragana.
    For testing purpose i added the Standard U.S. Layout and writing the Umlaut with the keyboard shortcut still works there. So that's why i think this is a Romaji specific bug.
    Has anyone any idea what's wrong ? Did Apple change something ?
    Best Regards

    Before I stumbled upon this thread, there was no flag at all. I had the character viewer there because pre-Yosemite it was the only way to access emoji (and things like arrows and other special symbols) in many apps (and still is for my Adobe CS5 apps). Additionally, I would use the keyboard viewer from time to time as a way to learn which keys to use for other special symbols (bring up the keyboard viewer and press option or shift-option or other combinations and it would show you a preview of what each key would generate).
    While reading this thread, I added more input sources (US International and US Extended) and would see the flags. The flags replaced the previous character/keyboard viewer menu icon. I switched between each flag to test my issue under each, to no avail.  Then I tried adding the Spanish keyboard but still had the same issue.
    Now I've removed all the input sources except the primary US keyboard. There is no longer a flag in my menu, it's gone back to the character viewer icon.
    The issue is still there. When I type option-r, u, or g, in any app nothing happens at all.
    Unfortunately, neither auto-substitution nor press-and-hold work in Adobe CS5 apps, which is where I need to use these special characters the most.
    Thank you for reaching out

  • [SOLVED] Problem with vim and wombat colorscheme

    Hi there,
    I'm having some problems with wombat colorscheme for vim. It's just working on gvim.
    I read somewhere that wombat just work in gvim. Is that right ? I'm already using a 256-colors terminal (rxvt-unicode).
    I looked here in the forum, but I didn't find anything about.
    Just for information I downloaded it from http://www.vim.org/scripts/script.php?script_id=1778
    Last edited by lsathler (2011-07-06 18:11:00)

    yngwin wrote:You can use wombat256: http://www.vim.org/scripts/script.php?script_id=2465
    Thanks for helping. It worked like a charm !

  • [Solved][VIM] E484: Can't open file syntax.vim

    Hi all,
    I've installed Archlinux few days ago on my netbook and yesterday i decided to configure Vim using plugins.
    During plugins configuration, i messed up and i decided to revome all Vim files in my ~ folder in order to restart configuration.
    However, since I've executed the `rm -R .vim .vimrc .viminfo` command, I can't re-activate Vim's syntax coloration using `syntax on` into my .vimrc file nor into Vim directly.
    Here is the error message when I start Vim :
    Error detected while processing /home/romain/.vimrc:
    line 1:
    E484: Can't open file /home/romain/.vim/syntax/syntax.vim
    Press ENTER or type command to continue
    I've found this topic on BBS which seems to be the same problem as me but reinstalling vim or vi doesn't solve this problem.
    I've tried to copy this syntax.vim file from /usr/share/vim/vim73/syntax/syntax.vim but it doesn't solve the problem and I want a clean solution without hacking my ~ folder ; moreover, this bug also appears being root while I haven't configured vim with the root account so it may be a problem into Vim's installation folders or something.
    Thanks for your help and sorry I my english contains mistakes,
    MicroJoe.
    Last edited by MicroJoe (2012-06-14 16:16:45)

    This is the output :
    VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun 7 2012 00:41:40)
    Rustines incluses : 1-547
    Compilé par ArchLinux
    Grosse version sans interface graphique.
    Fonctionnalités incluses (+) ou non (-) :
    +arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
    -clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
    +conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
    -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
    +find_in_path +float +folding -footer +fork() +gettext -hangul_input +iconv
    +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent
    +listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape
    +mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse
    +mouse_xterm +mouse_urxvt +multi_byte +multi_lang -mzscheme -netbeans_intg
    +path_extra +perl +persistent_undo +postscript +printer -profile -python
    -python3 +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent
    -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary
    +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
    -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
    +vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
    -xterm_clipboard -xterm_save
    fichier vimrc système : "/etc/vimrc"
    fichier vimrc utilisateur : "$HOME/.vimrc"
    fichier exrc utilisateur : "$HOME/.exrc"
    $VIM par défaut : "/usr/share/vim"
    Compilation : gcc -c -I. -Iproto -DHAVE_CONFIG_H -I/usr/local/include -march=i686 -mtune=generic -pipe -fstack-protector --param=ssp-buffer-size=4 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
    Édition de liens : gcc -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu -L/usr/local/lib -Wl,--as-needed -o vim -lm -lncurses -lacl -lattr -lgpm -ldl -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu -fstack-protector -L/usr/local/lib -L/usr/lib/perl5/core_perl/CORE -lperl -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    (I've noticed that some part were in French but I hope that it'll not be a problem).

  • Try to add the ESX to n1kv it give the below error got (vim.fault.PlatformConfigFault) exception

    Hello i m sharing to the forum the discussion we had in fb about my issue with a host see below:
    Guys anyone saw this error when u try to add the ESX to n1kv it give the below error
    vDS operation failed on host esxXX, An error occurred during host configuration. got (vim.fault.PlatformConfigFault) exception
    on the esx it shows correct version of vem version
    /var/log # esxcli software vib list | grep cisco
    cisco-vem-v162-esx 4.2.1.2.2.1a.0-3.0.1 Cisco PartnerSupported 2013-10-29
    I did try with the version Nexus1000v.4.2.1.SV2.1.1 and then with this is the latest version of cisco Nexus1000v.4.2.1.SV2.2.1a but shows same error
    maybe u guys saw it before
    - Robert Burns - Usually means the VSM doesn't have the appropriate VIB file for that version of ESX. You can simply manually install it using ESX CLI. You can pull down the appropriate VIB from VMware's site. Which version of ESX (Build) are you running?
    - ME - i think maybe is related to old config of old n1kv i tried add another host and it works but it doesn t show the same dvs switch name
    cannot add this host to n1kv
    /var/log # net-dvs -l
    switch 38 51 17 50 5d df 21 d0-29 b5 8c a7 df e8 e0 1b (cisco_nexus_1000v)
    working ifne
    ~ # net-dvs -l
    switch 09 72 17 50 f3 d5 87 8f-71 5b 8c 57 f5 fe b8 6a (cisco_nexus_1000v)
    - ME - by the way both esxi have same build
    ~ # vmware -vl
    VMware ESXi 5.0.0 build-1117897
    VMware ESXi 5.0.0 Update 2
    /var/log # vmware -vl
    VMware ESXi 5.0.0 build-1117897
    VMware ESXi 5.0.0 Update 2
    - Robert Burns - Are the two N1K's different versions? Likely yes. In that case your VSMs have the appropriate VIB for ONE version of VSM, but not the other.
    - ME - both have the same version
    ~ # esxcli software vib list | grep cisco
    cisco-vem-v162-esx 4.2.1.2.2.1a.0-3.0.1 Cisco PartnerSupported 2013-10-29
    /var/log # esxcli software vib list | grep cisco
    cisco-vem-v162-esx 4.2.1.2.2.1a.0-3.0.1 Cisco PartnerSupported 2013-10-29
    - ME - but one is already now part of n1kv and the other doesnt want to be added
    - Robert Burns - Have you tried doing a hotswap -u - reboot - then try to re-add the host.
    - ME - the command vemcmd show card shows that he still think he s part of the old n1kv switch  i will try the reload maybe that will help
    - ME - /var/log # hotswap.sh -u - reboot
    The following switch is of type cisco_nexus_1000v: DvsPortset-0
    Starting time: Tue Oct 29 17:22:18 UTC 2013
    Errors:
    Sysinfo error on operation returned status : Not found. Please see the VMkernel log for detailed error information
    stopDpa
    VEM SwISCSI PID is
    Warn: DPA running host/vim/vimuser/cisco/vem/vemdpa.80389
    Warn: DPA running host/vim/vimuser/cisco/vem/vemdpa.80389
    watchdog-vemdpa: Terminating watchdog process with PID 80382
    Unload N1k switch modules
    stop stun
    Module vem-v162-stun being unloaded..
    Module vem-v162-stun unloaded..
    Module vem-v162-vssnet being unloaded..
    Module vem-v162-vssnet unloaded..
    Module vem-v162-n1kv being unloaded..
    Module vem-v162-n1kv unloaded..
    Module vem-v162-l2device being unloaded..
    Module vem-v162-l2device unloaded..
    Unload of N1k modules done.
    did it and tried to re-add and it shows the same error...
    the net-dvs still shows another switch name
    /var/log # net-dvs -l
    switch 38 51 17 50 5d df 21 d0-29 b5 8c a7 df e8 e0 1b (cisco_nexus_1000v)
    - ME - i m trying a reboot of the host ...crossing fingers
    - Robert Burns - Let's take the issue over to support forums and save the group of the spam
    - ME - it s working after a reboot of the esxi host  , it was showing a warning out of sync and i did re-sync in vsphere and it removed the warning.

    So just to be clear - your issue is resolved?
    Robert

  • Best way for multiple files in vim?

    I've been trying out vim for a couple of weeks now, and I must say that I like it. I use it mostly for programming at work (a couple of hours per day).
    One thing I haven't settled on is how to use a single vim instance to edit multiple files. I've tried tabs and have been reading about vim+screen (how does yank + paste work between vim instances under screen, btw?).
    Which method would you recommend?

    ArchArael wrote:
    Ramses de Norre wrote:A combination of tabnew, split and vsplit
    That's also my case. I also prefer gvim over vim because of better font rendering and major amount of colors. I don't use screen proficiently but suppose you can use "+y for copying and "+gp for pasting.
    You could map these combination to some keyboard shortcut.
    By the way...sorry if offtopic.
    I can see why many of users use screen. I use it only if I have to keep active a job over a ssh session. Locally I prefer tabs or multiple terminal windows instead.
    when you're connected to a remote computer, you don't want to reconnect for each terminal tab. so you use screen and get used to the shortcuts and use it at your local pc too.

  • Numbers don't show german umlaut but quick view does

    I do have a problem opening CSV files in Numbers.
    I have a shared folder with VirtualBox. The virtual HD is formatted in FAT32. With Windows I created a CSV file which contains german umlauts like ÄÖÜ.
    When I open the CSV with the "quick view" (press space when file is selected in finder, the CSV is displayed as a nice Table and all Umlauts are OK.
    When I double click the CSV file to open it in Numbers, the Umlauts are not displayed. Opening in Text Edit is the same result, no Umlauts.
    ö = ^
    ß = fl
    ü = ¸
    ä = ‰
    I think this is an encoding problem, but why is "quick view" displaying it correct. I'm confused.
    Thanks for any help.

    Hello
    I cannot find any encoding settings for opening files in Numbers 09.
    A simple and obvious solution would be to save CSV file in UTF-8 in FAT32 volume in VirtualBox if possible.
    One other method is to copy the CSV file to HFS+ volume and set its extended attributes to specify its text encoding. This method is only changing the metadata of the file and so is less intrusive than to convert the data itself to different text encoding. When text encoding extended attribute is properly set, Numbers 09 (and TextEdit.app set to use "Automatic" encoding option in opening files) will open it in the specified text encoding.
    The following AppleScript script might help to set the extended attributes (OSX 10.5 or later only). Recipe is as follows.
    A1) Open /Applications/Utilities/AppleScript Editor.app, copy the code of set_latin1_xattr.applescript listed below and save it as application (bundle) in the folder where target CSV files reside.
    A2) Double click the saved applet and it will set the com.apple.TextEncoding extended attribute of the *.csv and *.txt files in the same folder where the applet resides to Latin 1 when they are recognised as 'ISO-8859 text' by file(1) command.
    -- set_latin1_xattr.applescript
    _main()
    on _main()
        set p2m to (path to me)'s POSIX path
        if p2m ends with "/" then set p2m to p2m's text 1 thru -2
        set sh to "
    # set current directory to parent directory of script (or die)
    cd \"${0%/*}\" || exit 1
    # add com.apple.TextEnncoding xattr for Latin-1
    # for *.csv and *.txt files, of which file info contains 'ISO-8859 text', in current directory
    for f in *.{csv,txt}
    do
        if [[ $(file \"$f\") =~ 'ISO-8859 text' ]]
        then
            xattr -w com.apple.TextEncoding \"WINDOWS-1252;$((0x0500))\" \"$f\"
        fi
    done
        do shell script "/bin/bash -c " & sh's quoted form & " " & p2m's quoted form
    end _main
    Another method is to convert the text encoding itself as you have already done using TextEdit.app.
    The following AppleScript might help to convert text encoding from latin-1 to utf-8 in bulk. Recipe is basically the same as the above.
    B1) Open /Applications/Utilities/AppleScript Editor.app, copy the code of convert_latin1_to_utf8.applescript listed below and save it as application (bundle) in the folder where target CSV files reside.
    B2) Double click the saved applet and it will convert the text encoding of the *.csv and *.txt files in the same folder where the applet resides to UTF-8 when they are recognised as 'ISO-8859 text' by file(1) command. Also it sets the extended attribute for text encoding accordingly.
    -- convert_latin1_to_utf8.applescript
    _main()
    on _main()
        set p2m to (path to me)'s POSIX path
        if p2m ends with "/" then set p2m to p2m's text 1 thru -2
        set sh to "
    # set current directory to parent directory of script (or die)
    cd \"${0%/*}\" || exit 1
    # make temporary directory
    temp=$(mktemp -d /tmp/\"${0##*/}\".XXXXXX) || exit 1
    # convert text encoding from ISO-8859-1 to UTF-8
    # for *.csv and *.txt files, of which file info contains 'ISO-8859 text', in current directory
    for f in *.{csv,txt}
    do
        if [[ $(file \"$f\") =~ 'ISO-8859 text' ]]
        then
            iconv -f ISO-8859-1 -t UTF-8 \"$f\" > \"$temp/$f\" \\
            && xattr -w com.apple.TextEncoding \"UTF-8;$((0x08000100))\" \"$temp/$f\" \\
            && mv -f \"$temp/$f\" \"$f\"
        fi
    done
    # clean up temporary directory
    rm -rf \"$temp\"
        do shell script "/bin/bash -c " & sh's quoted form & " " & p2m's quoted form
    end _main
    Note that the extended attribute is not supported in FAT32 and so the above methods only work in HFS+ formatted volume.
    Scripts are briefly tested with Numbers 2.0.5 under OSX 10.5.8 and 10.6.5. Please make sure you have backup CSV files before applying the above scripts.
    Good luck,
    H

  • Kludge to make less, vim et al. leave the screen uncluttered enjoy!

    I have written a script which leaves the screen uncluttered when finishing less.
    This script is written for bash in the "good old terminal", but works well with
    iTerm too. I wrote this script because less is opposite of more as less is so
    much more as more is so much less.
    I hope you will use this script and reap the rewards of using less while reading
    textfiles, gaining from less's features, avoiding the cluttering which may have
    made you disliking using less. You can make a copy of the script and modify and wrap
    the script around any other characterbased program which clutters your terminal screen.
    The script works by beeing placed in your ~/bin which I assume is before
    /usr/bin in your $PATH where the binary less resides. You must modify the paths
    in the script if they are different from that. (both the binary less, the script,
    and the kludge.scr)
    The script installs an interrupthandler which are triggered by changing the
    windowsize. The interupthandler figures out what it must do to preserve
    your screen when you exit less, and just does so, except for four characters
    to the extreme left on one line. (wich may well be part of your prompt).
    The interrupthandler gets its work done, by calling a kludge which are
    relatively referenced in the script from your homefolder, -presumes ~/bin
    - YOU MUST EDIT THE SCRIPT OTHERWISE. The configuration is like it is because
    that is what it takes to make the correct things happen in bash.
    I think this could have been accomplished much easier using another shell,
    but most people uses bash, especially newcomers, and they deserve to have
    it as easy as possible, while reaping the productivity gains laying dormant
    in the Unix core, so I hope you will share the script with you liberally,
    if you think it is worth the time and the work it takes to "install" it.
    I hope you will give this script a try, as to make less work comfortably for you,
    I have included an environment variable with all settings I like in less, which
    you may modify.
    Less was the first program I had that made me think "wow" back in 1986, beeing used
    to the "more" command, - which was, and is so much less than less. You can for instance
    invoke BBedit with a file you are viewing in less by pressing "v" if you have BBedit
    specified in the $EDITOR variable. You can pipe some text to the clipboard.
    Or you can pipe some lines out of a document you are viewing in less and into
    a file while viewing, you can load it with multiple files, and search them all,
    a programemer can make less work with tagfiles; you can have less create a logfile
    of what you read and, you can even scroll backwards. All in all less is a very handy
    tool which I think everybody would gain from using,in opposite to more.
    Especially when it leaves the screen uncluttered.
    Great care have been taken in order to make this kludge work properly.
    Still I MAKE ABSOLUTELY NO WARRANTIES ABOUT WHATSOEVER AND ANYTHING.
    -USE IT AT YOUR OWN RISK.
    You may do whatever you wish to do with it, aside from selling it alone, but you
    are free to do whatever that you please with it, aside from distributing
    malfunctioning copies or incomplete copies or tinker with the Copyright notice
    in the scripts.
    -------------------------------------------------- here comes the kludge for less - sends with you a tar as well. 8859 - encoded I think.
    #! /bin/bash
    # Less - lets us keep our screen nice even after resize, having used less or any other
    # character based program - like vim, which may leave an unorderly screen.
    # The fact that programs do clutter up the screen is because they probably didn't figure
    # that we one day would be able to resize our terminals when they specified the standards at
    # Ansi back in the 60's.
    # Installing : put it together with "kludge.bash" in your $HOME/bin folder ( ~/bin ).
    # its intended to work with the bash shell under MacOsX, the binary less is supposed
    # to reside in /usr/bin, if it isnt; ("which less" reveals where), adjust the path.
    # less - to be placed in the ~/bin folder is the wrap around less to make it behave
    # Copyright 2008 Tommy Bollman Public Domain. -No WARRANTIES ABOUT WHAT SO EVER-
    # Please do modify it for other programs which need helps with its cleanup as well.
    # ~ is an expansion for your home directory aka /Users/John\ Doe
    # Please document your version properly if you are posting it, relieving others.
    export LESS=" -I -r -f -J -S -g -M -x 4"
    # -I ignore case when searching
    # -r "raw" do not preparate ctrl-chars,
    # -f force open special files (may be binary) BEWARE OF ANSISEQUENCES.
    # -J show status column
    # -S chop long lines.
    # -g highlight on last hit in the search.
    # -M Most Verbose status column...
    # -x 4 tabspacing = 4
    # -------------------------------------- the screen handling starts here.................
    ORIGLINES=$LINES
    ESC=`printf "\e"`
    ScreenRedraw_off=`echo -n "$ESC""[8m"`
    ScreenRedraw_on=`echo -n "$ESC""[0m"`
    function OkayScreen()
    export PS1="" # Turns off the prompt to avoid cluttering..
    echo -n ${ScreenRedraw_off}
    CURLINES=`bash -i < ~/bin/kludge.bash `
    # ^^^^^^^^^^^ NB! the path where kludge.bash should be placed.
    if [ $CURLINES -gt $ORIGLINES ] ; then
    TO_SKIP="$(expr "$CURLINES" '-' "$ORIGLINES")"
    if [ $TO_SKIP -lt 3 ] ; then
    TO_SKIP="$(expr "$TO_SKIP" '-' '2')"
    else
    TO_SKIP="$(expr "$TO_SKIP" '-' '1')"
    fi
    tput cuu 1 #cursor up one line
    echo -n ${ScreenRedraw_on}
    echo -n "\$####" #restores an erased '$' making only 3 chars disappear.
    # ^ $ = prompt - $PS1. .(I have just a dollar here but if yours is longer,
    # you can add the first four if it's static, and you'll loose nothing!!)
    echo -n ${ScreenRedraw_off}
    tput cud $TO_SKIP # move cursor to where it should be.
    echo -n ${ScreenRedraw_on}
    echo # activate the cli at correct position.
    else
    tput cuu 2
    echo ${ScreenRedraw_on}
    fi
    trap OkayScreen SIGWINCH
    /usr/bin/less $@
    # ^^^^^^^^ NB! The path where the BINARY less is installed.
    trap '' SIGWINCH
    -------------------------------------------------------------------------------- and here is the kludge wich makes it all work!
    #! /bin/bash
    # kludge.scr - to be placed in the ~/bin folder is the inner workings of the bash script named less
    # Copyright 2008 Tommy Bollman
    PS1=""
    shopt -s checkwinsize
    echo $LINES
    ----><---------------------- EOF.

    I have written a script which leaves the screen uncluttered when finishing less.
    This script is written for bash in the "good old terminal", but works well with
    iTerm too. I wrote this script because less is opposite of more as less is so
    much more as more is so much less.
    I hope you will use this script and reap the rewards of using less while reading
    textfiles, gaining from less's features, avoiding the cluttering which may have
    made you disliking using less. You can make a copy of the script and modify and wrap
    the script around any other characterbased program which clutters your terminal screen.
    The script works by beeing placed in your ~/bin which I assume is before
    /usr/bin in your $PATH where the binary less resides. You must modify the paths
    in the script if they are different from that. (both the binary less, the script,
    and the kludge.scr)
    The script installs an interrupthandler which are triggered by changing the
    windowsize. The interupthandler figures out what it must do to preserve
    your screen when you exit less, and just does so, except for four characters
    to the extreme left on one line. (wich may well be part of your prompt).
    The interrupthandler gets its work done, by calling a kludge which are
    relatively referenced in the script from your homefolder, -presumes ~/bin
    - YOU MUST EDIT THE SCRIPT OTHERWISE. The configuration is like it is because
    that is what it takes to make the correct things happen in bash.
    I think this could have been accomplished much easier using another shell,
    but most people uses bash, especially newcomers, and they deserve to have
    it as easy as possible, while reaping the productivity gains laying dormant
    in the Unix core, so I hope you will share the script with you liberally,
    if you think it is worth the time and the work it takes to "install" it.
    I hope you will give this script a try, as to make less work comfortably for you,
    I have included an environment variable with all settings I like in less, which
    you may modify.
    Less was the first program I had that made me think "wow" back in 1986, beeing used
    to the "more" command, - which was, and is so much less than less. You can for instance
    invoke BBedit with a file you are viewing in less by pressing "v" if you have BBedit
    specified in the $EDITOR variable. You can pipe some text to the clipboard.
    Or you can pipe some lines out of a document you are viewing in less and into
    a file while viewing, you can load it with multiple files, and search them all,
    a programemer can make less work with tagfiles; you can have less create a logfile
    of what you read and, you can even scroll backwards. All in all less is a very handy
    tool which I think everybody would gain from using,in opposite to more.
    Especially when it leaves the screen uncluttered.
    Great care have been taken in order to make this kludge work properly.
    Still I MAKE ABSOLUTELY NO WARRANTIES ABOUT WHATSOEVER AND ANYTHING.
    -USE IT AT YOUR OWN RISK.
    You may do whatever you wish to do with it, aside from selling it alone, but you
    are free to do whatever that you please with it, aside from distributing
    malfunctioning copies or incomplete copies or tinker with the Copyright notice
    in the scripts.
    -------------------------------------------------- here comes the kludge for less - sends with you a tar as well. 8859 - encoded I think.
    #! /bin/bash
    # Less - lets us keep our screen nice even after resize, having used less or any other
    # character based program - like vim, which may leave an unorderly screen.
    # The fact that programs do clutter up the screen is because they probably didn't figure
    # that we one day would be able to resize our terminals when they specified the standards at
    # Ansi back in the 60's.
    # Installing : put it together with "kludge.bash" in your $HOME/bin folder ( ~/bin ).
    # its intended to work with the bash shell under MacOsX, the binary less is supposed
    # to reside in /usr/bin, if it isnt; ("which less" reveals where), adjust the path.
    # less - to be placed in the ~/bin folder is the wrap around less to make it behave
    # Copyright 2008 Tommy Bollman Public Domain. -No WARRANTIES ABOUT WHAT SO EVER-
    # Please do modify it for other programs which need helps with its cleanup as well.
    # ~ is an expansion for your home directory aka /Users/John\ Doe
    # Please document your version properly if you are posting it, relieving others.
    export LESS=" -I -r -f -J -S -g -M -x 4"
    # -I ignore case when searching
    # -r "raw" do not preparate ctrl-chars,
    # -f force open special files (may be binary) BEWARE OF ANSISEQUENCES.
    # -J show status column
    # -S chop long lines.
    # -g highlight on last hit in the search.
    # -M Most Verbose status column...
    # -x 4 tabspacing = 4
    # -------------------------------------- the screen handling starts here.................
    ORIGLINES=$LINES
    ESC=`printf "\e"`
    ScreenRedraw_off=`echo -n "$ESC""[8m"`
    ScreenRedraw_on=`echo -n "$ESC""[0m"`
    function OkayScreen()
    export PS1="" # Turns off the prompt to avoid cluttering..
    echo -n ${ScreenRedraw_off}
    CURLINES=`bash -i < ~/bin/kludge.bash `
    # ^^^^^^^^^^^ NB! the path where kludge.bash should be placed.
    if [ $CURLINES -gt $ORIGLINES ] ; then
    TO_SKIP="$(expr "$CURLINES" '-' "$ORIGLINES")"
    if [ $TO_SKIP -lt 3 ] ; then
    TO_SKIP="$(expr "$TO_SKIP" '-' '2')"
    else
    TO_SKIP="$(expr "$TO_SKIP" '-' '1')"
    fi
    tput cuu 1 #cursor up one line
    echo -n ${ScreenRedraw_on}
    echo -n "\$####" #restores an erased '$' making only 3 chars disappear.
    # ^ $ = prompt - $PS1. .(I have just a dollar here but if yours is longer,
    # you can add the first four if it's static, and you'll loose nothing!!)
    echo -n ${ScreenRedraw_off}
    tput cud $TO_SKIP # move cursor to where it should be.
    echo -n ${ScreenRedraw_on}
    echo # activate the cli at correct position.
    else
    tput cuu 2
    echo ${ScreenRedraw_on}
    fi
    trap OkayScreen SIGWINCH
    /usr/bin/less $@
    # ^^^^^^^^ NB! The path where the BINARY less is installed.
    trap '' SIGWINCH
    -------------------------------------------------------------------------------- and here is the kludge wich makes it all work!
    #! /bin/bash
    # kludge.scr - to be placed in the ~/bin folder is the inner workings of the bash script named less
    # Copyright 2008 Tommy Bollman
    PS1=""
    shopt -s checkwinsize
    echo $LINES
    ----><---------------------- EOF.

  • [Solved] The one thing I hate about Vim

    Hi,
    I've started using Vim some time ago and I now understand why everyone loves it.
    There's one thing, though, that is driving me nuts; a little but very irritating behaviour.
    I hope to be understandable enough so that someone can help me.
    Basically when editing (deleting or inserting characters)  a long line containing many words separated by spaces, Vim automatically moves  part of the line to a new line, creating a new paragraph.
    Do you see what I mean? I just don't want Vim to create new paragraphs when editing a line.
    I'm sure other Vim users already experienced this behaviour... how can I fix it?
    Here's my .vimrc, it may be involved somehow:
    " All system-wide defaults are set in $VIMRUNTIME/archlinux.vim (usually just
    " /usr/share/vim/vimfiles/archlinux.vim) and sourced by the call to :runtime
    " you can find below. If you wish to change any of those settings, you should
    " do it in this file (/etc/vimrc), since archlinux.vim will be overwritten
    " everytime an upgrade of the vim packages is performed. It is recommended to
    " make changes after sourcing archlinux.vim since it alters the value of the
    " 'compatible' option.
    " This line should not be removed as it ensures that various options are
    " properly set to work with the Vim-related packages available in Debian.
    runtime! archlinux.vim
    " If you prefer the old-style vim functionalty, add 'runtime! vimrc_example.vim'
    " Or better yet, read /usr/share/vim/vim72/vimrc_example.vim or the vim manual
    " and configure vim to your own liking!
    " no vi compatibility
    set nocompatible
    " directory
    set directory=/home/enrico/.vim
    " disable backups (and swap)
    set nobackup
    set nowritebackup
    set noswapfile
    " wrap searches
    set wrapscan
    " tab and indentation
    set tabstop=4
    set noexpandtab
    set smarttab
    set shiftwidth=4
    set backspace=indent,eol,start
    set autoindent
    set smartindent
    " show commands
    set showcmd
    " show line and column position of cursor
    set ruler
    " status bar
    set statusline=\ \%f%m%r%h%w\ ::\ %y\ [%{&ff}]\%=\ [%p%%:\ %l/%L]\
    set laststatus=2
    set cmdheight=1
    " textwidth
    set textwidth=79
    " formatting options
    set formatoptions=c,q,r,t
    " line numbers
    set number
    " match bracklets
    "set showmatch
    " search
    set hlsearch
    set incsearch
    set ignorecase
    set smartcase
    " syntax highlighting
    filetype plugin on
    syntax on
    " background
    set background=dark
    " enable mouse
    set mouse=a
    " set colorscheme
    colorscheme miromiro
    "colorscheme dante
    "colorscheme molokai
    "allows sudo with :w!!
    cmap w!! %!sudo tee > /dev/null %
    " mutt tricks (F1 through F3 re-wraps paragraphs)
    augroup MUTT
    au BufRead ~/.mutt/temp/mutt* set tw=72
    au BufRead ~/.mutt/temp/mutt* set spell " <-- vim 7 required
    au BufRead ~/.mutt/temp/mutt* nmap <F1> gqap
    au BufRead ~/.mutt/temp/mutt* nmap <F2> gqqj
    au BufRead ~/.mutt/temp/mutt* nmap <F3> kgqj
    au BufRead ~/.mutt/temp/mutt* map! <F1> <ESC>gqapi
    au BufRead ~/.mutt/temp/mutt* map! <F2> <ESC>gqqji
    au BufRead ~/.mutt/temp/mutt* map! <F3> <ESC>kgqji
    augroup END
    Thanks!
    Last edited by rent0n (2010-07-31 10:45:23)

    bernarcher wrote:
    This will suppress breaking the lines.
    " textwidth
    set textwidth=0
    See ":help textwidth" and ":help ins-textwidth" for more.
    BTW: "nowrap" does only influence how the text will be displayed. it doesn't change the text in the buffer.
    Thanks bernarcher, 'textwidth' was the option I was looking for!
    Wrapping is another thing and I like to keep it enabled.
    @quigybo: I will look through 'formatoptions', thanks. I already use augroup for mutt and is very handy indeed!
    Last edited by rent0n (2010-07-31 10:45:06)

  • [SOLVED] /bin/bash: endif: command not found ERROR while saving in vim

    My .vimrc file
    set expandtab
    set number
    syntax on
    set autoindent shiftwidth=4
    set smartindent
    set tabstop=4
    set smartcase
    colorscheme elflord
    set incsearch
    set hlsearch
    au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent !chmod +x <afile> | endif | endif
    " Tell vim to remember certain things when we exit
    " '10 : marks will be remembered for up to 10 previously edited files
    " "100 : will save up to 100 lines for each register
    " :20 : up to 20 lines of command-line history will be remembered
    " % : saves and restores the buffer list
    " n... : where to save the viminfo files
    set viminfo='10,\"100,:20,%,n~/.viminfo
    function! ResCur()
    if line("'\"") <= line("$")
    normal! g`"
    return 1
    endif
    endfunction
    augroup resCur
    autocmd!
    autocmd BufWinEnter * call ResCur()
    augroup END
    On some files, I get this error http://i.imgur.com/lKFvm.png at the bottom of vim . Please note that I get the error not on all files. Its driving me crazy!
    Last edited by shadyabhi (2011-09-11 02:41:52)

    Replace this:
    au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent !chmod +x <afile> | endif | endif
    with this:
    au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent execute "!chmod a+x <afile>" | endif | endif
    If the above doesn't work for you (though it should in Vim > 7), try a different way of doing the same thing:
    function ModeChange()
    if getline(1) =~ "^#!"
    if getline(1) =~ "/bin/"
    silent !chmod a+x <afile>
    endif
    endif
    endfunction
    au BufWritePost * call ModeChange()
    Last edited by bohoomil (2011-09-11 02:29:58)

Maybe you are looking for

  • How to use one commandButton  to execute two task in JSF

    I have a form in JSF page which contains different faces components. These faces bind to ADF BC to insert one row in the database when the user press commandButton. Also I need to bind the value of one inputText in that form to managed bean to execut

  • Whats the difference between the two XMP packet tags

    Hi, I opened a file Bluesquare.indd(from XMP SDK sampke) and I found two XMP packets inside the file. One packet with tag and another one with tag When I tried to extract the xmp using getXMP() method from XMPFiles then, I got the packet with tag So

  • Can't import CD into ITunes - Windows 7 error

    Tried to import CD into Itunes on VAIO laptop, using Windows 7. Get the following message "Itunes has stopped working. Windows is looking for a solution. A problem caused the program to stop working correctly. Windows will close the program and notif

  • Summarize total for Row items in pivot table

    Hi, I have a certain number of row items and few fact columns. 2 of the row items are level based measures that will summarize on other conditions so I cannot have them in the Fact section. But for these 2 row items (in the Rows section) I want them

  • What is the best way to handle canonical links?

    I am migrating a client website over to BC and I've noticed they have canonical links in most, if not all of the HEAD sections for each page. How should I go about maintaining these canonical links in BC .... since the HEAD section resides in the tem