From 60ce0f88a8019474facdfe592f45f284e6f2dd54 Mon Sep 17 00:00:00 2001 From: jokang Date: Thu, 14 Dec 2017 12:58:05 +0800 Subject: [PATCH 01/10] Add my_config.vim --- my_configs.vim | 1 + 1 file changed, 1 insertion(+) create mode 100644 my_configs.vim diff --git a/my_configs.vim b/my_configs.vim new file mode 100644 index 00000000..ec4d0d6f --- /dev/null +++ b/my_configs.vim @@ -0,0 +1 @@ +set nu From 8133f340516ae20ea28145ffa4b62d26485262dc Mon Sep 17 00:00:00 2001 From: jokang Date: Fri, 22 Dec 2017 14:24:52 +0800 Subject: [PATCH 02/10] Change my_configs.vim --- .gitignore | 1 - my_configs.vim | 102 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 55273366..5c89661e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,5 @@ sources_forked/yankring/doc/tags sources_non_forked/tlib/doc/tags sources_non_forked/ctrlp.vim/doc/tags* my_plugins/ -my_configs.vim tags .DS_Store diff --git a/my_configs.vim b/my_configs.vim index ec4d0d6f..e70e81c6 100644 --- a/my_configs.vim +++ b/my_configs.vim @@ -1 +1,103 @@ +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => General configuration +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set nu + +if has('gui_running') + set lines=60 columns=108 linespace=0 + if has('gui_win32') + set guifont=DejaVu_Sans_Mono:h10:cANSI + else + set guifont=DejaVu\ Sans\ Mono\ 10 + endif +endif + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Setup Vundle and my plugins +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set nocompatible " be iMproved, required +filetype off " required + +" set the runtime path to include Vundle and initialize +set rtp+=~/.vim_runtime/my_plugins/Vundle.vim +call vundle#begin('~/.vim_runtime/bundle') +" alternatively, pass a path where Vundle should install plugins +"call vundle#begin('~/some/path/here') + +" let Vundle manage Vundle, required +Plugin 'VundleVim/Vundle.vim' + +" The following are examples of different formats supported. +" Keep Plugin commands between vundle#begin/end. +" plugin on GitHub repo +" Plugin 'tpope/vim-fugitive' +" plugin from http://vim-scripts.org/vim/scripts.html +" Plugin 'L9' +" Git plugin not hosted on GitHub +" Plugin 'git://git.wincent.com/command-t.git' +" git repos on your local machine (i.e. when working on your own plugin) +" Plugin 'file:///home/gmarik/path/to/plugin' +" The sparkup vim script is in a subdirectory of this repo called vim. +" Pass the path to set the runtimepath properly. +" Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} +" Install L9 and avoid a Naming conflict if you've already installed a +" different version somewhere else. +" Plugin 'ascenator/L9', {'name': 'newL9'} + +" My Plugins +Plugin 'godlygeek/tabular' +Plugin 'plasticboy/vim-markdown' + +" All of your Plugins must bebundleore the following line +call vundle#end() " required +filetype plugin indent on " required +" To ignore plugin indent changes, instead use: +"filetype plugin on +" +" Brief help +" :PluginList - lists configured plugins +" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate +" :PluginSearch foo - searches for foo; append `!` to refresh local cache +" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal +" +" see :h vundle for more details or wiki for FAQ +" Put your non-Plugin stuff after this line + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Prettify XML +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +function! DoPrettyXML() + " save the filetype so we can restore it later + let l:origft = &ft + set ft= + " delete the xml header if it exists. This will + " permit us to surround the document with fake tags + " without creating invalid xml. + 1s///e + " insert fake tags around the entire document. + " This will permit us to pretty-format excerpts of + " XML that may contain multiple top-level elements. + 0put ='' + $put ='' + silent %!xmllint --format - + " xmllint will insert an header. it's easy enough to delete + " if you don't want it. + " delete the fake tags + 2d + $d + " restore the 'normal' indentation, which is one extra level + " too deep due to the extra tags we wrapped around the document. + silent %< + " back to home + 1 + " restore the filetype + exe "set ft=" . l:origft +endfunction +command! PrettyXML call DoPrettyXML() + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Plugins Configuration +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" From 5f398fe0a990efd36f3b1c919db56cabcacb4843 Mon Sep 17 00:00:00 2001 From: jokang Date: Fri, 22 Dec 2017 14:28:48 +0800 Subject: [PATCH 03/10] Remove duplicated plugin tabular --- my_configs.vim | 1 - 1 file changed, 1 deletion(-) diff --git a/my_configs.vim b/my_configs.vim index e70e81c6..81a6ef22 100644 --- a/my_configs.vim +++ b/my_configs.vim @@ -46,7 +46,6 @@ Plugin 'VundleVim/Vundle.vim' " Plugin 'ascenator/L9', {'name': 'newL9'} " My Plugins -Plugin 'godlygeek/tabular' Plugin 'plasticboy/vim-markdown' " All of your Plugins must bebundleore the following line From dcb7da949aa08d6a9c72b52cf70220482f096edb Mon Sep 17 00:00:00 2001 From: jokang Date: Fri, 29 Dec 2017 11:13:32 +0800 Subject: [PATCH 04/10] set Vundle --- .gitignore | 1 + my_configs.vim | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5c89661e..d123083a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,6 @@ sources_forked/yankring/doc/tags sources_non_forked/tlib/doc/tags sources_non_forked/ctrlp.vim/doc/tags* my_plugins/ +bundle/ tags .DS_Store diff --git a/my_configs.vim b/my_configs.vim index 81a6ef22..a4722e31 100644 --- a/my_configs.vim +++ b/my_configs.vim @@ -20,7 +20,7 @@ set nocompatible " be iMproved, required filetype off " required " set the runtime path to include Vundle and initialize -set rtp+=~/.vim_runtime/my_plugins/Vundle.vim +set rtp+=~/.vim_runtime/bundle/Vundle.vim call vundle#begin('~/.vim_runtime/bundle') " alternatively, pass a path where Vundle should install plugins "call vundle#begin('~/some/path/here') From 029e1240d871b782b772dc3437a2e93b6d46eb98 Mon Sep 17 00:00:00 2001 From: Zhou Kang Date: Fri, 29 Dec 2017 11:21:50 +0800 Subject: [PATCH 05/10] Add my_readme.me --- my_readme.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 my_readme.md diff --git a/my_readme.md b/my_readme.md new file mode 100644 index 00000000..39268a3f --- /dev/null +++ b/my_readme.md @@ -0,0 +1,2 @@ +git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim_runtime/bundle/Vundle.vim +Run :PluginInstall in Vim. From c774364ac8baa86caf9f2cd66ab670bee3368849 Mon Sep 17 00:00:00 2001 From: jokang Date: Fri, 29 Dec 2017 12:05:30 +0000 Subject: [PATCH 06/10] Add my_readme.md --- my_readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/my_readme.md b/my_readme.md index 39268a3f..c4a1446a 100644 --- a/my_readme.md +++ b/my_readme.md @@ -1,2 +1,4 @@ +git clone --depth=1 https://github.com/jokang/vimrc.git ~/.vim_runtime +sh ~/.vim_runtime/install_awesome_vimrc.sh git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim_runtime/bundle/Vundle.vim Run :PluginInstall in Vim. From c40753d25e56a61688311ef0fa989942da60c659 Mon Sep 17 00:00:00 2001 From: jokang Date: Thu, 25 Jan 2018 11:02:07 +0800 Subject: [PATCH 07/10] Add json formatter --- my_configs.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/my_configs.vim b/my_configs.vim index a4722e31..adca9c44 100644 --- a/my_configs.vim +++ b/my_configs.vim @@ -97,6 +97,7 @@ endfunction command! PrettyXML call DoPrettyXML() +command! PrettyJson :execute '%!python -m json.tool' """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Plugins Configuration """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" From 60da83bff3ae4bdaa224c7d42d0f8500a75813f6 Mon Sep 17 00:00:00 2001 From: jokang Date: Mon, 12 Mar 2018 11:14:39 +0800 Subject: [PATCH 08/10] Disable folding --- my_configs.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/my_configs.vim b/my_configs.vim index adca9c44..867dd68d 100644 --- a/my_configs.vim +++ b/my_configs.vim @@ -2,6 +2,7 @@ " => General configuration """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set nu +set nofoldenable if has('gui_running') set lines=60 columns=108 linespace=0 From 0d21f639d562afd908bcd1e6767709e745d0dc20 Mon Sep 17 00:00:00 2001 From: jokang Date: Tue, 13 Mar 2018 14:50:51 +0800 Subject: [PATCH 09/10] Add the vim-jsbeautify plugin. --- my_configs.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/my_configs.vim b/my_configs.vim index 867dd68d..8215a1d5 100644 --- a/my_configs.vim +++ b/my_configs.vim @@ -49,6 +49,18 @@ Plugin 'VundleVim/Vundle.vim' " My Plugins Plugin 'plasticboy/vim-markdown' +" https://github.com/maksimr/vim-jsbeautify.git +Plugin 'maksimr/vim-jsbeautify' +autocmd FileType javascript noremap :call JsBeautify() +" for json +autocmd FileType json noremap :call JsonBeautify() +" for jsx +autocmd FileType jsx noremap :call JsxBeautify() +" for html +autocmd FileType html noremap :call HtmlBeautify() +" for css or scss +autocmd FileType css noremap :call CSSBeautify() + " All of your Plugins must bebundleore the following line call vundle#end() " required filetype plugin indent on " required From 240e15d8a36ba13f7eb2d77df9f4e4a851644b2b Mon Sep 17 00:00:00 2001 From: jokang Date: Thu, 15 Mar 2018 17:02:43 +0800 Subject: [PATCH 10/10] Add fileencodings setting. --- my_configs.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/my_configs.vim b/my_configs.vim index 8215a1d5..d9514e57 100644 --- a/my_configs.vim +++ b/my_configs.vim @@ -3,6 +3,7 @@ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set nu set nofoldenable +set fileencodings=ucs-bom,utf-8,utf-16,gbk,big5,gb18030,latin1 if has('gui_running') set lines=60 columns=108 linespace=0