(5 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{ScriptComments|python: alternative indentation script for Python}} |
||
− | Problem and suggestion with this script |
||
==Problem== |
==Problem== |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
+ | <pre> |
||
− | |||
− | The page http://www.vim.org/scripts/script.php?script_id=974 |
||
− | |||
− | says: |
||
− | |||
− | install details |
||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
− | I tried and found the correct step is: |
||
− | |||
#cp python.vim /usr/share/vim/vim73/plugin/python.vim |
#cp python.vim /usr/share/vim/vim73/plugin/python.vim |
||
+ | </pre> |
||
⚫ | |||
+ | :No, this is wrong. If you copy it to your plugin directory, you will get python indent for all file types, until some other filetype indent script overrides it. |
||
⚫ | |||
+ | :The installation instructions are probably correct, but they assume you already have your Vim set up to read filetype-specific indent files. To do this, place the line "filetype indent plugin on" in your [[vimrc]]. See: |
||
⚫ | |||
+ | * [[Indent#File_type_based_indentation]] |
||
+ | * [[Turn_off_per-filetype_auto_indentation]] |
||
+ | :--[[User:Fritzophrenic|Fritzophrenic]] 15:50, July 7, 2011 (UTC) |
||
==Suggestion== |
==Suggestion== |
||
⚫ | |||
− | |||
⚫ | |||
The step is: |
The step is: |
||
+ | <pre> |
||
− | |||
− | 1. wget http://vim.sourceforge.net/scripts/download_script.php?src_id=2668 |
+ | 1. $wget http://vim.sourceforge.net/scripts/download_script.php?src_id=2668 |
− | |||
2. $mv download_file_name pydicton-0.5.tar.gz |
2. $mv download_file_name pydicton-0.5.tar.gz |
||
− | |||
3. $tar xvf pydicton-0.5.tar.gz |
3. $tar xvf pydicton-0.5.tar.gz |
||
− | |||
4. $mkdir ~/.vim/tools |
4. $mkdir ~/.vim/tools |
||
− | |||
5. $cp pydicton-0.5/pydiction ~/.vim/tools |
5. $cp pydicton-0.5/pydiction ~/.vim/tools |
||
+ | </pre> |
||
We can use Ctrl+N to get the prompt of python. |
We can use Ctrl+N to get the prompt of python. |
||
− | == |
+ | ==Comments== |
+ | As a user, I am deeply confused. |
||
− | <!-- Put any help links you want here in a list as follows: --> |
||
+ | Do the author of the script suggest doing this |
||
⚫ | |||
+ | ~/.vim/indent |
||
− | ==Comments== |
||
+ | |||
+ | Or |
||
+ | |||
+ | #cp python.vim /usr/share/vim/vim73/plugin/python.vim |
||
+ | |||
+ | Which one is wrong? |
||
+ | |||
+ | I would like to use the script to let vim do autoident for me with 1 tab which is 4 spaces. However, it keeps doing 2 tabs for me. |
Revision as of 02:50, 10 February 2013
Use this page to discuss script 974 python: alternative indentation script for Python
- Add constructive comments, bug reports, or discuss improvements (see the guideline).
- Do not document the script here (the author should do that on vim.org).
- This page may be out of date: check the script's vim.org page above, and its release notes.
Problem
It seems something wrong with the script installation. The script page says
- Drop the script in your ~/.vim/indent directory.
When I did that, no Python indent when I use Vim. The correct step is:
#cp python.vim /usr/share/vim/vim73/plugin/python.vim
the vim73 directory is your Vim version.
- No, this is wrong. If you copy it to your plugin directory, you will get python indent for all file types, until some other filetype indent script overrides it.
- The installation instructions are probably correct, but they assume you already have your Vim set up to read filetype-specific indent files. To do this, place the line "filetype indent plugin on" in your vimrc. See:
- --Fritzophrenic 15:50, July 7, 2011 (UTC)
Suggestion
The suggestion is the Python auto finished script when using Vim.
The step is:
1. $wget http://vim.sourceforge.net/scripts/download_script.php?src_id=2668 2. $mv download_file_name pydicton-0.5.tar.gz 3. $tar xvf pydicton-0.5.tar.gz 4. $mkdir ~/.vim/tools 5. $cp pydicton-0.5/pydiction ~/.vim/tools
We can use Ctrl+N to get the prompt of python.
Comments
As a user, I am deeply confused. Do the author of the script suggest doing this
~/.vim/indent
Or
- cp python.vim /usr/share/vim/vim73/plugin/python.vim
Which one is wrong?
I would like to use the script to let vim do autoident for me with 1 tab which is 4 spaces. However, it keeps doing 2 tabs for me.