MacVim tabwidth inconsistency issue - macvim

I have a python script with 3-spaces before each line as indent. Now I want to make further editing easier and added "set tabwidth=3" in my $HOME/.vimrc file. It works when editing under MacVim, however, when later running it, python complained about the inconsistent indent between the original '3-spaces' indents and my new '1-tab' indent. Not sure why and how to work it out.

Use
set ts=3
set expandtab
this should work for you.

Related

problem in using emmet in visual studio code

I am experiencing a strange problem with emmet in vs code.
after typing some emmet abbreviation and pressing tab I get a warning saying "command emmet.expandAbbriviation not found"
I have double-checked my settings.json and "emmet.triggerExpansionOnTab": true is there in the file.
I have been using vs code for a month but never before I had any problem with emmet, but suddenly this problem has come up
Update: I have noticed that suddenly other extensions like live server have also stopped working and also I'm no longer getting autocomplete suggestions from MDN docs.
Judging from this emmet won't work issue, the problem might have begun as a result of the last update.
Search #builtin in the Extensions view and make sure the Emmet extension is enabled.
Open the VS Code. Go to the Vscode settings by pressing the setting icon or ctrl+.
In the setting tabs, click on the HTML option.
Click on the “Edit in settings:json” hyperlink to edit the settings in JSON format. Click on the Edit in settings.json to edit and fix emmet problems.
Inside the curly braces, enter the following code under the already written JSON code:
“emmet.triggerExpansionOnTab”: true,
“files.associations”: {“*html”: “html”}
5.Save the file. Now if you try to apply emmet in your code, it will work smoothly!!
Because the error you are reporting reads like this:
"command emmet.expandAbbriviation not found"
You may have a typo in that command which would explain the interpreters inability to find the command. Of course it could be that you have the typo here in this post while your settings in VS Code are correct.
Either way, the correct spelling is emmet.expandAbbreviation. Notice the letter before the 'v' is an 'e' not an 'i'.
This link here seems to have the same issue..
VS Code - command 'emmet.expandAbbreviation' not found
I had the same issue as well and could not find much help..
But what fixed it for me was using a previous version.. so something with the never version might not work with my settings I guess (and some them I can't change like my Mac OS..;-).. as my mac is 2015 edition).. Anyways if you are still having this issue.. this link is what worked for me..
https://code.visualstudio.com/updates/v1_55
Download an earlier version and you should be fine... Hope it works for you.
I added a vetur.config.js file to my root directory, and it is working fine.
I can tab as per normal. HTML autocomplete is also back.
got the reference here:
https://vuejs.github.io/vetur/reference/#example

Visual Studio HTML formatter: Hitting enter removes all indents in the previous line

Running Visual Studio Community 2015 (but have seen the problem in earlier versions as well), and when I'm editing an HTML-file, when I hit enter to go to the next line, the line I just left is moved to the left, removing the indents. Ctrl-K,D reformats the line again. Pretty annoying?
Before enter:
After enter:
Identing is set to Smart in Text Editor|HTML|Tabs as well as Text Editor|HTML (Web Forms)|Tabs
Seems like a bug, why would anyone need that behaviour?
Solution:
It just hit me: ReSharper? And yes, I tried suspending ReSharper in Options|ReSharper and the weird behaviour went away.
After some trial'n'error, I found the option: ReSharper|Options and Code Editing|HTML|Formatting Style|Do not indent children of.
Apparently ReSharper don't want children of the body tag to be indented. I don't agree. Removed "body" from the setting, and all is bliss now.

PhpStorm - remove empty lines from end of file

At the moment I'm testing PhpStorm IDE. It is really great, except one feature. It doesn't remove empty lines from end of file. It's now remove unneeded whitespaces, but empty lines at the end aren't removed.
It's really annoying for me. Can I change this behaviour?
Not currently possible. Please vote for IDEA-119281

vim: about adding new rules to indentation configuration files

in order to get correct indentation in my html5 files, I have added lines like this below to my /usr/share/vim/vim73/indent/html.vim:
call <SID>HtmlIndentPush('header')
As you can guess header is a new tag in html5..
Now I don't know if I should leave those lines in that file or create another file in ~/vim/indent/html.vim that overwrites that /usr/share/vim/vim73/indent/html.vim.
What is your advice?
Take into account that I'm versioning my ~/.vim.
I see that you are using Vim 7.3.
Vim 7.4, which is the current "stable" (in quotes) release, has had its support for HTML improved. I checked the indent script and I can see that it does have code for new HTML5 tags, including header.
You could try upgrading your Vim to 7.4 and your problem will probably simply disappear.

Format Code In MonoDevelop

I am using MonoDevelop on Mac to write MonoTouch apps. Automatica code indenting/formatting works great while I am typing.
The problem is that when I copy and paste code snippets, in many cases I lose the formatting and lines are combined together, indenting is lost, and it is a huge pain to implement the tabs, spacing, and line breaks manually. Is there anyway I can use a command in monoDevelop to automatically indent and apply the formatting to existing code.
I thought maybe Edit|Format|Format Document/Selection would work, but these commands don't have any affect on the code at all.
Any help?
To format the entire document in one keystroke: control-I
To format a selection: Edit->Format->Format Selection
To customize the formatting: MonoDevelop->Preferences->Source Code->Code Formatting
You actually need to select all your text, and then go to Edit->Format->Format Document. It doesn't seem to work otherwise.
For me on macOS, the shortcut for "auto-format" is CTRL + i.
You can change the shortcut if you want. To change it, go to Preferences -> Key Bindings, then type "format" in the search box and edit the "Format Document" shortcut/key binding.