LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   vimrc question (https://www.linuxquestions.org/questions/programming-9/vimrc-question-846083/)

ArthurHuang 11-23-2010 02:28 PM

vimrc question
 
Hi guys,
Two naive but unknown questions!!
1) How to map "F2" to a shell command, like "gmake all"??
2) When editing a file and push "enter" key, how to make next line
aligned with the current line, but previous blank are SPACE, not TAB??

Many thanks!!!

barriehie 11-23-2010 02:37 PM

Quote:

Originally Posted by ArthurHuang (Post 4168543)
Hi guys,
Two naive but unknown questions!!
1) How to map "F2" to a shell command, like "gmake all"??
2) When editing a file and push "enter" key, how to make next line
aligned with the current line, but previous blank are SPACE, not TAB??

Many thanks!!!

Here's a tutorial on key mapping: http://vim.wikia.com/wiki/Mapping_ke...orial_(Part_1) I think you want
Code:

set autoindent
in your .vimrc for the indentation rule and to use spaces instead of tabs;
Code:

set tabstop=4
HTH

ArthurHuang 11-23-2010 02:45 PM

"set tabstop=4 " is to set tab space. But how to make line changing alignment?
And I also can't use this command, if other people open the same file on their config, such as set tabstop=8,
then it will 8 spaces, not 4.


Quote:

Originally Posted by barriehie (Post 4168548)
Here's a tutorial on key mapping: http://vim.wikia.com/wiki/Mapping_ke...orial_(Part_1) I think you want
Code:

set autoindent
in your .vimrc for the indentation rule and to use spaces instead of tabs;
Code:

set tabstop=4
HTH



All times are GMT -5. The time now is 06:23 AM.