XVim2 icon indicating copy to clipboard operation
XVim2 copied to clipboard

Shiftwidth fixed at 4

Open michaeleisel opened this issue 5 years ago • 5 comments

Hi, I'm working on a project where the shiftwidth needs to be at 2. I've updated the text editing settings in Xcode preferences to reflect this, but when I do ">>" or "<<" it still shifts by 4. How can I get it to shift by 2 instead? Thanks.

michaeleisel avatar Oct 08 '19 02:10 michaeleisel

The feature is not supported.

pebble8888 avatar Oct 08 '19 03:10 pebble8888

I see, well put in a big +1 for me. It would make editing files with a shiftwidth of 2, etc. much easier.

michaeleisel avatar Oct 08 '19 14:10 michaeleisel

The immediate work around is below. :%s/ / /gc

The former space is 4 pieces. The latter one is 2. Apple should provide vim.plugin. Like Android Studio.

externvoid avatar Oct 18 '19 06:10 externvoid

@externvoid that will not do what i'm trying to achieve. but the following code is easy to edit:

// TODO: These values should be taken from IDEFileTextSetting.
- (NSUInteger)xvim_indentWidth { return 4; }
- (NSUInteger)xvim_tabWidth { return 4; }

michaeleisel avatar Oct 18 '19 14:10 michaeleisel

@michaeleisel I followed your advice, finding the specific place at NSTextStorage+VimOperation.m It's working as what I desire.

externvoid avatar Oct 29 '19 01:10 externvoid