Oni: UTF8 encoded files are rendered (and decoded) incorrectly (`\t` -> `^I`)

Created on 13 Apr 2018  路  2Comments  路  Source: onivim/oni

Hey there,

it is the first time I'm using oni. I'm a long-time vim user and found out about this amazing project, and wanted to switch. But I'm kind of lost and have no clue how to fix this.

OS: Arch Linux, up-to-date
Oni: Installed via AUR, last package update 14th March.

When I open UTF8 encoded files with vim or neovim, they work fine, and the listchars are rendered correctly and \t is also written in these files correctly (verified via cat afterwards).

Though when I open the same files in oni, they look like this:

https://i.imgur.com/4UNxF1z.png

The files themselves are encoded correctly, and when I modify the buffer afterwards in oni, the listchars are rendered correctly (e.g. with (4 spaces) or \t (1 tab)).

When I modify the file with oni and e.g. add two new lines, only these two lines are changed and are written correctly (assuming that the default config is using 4 spaces for indention and tabs are auto-expanded).

But when viewing the file in oni (not reloading the file), the indentions are represented differently:

https://i.imgur.com/NFWgS6s.png

Also, when I use Oni -> Reopen with encoding -> UTF8, the file layout stays the same, including the difference in representation of the changed lines in oni vs. the "original lines".

Most helpful comment

This looks like a combination of a few things to me, but basically it boils down the the default config in the version you are running (0.3.1 at a guess from the release date) was a bit too opinionated so it rendered tabs as ^I due to set list.

Since it sounds like you get vim, I'd add the following to your config.tsx, accessed with Ctrl-Shift-P and User config:

    "oni.useDefaultConfig": false,
    "oni.loadInitVim": true,

Which disables the Oni default config, and enables loading of your init.vim (if you don't use neovim, you can either stick a renamed .vimrc in ~/.config/nvim/init.vim or set "oni.loadInitVim" to point to your .vimrc with "oni.loadInitVim": "~/.vimrc").

This will turn off all the Oni default config, and use your own which you've probably been making for years. If you want to check the default config first to see if you want to add anything to your vim config, or disable a few more Oni features to make it more "vim-like", I'd checkout our minimal config here : https://github.com/onivim/oni/wiki/How-To:-Minimal-Oni-Configuration

All 2 comments

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

This looks like a combination of a few things to me, but basically it boils down the the default config in the version you are running (0.3.1 at a guess from the release date) was a bit too opinionated so it rendered tabs as ^I due to set list.

Since it sounds like you get vim, I'd add the following to your config.tsx, accessed with Ctrl-Shift-P and User config:

    "oni.useDefaultConfig": false,
    "oni.loadInitVim": true,

Which disables the Oni default config, and enables loading of your init.vim (if you don't use neovim, you can either stick a renamed .vimrc in ~/.config/nvim/init.vim or set "oni.loadInitVim" to point to your .vimrc with "oni.loadInitVim": "~/.vimrc").

This will turn off all the Oni default config, and use your own which you've probably been making for years. If you want to check the default config first to see if you want to add anything to your vim config, or disable a few more Oni features to make it more "vim-like", I'd checkout our minimal config here : https://github.com/onivim/oni/wiki/How-To:-Minimal-Oni-Configuration

Was this page helpful?
0 / 5 - 0 ratings

Related issues

magopian picture magopian  路  3Comments

Siilwyn picture Siilwyn  路  3Comments

TalAmuyal picture TalAmuyal  路  3Comments

Canop picture Canop  路  3Comments

badosu picture badosu  路  3Comments