Last active
June 28, 2018 13:28
-
-
Save higedice/5be314f2d0c104d1feb9f2157ba5df78 to your computer and use it in GitHub Desktop.
My .vimrc VIM config file.
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 encoding=utf-8 | |
scriptencoding utf-8 | |
" statusline - help.txt[-][RO][HELP] 1C,1/221L 1% @20:00 [utf-8][unix][help] | |
set statusline=%F%m%r%h%w\ %3vC,%l/%LL\ %p%% | |
set statusline+=%=\ " \<space> | |
function FormatTime(t) | |
if a:t == -1 | |
return "" | |
endif | |
let lt = localtime() | |
if strftime("%Y%m%d", lt) == strftime("%Y%m%d", a:t) | |
let df = "@%H:%M " | |
elseif strftime("%Y", lt) == strftime("%Y", a:t) | |
let df = "@%m/%d %H:%M " | |
else | |
let df = "@%Y/%m/%d " | |
endif | |
" "@2016/09/03 01:02" -> "@2016/9/3 1:02" | |
let dstr = substitute(strftime(df, a:t), "@0", "@", "g") | |
let dstr = substitute(dstr, "/0", "/", "g") | |
let dstr = substitute(dstr, " 0", " ", "g") | |
return dstr | |
endfunction | |
set statusline+=%{FormatTime(getftime(expand('%:p')))} | |
set statusline+=[%{has('multi_byte')&&\&fileencoding!=''?&fileencoding:&encoding}][%{&fileformat}]%y | |
set laststatus=2 | |
set cmdheight=1 | |
set wildmenu | |
set list | |
set listchars=tab:»\ ,trail:␣,extends:»,precedes:« | |
set autoindent | |
set smartindent | |
set ignorecase | |
set smartcase | |
set incsearch | |
set hlsearch | |
syntax on | |
set nobackup | |
set noundofile | |
autocmd BufRead,BufNewFile *.c set tabstop=4 | |
autocmd BufRead,BufNewFile *.cpp set tabstop=4 | |
autocmd BufRead,BufNewFile *.h set tabstop=4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment