Created
May 9, 2020 15:04
-
-
Save souhaiebtar/3770c9eba544af4915c0c37887f58c3e to your computer and use it in GitHub Desktop.
[change between tab and space as indent] config for vim #vim #vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set tabstop=2 " Size of a hard tabstop (ts). | |
set shiftwidth=2 " Size of an indentation (sw). | |
set expandtab " Always uses spaces instead of tab characters (et). | |
set softtabstop=0 " Number of spaces a <Tab> counts for. When 0, featuer is off (sts). | |
set autoindent " Copy indent from current line when starting a new line. | |
set smarttab " Inserts blanks on a <Tab> key (as per sw, ts and sts). | |
set number " show number | |
function! UseTabs() | |
set tabstop=4 " Size of a hard tabstop (ts). | |
set shiftwidth=4 " Size of an indentation (sw). | |
set noexpandtab " Always uses tabs instead of space characters (noet). | |
set autoindent " Copy indent from current line when starting a new line (ai). | |
endfunction | |
function! UseSpaces() | |
set tabstop=2 " Size of a hard tabstop (ts). | |
set shiftwidth=2 " Size of an indentation (sw). | |
set expandtab " Always uses spaces instead of tab characters (et). | |
set softtabstop=0 " Number of spaces a <Tab> counts for. When 0, featuer is off (sts). | |
set autoindent " Copy indent from current line when starting a new line. | |
set smarttab " Inserts blanks on a <Tab> key (as per sw, ts and sts). | |
endfunction | |
au! BufWrite,FileWritePre *.module,*.py call UseSpaces() | |
" disable arrow keys and echo out a message instead | |
noremap <up> :echom 'stop being stupid'<CR> | |
noremap <down> :echom 'stop being stupid'<CR> | |
noremap <left> :echom 'stop being stupid'<CR> | |
noremap <right> :echom 'stop being stupid'<CR> | |
inoremap <up> <ESC>:echom 'stop being stupid'<CR> | |
inoremap <down> <ESC>:echom 'stop being stupid'<CR> | |
inoremap <right> <ESC>:echom 'stop being stupid'<CR> | |
inoremap <left> <ESC>:echom 'stop being stupid'<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment