Hello,
I have set tabstop=2
But whenever i press tab i get 4 spaces instead. How to fix this?
Confirming this issue happening for me as well.
I would guess this is a conflict with the set of defaults we pass to Vim:
" Default tab settings
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
I think you will at least need to do set noexpandtab as well. You could also try disabling the default configuration by setting oni.useDefaultConfig to false: https://github.com/onivim/oni/wiki/Configuration#oni
@bryphe I remember that one of the reasons I was still using useDefaultConfig was that because if it is false some Oni functionalities are disabled. Is this true?
@badosu - actually, most of the Oni functionality will be preserved with useDefaultConfig set to false. The only thing useDefaultConfig: false turns off are these defaults:
targets.vim pluginvim-commentary pluginvim-unimpaired pluginThere was a bug previously where auto-completion wouldn't work correctly, but it seems addressed now. LMK if you see any issues, though.
What I did was I went through the oni-vim-defaults config and moved over the stuff from their into my custom init.vim. For the stuff I didn't want, I removed it and for the stuff I wanted to be Oni exclusive (since I use neovim in the terminal on some machines etc) I wrapped them in an Oni-exclusive if statement.
This then let me set useDefaultConfig to false and know I was still maintaining what Oni wanted for the most part. That said, to do that I had to go through the code to find the defaults file, so maybe we could expose the default settings somehow?
Thanks @bryphe, that solves it for me.
Do you think we could make it clearer on the documentation on what are the additional configurations pre|appended by oni?
As I see there are two different parts that are very important, basic vim configurations that provide Oni with that IDE look-and-feel (colorscheme, vim compatibility, etc..) and others like additional plugins and keybindings.
These are the ones I had to maintain to keep the Oni experience without sacrificing configuration:
set number
set noswapfile
set smartcase
" Turn off statusbar, because it is externalized
set noshowmode
set noruler
set laststatus=0
set noshowcmd
" Enable GUI mouse behavior
set mouse=a
set list
set listchars=trail:路
colorscheme onedark
These are good defaults in my opinion, since I am aware of how to configure it the way we have the default config is fine by me, I am not sure everyone has interest in the additional plugins, configurations, keybindings (except for vim-unimpaired 馃槀 ).
Thanks @bryphe, that solves it for me.
Excellent 馃挴
Do you think we could make it clearer on the documentation on what are the additional configurations pre|appended by oni?
Yes, you're right, I think it would be helpful to have a section dedicated to using a custom init.vim, what exactly oni.useDefaultConfig does, and how to retain an Oni-like experience if you decide not to use the defaults.
Thanks for calling out the specific options that were needed!
There are a few things I'm thinking about here to help guide users:
config.js to set the tabs/spaces functionality - that might help keep people from needing to 'eject' from the default config in the first placemouse=a, things might not work as you expect...`@bryphe To be frank, I am not sure if we should configure so much stuff from the default vim experience.
People that use vim have a lot of different use cases/requirements and are power users.
I guess it's fine to have a 'batteries included' default config, but my opinion is that the default should be just stuff that really matters for Oni to work (mouse, tabs, statusbar fixes, etc...).
And the batteries included be all the other stuff. Ideally optin instead of optout.
Thanks for the feedback, @badosu .
I agree, it makes sense to minimize our VimL layer as much as possible. There is stuff we have by default (like the cnoremap and inoremap mappings) that really should not be there.
I used #973 to track some specifics in terms of how we can refactor our config a bit / cause less conflicts, while still having it work great out-of-the-box. LMK your thoughts!
Hi! I am using Oni 0.3.1 on Debian 9, NVIM v0.2.2.
This is my tab settings in init.vim
set tabstop=4
set noexpandtab "no replace 4 spaces to tab
set shiftwidth=4
set softtabstop=4
I created .c file and .txt file. Using tab was perfect. But .py extension gave me 4 spaces. So I added "oni.useDefaultConfig": false to config.tsx and nothing changed. I guess something is wrong with auto completing function for python extension.
I am having a funny bug as well. If i set init.vim to:
set tabstop=4
set noexpandtab "no replace 4 spaces to tab
"set shiftwidth=4
"set softtabstop=4
Pressing tab will give me 2 tabs. But this setting is fine for me in vim.
I think this can be closed out as we have a separate issue on reducing Oni's VimL surface area.
For anyone wondering about changing the tab stop etc, my comment over in #2085 should be the solution (ie disable Oni's config, or overwrite it).
Most helpful comment
Thanks @bryphe, that solves it for me.
Do you think we could make it clearer on the documentation on what are the additional configurations pre|appended by oni?
As I see there are two different parts that are very important, basic vim configurations that provide Oni with that IDE look-and-feel (colorscheme, vim compatibility, etc..) and others like additional plugins and keybindings.
These are the ones I had to maintain to keep the Oni experience without sacrificing configuration:
These are good defaults in my opinion, since I am aware of how to configure it the way we have the default config is fine by me, I am not sure everyone has interest in the additional plugins, configurations, keybindings (except for vim-unimpaired 馃槀 ).