vimの設定

2021-08-03 (2021-08-03 更新)
#vim

vimの設定

設定

"Display line numbers
set number

"Configur indent
set autoindent
set smartindent

"Configur tab
set tabstop=4
set shiftwidth=4

"Display tab and half-space
set list
set listchars=tab:>\ ,trail:_

"Set editing a file of directory
set autochdir

"Enable Syntax highlighting
syntax on

"When script file is saved, add execution permission one
autocmd BufWritePost * call AddExecmod()
function AddExecmod()
    let line = getline(1)
    if strpart(line, 0, 2) == "#!"
        call system("chmod +x ". expand("%"))
    endif
endfunction

ファイル

vimrc