vim settings for python
I have the following settings file:
# ~/.vimrc
set tabstop=4
set shiftwidth=4
set smarttab
set expandtab
set softtabstop=4
set autoindent
How would I make these settings apply to python only? Also, how would I add python coloring (such as textmate does for each language) ?
python vim
add a comment |
I have the following settings file:
# ~/.vimrc
set tabstop=4
set shiftwidth=4
set smarttab
set expandtab
set softtabstop=4
set autoindent
How would I make these settings apply to python only? Also, how would I add python coloring (such as textmate does for each language) ?
python vim
add a comment |
I have the following settings file:
# ~/.vimrc
set tabstop=4
set shiftwidth=4
set smarttab
set expandtab
set softtabstop=4
set autoindent
How would I make these settings apply to python only? Also, how would I add python coloring (such as textmate does for each language) ?
python vim
I have the following settings file:
# ~/.vimrc
set tabstop=4
set shiftwidth=4
set smarttab
set expandtab
set softtabstop=4
set autoindent
How would I make these settings apply to python only? Also, how would I add python coloring (such as textmate does for each language) ?
python vim
python vim
asked May 25 '12 at 19:07
David542
32.5k90245451
32.5k90245451
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
I have these lines in my config:
filetype plugin indent on
syntax on
au BufNewFile,BufRead *.py set tabstop=4 softtabstop=4 shiftwidth=4 expandtab smarttab autoindent
This may be what you're looking for with the coloring:
Improved Python syntax, Blackboard color scheme
2
I don't think you need all the separators|
, you can do it all in oneset
withset tabstop=4 softtabstop=4 shifwitdth=4 expandtab...
– skeept
May 26 '12 at 20:58
@skeept Thanks! I updated my answer (and my vim config) to remove the extra set's.
– Justin Warkentin
May 27 '12 at 21:51
The nicer autocommand is:autocmd FileType python set ...
– Dave Halter
May 27 '12 at 22:59
add a comment |
Put them in vimfiles/ftplugin/python.vim
(but change set
to setlocal
) and add filetype plugin on
to .vimrc
. For syntax highlighting, add syntax on
to .vimrc
.
It this~/.vim/vimfiles/ftplugin/python.vim
or where is the exact location of the file?
– David542
May 25 '12 at 19:18
You have to put it into~/.vim/ftplugin/python.vim
.
– Dave Halter
May 27 '12 at 22:58
add a comment |
In addition to the above, try your hand at vim-janus which adds other goodies to vim.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f10760082%2fvim-settings-for-python%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
I have these lines in my config:
filetype plugin indent on
syntax on
au BufNewFile,BufRead *.py set tabstop=4 softtabstop=4 shiftwidth=4 expandtab smarttab autoindent
This may be what you're looking for with the coloring:
Improved Python syntax, Blackboard color scheme
2
I don't think you need all the separators|
, you can do it all in oneset
withset tabstop=4 softtabstop=4 shifwitdth=4 expandtab...
– skeept
May 26 '12 at 20:58
@skeept Thanks! I updated my answer (and my vim config) to remove the extra set's.
– Justin Warkentin
May 27 '12 at 21:51
The nicer autocommand is:autocmd FileType python set ...
– Dave Halter
May 27 '12 at 22:59
add a comment |
I have these lines in my config:
filetype plugin indent on
syntax on
au BufNewFile,BufRead *.py set tabstop=4 softtabstop=4 shiftwidth=4 expandtab smarttab autoindent
This may be what you're looking for with the coloring:
Improved Python syntax, Blackboard color scheme
2
I don't think you need all the separators|
, you can do it all in oneset
withset tabstop=4 softtabstop=4 shifwitdth=4 expandtab...
– skeept
May 26 '12 at 20:58
@skeept Thanks! I updated my answer (and my vim config) to remove the extra set's.
– Justin Warkentin
May 27 '12 at 21:51
The nicer autocommand is:autocmd FileType python set ...
– Dave Halter
May 27 '12 at 22:59
add a comment |
I have these lines in my config:
filetype plugin indent on
syntax on
au BufNewFile,BufRead *.py set tabstop=4 softtabstop=4 shiftwidth=4 expandtab smarttab autoindent
This may be what you're looking for with the coloring:
Improved Python syntax, Blackboard color scheme
I have these lines in my config:
filetype plugin indent on
syntax on
au BufNewFile,BufRead *.py set tabstop=4 softtabstop=4 shiftwidth=4 expandtab smarttab autoindent
This may be what you're looking for with the coloring:
Improved Python syntax, Blackboard color scheme
edited May 27 '12 at 21:50
answered May 25 '12 at 19:10
Justin Warkentin
5,78742428
5,78742428
2
I don't think you need all the separators|
, you can do it all in oneset
withset tabstop=4 softtabstop=4 shifwitdth=4 expandtab...
– skeept
May 26 '12 at 20:58
@skeept Thanks! I updated my answer (and my vim config) to remove the extra set's.
– Justin Warkentin
May 27 '12 at 21:51
The nicer autocommand is:autocmd FileType python set ...
– Dave Halter
May 27 '12 at 22:59
add a comment |
2
I don't think you need all the separators|
, you can do it all in oneset
withset tabstop=4 softtabstop=4 shifwitdth=4 expandtab...
– skeept
May 26 '12 at 20:58
@skeept Thanks! I updated my answer (and my vim config) to remove the extra set's.
– Justin Warkentin
May 27 '12 at 21:51
The nicer autocommand is:autocmd FileType python set ...
– Dave Halter
May 27 '12 at 22:59
2
2
I don't think you need all the separators
|
, you can do it all in one set
with set tabstop=4 softtabstop=4 shifwitdth=4 expandtab...
– skeept
May 26 '12 at 20:58
I don't think you need all the separators
|
, you can do it all in one set
with set tabstop=4 softtabstop=4 shifwitdth=4 expandtab...
– skeept
May 26 '12 at 20:58
@skeept Thanks! I updated my answer (and my vim config) to remove the extra set's.
– Justin Warkentin
May 27 '12 at 21:51
@skeept Thanks! I updated my answer (and my vim config) to remove the extra set's.
– Justin Warkentin
May 27 '12 at 21:51
The nicer autocommand is:
autocmd FileType python set ...
– Dave Halter
May 27 '12 at 22:59
The nicer autocommand is:
autocmd FileType python set ...
– Dave Halter
May 27 '12 at 22:59
add a comment |
Put them in vimfiles/ftplugin/python.vim
(but change set
to setlocal
) and add filetype plugin on
to .vimrc
. For syntax highlighting, add syntax on
to .vimrc
.
It this~/.vim/vimfiles/ftplugin/python.vim
or where is the exact location of the file?
– David542
May 25 '12 at 19:18
You have to put it into~/.vim/ftplugin/python.vim
.
– Dave Halter
May 27 '12 at 22:58
add a comment |
Put them in vimfiles/ftplugin/python.vim
(but change set
to setlocal
) and add filetype plugin on
to .vimrc
. For syntax highlighting, add syntax on
to .vimrc
.
It this~/.vim/vimfiles/ftplugin/python.vim
or where is the exact location of the file?
– David542
May 25 '12 at 19:18
You have to put it into~/.vim/ftplugin/python.vim
.
– Dave Halter
May 27 '12 at 22:58
add a comment |
Put them in vimfiles/ftplugin/python.vim
(but change set
to setlocal
) and add filetype plugin on
to .vimrc
. For syntax highlighting, add syntax on
to .vimrc
.
Put them in vimfiles/ftplugin/python.vim
(but change set
to setlocal
) and add filetype plugin on
to .vimrc
. For syntax highlighting, add syntax on
to .vimrc
.
answered May 25 '12 at 19:11
Cat Plus Plus
89.8k22166201
89.8k22166201
It this~/.vim/vimfiles/ftplugin/python.vim
or where is the exact location of the file?
– David542
May 25 '12 at 19:18
You have to put it into~/.vim/ftplugin/python.vim
.
– Dave Halter
May 27 '12 at 22:58
add a comment |
It this~/.vim/vimfiles/ftplugin/python.vim
or where is the exact location of the file?
– David542
May 25 '12 at 19:18
You have to put it into~/.vim/ftplugin/python.vim
.
– Dave Halter
May 27 '12 at 22:58
It this
~/.vim/vimfiles/ftplugin/python.vim
or where is the exact location of the file?– David542
May 25 '12 at 19:18
It this
~/.vim/vimfiles/ftplugin/python.vim
or where is the exact location of the file?– David542
May 25 '12 at 19:18
You have to put it into
~/.vim/ftplugin/python.vim
.– Dave Halter
May 27 '12 at 22:58
You have to put it into
~/.vim/ftplugin/python.vim
.– Dave Halter
May 27 '12 at 22:58
add a comment |
In addition to the above, try your hand at vim-janus which adds other goodies to vim.
add a comment |
In addition to the above, try your hand at vim-janus which adds other goodies to vim.
add a comment |
In addition to the above, try your hand at vim-janus which adds other goodies to vim.
In addition to the above, try your hand at vim-janus which adds other goodies to vim.
answered May 25 '12 at 20:51
Burhan Khalid
121k13150210
121k13150210
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f10760082%2fvim-settings-for-python%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown