" Arcy's vim environment (based on perky's) let g:Arcy="4.9" let mapleader="\" set nocompatible "set fileformat=unix set formatoptions=tcql set ai "set laststatus=2 "set wrapmargin=2 set visualbell set mat=3 showmatch "set term=xterm "set nu set bs=2 " allow backspacing over everything in insert mode set nobackup " do not keep a backup file, use versions instead set viminfo='100,<50 " read/write a .viminfo file, don't store more " than 100 lines of registers set history=500 " keep 500 lines of command line history set ruler " show the cursor position all the time set list lcs=tab:\|.,trail:~ " display tab as >------, and trail as ~ set fencs=utf-8,cp949,euc-kr,ucs-bom,latin1 set incsearch " incremental searching set ignorecase smartcase set wildmenu " netrw setting let g:netrw_winsize = -28 let g:netrw_chgwin = -1 let g:netrw_browse_split = 0 let g:netrw_banner = 0 let g:netrw_liststyle = 3 " https://vi.stackexchange.com/questions/7889/cannot-exit-vim-even-using-q " Per default, netrw leaves unmodified buffers open. This autocommand " deletes netrw's buffer once it's hidden (using ':q', for example) autocmd FileType netrw setl bufhidden=delete if v:version >= 703 let undodir=$HOME."/.vim/undo" if !isdirectory(undodir) call mkdir(undodir, "p") endif set undofile " Save undo's after file closes set undodir=$HOME/.vim/undo " where to save undo histories set undolevels=1000 " How many undos set undoreload=10000 " number of lines to save for undo endif " Switch syntax highlighting on, when the terminal has colors " Also switch on highlighting the last used search pattern. if &t_Co > 2 || has("gui_running") syntax on set hlsearch endif " Force encoding as UTF-8, in cygwin ssh enviroment if stridx(&term, "xterm") >= 0 && stridx($USERDOMAIN, "NT AUTHORITY") >= 0 set enc=utf-8 endif " Update function if has("eval") fun! Updateit() " Install Vundle if !isdirectory($HOME."/.vim/bundle") !git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim endif BundleInstall " Update vimrc winc n ,!uname -s yank undo winc c let os = @ if stridx(os, "FreeBSD") >= 0 !fetch -o ~/.vimrc.new https://arcy.org/.vimrc else !curl -o ~/.vimrc.new https://arcy.org/.vimrc endif if match(readfile($HOME."/.vimrc.new"), "\" Arcy") != 0 echo "Error while downloading new vimrc" echo readfile($HOME."/.vimrc.new") return endif !mv ~/.vimrc.new ~/.vimrc endfun endif set background=dark set =O2P set =O2Q set =O2R set =O2S map :echo "Arcy's environment version " g:Arcy map :call Updateit():source ~/.vimrc map :Lexplore map :bd map :up imap :upa map :q map :exec v:count1 . "cp" map :exec v:count1 . "cn" map :bp map :bn map :N map :n map :tN map :tn map j map k map h map l map n map :redr! map :tabprev map :tabnext map :tabnew " Leader mapping noremap b :term bash noremap t :Sexplore noremap T :Texplore noremap gs :Git noremap gd :Gdiff noremap ge :Gedit noremap gg :Ggrep noremap du :diffupdate noremap r :set relativenumber! nu! noremap p :set paste! set pastetoggle= " Disable man page nnoremap K " Disable ex mode nmap Q q " Command mode remap cnoremap cnoremap cnoremap b cnoremap f " Alt-Backspace to delete a word inoremap cnoremap "map D o/* * */ka " Auto close tag with HTML files function! s:CloseTags() imap / endfunction autocmd BufRead,BufNewFile *.html,*.js,*.xml,*.vue call s:CloseTags() " show relavite line number from cursor augroup numbertoggle autocmd! autocmd VimEnter,WinEnter,BufWinEnter * setlocal relativenumber number autocmd WinLeave * setlocal norelativenumber number augroup END au BufNewFile,BufRead *.c set si au BufNewFile,BufRead *.php set si et sw=4 sts=4 au BufNewFile,BufRead *.py set si et sw=4 sts=4 au BufNewFile,BufRead *.html,*.css set sw=8 sts=8 noet au BufNewFile,BufRead *.js,*.ts set et sw=2 sts=2 au BufNewFile,BufRead *.rdf set et sw=2 sts=2 au BufNewFile,BufRead *.vue setlocal filetype=vue.html.javascript.css " Load Vundle if isdirectory($HOME."/.vim/bundle") filetype off set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'VundleVim/Vundle.vim' Plugin 'tpope/vim-fugitive' " Git management Plugin 'AutoComplPop' " Auto complete popup " Syntax " Plugin 'vim-syntastic/syntastic' " Plugin 'posva/vim-vue' " Vue.js " Plugin 'fatih/vim-go' " Golang call vundle#end() filetype plugin indent on endif " Load local config if filereadable($HOME."/.vimrc.local") source $HOME/.vimrc.local endif